mac80211: force use_short_slot=true for 5GHz
authorFelix Fietkau <nbd@openwrt.org>
Fri, 15 Jan 2010 02:00:48 +0000 (03:00 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 15 Jan 2010 22:02:07 +0000 (17:02 -0500)
Normally 5GHz does not have a concept of long vs short slot time,
however the slot time that it ends up using is the same as for 2.4 GHZ
and use_short_slot == true
Because of that, it makes more sense to force use_short_slot = true
whenever 5 GHz is being used, so that this particular check does not
have to be in every single driver that uses this flag.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/cfg.c
net/mac80211/mlme.c

index 8286df5822d5a3c16aa41eb672ff5ab5fe86c2db..b0102c538b309c44138fe047460b88668706a60f 100644 (file)
@@ -1085,6 +1085,13 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
                        params->use_short_preamble;
                changed |= BSS_CHANGED_ERP_PREAMBLE;
        }
+
+       if (!sdata->vif.bss_conf.use_short_slot &&
+           sdata->local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) {
+               sdata->vif.bss_conf.use_short_slot = true;
+               changed |= BSS_CHANGED_ERP_SLOT;
+       }
+
        if (params->use_short_slot_time >= 0) {
                sdata->vif.bss_conf.use_short_slot =
                        params->use_short_slot_time;
index 2746391248d34a1cddc671f9dfa666d1fd9dea1f..a82564e73d91799d973b3b3a68c19d8ec5ac1d58 100644 (file)
@@ -670,6 +670,8 @@ static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
        }
 
        use_short_slot = !!(capab & WLAN_CAPABILITY_SHORT_SLOT_TIME);
+       if (sdata->local->hw.conf.channel->band == IEEE80211_BAND_5GHZ)
+               use_short_slot = true;
 
        if (use_protection != bss_conf->use_cts_prot) {
                bss_conf->use_cts_prot = use_protection;