aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-03-09 17:42:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-13 16:02:35 -0400
commit8af244ccb14a4367568db11c5e78b45a4c2cf77e (patch)
tree350727822602b851dcc2d31ad7a64fe7c4528a88 /drivers/net/wireless/rt2x00/rt73usb.c
parent3976ae6c2b09608cd6a13663737a6b219245b651 (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/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 468039f1bff9..a28c1d84ba95 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -347,17 +347,12 @@ static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev,
347 * bits which (when set to 0) will invalidate the entire beacon. 347 * bits which (when set to 0) will invalidate the entire beacon.
348 */ 348 */
349 beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); 349 beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx);
350 rt73usb_register_write(rt2x00dev, TXRX_CSR9, 0);
351 rt73usb_register_write(rt2x00dev, beacon_base, 0); 350 rt73usb_register_write(rt2x00dev, beacon_base, 0);
352 351
353 /* 352 /*
354 * Enable synchronisation. 353 * Enable synchronisation.
355 */ 354 */
356 rt73usb_register_read(rt2x00dev, TXRX_CSR9, &reg); 355 rt73usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
357 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
358 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE,
359 (conf->sync == TSF_SYNC_BEACON));
360 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
361 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_SYNC, conf->sync); 356 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_SYNC, conf->sync);
362 rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg); 357 rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg);
363 } 358 }
@@ -1312,6 +1307,8 @@ static void rt73usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1312 1307
1313 rt73usb_register_read(rt2x00dev, TXRX_CSR9, &reg); 1308 rt73usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
1314 if (!rt2x00_get_field32(reg, TXRX_CSR9_BEACON_GEN)) { 1309 if (!rt2x00_get_field32(reg, TXRX_CSR9_BEACON_GEN)) {
1310 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
1311 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
1315 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1); 1312 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1316 rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg); 1313 rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1317 } 1314 }
@@ -1987,6 +1984,7 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1987 struct skb_frame_desc *skbdesc; 1984 struct skb_frame_desc *skbdesc;
1988 unsigned int beacon_base; 1985 unsigned int beacon_base;
1989 unsigned int timeout; 1986 unsigned int timeout;
1987 u32 reg;
1990 1988
1991 if (unlikely(!intf->beacon)) 1989 if (unlikely(!intf->beacon))
1992 return -ENOBUFS; 1990 return -ENOBUFS;
@@ -2010,6 +2008,16 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2010 skbdesc->entry = intf->beacon; 2008 skbdesc->entry = intf->beacon;
2011 2009
2012 /* 2010 /*
2011 * Disable beaconing while we are reloading the beacon data,
2012 * otherwise we might be sending out invalid data.
2013 */
2014 rt73usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
2015 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 0);
2016 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 0);
2017 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
2018 rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg);
2019
2020 /*
2013 * mac80211 doesn't provide the control->queue variable 2021 * mac80211 doesn't provide the control->queue variable
2014 * for beacons. Set our own queue identification so 2022 * for beacons. Set our own queue identification so
2015 * it can be used during descriptor initialization. 2023 * it can be used during descriptor initialization.