diff options
author | Stefano Brivio <stefano.brivio@polimi.it> | 2007-11-24 17:35:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:04 -0500 |
commit | a293ee990d0a3ba945eda5d0861969d0ca7ce62c (patch) | |
tree | 28fd3a962f93ce02ef61f3a7ffe4eefe425529a2 /drivers/net/wireless/b43legacy | |
parent | 5be3bda8987b12a87863c89b74b136fdb1f072db (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')
-rw-r--r-- | drivers/net/wireless/b43legacy/b43legacy.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h index d906f6eb2020..e4de437b7896 100644 --- a/drivers/net/wireless/b43legacy/b43legacy.h +++ b/drivers/net/wireless/b43legacy/b43legacy.h | |||
@@ -276,6 +276,8 @@ | |||
276 | #define B43legacy_DEFAULT_SHORT_RETRY_LIMIT 7 | 276 | #define B43legacy_DEFAULT_SHORT_RETRY_LIMIT 7 |
277 | #define B43legacy_DEFAULT_LONG_RETRY_LIMIT 4 | 277 | #define B43legacy_DEFAULT_LONG_RETRY_LIMIT 4 |
278 | 278 | ||
279 | #define B43legacy_PHY_TX_BADNESS_LIMIT 1000 | ||
280 | |||
279 | /* Max size of a security key */ | 281 | /* Max size of a security key */ |
280 | #define B43legacy_SEC_KEYSIZE 16 | 282 | #define B43legacy_SEC_KEYSIZE 16 |
281 | /* Security algorithms. */ | 283 | /* Security algorithms. */ |
@@ -511,6 +513,9 @@ struct b43legacy_phy { | |||
511 | u16 lofcal; | 513 | u16 lofcal; |
512 | 514 | ||
513 | u16 initval; | 515 | u16 initval; |
516 | |||
517 | /* PHY TX errors counter. */ | ||
518 | atomic_t txerr_cnt; | ||
514 | }; | 519 | }; |
515 | 520 | ||
516 | /* Data structures for DMA transmission, per 80211 core. */ | 521 | /* Data structures for DMA transmission, per 80211 core. */ |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 92c03b0336a4..aa723effcf22 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"); |
2099 | out: | 2109 | out: |
@@ -2138,6 +2148,9 @@ static void b43legacy_periodic_every30sec(struct b43legacy_wldev *dev) | |||
2138 | static void b43legacy_periodic_every15sec(struct b43legacy_wldev *dev) | 2148 | static 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 | ||
2143 | static void do_periodic_work(struct b43legacy_wldev *dev) | 2156 | static void do_periodic_work(struct b43legacy_wldev *dev) |