mac80211: use short slot time in mesh for 5GHz
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Thu, 13 Dec 2012 10:59:57 +0000 (18:59 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 3 Jan 2013 12:01:14 +0000 (13:01 +0100)
Use short slot time in 5GHz for mesh. The performance is
increased from 16.4Mbps to 23.4Mbps for two directly
connected mesh STAs operating in legacy rate using iperf
measurement. Almost similar to the results claimed in IBSS
mode.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[call ieee80211_get_sdata_band() only once]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mesh.c

index 649ad513547f99728d43dbeeabcd2b58d7862c30..8565c00cb6448b9cbe1f3e6dbde8f7788bb24262 100644 (file)
@@ -607,6 +607,12 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
 {
        struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
        struct ieee80211_local *local = sdata->local;
+       u32 changed = BSS_CHANGED_BEACON |
+                     BSS_CHANGED_BEACON_ENABLED |
+                     BSS_CHANGED_HT |
+                     BSS_CHANGED_BASIC_RATES |
+                     BSS_CHANGED_BEACON_INT;
+       enum ieee80211_band band = ieee80211_get_sdata_band(sdata);
 
        local->fif_other_bss++;
        /* mesh ifaces must set allmulti to forward mcast traffic */
@@ -626,13 +632,14 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
                                ifmsh->mshcfg.ht_opmode;
        sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
        sdata->vif.bss_conf.basic_rates =
-               ieee80211_mandatory_rates(sdata->local,
-                                         ieee80211_get_sdata_band(sdata));
-       ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON |
-                                               BSS_CHANGED_BEACON_ENABLED |
-                                               BSS_CHANGED_HT |
-                                               BSS_CHANGED_BASIC_RATES |
-                                               BSS_CHANGED_BEACON_INT);
+               ieee80211_mandatory_rates(local, band);
+
+       if (band == IEEE80211_BAND_5GHZ) {
+               sdata->vif.bss_conf.use_short_slot = true;
+               changed |= BSS_CHANGED_ERP_SLOT;
+       }
+
+       ieee80211_bss_info_change_notify(sdata, changed);
 
        netif_carrier_on(sdata->dev);
 }