diff mbox

hostapd: Supply default parameters for OBSS

Message ID 20140312223153.2A87B200FFA@clearcreek.mtv.corp.google.com
State Accepted
Headers show

Commit Message

Paul Stewart March 12, 2014, 10:28 p.m. UTC
For some client OBSS implementations that are performed in
firmware, all OBSS parameters need to be set to valid values.
Do this, as well as supplying the "20/40 Coex Mgmt Support"
flag in the extended capabilities IE.

Signed-hostap: Paul Stewart <pstew@chromium.org>
---
 src/ap/ieee802_11_ht.c     | 14 +++++++++++++-
 src/ap/ieee802_11_shared.c |  4 ++++
 2 files changed, 17 insertions(+), 1 deletion(-)

Comments

Jouni Malinen March 14, 2014, 10:22 p.m. UTC | #1
On Wed, Mar 12, 2014 at 03:28:39PM -0700, Paul Stewart wrote:
> For some client OBSS implementations that are performed in
> firmware, all OBSS parameters need to be set to valid values.
> Do this, as well as supplying the "20/40 Coex Mgmt Support"
> flag in the extended capabilities IE.

Thanks, applied.

> @@ -54,7 +54,19 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
> -		/* TODO: Fill in more parameters (supplicant ignores them) */
> +		/* Fill in default values for remaining parameters (7.3.2.60) */
> +		scan_params->scan_passive_dwell =
> +			host_to_le16(20);
> +		scan_params->scan_active_dwell =
> +			host_to_le16(10);
> +		scan_params->scan_passive_total_per_channel =
> +			host_to_le16(200);
> +		scan_params->scan_active_total_per_channel =
> +			host_to_le16(20);
> +		scan_params->channel_transition_delay_factor =
> +			host_to_le16(5);
> +		scan_params->scan_activity_threshold =
> +			host_to_le16(5);

Though, I changed that IEEE 802.11 reference to match the current
standard and also mention the MIB where these defaults come from. I also
changed that last value to 25 which is the defined default. If 5 was
used here on purpose, please submit a separate patch to change it with
the comment updated to indicate why it is different.
diff mbox

Patch

diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index a166178..694984b 100644
--- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c
@@ -54,7 +54,19 @@  u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
 		scan_params->width_trigger_scan_interval =
 			host_to_le16(hapd->iconf->obss_interval);
 
-		/* TODO: Fill in more parameters (supplicant ignores them) */
+		/* Fill in default values for remaining parameters (7.3.2.60) */
+		scan_params->scan_passive_dwell =
+			host_to_le16(20);
+		scan_params->scan_active_dwell =
+			host_to_le16(10);
+		scan_params->scan_passive_total_per_channel =
+			host_to_le16(200);
+		scan_params->scan_active_total_per_channel =
+			host_to_le16(20);
+		scan_params->channel_transition_delay_factor =
+			host_to_le16(5);
+		scan_params->scan_activity_threshold =
+			host_to_le16(5);
 
 		pos += sizeof(*scan_params);
 	}
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index b78fd01..12403f9 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -170,6 +170,8 @@  static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
 
 	switch (idx) {
 	case 0: /* Bits 0-7 */
+		if (hapd->iconf->obss_interval)
+			*pos |= 0x01; /* Bit 0 - Coexistence management */
 		break;
 	case 1: /* Bits 8-15 */
 		break;
@@ -223,6 +225,8 @@  u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
 		len = 4;
 	if (len < 3 && hapd->conf->wnm_sleep_mode)
 		len = 3;
+	if (len < 1 && hapd->iconf->obss_interval)
+		len = 1;
 	if (len < 7 && hapd->conf->ssid.utf8_ssid)
 		len = 7;
 #ifdef CONFIG_WNM