aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43legacy/b43legacy.h5
-rw-r--r--drivers/net/wireless/b43legacy/main.c15
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h
index d906f6eb202..e4de437b789 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 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)