[PATCH] hostapd: remove short slot time from beacon capabilities for 11b

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case ieee80211b was configured, the short slot time should
not appear in beacon capabilities.

Signed-off-by: Sarada Prasanna Garnayak <sarada.prasanna.garnayak@xxxxxxxxx>
---
 src/ap/beacon.c     | 16 ++++++++++++----
 src/ap/ieee802_11.c | 14 ++++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 3e62991d0..68f8e76ea 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -1332,12 +1332,20 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
 				ERP_INFO_USE_PROTECTION);
 	params->preamble = hapd->iface->num_sta_no_short_preamble == 0 &&
 		hapd->iconf->preamble == SHORT_PREAMBLE;
-	if (hapd->iface->current_mode &&
-	    hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G)
-		params->short_slot_time =
+	if (hapd->iface->current_mode) {
+		if (hapd->iface->current_mode->mode ==
+					HOSTAPD_MODE_IEEE80211B) {
+			params->short_slot_time = 0;
+		} else if (hapd->iface->current_mode->mode ==
+					HOSTAPD_MODE_IEEE80211G) {
+			params->short_slot_time =
 			hapd->iface->num_sta_no_short_slot_time > 0 ? 0 : 1;
-	else
+		} else {
+			params->short_slot_time = 1;
+		}
+	} else {
 		params->short_slot_time = -1;
+	}
 	if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n)
 		params->ht_opmode = -1;
 	else
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index c6138e1af..65cee784d 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -206,10 +206,16 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd)
 	if (privacy)
 		capab |= WLAN_CAPABILITY_PRIVACY;
 
-	if (hapd->iface->current_mode &&
-	    hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G &&
-	    hapd->iface->num_sta_no_short_slot_time == 0)
-		capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
+	if (hapd->iface->current_mode) {
+		if (hapd->iface->current_mode->mode ==
+				HOSTAPD_MODE_IEEE80211G) {
+			if (hapd->iface->num_sta_no_short_slot_time == 0)
+				capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
+		} else if (hapd->iface->current_mode->mode !=
+				HOSTAPD_MODE_IEEE80211B) {
+			capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
+		}
+	}
 
 	/*
 	 * Currently, Spectrum Management capability bit is set when directly
-- 
2.11.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux