[PATCH] hostapd: Advertise OBSS scan params based on driver capability

Rajkumar Manoharan rmanohar
Tue May 6 04:35:51 PDT 2014


Advertise OBSS scan params based on driver capabilities and also
set default value for obss scan interval as defined in IEEE Std
802.11-2012, 8.4.2.61 and MIB defval.

Signed-off-by: Rajkumar Manoharan <rmanohar at qti.qualcomm.com>
---
 src/ap/ap_config.c         | 1 +
 src/ap/ieee802_11_ht.c     | 3 ++-
 src/ap/ieee802_11_shared.c | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 9680817..64c9795 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -169,6 +169,7 @@ struct hostapd_config * hostapd_config_defaults(void)
 	conf->tx_queue[3] = txq_bk;
 
 	conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;
+	conf->obss_interval = 300;
 
 	conf->ap_table_max_size = 255;
 	conf->ap_table_expiration_time = 60;
diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index c0a7cd4..7020858 100644
--- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c
@@ -46,7 +46,8 @@ u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
 
  	pos += sizeof(*cap);
 
-	if (hapd->iconf->obss_interval) {
+	if (hapd->iconf->obss_interval &&
+	    (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
 		struct ieee80211_obss_scan_parameters *scan_params;
 
 		*pos++ = WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS;
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 12403f9..2755528 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -170,7 +170,7 @@ 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)
+		if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)
 			*pos |= 0x01; /* Bit 0 - Coexistence management */
 		break;
 	case 1: /* Bits 8-15 */
@@ -225,7 +225,7 @@ 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)
+	if (len < 1 && (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX))
 		len = 1;
 	if (len < 7 && hapd->conf->ssid.utf8_ssid)
 		len = 7;
-- 
1.9.2




More information about the Hostap mailing list