aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-04-17 18:54:40 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-17 18:54:40 -0400
commit75a241f959a65ec9bde237d1af1a34ef794f0c9c (patch)
tree6a2b9fe1b525b69ac094d6ae088e00cb5d626969 /drivers
parente18e37e50966f137f8a3b807fe0da7703779be34 (diff)
parent957b0516f7881284b48f2f2e4a909a1c5de0ddf8 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ps3_gelic_wireless.c3
-rw-r--r--drivers/net/wireless/airo.c2
-rw-r--r--drivers/net/wireless/ar9170/hw.h8
-rw-r--r--drivers/net/wireless/ar9170/usb.c4
-rw-r--r--drivers/net/wireless/at76c50x-usb.c2
-rw-r--r--drivers/net/wireless/ath9k/recv.c4
-rw-r--r--drivers/net/wireless/b43/dma.c50
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/b43/phy_common.c16
-rw-r--r--drivers/net/wireless/b43/phy_common.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c2
-rw-r--r--drivers/net/wireless/libertas/rx.c2
-rw-r--r--drivers/net/wireless/orinoco/hw.c8
-rw-r--r--drivers/net/wireless/p54/p54.h12
-rw-r--r--drivers/net/wireless/p54/p54spi.c25
-rw-r--r--drivers/net/wireless/p54/p54usb.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
18 files changed, 107 insertions, 47 deletions
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index a5ac2bd58b5b..4f3ada622f9b 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2101,6 +2101,9 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl,
2101 if (ret) { 2101 if (ret) {
2102 pr_debug("%s: WEP/WPA setup failed %d\n", __func__, 2102 pr_debug("%s: WEP/WPA setup failed %d\n", __func__,
2103 ret); 2103 ret);
2104 ret = -EPERM;
2105 gelic_wl_send_iwap_event(wl, NULL);
2106 goto out;
2104 } 2107 }
2105 2108
2106 /* start association */ 2109 /* start association */
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index f21a6171c691..c36d3a3d655f 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -6713,11 +6713,11 @@ static int airo_set_auth(struct net_device *dev,
6713 local->config.authType = AUTH_ENCRYPT; 6713 local->config.authType = AUTH_ENCRYPT;
6714 } else 6714 } else
6715 return -EINVAL; 6715 return -EINVAL;
6716 break;
6717 6716
6718 /* Commit the changes to flags if needed */ 6717 /* Commit the changes to flags if needed */
6719 if (local->config.authType != currentAuthType) 6718 if (local->config.authType != currentAuthType)
6720 set_bit (FLAG_COMMIT, &local->flags); 6719 set_bit (FLAG_COMMIT, &local->flags);
6720 break;
6721 } 6721 }
6722 6722
6723 case IW_AUTH_WPA_ENABLED: 6723 case IW_AUTH_WPA_ENABLED:
diff --git a/drivers/net/wireless/ar9170/hw.h b/drivers/net/wireless/ar9170/hw.h
index 13091bd9d815..53e250a4278f 100644
--- a/drivers/net/wireless/ar9170/hw.h
+++ b/drivers/net/wireless/ar9170/hw.h
@@ -310,7 +310,7 @@ struct ar9170_tx_control {
310 310
311struct ar9170_rx_head { 311struct ar9170_rx_head {
312 u8 plcp[12]; 312 u8 plcp[12];
313}; 313} __packed;
314 314
315struct ar9170_rx_tail { 315struct ar9170_rx_tail {
316 union { 316 union {
@@ -318,16 +318,16 @@ struct ar9170_rx_tail {
318 u8 rssi_ant0, rssi_ant1, rssi_ant2, 318 u8 rssi_ant0, rssi_ant1, rssi_ant2,
319 rssi_ant0x, rssi_ant1x, rssi_ant2x, 319 rssi_ant0x, rssi_ant1x, rssi_ant2x,
320 rssi_combined; 320 rssi_combined;
321 }; 321 } __packed;
322 u8 rssi[7]; 322 u8 rssi[7];
323 }; 323 } __packed;
324 324
325 u8 evm_stream0[6], evm_stream1[6]; 325 u8 evm_stream0[6], evm_stream1[6];
326 u8 phy_err; 326 u8 phy_err;
327 u8 SAidx, DAidx; 327 u8 SAidx, DAidx;
328 u8 error; 328 u8 error;
329 u8 status; 329 u8 status;
330}; 330} __packed;
331 331
332#define AR9170_ENC_ALG_NONE 0x0 332#define AR9170_ENC_ALG_NONE 0x0
333#define AR9170_ENC_ALG_WEP64 0x1 333#define AR9170_ENC_ALG_WEP64 0x1
diff --git a/drivers/net/wireless/ar9170/usb.c b/drivers/net/wireless/ar9170/usb.c
index ad296840893e..c9e422ead925 100644
--- a/drivers/net/wireless/ar9170/usb.c
+++ b/drivers/net/wireless/ar9170/usb.c
@@ -59,6 +59,8 @@ static struct usb_device_id ar9170_usb_ids[] = {
59 { USB_DEVICE(0x0cf3, 0x9170) }, 59 { USB_DEVICE(0x0cf3, 0x9170) },
60 /* Atheros TG121N */ 60 /* Atheros TG121N */
61 { USB_DEVICE(0x0cf3, 0x1001) }, 61 { USB_DEVICE(0x0cf3, 0x1001) },
62 /* Cace Airpcap NX */
63 { USB_DEVICE(0xcace, 0x0300) },
62 /* D-Link DWA 160A */ 64 /* D-Link DWA 160A */
63 { USB_DEVICE(0x07d1, 0x3c10) }, 65 { USB_DEVICE(0x07d1, 0x3c10) },
64 /* Netgear WNDA3100 */ 66 /* Netgear WNDA3100 */
@@ -67,6 +69,8 @@ static struct usb_device_id ar9170_usb_ids[] = {
67 { USB_DEVICE(0x0846, 0x9001) }, 69 { USB_DEVICE(0x0846, 0x9001) },
68 /* Zydas ZD1221 */ 70 /* Zydas ZD1221 */
69 { USB_DEVICE(0x0ace, 0x1221) }, 71 { USB_DEVICE(0x0ace, 0x1221) },
72 /* ZyXEL NWD271N */
73 { USB_DEVICE(0x0586, 0x3417) },
70 /* Z-Com UB81 BG */ 74 /* Z-Com UB81 BG */
71 { USB_DEVICE(0x0cde, 0x0023) }, 75 { USB_DEVICE(0x0cde, 0x0023) },
72 /* Z-Com UB82 ABG */ 76 /* Z-Com UB82 ABG */
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 0c02f1c2bd94..744f4f4dd3d1 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -250,6 +250,8 @@ static struct usb_device_id dev_table[] = {
250 { USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A) }, 250 { USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A) },
251 /* Siemens Gigaset USB WLAN Adapter 11 */ 251 /* Siemens Gigaset USB WLAN Adapter 11 */
252 { USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A) }, 252 { USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A) },
253 /* OQO Model 01+ Internal Wi-Fi */
254 { USB_DEVICE(0x1557, 0x0002), USB_DEVICE_DATA(BOARD_505A) },
253 /* 255 /*
254 * at76c505amx-rfmd 256 * at76c505amx-rfmd
255 */ 257 */
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 71cb18d6757d..dd1f30156740 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -493,6 +493,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
493 int hdrlen, padsize, retval; 493 int hdrlen, padsize, retval;
494 bool decrypt_error = false; 494 bool decrypt_error = false;
495 u8 keyix; 495 u8 keyix;
496 __le16 fc;
496 497
497 spin_lock_bh(&sc->rx.rxbuflock); 498 spin_lock_bh(&sc->rx.rxbuflock);
498 499
@@ -606,6 +607,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
606 /* see if any padding is done by the hw and remove it */ 607 /* see if any padding is done by the hw and remove it */
607 hdr = (struct ieee80211_hdr *)skb->data; 608 hdr = (struct ieee80211_hdr *)skb->data;
608 hdrlen = ieee80211_get_hdrlen_from_skb(skb); 609 hdrlen = ieee80211_get_hdrlen_from_skb(skb);
610 fc = hdr->frame_control;
609 611
610 /* The MAC header is padded to have 32-bit boundary if the 612 /* The MAC header is padded to have 32-bit boundary if the
611 * packet payload is non-zero. The general calculation for 613 * packet payload is non-zero. The general calculation for
@@ -690,7 +692,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
690 sc->rx.rxotherant = 0; 692 sc->rx.rxotherant = 0;
691 } 693 }
692 694
693 if (ieee80211_is_beacon(hdr->frame_control) && 695 if (ieee80211_is_beacon(fc) &&
694 (sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) { 696 (sc->sc_flags & SC_OP_WAIT_FOR_BEACON)) {
695 sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; 697 sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON;
696 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); 698 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index e228c1de6e11..eae680b53052 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -555,11 +555,32 @@ address_error:
555 return 1; 555 return 1;
556} 556}
557 557
558static bool b43_rx_buffer_is_poisoned(struct b43_dmaring *ring, struct sk_buff *skb)
559{
560 unsigned char *f = skb->data + ring->frameoffset;
561
562 return ((f[0] & f[1] & f[2] & f[3] & f[4] & f[5] & f[6] & f[7]) == 0xFF);
563}
564
565static void b43_poison_rx_buffer(struct b43_dmaring *ring, struct sk_buff *skb)
566{
567 struct b43_rxhdr_fw4 *rxhdr;
568 unsigned char *frame;
569
570 /* This poisons the RX buffer to detect DMA failures. */
571
572 rxhdr = (struct b43_rxhdr_fw4 *)(skb->data);
573 rxhdr->frame_len = 0;
574
575 B43_WARN_ON(ring->rx_buffersize < ring->frameoffset + sizeof(struct b43_plcp_hdr6) + 2);
576 frame = skb->data + ring->frameoffset;
577 memset(frame, 0xFF, sizeof(struct b43_plcp_hdr6) + 2 /* padding */);
578}
579
558static int setup_rx_descbuffer(struct b43_dmaring *ring, 580static int setup_rx_descbuffer(struct b43_dmaring *ring,
559 struct b43_dmadesc_generic *desc, 581 struct b43_dmadesc_generic *desc,
560 struct b43_dmadesc_meta *meta, gfp_t gfp_flags) 582 struct b43_dmadesc_meta *meta, gfp_t gfp_flags)
561{ 583{
562 struct b43_rxhdr_fw4 *rxhdr;
563 dma_addr_t dmaaddr; 584 dma_addr_t dmaaddr;
564 struct sk_buff *skb; 585 struct sk_buff *skb;
565 586
@@ -568,6 +589,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
568 skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags); 589 skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags);
569 if (unlikely(!skb)) 590 if (unlikely(!skb))
570 return -ENOMEM; 591 return -ENOMEM;
592 b43_poison_rx_buffer(ring, skb);
571 dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0); 593 dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0);
572 if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { 594 if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
573 /* ugh. try to realloc in zone_dma */ 595 /* ugh. try to realloc in zone_dma */
@@ -578,6 +600,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
578 skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags); 600 skb = __dev_alloc_skb(ring->rx_buffersize, gfp_flags);
579 if (unlikely(!skb)) 601 if (unlikely(!skb))
580 return -ENOMEM; 602 return -ENOMEM;
603 b43_poison_rx_buffer(ring, skb);
581 dmaaddr = map_descbuffer(ring, skb->data, 604 dmaaddr = map_descbuffer(ring, skb->data,
582 ring->rx_buffersize, 0); 605 ring->rx_buffersize, 0);
583 if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { 606 if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
@@ -592,9 +615,6 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
592 ring->ops->fill_descriptor(ring, desc, dmaaddr, 615 ring->ops->fill_descriptor(ring, desc, dmaaddr,
593 ring->rx_buffersize, 0, 0, 0); 616 ring->rx_buffersize, 0, 0, 0);
594 617
595 rxhdr = (struct b43_rxhdr_fw4 *)(skb->data);
596 rxhdr->frame_len = 0;
597
598 return 0; 618 return 0;
599} 619}
600 620
@@ -1483,12 +1503,17 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
1483 len = le16_to_cpu(rxhdr->frame_len); 1503 len = le16_to_cpu(rxhdr->frame_len);
1484 } while (len == 0 && i++ < 5); 1504 } while (len == 0 && i++ < 5);
1485 if (unlikely(len == 0)) { 1505 if (unlikely(len == 0)) {
1486 /* recycle the descriptor buffer. */ 1506 dmaaddr = meta->dmaaddr;
1487 sync_descbuffer_for_device(ring, meta->dmaaddr, 1507 goto drop_recycle_buffer;
1488 ring->rx_buffersize);
1489 goto drop;
1490 } 1508 }
1491 } 1509 }
1510 if (unlikely(b43_rx_buffer_is_poisoned(ring, skb))) {
1511 /* Something went wrong with the DMA.
1512 * The device did not touch the buffer and did not overwrite the poison. */
1513 b43dbg(ring->dev->wl, "DMA RX: Dropping poisoned buffer.\n");
1514 dmaaddr = meta->dmaaddr;
1515 goto drop_recycle_buffer;
1516 }
1492 if (unlikely(len > ring->rx_buffersize)) { 1517 if (unlikely(len > ring->rx_buffersize)) {
1493 /* The data did not fit into one descriptor buffer 1518 /* The data did not fit into one descriptor buffer
1494 * and is split over multiple buffers. 1519 * and is split over multiple buffers.
@@ -1501,6 +1526,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
1501 while (1) { 1526 while (1) {
1502 desc = ops->idx2desc(ring, *slot, &meta); 1527 desc = ops->idx2desc(ring, *slot, &meta);
1503 /* recycle the descriptor buffer. */ 1528 /* recycle the descriptor buffer. */
1529 b43_poison_rx_buffer(ring, meta->skb);
1504 sync_descbuffer_for_device(ring, meta->dmaaddr, 1530 sync_descbuffer_for_device(ring, meta->dmaaddr,
1505 ring->rx_buffersize); 1531 ring->rx_buffersize);
1506 *slot = next_slot(ring, *slot); 1532 *slot = next_slot(ring, *slot);
@@ -1519,8 +1545,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
1519 err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC); 1545 err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC);
1520 if (unlikely(err)) { 1546 if (unlikely(err)) {
1521 b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n"); 1547 b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n");
1522 sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); 1548 goto drop_recycle_buffer;
1523 goto drop;
1524 } 1549 }
1525 1550
1526 unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0); 1551 unmap_descbuffer(ring, dmaaddr, ring->rx_buffersize, 0);
@@ -1530,6 +1555,11 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
1530 b43_rx(ring->dev, skb, rxhdr); 1555 b43_rx(ring->dev, skb, rxhdr);
1531drop: 1556drop:
1532 return; 1557 return;
1558
1559drop_recycle_buffer:
1560 /* Poison and recycle the RX buffer. */
1561 b43_poison_rx_buffer(ring, skb);
1562 sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize);
1533} 1563}
1534 1564
1535void b43_dma_rx(struct b43_dmaring *ring) 1565void b43_dma_rx(struct b43_dmaring *ring)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 4896e0831114..79b685e300c7 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3974,6 +3974,11 @@ static void setup_struct_phy_for_init(struct b43_wldev *dev,
3974 phy->next_txpwr_check_time = jiffies; 3974 phy->next_txpwr_check_time = jiffies;
3975 /* PHY TX errors counter. */ 3975 /* PHY TX errors counter. */
3976 atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT); 3976 atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT);
3977
3978#if B43_DEBUG
3979 phy->phy_locked = 0;
3980 phy->radio_locked = 0;
3981#endif
3977} 3982}
3978 3983
3979static void setup_struct_wldev_for_init(struct b43_wldev *dev) 3984static void setup_struct_wldev_for_init(struct b43_wldev *dev)
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 026b61c03fb9..e176b6e0d9cf 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -131,12 +131,16 @@ void b43_radio_lock(struct b43_wldev *dev)
131{ 131{
132 u32 macctl; 132 u32 macctl;
133 133
134#if B43_DEBUG
135 B43_WARN_ON(dev->phy.radio_locked);
136 dev->phy.radio_locked = 1;
137#endif
138
134 macctl = b43_read32(dev, B43_MMIO_MACCTL); 139 macctl = b43_read32(dev, B43_MMIO_MACCTL);
135 B43_WARN_ON(macctl & B43_MACCTL_RADIOLOCK);
136 macctl |= B43_MACCTL_RADIOLOCK; 140 macctl |= B43_MACCTL_RADIOLOCK;
137 b43_write32(dev, B43_MMIO_MACCTL, macctl); 141 b43_write32(dev, B43_MMIO_MACCTL, macctl);
138 /* Commit the write and wait for the device 142 /* Commit the write and wait for the firmware
139 * to exit any radio register access. */ 143 * to finish any radio register access. */
140 b43_read32(dev, B43_MMIO_MACCTL); 144 b43_read32(dev, B43_MMIO_MACCTL);
141 udelay(10); 145 udelay(10);
142} 146}
@@ -145,11 +149,15 @@ void b43_radio_unlock(struct b43_wldev *dev)
145{ 149{
146 u32 macctl; 150 u32 macctl;
147 151
152#if B43_DEBUG
153 B43_WARN_ON(!dev->phy.radio_locked);
154 dev->phy.radio_locked = 0;
155#endif
156
148 /* Commit any write */ 157 /* Commit any write */
149 b43_read16(dev, B43_MMIO_PHY_VER); 158 b43_read16(dev, B43_MMIO_PHY_VER);
150 /* unlock */ 159 /* unlock */
151 macctl = b43_read32(dev, B43_MMIO_MACCTL); 160 macctl = b43_read32(dev, B43_MMIO_MACCTL);
152 B43_WARN_ON(!(macctl & B43_MACCTL_RADIOLOCK));
153 macctl &= ~B43_MACCTL_RADIOLOCK; 161 macctl &= ~B43_MACCTL_RADIOLOCK;
154 b43_write32(dev, B43_MMIO_MACCTL, macctl); 162 b43_write32(dev, B43_MMIO_MACCTL, macctl);
155} 163}
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h
index c9f5430d1d7d..b2d99101947b 100644
--- a/drivers/net/wireless/b43/phy_common.h
+++ b/drivers/net/wireless/b43/phy_common.h
@@ -245,8 +245,10 @@ struct b43_phy {
245 atomic_t txerr_cnt; 245 atomic_t txerr_cnt;
246 246
247#ifdef CONFIG_B43_DEBUG 247#ifdef CONFIG_B43_DEBUG
248 /* PHY registers locked by b43_phy_lock()? */ 248 /* PHY registers locked (w.r.t. firmware) */
249 bool phy_locked; 249 bool phy_locked;
250 /* Radio registers locked (w.r.t. firmware) */
251 bool radio_locked;
250#endif /* B43_DEBUG */ 252#endif /* B43_DEBUG */
251}; 253};
252 254
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index ce729281ff62..8d738d752487 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4913,6 +4913,8 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
4913 4913
4914 hw->wiphy->custom_regulatory = true; 4914 hw->wiphy->custom_regulatory = true;
4915 4915
4916 hw->wiphy->max_scan_ssids = 1; /* WILL FIX */
4917
4916 /* Default value; 4 EDCA QOS priorities */ 4918 /* Default value; 4 EDCA QOS priorities */
4917 hw->queues = 4; 4919 hw->queues = 4;
4918 4920
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 63d7e19ce9bd..8e669775cb5d 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -170,6 +170,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
170 lbs_deb_rx("rx err: frame received with bad length\n"); 170 lbs_deb_rx("rx err: frame received with bad length\n");
171 dev->stats.rx_length_errors++; 171 dev->stats.rx_length_errors++;
172 ret = 0; 172 ret = 0;
173 dev_kfree_skb(skb);
173 goto done; 174 goto done;
174 } 175 }
175 176
@@ -181,6 +182,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
181 lbs_pr_alert("rxpd not ok\n"); 182 lbs_pr_alert("rxpd not ok\n");
182 dev->stats.rx_errors++; 183 dev->stats.rx_errors++;
183 ret = 0; 184 ret = 0;
185 dev_kfree_skb(skb);
184 goto done; 186 goto done;
185 } 187 }
186 188
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c
index 081428d9409e..632fac86a308 100644
--- a/drivers/net/wireless/orinoco/hw.c
+++ b/drivers/net/wireless/orinoco/hw.c
@@ -372,15 +372,13 @@ int __orinoco_hw_set_tkip_key(hermes_t *hw, int key_idx, int set_tx,
372 } 372 }
373 373
374 /* Wait upto 100ms for tx queue to empty */ 374 /* Wait upto 100ms for tx queue to empty */
375 k = 100; 375 for (k = 100; k > 0; k--) {
376 do {
377 k--;
378 udelay(1000); 376 udelay(1000);
379 ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY, 377 ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY,
380 &xmitting); 378 &xmitting);
381 if (ret) 379 if (ret || !xmitting)
382 break; 380 break;
383 } while ((k > 0) && xmitting); 381 }
384 382
385 if (k == 0) 383 if (k == 0)
386 ret = -ETIMEDOUT; 384 ret = -ETIMEDOUT;
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index 2dda5fe418b6..ecf8b6ed5a47 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -14,9 +14,9 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#ifdef CONFIG_MAC80211_LEDS 17#ifdef CONFIG_P54_LEDS
18#include <linux/leds.h> 18#include <linux/leds.h>
19#endif /* CONFIG_MAC80211_LEDS */ 19#endif /* CONFIG_P54_LEDS */
20 20
21enum p54_control_frame_types { 21enum p54_control_frame_types {
22 P54_CONTROL_TYPE_SETUP = 0, 22 P54_CONTROL_TYPE_SETUP = 0,
@@ -116,7 +116,7 @@ enum fw_state {
116 FW_STATE_RESETTING, 116 FW_STATE_RESETTING,
117}; 117};
118 118
119#ifdef CONFIG_MAC80211_LEDS 119#ifdef CONFIG_P54_LEDS
120 120
121#define P54_LED_MAX_NAME_LEN 31 121#define P54_LED_MAX_NAME_LEN 31
122 122
@@ -129,7 +129,7 @@ struct p54_led_dev {
129 unsigned int registered; 129 unsigned int registered;
130}; 130};
131 131
132#endif /* CONFIG_MAC80211_LEDS */ 132#endif /* CONFIG_P54_LEDS */
133 133
134struct p54_common { 134struct p54_common {
135 struct ieee80211_hw *hw; 135 struct ieee80211_hw *hw;
@@ -177,10 +177,10 @@ struct p54_common {
177 u8 privacy_caps; 177 u8 privacy_caps;
178 u8 rx_keycache_size; 178 u8 rx_keycache_size;
179 /* LED management */ 179 /* LED management */
180 #ifdef CONFIG_MAC80211_LEDS 180#ifdef CONFIG_P54_LEDS
181 struct p54_led_dev assoc_led; 181 struct p54_led_dev assoc_led;
182 struct p54_led_dev tx_led; 182 struct p54_led_dev tx_led;
183 #endif /* CONFIG_MAC80211_LEDS */ 183#endif /* CONFIG_P54_LEDS */
184 u16 softled_state; /* bit field of glowing LEDs */ 184 u16 softled_state; /* bit field of glowing LEDs */
185}; 185};
186 186
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 2b222aaa6f0a..d1fe577de3d4 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -457,9 +457,10 @@ static int p54spi_wq_tx(struct p54s_priv *priv)
457 struct ieee80211_tx_info *info; 457 struct ieee80211_tx_info *info;
458 struct p54_tx_info *minfo; 458 struct p54_tx_info *minfo;
459 struct p54s_tx_info *dinfo; 459 struct p54s_tx_info *dinfo;
460 unsigned long flags;
460 int ret = 0; 461 int ret = 0;
461 462
462 spin_lock_bh(&priv->tx_lock); 463 spin_lock_irqsave(&priv->tx_lock, flags);
463 464
464 while (!list_empty(&priv->tx_pending)) { 465 while (!list_empty(&priv->tx_pending)) {
465 entry = list_entry(priv->tx_pending.next, 466 entry = list_entry(priv->tx_pending.next,
@@ -467,7 +468,7 @@ static int p54spi_wq_tx(struct p54s_priv *priv)
467 468
468 list_del_init(&entry->tx_list); 469 list_del_init(&entry->tx_list);
469 470
470 spin_unlock_bh(&priv->tx_lock); 471 spin_unlock_irqrestore(&priv->tx_lock, flags);
471 472
472 dinfo = container_of((void *) entry, struct p54s_tx_info, 473 dinfo = container_of((void *) entry, struct p54s_tx_info,
473 tx_list); 474 tx_list);
@@ -479,16 +480,14 @@ static int p54spi_wq_tx(struct p54s_priv *priv)
479 480
480 ret = p54spi_tx_frame(priv, skb); 481 ret = p54spi_tx_frame(priv, skb);
481 482
482 spin_lock_bh(&priv->tx_lock);
483
484 if (ret < 0) { 483 if (ret < 0) {
485 p54_free_skb(priv->hw, skb); 484 p54_free_skb(priv->hw, skb);
486 goto out; 485 return ret;
487 } 486 }
488 }
489 487
490out: 488 spin_lock_irqsave(&priv->tx_lock, flags);
491 spin_unlock_bh(&priv->tx_lock); 489 }
490 spin_unlock_irqrestore(&priv->tx_lock, flags);
492 return ret; 491 return ret;
493} 492}
494 493
@@ -498,12 +497,13 @@ static void p54spi_op_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
498 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 497 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
499 struct p54_tx_info *mi = (struct p54_tx_info *) info->rate_driver_data; 498 struct p54_tx_info *mi = (struct p54_tx_info *) info->rate_driver_data;
500 struct p54s_tx_info *di = (struct p54s_tx_info *) mi->data; 499 struct p54s_tx_info *di = (struct p54s_tx_info *) mi->data;
500 unsigned long flags;
501 501
502 BUILD_BUG_ON(sizeof(*di) > sizeof((mi->data))); 502 BUILD_BUG_ON(sizeof(*di) > sizeof((mi->data)));
503 503
504 spin_lock_bh(&priv->tx_lock); 504 spin_lock_irqsave(&priv->tx_lock, flags);
505 list_add_tail(&di->tx_list, &priv->tx_pending); 505 list_add_tail(&di->tx_list, &priv->tx_pending);
506 spin_unlock_bh(&priv->tx_lock); 506 spin_unlock_irqrestore(&priv->tx_lock, flags);
507 507
508 queue_work(priv->hw->workqueue, &priv->work); 508 queue_work(priv->hw->workqueue, &priv->work);
509} 509}
@@ -604,6 +604,7 @@ out:
604static void p54spi_op_stop(struct ieee80211_hw *dev) 604static void p54spi_op_stop(struct ieee80211_hw *dev)
605{ 605{
606 struct p54s_priv *priv = dev->priv; 606 struct p54s_priv *priv = dev->priv;
607 unsigned long flags;
607 608
608 if (mutex_lock_interruptible(&priv->mutex)) { 609 if (mutex_lock_interruptible(&priv->mutex)) {
609 /* FIXME: how to handle this error? */ 610 /* FIXME: how to handle this error? */
@@ -615,9 +616,9 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)
615 cancel_work_sync(&priv->work); 616 cancel_work_sync(&priv->work);
616 617
617 p54spi_power_off(priv); 618 p54spi_power_off(priv);
618 spin_lock_bh(&priv->tx_lock); 619 spin_lock_irqsave(&priv->tx_lock, flags);
619 INIT_LIST_HEAD(&priv->tx_pending); 620 INIT_LIST_HEAD(&priv->tx_pending);
620 spin_unlock_bh(&priv->tx_lock); 621 spin_unlock_irqrestore(&priv->tx_lock, flags);
621 622
622 priv->fw_state = FW_STATE_OFF; 623 priv->fw_state = FW_STATE_OFF;
623 mutex_unlock(&priv->mutex); 624 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index da6640afc835..6cc6cbc9234f 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -71,6 +71,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
71 {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */ 71 {USB_DEVICE(0x1260, 0xee22)}, /* SMC 2862W-G version 2 */
72 {USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */ 72 {USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */
73 {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ 73 {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
74 {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
74 {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ 75 {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
75 {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ 76 {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
76 {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ 77 {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 05f94e21b423..5752aaae906b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -646,10 +646,8 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
646 * Register HW. 646 * Register HW.
647 */ 647 */
648 status = ieee80211_register_hw(rt2x00dev->hw); 648 status = ieee80211_register_hw(rt2x00dev->hw);
649 if (status) { 649 if (status)
650 rt2x00lib_remove_hw(rt2x00dev);
651 return status; 650 return status;
652 }
653 651
654 set_bit(DEVICE_STATE_REGISTERED_HW, &rt2x00dev->flags); 652 set_bit(DEVICE_STATE_REGISTERED_HW, &rt2x00dev->flags);
655 653
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 420fff42c0dd..853b2b279b64 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2369,6 +2369,8 @@ static struct usb_device_id rt73usb_device_table[] = {
2369 /* Buffalo */ 2369 /* Buffalo */
2370 { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) }, 2370 { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) },
2371 { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) }, 2371 { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) },
2372 { USB_DEVICE(0x0411, 0x0116), USB_DEVICE_DATA(&rt73usb_ops) },
2373 { USB_DEVICE(0x0411, 0x0119), USB_DEVICE_DATA(&rt73usb_ops) },
2372 /* CNet */ 2374 /* CNet */
2373 { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) }, 2375 { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) },
2374 { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, 2376 { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) },