[PATCH] rt2x00: get_duration expects values in 100kbs
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 6 Oct 2007 12:14:58 +0000 (14:14 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:55:12 +0000 (16:55 -0700)
get_duration expects all speeds to be passed in 100kbs,
this means that passing 2 is incorrect and should be raised to 20

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c

index 0e345659f42190e4ce4622b277f34a88f81a8f8f..bfab5a165b7633452860a38f66a326072d78f616 100644 (file)
@@ -277,7 +277,7 @@ static void rt2400pci_config_type(struct rt2x00_dev *rt2x00dev, const int type,
         */
        rt2x00pci_register_read(rt2x00dev, BCNCSR1, &reg);
        rt2x00_set_field32(&reg, BCNCSR1_PRELOAD,
-                          PREAMBLE + get_duration(IEEE80211_HEADER, 2));
+                          PREAMBLE + get_duration(IEEE80211_HEADER, 20));
        rt2x00pci_register_write(rt2x00dev, BCNCSR1, reg);
 
        /*
index fa8669f5c965fd7a9aabdc7d93ae7c164658d904..c8c6a848be9729544a006d336714834f1ecd2d36 100644 (file)
@@ -277,7 +277,7 @@ static void rt2500pci_config_type(struct rt2x00_dev *rt2x00dev, const int type,
         */
        rt2x00pci_register_read(rt2x00dev, BCNCSR1, &reg);
        rt2x00_set_field32(&reg, BCNCSR1_PRELOAD,
-                          PREAMBLE + get_duration(IEEE80211_HEADER, 2));
+                          PREAMBLE + get_duration(IEEE80211_HEADER, 20));
        rt2x00_set_field32(&reg, BCNCSR1_BEACON_CWMIN,
                           rt2x00lib_get_ring(rt2x00dev,
                                              IEEE80211_TX_QUEUE_BEACON)
index 6d5444b58e6cffe2626b0eea0d864c0d47c9b7c0..c70c677b3f73b7746e60eeb5fbfb5decf15ea2d8 100644 (file)
@@ -280,7 +280,7 @@ static void rt2500usb_config_type(struct rt2x00_dev *rt2x00dev, const int type,
         */
        rt2500usb_register_read(rt2x00dev, TXRX_CSR20, &reg);
        rt2x00_set_field16(&reg, TXRX_CSR20_OFFSET,
-                          (PREAMBLE + get_duration(IEEE80211_HEADER, 2)) >> 6);
+                          (PREAMBLE + get_duration(IEEE80211_HEADER, 20)) >> 6);
        if (type == IEEE80211_IF_TYPE_STA)
                rt2x00_set_field16(&reg, TXRX_CSR20_BCN_EXPECT_WINDOW, 0);
        else