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/rt2400pci.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/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 460ef2fb5104..a1c38a144149 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -279,8 +279,6 @@ static void rt2400pci_config_intf(struct rt2x00_dev *rt2x00dev, | |||
279 | u32 reg; | 279 | u32 reg; |
280 | 280 | ||
281 | if (flags & CONFIG_UPDATE_TYPE) { | 281 | if (flags & CONFIG_UPDATE_TYPE) { |
282 | rt2x00pci_register_write(rt2x00dev, CSR14, 0); | ||
283 | |||
284 | /* | 282 | /* |
285 | * Enable beacon config | 283 | * Enable beacon config |
286 | */ | 284 | */ |
@@ -293,10 +291,6 @@ static void rt2400pci_config_intf(struct rt2x00_dev *rt2x00dev, | |||
293 | * Enable synchronisation. | 291 | * Enable synchronisation. |
294 | */ | 292 | */ |
295 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); | 293 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); |
296 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 1); | ||
297 | rt2x00_set_field32(®, CSR14_TBCN, | ||
298 | (conf->sync == TSF_SYNC_BEACON)); | ||
299 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | ||
300 | rt2x00_set_field32(®, CSR14_TSF_SYNC, conf->sync); | 294 | rt2x00_set_field32(®, CSR14_TSF_SYNC, conf->sync); |
301 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 295 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
302 | } | 296 | } |
@@ -1040,6 +1034,8 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | |||
1040 | if (queue == RT2X00_BCN_QUEUE_BEACON) { | 1034 | if (queue == RT2X00_BCN_QUEUE_BEACON) { |
1041 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); | 1035 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); |
1042 | if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { | 1036 | if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { |
1037 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 1); | ||
1038 | rt2x00_set_field32(®, CSR14_TBCN, 1); | ||
1043 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 1); | 1039 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 1); |
1044 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 1040 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
1045 | } | 1041 | } |
@@ -1517,10 +1513,10 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1517 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 1513 | struct rt2x00_intf *intf = vif_to_intf(control->vif); |
1518 | struct queue_entry_priv_pci_tx *priv_tx; | 1514 | struct queue_entry_priv_pci_tx *priv_tx; |
1519 | struct skb_frame_desc *skbdesc; | 1515 | struct skb_frame_desc *skbdesc; |
1516 | u32 reg; | ||
1520 | 1517 | ||
1521 | if (unlikely(!intf->beacon)) | 1518 | if (unlikely(!intf->beacon)) |
1522 | return -ENOBUFS; | 1519 | return -ENOBUFS; |
1523 | |||
1524 | priv_tx = intf->beacon->priv_data; | 1520 | priv_tx = intf->beacon->priv_data; |
1525 | 1521 | ||
1526 | /* | 1522 | /* |
@@ -1536,6 +1532,16 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1536 | skbdesc->entry = intf->beacon; | 1532 | skbdesc->entry = intf->beacon; |
1537 | 1533 | ||
1538 | /* | 1534 | /* |
1535 | * Disable beaconing while we are reloading the beacon data, | ||
1536 | * otherwise we might be sending out invalid data. | ||
1537 | */ | ||
1538 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); | ||
1539 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 0); | ||
1540 | rt2x00_set_field32(®, CSR14_TBCN, 0); | ||
1541 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | ||
1542 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | ||
1543 | |||
1544 | /* | ||
1539 | * mac80211 doesn't provide the control->queue variable | 1545 | * mac80211 doesn't provide the control->queue variable |
1540 | * for beacons. Set our own queue identification so | 1546 | * for beacons. Set our own queue identification so |
1541 | * it can be used during descriptor initialization. | 1547 | * it can be used during descriptor initialization. |