aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2010-06-29 15:48:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-30 15:00:52 -0400
commitfdb87251229be046b2b61fd15320320f7b66853b (patch)
tree5b2a4cb9403004bfc9e57e618fefceb7938a8621 /drivers/net
parent8654b79f9cad1095c905d407193f1230d073786d (diff)
rt2x00: fix beacon reset on rt2800
When an interface is removed the according beacon entry should be reset. The current approach to only clear the first word is not enough to stop the device from sending out the beacon, hence resulting in beacons being sent out for already removed interfaces. Fix this by invalidating the entire TXWI in front of the beacon instead of only the first word. Also clear all beacons during startup in the same way. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index f7e9e7635303..5125315abf50 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -432,6 +432,20 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
432} 432}
433EXPORT_SYMBOL(rt2800_write_beacon); 433EXPORT_SYMBOL(rt2800_write_beacon);
434 434
435static void inline rt2800_clear_beacon(struct rt2x00_dev *rt2x00dev,
436 unsigned int beacon_base)
437{
438 int i;
439
440 /*
441 * For the Beacon base registers we only need to clear
442 * the whole TXWI which (when set to 0) will invalidate
443 * the entire beacon.
444 */
445 for (i = 0; i < TXWI_DESC_SIZE; i += sizeof(__le32))
446 rt2800_register_write(rt2x00dev, beacon_base + i, 0);
447}
448
435#ifdef CONFIG_RT2X00_LIB_DEBUGFS 449#ifdef CONFIG_RT2X00_LIB_DEBUGFS
436const struct rt2x00debug rt2800_rt2x00debug = { 450const struct rt2x00debug rt2800_rt2x00debug = {
437 .owner = THIS_MODULE, 451 .owner = THIS_MODULE,
@@ -733,19 +747,14 @@ EXPORT_SYMBOL_GPL(rt2800_config_filter);
733void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, 747void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
734 struct rt2x00intf_conf *conf, const unsigned int flags) 748 struct rt2x00intf_conf *conf, const unsigned int flags)
735{ 749{
736 unsigned int beacon_base;
737 u32 reg; 750 u32 reg;
738 751
739 if (flags & CONFIG_UPDATE_TYPE) { 752 if (flags & CONFIG_UPDATE_TYPE) {
740 /* 753 /*
741 * Clear current synchronisation setup. 754 * Clear current synchronisation setup.
742 * For the Beacon base registers we only need to clear
743 * the first byte since that byte contains the VALID and OWNER
744 * bits which (when set to 0) will invalidate the entire beacon.
745 */ 755 */
746 beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); 756 rt2800_clear_beacon(rt2x00dev,
747 rt2800_register_write(rt2x00dev, beacon_base, 0); 757 HW_BEACON_OFFSET(intf->beacon->entry_idx));
748
749 /* 758 /*
750 * Enable synchronisation. 759 * Enable synchronisation.
751 */ 760 */
@@ -1565,18 +1574,15 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
1565 1574
1566 /* 1575 /*
1567 * Clear all beacons 1576 * Clear all beacons
1568 * For the Beacon base registers we only need to clear
1569 * the first byte since that byte contains the VALID and OWNER
1570 * bits which (when set to 0) will invalidate the entire beacon.
1571 */ 1577 */
1572 rt2800_register_write(rt2x00dev, HW_BEACON_BASE0, 0); 1578 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE0);
1573 rt2800_register_write(rt2x00dev, HW_BEACON_BASE1, 0); 1579 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE1);
1574 rt2800_register_write(rt2x00dev, HW_BEACON_BASE2, 0); 1580 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE2);
1575 rt2800_register_write(rt2x00dev, HW_BEACON_BASE3, 0); 1581 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE3);
1576 rt2800_register_write(rt2x00dev, HW_BEACON_BASE4, 0); 1582 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE4);
1577 rt2800_register_write(rt2x00dev, HW_BEACON_BASE5, 0); 1583 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE5);
1578 rt2800_register_write(rt2x00dev, HW_BEACON_BASE6, 0); 1584 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE6);
1579 rt2800_register_write(rt2x00dev, HW_BEACON_BASE7, 0); 1585 rt2800_clear_beacon(rt2x00dev, HW_BEACON_BASE7);
1580 1586
1581 if (rt2x00_is_usb(rt2x00dev)) { 1587 if (rt2x00_is_usb(rt2x00dev)) {
1582 rt2800_register_read(rt2x00dev, US_CYC_CNT, &reg); 1588 rt2800_register_read(rt2x00dev, US_CYC_CNT, &reg);