diff mbox

[RFC,3/3] wpa_supplicant: Add configuration parameter for 2040coex

Message ID 1334756650-10624-3-git-send-email-rmanohar@qca.qualcomm.com
State Superseded
Headers show

Commit Message

Rajkumar Manoharan April 18, 2012, 1:44 p.m. UTC
To enable 2040 coexistence report generation for 40MHz intolerance, use
the following option in wpa_supplicant config file.

report_2040coex=1

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 wpa_supplicant/config.c         |    3 ++-
 wpa_supplicant/config.h         |    8 ++++++++
 wpa_supplicant/config_file.c    |    2 ++
 wpa_supplicant/wpa_supplicant.c |    3 +++
 4 files changed, 15 insertions(+), 1 deletion(-)

Comments

Jouni Malinen April 23, 2012, 9:02 a.m. UTC | #1
On Wed, Apr 18, 2012 at 07:14:10PM +0530, Rajkumar Manoharan wrote:
> To enable 2040 coexistence report generation for 40MHz intolerance, use
> the following option in wpa_supplicant config file.
> 
> report_2040coex=1

Why would this need to be configurable? Shouldn't we report these
unconditionally? Or well, to be more exact, based on AP configuration
and requests for OBSS scans, not on user configuration.
Rajkumar Manoharan April 23, 2012, 9:46 a.m. UTC | #2
On Mon, Apr 23, 2012 at 12:02:05PM +0300, Jouni Malinen wrote:
> On Wed, Apr 18, 2012 at 07:14:10PM +0530, Rajkumar Manoharan wrote:
> > To enable 2040 coexistence report generation for 40MHz intolerance, use
> > the following option in wpa_supplicant config file.
> > 
> > report_2040coex=1
> 
> Why would this need to be configurable? Shouldn't we report these
> unconditionally? Or well, to be more exact, based on AP configuration
> and requests for OBSS scans, not on user configuration.
> 
Right now, the scan request is not differentiated between OBSS/regular (bgscan).
So to avoid the action frame being exchanged at the end of bgscan that could
bring down channel width in associated AP, I made it as configurable one. So
that it wont affect existing functionality.

-Rajkumar
diff mbox

Patch

diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 2a166c7..ff3bf52 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2871,7 +2871,8 @@  static const struct global_parse_data global_fields[] = {
 	{ INT_RANGE(disassoc_low_ack, 0, 1), 0 },
 	{ INT_RANGE(interworking, 0, 1), 0 },
 	{ FUNC(hessid), 0 },
-	{ INT_RANGE(access_network_type, 0, 15), 0 }
+	{ INT_RANGE(access_network_type, 0, 15), 0 },
+	{ INT(report_2040coex), 0 }
 };
 
 #undef FUNC
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 968f14b..bee3b21 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -602,6 +602,14 @@  struct wpa_config {
 	 * Homogeneous ESS. This is used only if interworking is enabled.
 	 */
 	u8 hessid[ETH_ALEN];
+
+	/**
+	 * report_2040coex - Generate 2040 coexistence report
+	 *
+	 * Allow the station to generate 2040 coexistence report if any of
+	 * 40 MHz intolerant AP found in the network.
+	 */
+	int report_2040coex;
 };
 
 
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 671f7d6..ecb41bf 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -842,6 +842,8 @@  static void wpa_config_write_global(FILE *f, struct wpa_config *config)
 		fprintf(f, "access_network_type=%d\n",
 			config->access_network_type);
 #endif /* CONFIG_INTERWORKING */
+	if (config->report_2040coex)
+		fprintf(f, "report_2040coex=%d\n", config->report_2040coex);
 }
 
 #endif /* CONFIG_NO_CONFIG_WRITE */
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 5d4de3c..25827d5 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3249,6 +3249,9 @@  void wpa_supplicant_proc_40mhz_intolerant(struct wpa_supplicant *wpa_s)
 	u8 chan_list[P2P_MAX_CHANNELS], channel;
 	u8 num_channels = 0, i;
 
+	if (!wpa_s->conf->report_2040coex)
+		return;
+
 	if (!wpa_s->current_bss || wpa_s->wpa_state != WPA_COMPLETED)
 		return;