aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorIgor Perminov <igor.perminov@inbox.ru>2009-08-09 18:58:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:55 -0400
commitd6756d0dc220c3d12e2c4c06ca97d1dbcb5edf4e (patch)
treeaaa10e86a291624fa71cde855860a7787bb49d2e /drivers/net/wireless/rt2x00
parent3281d95d0535909e28ff16c38a678102e10f0312 (diff)
rt2x00: Fix beacon de-synchronization while update beacon
When beacon is being updated to refresh TIM (AP mode), beacon frames are de-synchronizing (i.e. two neighbor beacon frames - before and after update - are being transmitted with a wrong time interval). That is because xxx_write_beacon should disable beacon generation only while beacon data are being uploaded to the device, but it should not disable the beacon clock. Signed-off-by: Igor Perminov <igor.perminov@inbox.ru> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
6 files changed, 8 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 30185ad28d93..164df9347a2f 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1069,8 +1069,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry)
1069 * otherwise we might be sending out invalid data. 1069 * otherwise we might be sending out invalid data.
1070 */ 1070 */
1071 rt2x00pci_register_read(rt2x00dev, CSR14, &reg); 1071 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1072 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 0);
1073 rt2x00_set_field32(&reg, CSR14_TBCN, 0);
1074 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0); 1072 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
1075 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 1073 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1076 1074
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 3b3171578b14..4186582f2770 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1227,8 +1227,6 @@ static void rt2500pci_write_beacon(struct queue_entry *entry)
1227 * otherwise we might be sending out invalid data. 1227 * otherwise we might be sending out invalid data.
1228 */ 1228 */
1229 rt2x00pci_register_read(rt2x00dev, CSR14, &reg); 1229 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1230 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 0);
1231 rt2x00_set_field32(&reg, CSR14_TBCN, 0);
1232 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0); 1230 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
1233 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 1231 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1234 1232
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index de48c5c68eff..09a589432dab 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1238,8 +1238,6 @@ static void rt2500usb_write_beacon(struct queue_entry *entry)
1238 * otherwise we might be sending out invalid data. 1238 * otherwise we might be sending out invalid data.
1239 */ 1239 */
1240 rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg); 1240 rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg);
1241 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 0);
1242 rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 0);
1243 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 0); 1241 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 0);
1244 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); 1242 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1245 1243
@@ -1287,7 +1285,7 @@ static int rt2500usb_get_tx_data_len(struct queue_entry *entry)
1287static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, 1285static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1288 const enum data_queue_qid queue) 1286 const enum data_queue_qid queue)
1289{ 1287{
1290 u16 reg; 1288 u16 reg, reg0;
1291 1289
1292 if (queue != QID_BEACON) { 1290 if (queue != QID_BEACON) {
1293 rt2x00usb_kick_tx_queue(rt2x00dev, queue); 1291 rt2x00usb_kick_tx_queue(rt2x00dev, queue);
@@ -1298,16 +1296,19 @@ static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1298 if (!rt2x00_get_field16(reg, TXRX_CSR19_BEACON_GEN)) { 1296 if (!rt2x00_get_field16(reg, TXRX_CSR19_BEACON_GEN)) {
1299 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 1); 1297 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 1);
1300 rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 1); 1298 rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 1);
1299 reg0 = reg;
1301 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 1); 1300 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 1);
1302 /* 1301 /*
1303 * Beacon generation will fail initially. 1302 * Beacon generation will fail initially.
1304 * To prevent this we need to register the TXRX_CSR19 1303 * To prevent this we need to change the TXRX_CSR19
1305 * register several times. 1304 * register several times (reg0 is the same as reg
1305 * except for TXRX_CSR19_BEACON_GEN, which is 0 in reg0
1306 * and 1 in reg).
1306 */ 1307 */
1307 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); 1308 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1308 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, 0); 1309 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg0);
1309 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); 1310 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1310 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, 0); 1311 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg0);
1311 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); 1312 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1312 } 1313 }
1313} 1314}
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 2de0389d823d..3856f06fdca7 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -2050,8 +2050,6 @@ static void rt2800usb_write_beacon(struct queue_entry *entry)
2050 * otherwise we might be sending out invalid data. 2050 * otherwise we might be sending out invalid data.
2051 */ 2051 */
2052 rt2x00usb_register_read(rt2x00dev, BCN_TIME_CFG, &reg); 2052 rt2x00usb_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
2053 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 0);
2054 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 0);
2055 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 0); 2053 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 0);
2056 rt2x00usb_register_write(rt2x00dev, BCN_TIME_CFG, reg); 2054 rt2x00usb_register_write(rt2x00dev, BCN_TIME_CFG, reg);
2057 2055
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 3447997fc71a..f4b4b86da4da 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1855,8 +1855,6 @@ static void rt61pci_write_beacon(struct queue_entry *entry)
1855 * otherwise we might be sending out invalid data. 1855 * otherwise we might be sending out invalid data.
1856 */ 1856 */
1857 rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, &reg); 1857 rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, &reg);
1858 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 0);
1859 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 0);
1860 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0); 1858 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
1861 rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); 1859 rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg);
1862 1860
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4b9955b1c70e..4d94b65943f1 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1527,8 +1527,6 @@ static void rt73usb_write_beacon(struct queue_entry *entry)
1527 * otherwise we might be sending out invalid data. 1527 * otherwise we might be sending out invalid data.
1528 */ 1528 */
1529 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg); 1529 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
1530 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 0);
1531 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 0);
1532 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0); 1530 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
1533 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); 1531 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1534 1532