diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-03-09 17:42:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-13 16:02:35 -0400 |
commit | 8af244ccb14a4367568db11c5e78b45a4c2cf77e (patch) | |
tree | 350727822602b851dcc2d31ad7a64fe7c4528a88 /drivers/net/wireless/rt2x00/rt61pci.c | |
parent | 3976ae6c2b09608cd6a13663737a6b219245b651 (diff) |
rt2x00: Only disable beaconing just before beacon update
We should not write 0 to the beacon sync register during
config_intf() since that will clear out the beacon interval
and forces the beacon to be send out at the lowest interval.
(reported by Mattias Nissler).
The side effect of the same bug was that while working with
multiple virtual AP interfaces a change for any of those
interfaces would disable beaconing untill an beacon update
was provided.
This is resolved by only updating the TSF_SYNC value during
config_intf(). In update_beacon() we disable beaconing
temporarily to prevent fake beacons to be transmitted.
Finally kick_tx_queue() will enable beaconing again.
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/rt61pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 091fe398676d..13b918db1850 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -336,17 +336,12 @@ static void rt61pci_config_intf(struct rt2x00_dev *rt2x00dev, | |||
336 | * bits which (when set to 0) will invalidate the entire beacon. | 336 | * bits which (when set to 0) will invalidate the entire beacon. |
337 | */ | 337 | */ |
338 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); | 338 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); |
339 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, 0); | ||
340 | rt2x00pci_register_write(rt2x00dev, beacon_base, 0); | 339 | rt2x00pci_register_write(rt2x00dev, beacon_base, 0); |
341 | 340 | ||
342 | /* | 341 | /* |
343 | * Enable synchronisation. | 342 | * Enable synchronisation. |
344 | */ | 343 | */ |
345 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); | 344 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); |
346 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 1); | ||
347 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, | ||
348 | (conf->sync == TSF_SYNC_BEACON)); | ||
349 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | ||
350 | rt2x00_set_field32(®, TXRX_CSR9_TSF_SYNC, conf->sync); | 345 | rt2x00_set_field32(®, TXRX_CSR9_TSF_SYNC, conf->sync); |
351 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); | 346 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); |
352 | } | 347 | } |
@@ -1562,6 +1557,8 @@ static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | |||
1562 | 1557 | ||
1563 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); | 1558 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); |
1564 | if (!rt2x00_get_field32(reg, TXRX_CSR9_BEACON_GEN)) { | 1559 | if (!rt2x00_get_field32(reg, TXRX_CSR9_BEACON_GEN)) { |
1560 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 1); | ||
1561 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 1); | ||
1565 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 1); | 1562 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 1); |
1566 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); | 1563 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); |
1567 | } | 1564 | } |
@@ -2373,6 +2370,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2373 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 2370 | struct rt2x00_intf *intf = vif_to_intf(control->vif); |
2374 | struct skb_frame_desc *skbdesc; | 2371 | struct skb_frame_desc *skbdesc; |
2375 | unsigned int beacon_base; | 2372 | unsigned int beacon_base; |
2373 | u32 reg; | ||
2376 | 2374 | ||
2377 | if (unlikely(!intf->beacon)) | 2375 | if (unlikely(!intf->beacon)) |
2378 | return -ENOBUFS; | 2376 | return -ENOBUFS; |
@@ -2408,6 +2406,16 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2408 | skbdesc->entry = intf->beacon; | 2406 | skbdesc->entry = intf->beacon; |
2409 | 2407 | ||
2410 | /* | 2408 | /* |
2409 | * Disable beaconing while we are reloading the beacon data, | ||
2410 | * otherwise we might be sending out invalid data. | ||
2411 | */ | ||
2412 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); | ||
2413 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 0); | ||
2414 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 0); | ||
2415 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | ||
2416 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
2417 | |||
2418 | /* | ||
2411 | * mac80211 doesn't provide the control->queue variable | 2419 | * mac80211 doesn't provide the control->queue variable |
2412 | * for beacons. Set our own queue identification so | 2420 | * for beacons. Set our own queue identification so |
2413 | * it can be used during descriptor initialization. | 2421 | * it can be used during descriptor initialization. |