mac80211: adapt slot time in IBSS mode
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Mon, 3 Dec 2012 21:21:30 +0000 (22:21 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 4 Dec 2012 14:54:43 +0000 (15:54 +0100)
In 5GHz/802.11a, we are allowed to use short slot times. Doing this
may increases performance by 20% for legacy connections (54 MBit/s).
I can confirm this in my tests (27% more throughput using iperf), and
also have a small positive effect (5% more throughput) for HT rates,
tested on 1 stream.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ibss.c

index 11a6a1b..700d0ed 100644 (file)
@@ -201,6 +201,20 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
        bss_change |= BSS_CHANGED_BASIC_RATES;
        bss_change |= BSS_CHANGED_HT;
        bss_change |= BSS_CHANGED_IBSS;
+
+       /*
+        * In 5 GHz/802.11a, we can always use short slot time.
+        * (IEEE 802.11-2012 18.3.8.7)
+        *
+        * In 2.4GHz, we must always use long slots in IBSS for compatibility
+        * reasons.
+        * (IEEE 802.11-2012 19.4.5)
+        *
+        * HT follows these specifications (IEEE 802.11-2012 20.3.18)
+        */
+       sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ;
+       bss_change |= BSS_CHANGED_ERP_SLOT;
+
        sdata->vif.bss_conf.ibss_joined = true;
        sdata->vif.bss_conf.ibss_creator = creator;
        ieee80211_bss_info_change_notify(sdata, bss_change);