aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43legacy/main.c
diff options
context:
space:
mode:
authorStefano Brivio <stefano.brivio@polimi.it>2007-11-24 17:35:25 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:04 -0500
commita293ee990d0a3ba945eda5d0861969d0ca7ce62c (patch)
tree28fd3a962f93ce02ef61f3a7ffe4eefe425529a2 /drivers/net/wireless/b43legacy/main.c
parent5be3bda8987b12a87863c89b74b136fdb1f072db (diff)
b43legacy: reinit on too many PHY TX errors
Restart the hardware on too many PHY TX errors. A thousand PHY TX errors per 15 seconds means we won't be able to recover for sure. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy/main.c')
-rw-r--r--drivers/net/wireless/b43legacy/main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 92c03b0336a..aa723effcf2 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -1221,8 +1221,15 @@ static void b43legacy_interrupt_tasklet(struct b43legacy_wldev *dev)
1221 if (unlikely(reason & B43legacy_IRQ_MAC_TXERR)) 1221 if (unlikely(reason & B43legacy_IRQ_MAC_TXERR))
1222 b43legacyerr(dev->wl, "MAC transmission error\n"); 1222 b43legacyerr(dev->wl, "MAC transmission error\n");
1223 1223
1224 if (unlikely(reason & B43legacy_IRQ_PHY_TXERR)) 1224 if (unlikely(reason & B43legacy_IRQ_PHY_TXERR)) {
1225 b43legacyerr(dev->wl, "PHY transmission error\n"); 1225 b43legacyerr(dev->wl, "PHY transmission error\n");
1226 rmb();
1227 if (unlikely(atomic_dec_and_test(&dev->phy.txerr_cnt))) {
1228 b43legacyerr(dev->wl, "Too many PHY TX errors, "
1229 "restarting the controller\n");
1230 b43legacy_controller_restart(dev, "PHY TX errors");
1231 }
1232 }
1226 1233
1227 if (unlikely(merged_dma_reason & (B43legacy_DMAIRQ_FATALMASK | 1234 if (unlikely(merged_dma_reason & (B43legacy_DMAIRQ_FATALMASK |
1228 B43legacy_DMAIRQ_NONFATALMASK))) { 1235 B43legacy_DMAIRQ_NONFATALMASK))) {
@@ -2094,6 +2101,9 @@ static int b43legacy_chip_init(struct b43legacy_wldev *dev)
2094 b43legacy_write16(dev, B43legacy_MMIO_POWERUP_DELAY, 2101 b43legacy_write16(dev, B43legacy_MMIO_POWERUP_DELAY,
2095 dev->dev->bus->chipco.fast_pwrup_delay); 2102 dev->dev->bus->chipco.fast_pwrup_delay);
2096 2103
2104 /* PHY TX errors counter. */
2105 atomic_set(&phy->txerr_cnt, B43legacy_PHY_TX_BADNESS_LIMIT);
2106
2097 B43legacy_WARN_ON(err != 0); 2107 B43legacy_WARN_ON(err != 0);
2098 b43legacydbg(dev->wl, "Chip initialized\n"); 2108 b43legacydbg(dev->wl, "Chip initialized\n");
2099out: 2109out:
@@ -2138,6 +2148,9 @@ static void b43legacy_periodic_every30sec(struct b43legacy_wldev *dev)
2138static void b43legacy_periodic_every15sec(struct b43legacy_wldev *dev) 2148static void b43legacy_periodic_every15sec(struct b43legacy_wldev *dev)
2139{ 2149{
2140 b43legacy_phy_xmitpower(dev); /* FIXME: unless scanning? */ 2150 b43legacy_phy_xmitpower(dev); /* FIXME: unless scanning? */
2151
2152 atomic_set(&dev->phy.txerr_cnt, B43legacy_PHY_TX_BADNESS_LIMIT);
2153 wmb();
2141} 2154}
2142 2155
2143static void do_periodic_work(struct b43legacy_wldev *dev) 2156static void do_periodic_work(struct b43legacy_wldev *dev)