aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.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/rt2500pci.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/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index ffcd996df064..096232763055 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -281,8 +281,6 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev,
281 u32 reg; 281 u32 reg;
282 282
283 if (flags & CONFIG_UPDATE_TYPE) { 283 if (flags & CONFIG_UPDATE_TYPE) {
284 rt2x00pci_register_write(rt2x00dev, CSR14, 0);
285
286 /* 284 /*
287 * Enable beacon config 285 * Enable beacon config
288 */ 286 */
@@ -296,10 +294,6 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev,
296 * Enable synchronisation. 294 * Enable synchronisation.
297 */ 295 */
298 rt2x00pci_register_read(rt2x00dev, CSR14, &reg); 296 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
299 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
300 rt2x00_set_field32(&reg, CSR14_TBCN,
301 (conf->sync == TSF_SYNC_BEACON));
302 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
303 rt2x00_set_field32(&reg, CSR14_TSF_SYNC, conf->sync); 297 rt2x00_set_field32(&reg, CSR14_TSF_SYNC, conf->sync);
304 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 298 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
305 } 299 }
@@ -1193,6 +1187,8 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1193 if (queue == RT2X00_BCN_QUEUE_BEACON) { 1187 if (queue == RT2X00_BCN_QUEUE_BEACON) {
1194 rt2x00pci_register_read(rt2x00dev, CSR14, &reg); 1188 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1195 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { 1189 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
1190 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
1191 rt2x00_set_field32(&reg, CSR14_TBCN, 1);
1196 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1); 1192 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
1197 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 1193 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1198 } 1194 }
@@ -1828,6 +1824,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1828 struct rt2x00_intf *intf = vif_to_intf(control->vif); 1824 struct rt2x00_intf *intf = vif_to_intf(control->vif);
1829 struct queue_entry_priv_pci_tx *priv_tx; 1825 struct queue_entry_priv_pci_tx *priv_tx;
1830 struct skb_frame_desc *skbdesc; 1826 struct skb_frame_desc *skbdesc;
1827 u32 reg;
1831 1828
1832 if (unlikely(!intf->beacon)) 1829 if (unlikely(!intf->beacon))
1833 return -ENOBUFS; 1830 return -ENOBUFS;
@@ -1847,6 +1844,16 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1847 skbdesc->entry = intf->beacon; 1844 skbdesc->entry = intf->beacon;
1848 1845
1849 /* 1846 /*
1847 * Disable beaconing while we are reloading the beacon data,
1848 * otherwise we might be sending out invalid data.
1849 */
1850 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1851 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 0);
1852 rt2x00_set_field32(&reg, CSR14_TBCN, 0);
1853 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
1854 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1855
1856 /*
1850 * mac80211 doesn't provide the control->queue variable 1857 * mac80211 doesn't provide the control->queue variable
1851 * for beacons. Set our own queue identification so 1858 * for beacons. Set our own queue identification so
1852 * it can be used during descriptor initialization. 1859 * it can be used during descriptor initialization.