rtl818x_pci: Fix rtl8185 excessive IFS after CTS-to-self
authorAndrea Merello <andrea.merello@gmail.com>
Mon, 30 Jun 2014 16:18:25 +0000 (18:18 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 1 Jul 2014 18:26:27 +0000 (14:26 -0400)
Measuring time between _end_ of CTS-to-self and _end_ of datapacket (with a
prism54 board and mac80211 hacked to let the MAC timestamp stay untouched in the
radiotap header) resulted in about 300uS, while the datapacket itself should be
by far shorter (less than 100uS) and IFS should be SIFS (10uS).
This measure was confirmed whith a scope: about 250uS IFS has been seen between
the two packets.

This situation causes the CTS-to-self protection mechanism to work incorrectly
due to the NAV expiring during, or even before beginning, the packet
transmission, and it also causes the performances to be anyway reduced due to
time waste.

This problem has been seen at every packet TXed with CTS-to-self enabled on
rtl8185 board.
rtl8187se seems not affected (and rtl8180, being a 802.11b card, does not have
CTS-to-self mechaninsm).

This patch fixes this by adding a magic register write, making the board wait
for correct SIFS after CTS-to-self packet.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtl818x/rtl8180/dev.c

index e2dcede..73baf26 100644 (file)
@@ -879,6 +879,8 @@ static int rtl8180_init_hw(struct ieee80211_hw *dev)
                reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
                rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | (1 << 2));
                rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
+               /* fix eccessive IFS after CTS-to-self */
+               rtl818x_iowrite8(priv, REG_ADDR1(0x1ff), 0x35);
        }
 
        if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) {