aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-05-25 16:15:11 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-25 16:15:11 -0400
commita261af927df64523925c98369106de15af9d7b5e (patch)
tree3c8fb8be59b8a4733eb5b63ecf567976185c9f58
parentacfbe96a3035639619a6533e04d88ed4ef9ccb61 (diff)
parenta65e4cb402b5f3e120570ba1faca4354d47e8f2f (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c75
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c28
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ict.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c2
-rw-r--r--drivers/net/wireless/rndis_wlan.c16
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c7
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c7
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_rx.c2
-rw-r--r--include/net/mac80211.h4
-rw-r--r--net/mac80211/key.c1
-rw-r--r--net/mac80211/sta_info.h2
-rw-r--r--net/wireless/chan.c2
-rw-r--r--net/wireless/nl80211.c6
-rw-r--r--net/wireless/scan.c4
24 files changed, 104 insertions, 132 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 5f04cf38a5bc..cc6d41dec332 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1214,6 +1214,7 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
1214 struct ath5k_hw *ah = sc->ah; 1214 struct ath5k_hw *ah = sc->ah;
1215 struct sk_buff *skb = bf->skb; 1215 struct sk_buff *skb = bf->skb;
1216 struct ath5k_desc *ds; 1216 struct ath5k_desc *ds;
1217 int ret;
1217 1218
1218 if (!skb) { 1219 if (!skb) {
1219 skb = ath5k_rx_skb_alloc(sc, &bf->skbaddr); 1220 skb = ath5k_rx_skb_alloc(sc, &bf->skbaddr);
@@ -1240,9 +1241,9 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
1240 ds = bf->desc; 1241 ds = bf->desc;
1241 ds->ds_link = bf->daddr; /* link to self */ 1242 ds->ds_link = bf->daddr; /* link to self */
1242 ds->ds_data = bf->skbaddr; 1243 ds->ds_data = bf->skbaddr;
1243 ah->ah_setup_rx_desc(ah, ds, 1244 ret = ah->ah_setup_rx_desc(ah, ds, ah->common.rx_bufsize, 0);
1244 skb_tailroom(skb), /* buffer size */ 1245 if (ret)
1245 0); 1246 return ret;
1246 1247
1247 if (sc->rxlink != NULL) 1248 if (sc->rxlink != NULL)
1248 *sc->rxlink = bf->daddr; 1249 *sc->rxlink = bf->daddr;
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index c8a4558f79ba..f43d85a302c4 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -76,22 +76,13 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
76 ds = bf->bf_desc; 76 ds = bf->bf_desc;
77 flags = ATH9K_TXDESC_NOACK; 77 flags = ATH9K_TXDESC_NOACK;
78 78
79 if (((sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || 79 ds->ds_link = 0;
80 (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) && 80 /*
81 (ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) { 81 * Switch antenna every beacon.
82 ds->ds_link = bf->bf_daddr; /* self-linked */ 82 * Should only switch every beacon period, not for every SWBA
83 flags |= ATH9K_TXDESC_VEOL; 83 * XXX assumes two antennae
84 /* Let hardware handle antenna switching. */ 84 */
85 antenna = 0; 85 antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1);
86 } else {
87 ds->ds_link = 0;
88 /*
89 * Switch antenna every beacon.
90 * Should only switch every beacon period, not for every SWBA
91 * XXX assumes two antennae
92 */
93 antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1);
94 }
95 86
96 sband = &sc->sbands[common->hw->conf.channel->band]; 87 sband = &sc->sbands[common->hw->conf.channel->band];
97 rate = sband->bitrates[rateidx].hw_value; 88 rate = sband->bitrates[rateidx].hw_value;
@@ -215,36 +206,6 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
215 return bf; 206 return bf;
216} 207}
217 208
218/*
219 * Startup beacon transmission for adhoc mode when they are sent entirely
220 * by the hardware using the self-linked descriptor + veol trick.
221*/
222static void ath_beacon_start_adhoc(struct ath_softc *sc,
223 struct ieee80211_vif *vif)
224{
225 struct ath_hw *ah = sc->sc_ah;
226 struct ath_common *common = ath9k_hw_common(ah);
227 struct ath_buf *bf;
228 struct ath_vif *avp;
229 struct sk_buff *skb;
230
231 avp = (void *)vif->drv_priv;
232
233 if (avp->av_bcbuf == NULL)
234 return;
235
236 bf = avp->av_bcbuf;
237 skb = bf->bf_mpdu;
238
239 ath_beacon_setup(sc, avp, bf, 0);
240
241 /* NB: caller is known to have already stopped tx dma */
242 ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr);
243 ath9k_hw_txstart(ah, sc->beacon.beaconq);
244 ath_print(common, ATH_DBG_BEACON, "TXDP%u = %llx (%p)\n",
245 sc->beacon.beaconq, ito64(bf->bf_daddr), bf->bf_desc);
246}
247
248int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) 209int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
249{ 210{
250 struct ath_softc *sc = aphy->sc; 211 struct ath_softc *sc = aphy->sc;
@@ -265,7 +226,8 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
265 list_del(&avp->av_bcbuf->list); 226 list_del(&avp->av_bcbuf->list);
266 227
267 if (sc->sc_ah->opmode == NL80211_IFTYPE_AP || 228 if (sc->sc_ah->opmode == NL80211_IFTYPE_AP ||
268 !(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) { 229 sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC ||
230 sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT) {
269 int slot; 231 int slot;
270 /* 232 /*
271 * Assign the vif to a beacon xmit slot. As 233 * Assign the vif to a beacon xmit slot. As
@@ -274,17 +236,11 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
274 avp->av_bslot = 0; 236 avp->av_bslot = 0;
275 for (slot = 0; slot < ATH_BCBUF; slot++) 237 for (slot = 0; slot < ATH_BCBUF; slot++)
276 if (sc->beacon.bslot[slot] == NULL) { 238 if (sc->beacon.bslot[slot] == NULL) {
277 /*
278 * XXX hack, space out slots to better
279 * deal with misses
280 */
281 if (slot+1 < ATH_BCBUF &&
282 sc->beacon.bslot[slot+1] == NULL) {
283 avp->av_bslot = slot+1;
284 break;
285 }
286 avp->av_bslot = slot; 239 avp->av_bslot = slot;
240
287 /* NB: keep looking for a double slot */ 241 /* NB: keep looking for a double slot */
242 if (slot == 0 || !sc->beacon.bslot[slot-1])
243 break;
288 } 244 }
289 BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL); 245 BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL);
290 sc->beacon.bslot[avp->av_bslot] = vif; 246 sc->beacon.bslot[avp->av_bslot] = vif;
@@ -721,8 +677,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
721 * self-linked tx descriptor and let the hardware deal with things. 677 * self-linked tx descriptor and let the hardware deal with things.
722 */ 678 */
723 intval |= ATH9K_BEACON_ENA; 679 intval |= ATH9K_BEACON_ENA;
724 if (!(ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) 680 ah->imask |= ATH9K_INT_SWBA;
725 ah->imask |= ATH9K_INT_SWBA;
726 681
727 ath_beaconq_config(sc); 682 ath_beaconq_config(sc);
728 683
@@ -732,10 +687,6 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
732 ath9k_beacon_init(sc, nexttbtt, intval); 687 ath9k_beacon_init(sc, nexttbtt, intval);
733 sc->beacon.bmisscnt = 0; 688 sc->beacon.bmisscnt = 0;
734 ath9k_hw_set_interrupts(ah, ah->imask); 689 ath9k_hw_set_interrupts(ah, ah->imask);
735
736 /* FIXME: Handle properly when vif is NULL */
737 if (vif && ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)
738 ath_beacon_start_adhoc(sc, vif);
739} 690}
740 691
741void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif) 692void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 46dc41a16faa..77b359162d6c 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -107,12 +107,14 @@ static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev,
107static void hif_usb_tx_cb(struct urb *urb) 107static void hif_usb_tx_cb(struct urb *urb)
108{ 108{
109 struct tx_buf *tx_buf = (struct tx_buf *) urb->context; 109 struct tx_buf *tx_buf = (struct tx_buf *) urb->context;
110 struct hif_device_usb *hif_dev = tx_buf->hif_dev; 110 struct hif_device_usb *hif_dev;
111 struct sk_buff *skb; 111 struct sk_buff *skb;
112 112
113 if (!hif_dev || !tx_buf) 113 if (!tx_buf || !tx_buf->hif_dev)
114 return; 114 return;
115 115
116 hif_dev = tx_buf->hif_dev;
117
116 switch (urb->status) { 118 switch (urb->status) {
117 case 0: 119 case 0:
118 break; 120 break;
@@ -607,6 +609,10 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev)
607 609
608 return 0; 610 return 0;
609err: 611err:
612 if (tx_buf) {
613 kfree(tx_buf->buf);
614 kfree(tx_buf);
615 }
610 ath9k_hif_usb_dealloc_tx_urbs(hif_dev); 616 ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
611 return -ENOMEM; 617 return -ENOMEM;
612} 618}
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index ad556aa8da39..c251603ab032 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -23,6 +23,7 @@
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <linux/netdevice.h> 24#include <linux/netdevice.h>
25#include <linux/leds.h> 25#include <linux/leds.h>
26#include <linux/slab.h>
26#include <net/mac80211.h> 27#include <net/mac80211.h>
27 28
28#include "common.h" 29#include "common.h"
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 893b552981a0..abfa0493236f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -752,7 +752,6 @@ static int ath_key_config(struct ath_common *common,
752 struct ath_hw *ah = common->ah; 752 struct ath_hw *ah = common->ah;
753 struct ath9k_keyval hk; 753 struct ath9k_keyval hk;
754 const u8 *mac = NULL; 754 const u8 *mac = NULL;
755 u8 gmac[ETH_ALEN];
756 int ret = 0; 755 int ret = 0;
757 int idx; 756 int idx;
758 757
@@ -776,30 +775,9 @@ static int ath_key_config(struct ath_common *common,
776 memcpy(hk.kv_val, key->key, key->keylen); 775 memcpy(hk.kv_val, key->key, key->keylen);
777 776
778 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { 777 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
779 778 /* For now, use the default keys for broadcast keys. This may
780 if (key->ap_addr) { 779 * need to change with virtual interfaces. */
781 /* 780 idx = key->keyidx;
782 * Group keys on hardware that supports multicast frame
783 * key search use a mac that is the sender's address with
784 * the high bit set instead of the app-specified address.
785 */
786 memcpy(gmac, key->ap_addr, ETH_ALEN);
787 gmac[0] |= 0x80;
788 mac = gmac;
789
790 if (key->alg == ALG_TKIP)
791 idx = ath_reserve_key_cache_slot_tkip(common);
792 else
793 idx = ath_reserve_key_cache_slot(common);
794 if (idx < 0)
795 mac = NULL; /* no free key cache entries */
796 }
797
798 if (!mac) {
799 /* For now, use the default keys for broadcast keys. This may
800 * need to change with virtual interfaces. */
801 idx = key->keyidx;
802 }
803 } else if (key->keyidx) { 781 } else if (key->keyidx) {
804 if (WARN_ON(!sta)) 782 if (WARN_ON(!sta))
805 return -EOPNOTSUPP; 783 return -EOPNOTSUPP;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 257b10ba6f57..1ec836cf1c0d 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -28,7 +28,6 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
28 { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ 28 { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
29 { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */ 29 { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
30 { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */ 30 { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
31 { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */
32 { 0 } 31 { 0 }
33}; 32};
34 33
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ba139132c85f..ca6065b71b46 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -19,6 +19,12 @@
19 19
20#define SKB_CB_ATHBUF(__skb) (*((struct ath_buf **)__skb->cb)) 20#define SKB_CB_ATHBUF(__skb) (*((struct ath_buf **)__skb->cb))
21 21
22static inline bool ath9k_check_auto_sleep(struct ath_softc *sc)
23{
24 return sc->ps_enabled &&
25 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP);
26}
27
22static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc, 28static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc,
23 struct ieee80211_hdr *hdr) 29 struct ieee80211_hdr *hdr)
24{ 30{
@@ -616,8 +622,8 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
616 hdr = (struct ieee80211_hdr *)skb->data; 622 hdr = (struct ieee80211_hdr *)skb->data;
617 623
618 /* Process Beacon and CAB receive in PS state */ 624 /* Process Beacon and CAB receive in PS state */
619 if ((sc->ps_flags & PS_WAIT_FOR_BEACON) && 625 if (((sc->ps_flags & PS_WAIT_FOR_BEACON) || ath9k_check_auto_sleep(sc))
620 ieee80211_is_beacon(hdr->frame_control)) 626 && ieee80211_is_beacon(hdr->frame_control))
621 ath_rx_ps_beacon(sc, skb); 627 ath_rx_ps_beacon(sc, skb);
622 else if ((sc->ps_flags & PS_WAIT_FOR_CAB) && 628 else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
623 (ieee80211_is_data(hdr->frame_control) || 629 (ieee80211_is_data(hdr->frame_control) ||
@@ -932,9 +938,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
932 sc->rx.rxotherant = 0; 938 sc->rx.rxotherant = 0;
933 } 939 }
934 940
935 if (unlikely(sc->ps_flags & (PS_WAIT_FOR_BEACON | 941 if (unlikely(ath9k_check_auto_sleep(sc) ||
936 PS_WAIT_FOR_CAB | 942 (sc->ps_flags & (PS_WAIT_FOR_BEACON |
937 PS_WAIT_FOR_PSPOLL_DATA))) 943 PS_WAIT_FOR_CAB |
944 PS_WAIT_FOR_PSPOLL_DATA))))
938 ath_rx_ps(sc, skb); 945 ath_rx_ps(sc, skb);
939 946
940 ath_rx_send_to_mac80211(hw, sc, skb, rxs); 947 ath_rx_send_to_mac80211(hw, sc, skb, rxs);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
index a273e373b7b0..c92b2c0cbd91 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/etherdevice.h> 31#include <linux/etherdevice.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/gfp.h>
33#include <net/mac80211.h> 34#include <net/mac80211.h>
34 35
35#include "iwl-dev.h" 36#include "iwl-dev.h"
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 107e173112f6..5d3f51ff2f0d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -376,6 +376,11 @@ void iwl_bg_start_internal_scan(struct work_struct *work)
376 376
377 mutex_lock(&priv->mutex); 377 mutex_lock(&priv->mutex);
378 378
379 if (priv->is_internal_short_scan == true) {
380 IWL_DEBUG_SCAN(priv, "Internal scan already in progress\n");
381 goto unlock;
382 }
383
379 if (!iwl_is_ready_rf(priv)) { 384 if (!iwl_is_ready_rf(priv)) {
380 IWL_DEBUG_SCAN(priv, "not ready or exit pending\n"); 385 IWL_DEBUG_SCAN(priv, "not ready or exit pending\n");
381 goto unlock; 386 goto unlock;
@@ -497,17 +502,27 @@ void iwl_bg_scan_completed(struct work_struct *work)
497{ 502{
498 struct iwl_priv *priv = 503 struct iwl_priv *priv =
499 container_of(work, struct iwl_priv, scan_completed); 504 container_of(work, struct iwl_priv, scan_completed);
505 bool internal = false;
500 506
501 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); 507 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");
502 508
503 cancel_delayed_work(&priv->scan_check); 509 cancel_delayed_work(&priv->scan_check);
504 510
505 if (!priv->is_internal_short_scan) 511 mutex_lock(&priv->mutex);
506 ieee80211_scan_completed(priv->hw, false); 512 if (priv->is_internal_short_scan) {
507 else {
508 priv->is_internal_short_scan = false; 513 priv->is_internal_short_scan = false;
509 IWL_DEBUG_SCAN(priv, "internal short scan completed\n"); 514 IWL_DEBUG_SCAN(priv, "internal short scan completed\n");
515 internal = true;
510 } 516 }
517 mutex_unlock(&priv->mutex);
518
519 /*
520 * Do not hold mutex here since this will cause mac80211 to call
521 * into driver again into functions that will attempt to take
522 * mutex.
523 */
524 if (!internal)
525 ieee80211_scan_completed(priv->hw, false);
511 526
512 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 527 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
513 return; 528 return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 85ed235ac901..83a26361a9b5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -431,7 +431,7 @@ int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
431 struct iwl_link_quality_cmd *link_cmd; 431 struct iwl_link_quality_cmd *link_cmd;
432 unsigned long flags; 432 unsigned long flags;
433 433
434 if (*sta_id_r) 434 if (sta_id_r)
435 *sta_id_r = IWL_INVALID_STATION; 435 *sta_id_r = IWL_INVALID_STATION;
436 436
437 ret = iwl_add_station_common(priv, addr, 0, NULL, &sta_id); 437 ret = iwl_add_station_common(priv, addr, 0, NULL, &sta_id);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 2d2890878dea..4bd61ee627c0 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2572,14 +2572,18 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
2572 2572
2573static void rndis_wlan_do_link_down_work(struct usbnet *usbdev) 2573static void rndis_wlan_do_link_down_work(struct usbnet *usbdev)
2574{ 2574{
2575 union iwreq_data evt; 2575 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
2576 2576
2577 netif_carrier_off(usbdev->net); 2577 if (priv->connected) {
2578 priv->connected = false;
2579 memset(priv->bssid, 0, ETH_ALEN);
2580
2581 deauthenticate(usbdev);
2578 2582
2579 evt.data.flags = 0; 2583 cfg80211_disconnected(usbdev->net, 0, NULL, 0, GFP_KERNEL);
2580 evt.data.length = 0; 2584 }
2581 memset(evt.ap_addr.sa_data, 0, ETH_ALEN); 2585
2582 wireless_send_event(usbdev->net, SIOCGIWAP, &evt, NULL); 2586 netif_carrier_off(usbdev->net);
2583} 2587}
2584 2588
2585static void rndis_wlan_worker(struct work_struct *work) 2589static void rndis_wlan_worker(struct work_struct *work)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 4ba7b038928f..ad2c98af7e9d 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -926,7 +926,7 @@ static void rt2400pci_disable_radio(struct rt2x00_dev *rt2x00dev)
926static int rt2400pci_set_state(struct rt2x00_dev *rt2x00dev, 926static int rt2400pci_set_state(struct rt2x00_dev *rt2x00dev,
927 enum dev_state state) 927 enum dev_state state)
928{ 928{
929 u32 reg; 929 u32 reg, reg2;
930 unsigned int i; 930 unsigned int i;
931 char put_to_sleep; 931 char put_to_sleep;
932 char bbp_state; 932 char bbp_state;
@@ -947,11 +947,12 @@ static int rt2400pci_set_state(struct rt2x00_dev *rt2x00dev,
947 * device has entered the correct state. 947 * device has entered the correct state.
948 */ 948 */
949 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 949 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
950 rt2x00pci_register_read(rt2x00dev, PWRCSR1, &reg); 950 rt2x00pci_register_read(rt2x00dev, PWRCSR1, &reg2);
951 bbp_state = rt2x00_get_field32(reg, PWRCSR1_BBP_CURR_STATE); 951 bbp_state = rt2x00_get_field32(reg2, PWRCSR1_BBP_CURR_STATE);
952 rf_state = rt2x00_get_field32(reg, PWRCSR1_RF_CURR_STATE); 952 rf_state = rt2x00_get_field32(reg2, PWRCSR1_RF_CURR_STATE);
953 if (bbp_state == state && rf_state == state) 953 if (bbp_state == state && rf_state == state)
954 return 0; 954 return 0;
955 rt2x00pci_register_write(rt2x00dev, PWRCSR1, reg);
955 msleep(10); 956 msleep(10);
956 } 957 }
957 958
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 89d132d4af12..41da3d218c65 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1084,7 +1084,7 @@ static void rt2500pci_disable_radio(struct rt2x00_dev *rt2x00dev)
1084static int rt2500pci_set_state(struct rt2x00_dev *rt2x00dev, 1084static int rt2500pci_set_state(struct rt2x00_dev *rt2x00dev,
1085 enum dev_state state) 1085 enum dev_state state)
1086{ 1086{
1087 u32 reg; 1087 u32 reg, reg2;
1088 unsigned int i; 1088 unsigned int i;
1089 char put_to_sleep; 1089 char put_to_sleep;
1090 char bbp_state; 1090 char bbp_state;
@@ -1105,11 +1105,12 @@ static int rt2500pci_set_state(struct rt2x00_dev *rt2x00dev,
1105 * device has entered the correct state. 1105 * device has entered the correct state.
1106 */ 1106 */
1107 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 1107 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
1108 rt2x00pci_register_read(rt2x00dev, PWRCSR1, &reg); 1108 rt2x00pci_register_read(rt2x00dev, PWRCSR1, &reg2);
1109 bbp_state = rt2x00_get_field32(reg, PWRCSR1_BBP_CURR_STATE); 1109 bbp_state = rt2x00_get_field32(reg2, PWRCSR1_BBP_CURR_STATE);
1110 rf_state = rt2x00_get_field32(reg, PWRCSR1_RF_CURR_STATE); 1110 rf_state = rt2x00_get_field32(reg2, PWRCSR1_RF_CURR_STATE);
1111 if (bbp_state == state && rf_state == state) 1111 if (bbp_state == state && rf_state == state)
1112 return 0; 1112 return 0;
1113 rt2x00pci_register_write(rt2x00dev, PWRCSR1, reg);
1113 msleep(10); 1114 msleep(10);
1114 } 1115 }
1115 1116
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 0f8b84b7224c..699161327d65 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -413,7 +413,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
413 */ 413 */
414 rt2x00_desc_read(txi, 0, &word); 414 rt2x00_desc_read(txi, 0, &word);
415 rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, 415 rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN,
416 skb->len + TXWI_DESC_SIZE); 416 skb->len - TXINFO_DESC_SIZE);
417 rt2x00_set_field32(&word, TXINFO_W0_WIV, 417 rt2x00_set_field32(&word, TXINFO_W0_WIV,
418 !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); 418 !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags));
419 rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); 419 rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2);
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index a016f7ccde29..f71eee67f977 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -206,7 +206,7 @@ void rt2x00pci_uninitialize(struct rt2x00_dev *rt2x00dev)
206 /* 206 /*
207 * Free irq line. 207 * Free irq line.
208 */ 208 */
209 free_irq(to_pci_dev(rt2x00dev->dev)->irq, rt2x00dev); 209 free_irq(rt2x00dev->irq, rt2x00dev);
210 210
211 /* 211 /*
212 * Free DMA 212 * Free DMA
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 2e3076f67535..6a74baf4e934 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1689,7 +1689,7 @@ static void rt61pci_disable_radio(struct rt2x00_dev *rt2x00dev)
1689 1689
1690static int rt61pci_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state) 1690static int rt61pci_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state)
1691{ 1691{
1692 u32 reg; 1692 u32 reg, reg2;
1693 unsigned int i; 1693 unsigned int i;
1694 char put_to_sleep; 1694 char put_to_sleep;
1695 1695
@@ -1706,10 +1706,11 @@ static int rt61pci_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state)
1706 * device has entered the correct state. 1706 * device has entered the correct state.
1707 */ 1707 */
1708 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 1708 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
1709 rt2x00pci_register_read(rt2x00dev, MAC_CSR12, &reg); 1709 rt2x00pci_register_read(rt2x00dev, MAC_CSR12, &reg2);
1710 state = rt2x00_get_field32(reg, MAC_CSR12_BBP_CURRENT_STATE); 1710 state = rt2x00_get_field32(reg2, MAC_CSR12_BBP_CURRENT_STATE);
1711 if (state == !put_to_sleep) 1711 if (state == !put_to_sleep)
1712 return 0; 1712 return 0;
1713 rt2x00pci_register_write(rt2x00dev, MAC_CSR12, reg);
1713 msleep(10); 1714 msleep(10);
1714 } 1715 }
1715 1716
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index e35bd19c3c5a..6e0d82efe924 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1366,7 +1366,7 @@ static void rt73usb_disable_radio(struct rt2x00_dev *rt2x00dev)
1366 1366
1367static int rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state) 1367static int rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state)
1368{ 1368{
1369 u32 reg; 1369 u32 reg, reg2;
1370 unsigned int i; 1370 unsigned int i;
1371 char put_to_sleep; 1371 char put_to_sleep;
1372 1372
@@ -1383,10 +1383,11 @@ static int rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state)
1383 * device has entered the correct state. 1383 * device has entered the correct state.
1384 */ 1384 */
1385 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 1385 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
1386 rt2x00usb_register_read(rt2x00dev, MAC_CSR12, &reg); 1386 rt2x00usb_register_read(rt2x00dev, MAC_CSR12, &reg2);
1387 state = rt2x00_get_field32(reg, MAC_CSR12_BBP_CURRENT_STATE); 1387 state = rt2x00_get_field32(reg2, MAC_CSR12_BBP_CURRENT_STATE);
1388 if (state == !put_to_sleep) 1388 if (state == !put_to_sleep)
1389 return 0; 1389 return 0;
1390 rt2x00usb_register_write(rt2x00dev, MAC_CSR12, reg);
1390 msleep(10); 1391 msleep(10);
1391 } 1392 }
1392 1393
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index 57f4bfd959c8..b98fb643fab0 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -113,6 +113,8 @@ static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)
113 wl1271_debug(DEBUG_RX, "rx skb 0x%p: %d B %s", skb, skb->len, 113 wl1271_debug(DEBUG_RX, "rx skb 0x%p: %d B %s", skb, skb->len,
114 beacon ? "beacon" : ""); 114 beacon ? "beacon" : "");
115 115
116 skb_trim(skb, skb->len - desc->pad_len);
117
116 memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); 118 memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
117 ieee80211_rx_ni(wl->hw, skb); 119 ieee80211_rx_ni(wl->hw, skb);
118} 120}
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5be900d19660..de22cbfef232 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -815,6 +815,7 @@ enum ieee80211_key_flags {
815 * encrypted in hardware. 815 * encrypted in hardware.
816 * @alg: The key algorithm. 816 * @alg: The key algorithm.
817 * @flags: key flags, see &enum ieee80211_key_flags. 817 * @flags: key flags, see &enum ieee80211_key_flags.
818 * @ap_addr: AP's MAC address
818 * @keyidx: the key index (0-3) 819 * @keyidx: the key index (0-3)
819 * @keylen: key material length 820 * @keylen: key material length
820 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) 821 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte)
@@ -831,7 +832,6 @@ struct ieee80211_key_conf {
831 u8 iv_len; 832 u8 iv_len;
832 u8 hw_key_idx; 833 u8 hw_key_idx;
833 u8 flags; 834 u8 flags;
834 u8 *ap_addr;
835 s8 keyidx; 835 s8 keyidx;
836 u8 keylen; 836 u8 keylen;
837 u8 key[0]; 837 u8 key[0];
@@ -1638,6 +1638,8 @@ enum ieee80211_ampdu_mlme_action {
1638 * Returns a negative error code on failure. 1638 * Returns a negative error code on failure.
1639 * The callback must be atomic. 1639 * The callback must be atomic.
1640 * 1640 *
1641 * @get_survey: Return per-channel survey information
1642 *
1641 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1643 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1642 * need to set wiphy->rfkill_poll to %true before registration, 1644 * need to set wiphy->rfkill_poll to %true before registration,
1643 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1645 * and need to call wiphy_rfkill_set_hw_state() in the callback.
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 8d4b41787dcf..e8f6e3b252d8 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -140,7 +140,6 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
140 struct ieee80211_sub_if_data, 140 struct ieee80211_sub_if_data,
141 u.ap); 141 u.ap);
142 142
143 key->conf.ap_addr = sdata->dev->dev_addr;
144 ret = drv_set_key(key->local, SET_KEY, sdata, sta, &key->conf); 143 ret = drv_set_key(key->local, SET_KEY, sdata, sta, &key->conf);
145 144
146 if (!ret) { 145 if (!ret) {
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 48a5e80957f0..df9d45544ca5 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -145,7 +145,7 @@ enum plink_state {
145/** 145/**
146 * struct sta_ampdu_mlme - STA aggregation information. 146 * struct sta_ampdu_mlme - STA aggregation information.
147 * 147 *
148 * @tid_state_rx: TID's state in Rx session state machine. 148 * @tid_active_rx: TID's state in Rx session state machine.
149 * @tid_rx: aggregation info for Rx per TID 149 * @tid_rx: aggregation info for Rx per TID
150 * @tid_state_tx: TID's state in Tx session state machine. 150 * @tid_state_tx: TID's state in Tx session state machine.
151 * @tid_tx: aggregation info for Tx per TID 151 * @tid_tx: aggregation info for Tx per TID
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index d92d088026bf..b01a6f6397d7 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -50,7 +50,7 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
50 struct ieee80211_channel *chan; 50 struct ieee80211_channel *chan;
51 int result; 51 int result;
52 52
53 if (wdev->iftype == NL80211_IFTYPE_MONITOR) 53 if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
54 wdev = NULL; 54 wdev = NULL;
55 55
56 if (wdev) { 56 if (wdev) {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index aaa1aad566cd..db71150b8040 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4443,9 +4443,10 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
4443 if (channel_type != NL80211_CHAN_NO_HT && 4443 if (channel_type != NL80211_CHAN_NO_HT &&
4444 channel_type != NL80211_CHAN_HT20 && 4444 channel_type != NL80211_CHAN_HT20 &&
4445 channel_type != NL80211_CHAN_HT40PLUS && 4445 channel_type != NL80211_CHAN_HT40PLUS &&
4446 channel_type != NL80211_CHAN_HT40MINUS) 4446 channel_type != NL80211_CHAN_HT40MINUS) {
4447 err = -EINVAL; 4447 err = -EINVAL;
4448 goto out; 4448 goto out;
4449 }
4449 } 4450 }
4450 4451
4451 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]); 4452 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
@@ -4717,9 +4718,10 @@ static int nl80211_action(struct sk_buff *skb, struct genl_info *info)
4717 if (channel_type != NL80211_CHAN_NO_HT && 4718 if (channel_type != NL80211_CHAN_NO_HT &&
4718 channel_type != NL80211_CHAN_HT20 && 4719 channel_type != NL80211_CHAN_HT20 &&
4719 channel_type != NL80211_CHAN_HT40PLUS && 4720 channel_type != NL80211_CHAN_HT40PLUS &&
4720 channel_type != NL80211_CHAN_HT40MINUS) 4721 channel_type != NL80211_CHAN_HT40MINUS) {
4721 err = -EINVAL; 4722 err = -EINVAL;
4722 goto out; 4723 goto out;
4724 }
4723 } 4725 }
4724 4726
4725 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]); 4727 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index a026c6d56bd3..58401d246bda 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -515,7 +515,7 @@ cfg80211_inform_bss(struct wiphy *wiphy,
515 515
516 privsz = wiphy->bss_priv_size; 516 privsz = wiphy->bss_priv_size;
517 517
518 if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC && 518 if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
519 (signal < 0 || signal > 100))) 519 (signal < 0 || signal > 100)))
520 return NULL; 520 return NULL;
521 521
@@ -571,7 +571,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
571 u.probe_resp.variable); 571 u.probe_resp.variable);
572 size_t privsz = wiphy->bss_priv_size; 572 size_t privsz = wiphy->bss_priv_size;
573 573
574 if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC && 574 if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
575 (signal < 0 || signal > 100))) 575 (signal < 0 || signal > 100)))
576 return NULL; 576 return NULL;
577 577