]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mt76x2: apply coverage class on slot time too
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Tue, 15 May 2018 10:08:14 +0000 (12:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:47:46 +0000 (07:47 +0200)
[ Upstream commit 0d45d3fe42efc76b6c4f5a62f8d110c7a2e6f83f ]

According to 802.11-2007 17.3.8.6 (slot time), the slot time should
be increased by 3 us * coverage class. Taking into account coverage
class in slot time configuration allows to increase by an order of
magnitude the throughput on a 4Km link in a noisy environment

Tested-by: Luca Bisti <luca.bisti@gmail.com>
Tested-by: Gaetano Catalli <gaetano.catalli@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mediatek/mt76/mt76x2_init.c
drivers/net/wireless/mediatek/mt76/mt76x2_main.c

index 934c331d995e9c3611ee9f470177de1c4b231461..1932414e5088e93cb44a912817918d4dc0aa9e3d 100644 (file)
@@ -482,7 +482,10 @@ void mt76x2_set_tx_ackto(struct mt76x2_dev *dev)
 {
        u8 ackto, sifs, slottime = dev->slottime;
 
+       /* As defined by IEEE 802.11-2007 17.3.8.6 */
        slottime += 3 * dev->coverage_class;
+       mt76_rmw_field(dev, MT_BKOFF_SLOT_CFG,
+                      MT_BKOFF_SLOT_CFG_SLOTTIME, slottime);
 
        sifs = mt76_get_field(dev, MT_XIFS_TIME_CFG,
                              MT_XIFS_TIME_CFG_OFDM_SIFS);
index 73c127f92613eeb06ebf5b021eecdfb83065f321..f66b6ff92ae0e134cb211febd1accc1b144f20a7 100644 (file)
@@ -247,8 +247,7 @@ mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                int slottime = info->use_short_slot ? 9 : 20;
 
                dev->slottime = slottime;
-               mt76_rmw_field(dev, MT_BKOFF_SLOT_CFG,
-                              MT_BKOFF_SLOT_CFG_SLOTTIME, slottime);
+               mt76x2_set_tx_ackto(dev);
        }
 
        mutex_unlock(&dev->mutex);