aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c70
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c13
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c14
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/sta.c1
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/tx.c14
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/tx.c18
-rw-r--r--drivers/net/wireless/libertas/cfg.c2
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c34
-rw-r--r--drivers/net/wireless/mwifiex/usb.c12
-rw-r--r--drivers/net/wireless/mwifiex/wmm.c3
14 files changed, 98 insertions, 99 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
index 1cc13569b17b..1b6b4d0cfa97 100644
--- a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
@@ -57,7 +57,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
57 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e}, 57 {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
58 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 58 {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
59 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, 59 {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
60 {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, 60 {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
61 {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, 61 {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
62 {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282}, 62 {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
63 {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27}, 63 {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
@@ -96,7 +96,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
96 {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000}, 96 {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
97 {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, 97 {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
98 {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, 98 {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
99 {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, 99 {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
100 {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550}, 100 {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
101}; 101};
102 102
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 11eab9f01fd8..303ce27964c1 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1534,7 +1534,7 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
1534bool ath9k_hw_check_alive(struct ath_hw *ah) 1534bool ath9k_hw_check_alive(struct ath_hw *ah)
1535{ 1535{
1536 int count = 50; 1536 int count = 50;
1537 u32 reg; 1537 u32 reg, last_val;
1538 1538
1539 if (AR_SREV_9300(ah)) 1539 if (AR_SREV_9300(ah))
1540 return !ath9k_hw_detect_mac_hang(ah); 1540 return !ath9k_hw_detect_mac_hang(ah);
@@ -1542,9 +1542,13 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1542 if (AR_SREV_9285_12_OR_LATER(ah)) 1542 if (AR_SREV_9285_12_OR_LATER(ah))
1543 return true; 1543 return true;
1544 1544
1545 last_val = REG_READ(ah, AR_OBS_BUS_1);
1545 do { 1546 do {
1546 reg = REG_READ(ah, AR_OBS_BUS_1); 1547 reg = REG_READ(ah, AR_OBS_BUS_1);
1548 if (reg != last_val)
1549 return true;
1547 1550
1551 last_val = reg;
1548 if ((reg & 0x7E7FFFEF) == 0x00702400) 1552 if ((reg & 0x7E7FFFEF) == 0x00702400)
1549 continue; 1553 continue;
1550 1554
@@ -1556,6 +1560,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1556 default: 1560 default:
1557 return true; 1561 return true;
1558 } 1562 }
1563
1564 udelay(1);
1559 } while (count-- > 0); 1565 } while (count-- > 0);
1560 1566
1561 return false; 1567 return false;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index a0ebdd000fc2..82e340d3ec60 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -732,11 +732,18 @@ static struct ath_rxbuf *ath_get_next_rx_buf(struct ath_softc *sc,
732 return NULL; 732 return NULL;
733 733
734 /* 734 /*
735 * mark descriptor as zero-length and set the 'more' 735 * Re-check previous descriptor, in case it has been filled
736 * flag to ensure that both buffers get discarded 736 * in the mean time.
737 */ 737 */
738 rs->rs_datalen = 0; 738 ret = ath9k_hw_rxprocdesc(ah, ds, rs);
739 rs->rs_more = true; 739 if (ret == -EINPROGRESS) {
740 /*
741 * mark descriptor as zero-length and set the 'more'
742 * flag to ensure that both buffers get discarded
743 */
744 rs->rs_datalen = 0;
745 rs->rs_more = true;
746 }
740 } 747 }
741 748
742 list_del(&bf->list); 749 list_del(&bf->list);
@@ -985,32 +992,32 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
985 struct ath_common *common = ath9k_hw_common(ah); 992 struct ath_common *common = ath9k_hw_common(ah);
986 struct ieee80211_hdr *hdr; 993 struct ieee80211_hdr *hdr;
987 bool discard_current = sc->rx.discard_next; 994 bool discard_current = sc->rx.discard_next;
988 int ret = 0;
989 995
990 /* 996 /*
991 * Discard corrupt descriptors which are marked in 997 * Discard corrupt descriptors which are marked in
992 * ath_get_next_rx_buf(). 998 * ath_get_next_rx_buf().
993 */ 999 */
994 sc->rx.discard_next = rx_stats->rs_more;
995 if (discard_current) 1000 if (discard_current)
996 return -EINVAL; 1001 goto corrupt;
1002
1003 sc->rx.discard_next = false;
997 1004
998 /* 1005 /*
999 * Discard zero-length packets. 1006 * Discard zero-length packets.
1000 */ 1007 */
1001 if (!rx_stats->rs_datalen) { 1008 if (!rx_stats->rs_datalen) {
1002 RX_STAT_INC(rx_len_err); 1009 RX_STAT_INC(rx_len_err);
1003 return -EINVAL; 1010 goto corrupt;
1004 } 1011 }
1005 1012
1006 /* 1013 /*
1007 * rs_status follows rs_datalen so if rs_datalen is too large 1014 * rs_status follows rs_datalen so if rs_datalen is too large
1008 * we can take a hint that hardware corrupted it, so ignore 1015 * we can take a hint that hardware corrupted it, so ignore
1009 * those frames. 1016 * those frames.
1010 */ 1017 */
1011 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) { 1018 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) {
1012 RX_STAT_INC(rx_len_err); 1019 RX_STAT_INC(rx_len_err);
1013 return -EINVAL; 1020 goto corrupt;
1014 } 1021 }
1015 1022
1016 /* Only use status info from the last fragment */ 1023 /* Only use status info from the last fragment */
@@ -1024,10 +1031,8 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1024 * This is different from the other corrupt descriptor 1031 * This is different from the other corrupt descriptor
1025 * condition handled above. 1032 * condition handled above.
1026 */ 1033 */
1027 if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC) { 1034 if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC)
1028 ret = -EINVAL; 1035 goto corrupt;
1029 goto exit;
1030 }
1031 1036
1032 hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len); 1037 hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len);
1033 1038
@@ -1043,18 +1048,15 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1043 if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime)) 1048 if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime))
1044 RX_STAT_INC(rx_spectral); 1049 RX_STAT_INC(rx_spectral);
1045 1050
1046 ret = -EINVAL; 1051 return -EINVAL;
1047 goto exit;
1048 } 1052 }
1049 1053
1050 /* 1054 /*
1051 * everything but the rate is checked here, the rate check is done 1055 * everything but the rate is checked here, the rate check is done
1052 * separately to avoid doing two lookups for a rate for each frame. 1056 * separately to avoid doing two lookups for a rate for each frame.
1053 */ 1057 */
1054 if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error)) { 1058 if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error))
1055 ret = -EINVAL; 1059 return -EINVAL;
1056 goto exit;
1057 }
1058 1060
1059 if (ath_is_mybeacon(common, hdr)) { 1061 if (ath_is_mybeacon(common, hdr)) {
1060 RX_STAT_INC(rx_beacons); 1062 RX_STAT_INC(rx_beacons);
@@ -1064,15 +1066,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1064 /* 1066 /*
1065 * This shouldn't happen, but have a safety check anyway. 1067 * This shouldn't happen, but have a safety check anyway.
1066 */ 1068 */
1067 if (WARN_ON(!ah->curchan)) { 1069 if (WARN_ON(!ah->curchan))
1068 ret = -EINVAL; 1070 return -EINVAL;
1069 goto exit;
1070 }
1071 1071
1072 if (ath9k_process_rate(common, hw, rx_stats, rx_status)) { 1072 if (ath9k_process_rate(common, hw, rx_stats, rx_status))
1073 ret =-EINVAL; 1073 return -EINVAL;
1074 goto exit;
1075 }
1076 1074
1077 ath9k_process_rssi(common, hw, rx_stats, rx_status); 1075 ath9k_process_rssi(common, hw, rx_stats, rx_status);
1078 1076
@@ -1087,9 +1085,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
1087 sc->rx.num_pkts++; 1085 sc->rx.num_pkts++;
1088#endif 1086#endif
1089 1087
1090exit: 1088 return 0;
1091 sc->rx.discard_next = false; 1089
1092 return ret; 1090corrupt:
1091 sc->rx.discard_next = rx_stats->rs_more;
1092 return -EINVAL;
1093} 1093}
1094 1094
1095static void ath9k_rx_skb_postprocess(struct ath_common *common, 1095static void ath9k_rx_skb_postprocess(struct ath_common *common,
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 0a75e2f68c9d..f042a18c8495 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1444,14 +1444,16 @@ void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
1444 for (tidno = 0, tid = &an->tid[tidno]; 1444 for (tidno = 0, tid = &an->tid[tidno];
1445 tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { 1445 tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
1446 1446
1447 if (!tid->sched)
1448 continue;
1449
1450 ac = tid->ac; 1447 ac = tid->ac;
1451 txq = ac->txq; 1448 txq = ac->txq;
1452 1449
1453 ath_txq_lock(sc, txq); 1450 ath_txq_lock(sc, txq);
1454 1451
1452 if (!tid->sched) {
1453 ath_txq_unlock(sc, txq);
1454 continue;
1455 }
1456
1455 buffered = ath_tid_has_buffered(tid); 1457 buffered = ath_tid_has_buffered(tid);
1456 1458
1457 tid->sched = false; 1459 tid->sched = false;
@@ -2184,14 +2186,15 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
2184 txq->stopped = true; 2186 txq->stopped = true;
2185 } 2187 }
2186 2188
2189 if (txctl->an)
2190 tid = ath_get_skb_tid(sc, txctl->an, skb);
2191
2187 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) { 2192 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
2188 ath_txq_unlock(sc, txq); 2193 ath_txq_unlock(sc, txq);
2189 txq = sc->tx.uapsdq; 2194 txq = sc->tx.uapsdq;
2190 ath_txq_lock(sc, txq); 2195 ath_txq_lock(sc, txq);
2191 } else if (txctl->an && 2196 } else if (txctl->an &&
2192 ieee80211_is_data_present(hdr->frame_control)) { 2197 ieee80211_is_data_present(hdr->frame_control)) {
2193 tid = ath_get_skb_tid(sc, txctl->an, skb);
2194
2195 WARN_ON(tid->ac->txq != txctl->txq); 2198 WARN_ON(tid->ac->txq != txctl->txq);
2196 2199
2197 if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) 2200 if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 3e991897d7ca..119ee6eaf1c3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -457,7 +457,6 @@ struct brcmf_sdio {
457 457
458 u8 tx_hdrlen; /* sdio bus header length for tx packet */ 458 u8 tx_hdrlen; /* sdio bus header length for tx packet */
459 bool txglom; /* host tx glomming enable flag */ 459 bool txglom; /* host tx glomming enable flag */
460 struct sk_buff *txglom_sgpad; /* scatter-gather padding buffer */
461 u16 head_align; /* buffer pointer alignment */ 460 u16 head_align; /* buffer pointer alignment */
462 u16 sgentry_align; /* scatter-gather buffer alignment */ 461 u16 sgentry_align; /* scatter-gather buffer alignment */
463}; 462};
@@ -1944,9 +1943,8 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
1944 if (lastfrm && chain_pad) 1943 if (lastfrm && chain_pad)
1945 tail_pad += blksize - chain_pad; 1944 tail_pad += blksize - chain_pad;
1946 if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) { 1945 if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) {
1947 pkt_pad = bus->txglom_sgpad; 1946 pkt_pad = brcmu_pkt_buf_get_skb(tail_pad + tail_chop +
1948 if (pkt_pad == NULL) 1947 bus->head_align);
1949 brcmu_pkt_buf_get_skb(tail_pad + tail_chop);
1950 if (pkt_pad == NULL) 1948 if (pkt_pad == NULL)
1951 return -ENOMEM; 1949 return -ENOMEM;
1952 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad); 1950 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad);
@@ -1957,6 +1955,7 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
1957 tail_chop); 1955 tail_chop);
1958 *(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop; 1956 *(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop;
1959 skb_trim(pkt, pkt->len - tail_chop); 1957 skb_trim(pkt, pkt->len - tail_chop);
1958 skb_trim(pkt_pad, tail_pad + tail_chop);
1960 __skb_queue_after(pktq, pkt, pkt_pad); 1959 __skb_queue_after(pktq, pkt, pkt_pad);
1961 } else { 1960 } else {
1962 ntail = pkt->data_len + tail_pad - 1961 ntail = pkt->data_len + tail_pad -
@@ -2011,7 +2010,7 @@ brcmf_sdio_txpkt_prep(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
2011 return ret; 2010 return ret;
2012 head_pad = (u16)ret; 2011 head_pad = (u16)ret;
2013 if (head_pad) 2012 if (head_pad)
2014 memset(pkt_next->data, 0, head_pad + bus->tx_hdrlen); 2013 memset(pkt_next->data + bus->tx_hdrlen, 0, head_pad);
2015 2014
2016 total_len += pkt_next->len; 2015 total_len += pkt_next->len;
2017 2016
@@ -3486,10 +3485,6 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
3486 bus->txglom = false; 3485 bus->txglom = false;
3487 value = 1; 3486 value = 1;
3488 pad_size = bus->sdiodev->func[2]->cur_blksize << 1; 3487 pad_size = bus->sdiodev->func[2]->cur_blksize << 1;
3489 bus->txglom_sgpad = brcmu_pkt_buf_get_skb(pad_size);
3490 if (!bus->txglom_sgpad)
3491 brcmf_err("allocating txglom padding skb failed, reduced performance\n");
3492
3493 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom", 3488 err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
3494 &value, sizeof(u32)); 3489 &value, sizeof(u32));
3495 if (err < 0) { 3490 if (err < 0) {
@@ -4053,7 +4048,6 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
4053 brcmf_sdio_chip_detach(&bus->ci); 4048 brcmf_sdio_chip_detach(&bus->ci);
4054 } 4049 }
4055 4050
4056 brcmu_pkt_buf_free_skb(bus->txglom_sgpad);
4057 kfree(bus->rxbuf); 4051 kfree(bus->rxbuf);
4058 kfree(bus->hdrbuf); 4052 kfree(bus->hdrbuf);
4059 kfree(bus); 4053 kfree(bus);
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index d36e252d2ccb..596525528f50 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -147,7 +147,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta)
147 147
148 if (!sta->ap && sta->u.sta.challenge) 148 if (!sta->ap && sta->u.sta.challenge)
149 kfree(sta->u.sta.challenge); 149 kfree(sta->u.sta.challenge);
150 del_timer(&sta->timer); 150 del_timer_sync(&sta->timer);
151#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 151#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
152 152
153 kfree(sta); 153 kfree(sta);
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c
index c0d070c5df5e..9cdd91cdf661 100644
--- a/drivers/net/wireless/iwlwifi/dvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/dvm/sta.c
@@ -590,6 +590,7 @@ void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id,
590 sizeof(priv->tid_data[sta_id][tid])); 590 sizeof(priv->tid_data[sta_id][tid]));
591 591
592 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE; 592 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;
593 priv->stations[sta_id].used &= ~IWL_STA_UCODE_INPROGRESS;
593 594
594 priv->num_stations--; 595 priv->num_stations--;
595 596
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index a6839dfcb82d..398dd096674c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -1291,8 +1291,6 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1291 struct iwl_compressed_ba_resp *ba_resp = (void *)pkt->data; 1291 struct iwl_compressed_ba_resp *ba_resp = (void *)pkt->data;
1292 struct iwl_ht_agg *agg; 1292 struct iwl_ht_agg *agg;
1293 struct sk_buff_head reclaimed_skbs; 1293 struct sk_buff_head reclaimed_skbs;
1294 struct ieee80211_tx_info *info;
1295 struct ieee80211_hdr *hdr;
1296 struct sk_buff *skb; 1294 struct sk_buff *skb;
1297 int sta_id; 1295 int sta_id;
1298 int tid; 1296 int tid;
@@ -1379,22 +1377,28 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1379 freed = 0; 1377 freed = 0;
1380 1378
1381 skb_queue_walk(&reclaimed_skbs, skb) { 1379 skb_queue_walk(&reclaimed_skbs, skb) {
1382 hdr = (struct ieee80211_hdr *)skb->data; 1380 struct ieee80211_hdr *hdr = (void *)skb->data;
1381 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1383 1382
1384 if (ieee80211_is_data_qos(hdr->frame_control)) 1383 if (ieee80211_is_data_qos(hdr->frame_control))
1385 freed++; 1384 freed++;
1386 else 1385 else
1387 WARN_ON_ONCE(1); 1386 WARN_ON_ONCE(1);
1388 1387
1389 info = IEEE80211_SKB_CB(skb);
1390 iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]); 1388 iwl_trans_free_tx_cmd(priv->trans, info->driver_data[1]);
1391 1389
1390 memset(&info->status, 0, sizeof(info->status));
1391 /* Packet was transmitted successfully, failures come as single
1392 * frames because before failing a frame the firmware transmits
1393 * it without aggregation at least once.
1394 */
1395 info->flags |= IEEE80211_TX_STAT_ACK;
1396
1392 if (freed == 1) { 1397 if (freed == 1) {
1393 /* this is the first skb we deliver in this batch */ 1398 /* this is the first skb we deliver in this batch */
1394 /* put the rate scaling data there */ 1399 /* put the rate scaling data there */
1395 info = IEEE80211_SKB_CB(skb); 1400 info = IEEE80211_SKB_CB(skb);
1396 memset(&info->status, 0, sizeof(info->status)); 1401 memset(&info->status, 0, sizeof(info->status));
1397 info->flags |= IEEE80211_TX_STAT_ACK;
1398 info->flags |= IEEE80211_TX_STAT_AMPDU; 1402 info->flags |= IEEE80211_TX_STAT_AMPDU;
1399 info->status.ampdu_ack_len = ba_resp->txed_2_done; 1403 info->status.ampdu_ack_len = ba_resp->txed_2_done;
1400 info->status.ampdu_len = ba_resp->txed; 1404 info->status.ampdu_len = ba_resp->txed;
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index e4ead86f06d6..2b0ba1fc3c82 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -152,7 +152,7 @@ enum iwl_power_scheme {
152 IWL_POWER_SCHEME_LP 152 IWL_POWER_SCHEME_LP
153}; 153};
154 154
155#define IWL_CONN_MAX_LISTEN_INTERVAL 70 155#define IWL_CONN_MAX_LISTEN_INTERVAL 10
156#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ 156#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\
157 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\ 157 IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\
158 IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\ 158 IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index 4df12fa9d336..76ee486039d7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -822,16 +822,12 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
822 struct iwl_mvm_ba_notif *ba_notif = (void *)pkt->data; 822 struct iwl_mvm_ba_notif *ba_notif = (void *)pkt->data;
823 struct sk_buff_head reclaimed_skbs; 823 struct sk_buff_head reclaimed_skbs;
824 struct iwl_mvm_tid_data *tid_data; 824 struct iwl_mvm_tid_data *tid_data;
825 struct ieee80211_tx_info *info;
826 struct ieee80211_sta *sta; 825 struct ieee80211_sta *sta;
827 struct iwl_mvm_sta *mvmsta; 826 struct iwl_mvm_sta *mvmsta;
828 struct ieee80211_hdr *hdr;
829 struct sk_buff *skb; 827 struct sk_buff *skb;
830 int sta_id, tid, freed; 828 int sta_id, tid, freed;
831
832 /* "flow" corresponds to Tx queue */ 829 /* "flow" corresponds to Tx queue */
833 u16 scd_flow = le16_to_cpu(ba_notif->scd_flow); 830 u16 scd_flow = le16_to_cpu(ba_notif->scd_flow);
834
835 /* "ssn" is start of block-ack Tx window, corresponds to index 831 /* "ssn" is start of block-ack Tx window, corresponds to index
836 * (in Tx queue's circular buffer) of first TFD/frame in window */ 832 * (in Tx queue's circular buffer) of first TFD/frame in window */
837 u16 ba_resp_scd_ssn = le16_to_cpu(ba_notif->scd_ssn); 833 u16 ba_resp_scd_ssn = le16_to_cpu(ba_notif->scd_ssn);
@@ -888,22 +884,26 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
888 freed = 0; 884 freed = 0;
889 885
890 skb_queue_walk(&reclaimed_skbs, skb) { 886 skb_queue_walk(&reclaimed_skbs, skb) {
891 hdr = (struct ieee80211_hdr *)skb->data; 887 struct ieee80211_hdr *hdr = (void *)skb->data;
888 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
892 889
893 if (ieee80211_is_data_qos(hdr->frame_control)) 890 if (ieee80211_is_data_qos(hdr->frame_control))
894 freed++; 891 freed++;
895 else 892 else
896 WARN_ON_ONCE(1); 893 WARN_ON_ONCE(1);
897 894
898 info = IEEE80211_SKB_CB(skb);
899 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]); 895 iwl_trans_free_tx_cmd(mvm->trans, info->driver_data[1]);
900 896
897 memset(&info->status, 0, sizeof(info->status));
898 /* Packet was transmitted successfully, failures come as single
899 * frames because before failing a frame the firmware transmits
900 * it without aggregation at least once.
901 */
902 info->flags |= IEEE80211_TX_STAT_ACK;
903
901 if (freed == 1) { 904 if (freed == 1) {
902 /* this is the first skb we deliver in this batch */ 905 /* this is the first skb we deliver in this batch */
903 /* put the rate scaling data there */ 906 /* put the rate scaling data there */
904 info = IEEE80211_SKB_CB(skb);
905 memset(&info->status, 0, sizeof(info->status));
906 info->flags |= IEEE80211_TX_STAT_ACK;
907 info->flags |= IEEE80211_TX_STAT_AMPDU; 907 info->flags |= IEEE80211_TX_STAT_AMPDU;
908 info->status.ampdu_ack_len = ba_notif->txed_2_done; 908 info->status.ampdu_ack_len = ba_notif->txed_2_done;
909 info->status.ampdu_len = ba_notif->txed; 909 info->status.ampdu_len = ba_notif->txed;
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 32f75007a825..cb6d189bc3e6 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -621,7 +621,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
621 id = *pos++; 621 id = *pos++;
622 elen = *pos++; 622 elen = *pos++;
623 left -= 2; 623 left -= 2;
624 if (elen > left || elen == 0) { 624 if (elen > left) {
625 lbs_deb_scan("scan response: invalid IE fmt\n"); 625 lbs_deb_scan("scan response: invalid IE fmt\n");
626 goto done; 626 goto done;
627 } 627 }
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 03688aa14e8a..7fe7b53fb17a 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1211,6 +1211,12 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
1211 rd_index = card->rxbd_rdptr & reg->rx_mask; 1211 rd_index = card->rxbd_rdptr & reg->rx_mask;
1212 skb_data = card->rx_buf_list[rd_index]; 1212 skb_data = card->rx_buf_list[rd_index];
1213 1213
1214 /* If skb allocation was failed earlier for Rx packet,
1215 * rx_buf_list[rd_index] would have been left with a NULL.
1216 */
1217 if (!skb_data)
1218 return -ENOMEM;
1219
1214 MWIFIEX_SKB_PACB(skb_data, &buf_pa); 1220 MWIFIEX_SKB_PACB(skb_data, &buf_pa);
1215 pci_unmap_single(card->dev, buf_pa, MWIFIEX_RX_DATA_BUF_SIZE, 1221 pci_unmap_single(card->dev, buf_pa, MWIFIEX_RX_DATA_BUF_SIZE,
1216 PCI_DMA_FROMDEVICE); 1222 PCI_DMA_FROMDEVICE);
@@ -1525,6 +1531,14 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
1525 if (adapter->ps_state == PS_STATE_SLEEP_CFM) { 1531 if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
1526 mwifiex_process_sleep_confirm_resp(adapter, skb->data, 1532 mwifiex_process_sleep_confirm_resp(adapter, skb->data,
1527 skb->len); 1533 skb->len);
1534 mwifiex_pcie_enable_host_int(adapter);
1535 if (mwifiex_write_reg(adapter,
1536 PCIE_CPU_INT_EVENT,
1537 CPU_INTR_SLEEP_CFM_DONE)) {
1538 dev_warn(adapter->dev,
1539 "Write register failed\n");
1540 return -1;
1541 }
1528 while (reg->sleep_cookie && (count++ < 10) && 1542 while (reg->sleep_cookie && (count++ < 10) &&
1529 mwifiex_pcie_ok_to_access_hw(adapter)) 1543 mwifiex_pcie_ok_to_access_hw(adapter))
1530 usleep_range(50, 60); 1544 usleep_range(50, 60);
@@ -1993,23 +2007,9 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
1993 adapter->int_status |= pcie_ireg; 2007 adapter->int_status |= pcie_ireg;
1994 spin_unlock_irqrestore(&adapter->int_lock, flags); 2008 spin_unlock_irqrestore(&adapter->int_lock, flags);
1995 2009
1996 if (pcie_ireg & HOST_INTR_CMD_DONE) { 2010 if (!adapter->pps_uapsd_mode &&
1997 if ((adapter->ps_state == PS_STATE_SLEEP_CFM) || 2011 adapter->ps_state == PS_STATE_SLEEP &&
1998 (adapter->ps_state == PS_STATE_SLEEP)) { 2012 mwifiex_pcie_ok_to_access_hw(adapter)) {
1999 mwifiex_pcie_enable_host_int(adapter);
2000 if (mwifiex_write_reg(adapter,
2001 PCIE_CPU_INT_EVENT,
2002 CPU_INTR_SLEEP_CFM_DONE)
2003 ) {
2004 dev_warn(adapter->dev,
2005 "Write register failed\n");
2006 return;
2007
2008 }
2009 }
2010 } else if (!adapter->pps_uapsd_mode &&
2011 adapter->ps_state == PS_STATE_SLEEP &&
2012 mwifiex_pcie_ok_to_access_hw(adapter)) {
2013 /* Potentially for PCIe we could get other 2013 /* Potentially for PCIe we could get other
2014 * interrupts like shared. Don't change power 2014 * interrupts like shared. Don't change power
2015 * state until cookie is set */ 2015 * state until cookie is set */
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c
index e8ebbd4bc3cd..208748804a55 100644
--- a/drivers/net/wireless/mwifiex/usb.c
+++ b/drivers/net/wireless/mwifiex/usb.c
@@ -22,8 +22,6 @@
22 22
23#define USB_VERSION "1.0" 23#define USB_VERSION "1.0"
24 24
25static const char usbdriver_name[] = "usb8xxx";
26
27static struct mwifiex_if_ops usb_ops; 25static struct mwifiex_if_ops usb_ops;
28static struct semaphore add_remove_card_sem; 26static struct semaphore add_remove_card_sem;
29static struct usb_card_rec *usb_card; 27static struct usb_card_rec *usb_card;
@@ -527,13 +525,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf)
527 MWIFIEX_BSS_ROLE_ANY), 525 MWIFIEX_BSS_ROLE_ANY),
528 MWIFIEX_ASYNC_CMD); 526 MWIFIEX_ASYNC_CMD);
529 527
530#ifdef CONFIG_PM
531 /* Resume handler may be called due to remote wakeup,
532 * force to exit suspend anyway
533 */
534 usb_disable_autosuspend(card->udev);
535#endif /* CONFIG_PM */
536
537 return 0; 528 return 0;
538} 529}
539 530
@@ -567,13 +558,12 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
567} 558}
568 559
569static struct usb_driver mwifiex_usb_driver = { 560static struct usb_driver mwifiex_usb_driver = {
570 .name = usbdriver_name, 561 .name = "mwifiex_usb",
571 .probe = mwifiex_usb_probe, 562 .probe = mwifiex_usb_probe,
572 .disconnect = mwifiex_usb_disconnect, 563 .disconnect = mwifiex_usb_disconnect,
573 .id_table = mwifiex_usb_table, 564 .id_table = mwifiex_usb_table,
574 .suspend = mwifiex_usb_suspend, 565 .suspend = mwifiex_usb_suspend,
575 .resume = mwifiex_usb_resume, 566 .resume = mwifiex_usb_resume,
576 .supports_autosuspend = 1,
577}; 567};
578 568
579static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter) 569static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter)
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 13eaeed03898..981cf6e7c73b 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -559,7 +559,8 @@ mwifiex_clean_txrx(struct mwifiex_private *priv)
559 mwifiex_wmm_delete_all_ralist(priv); 559 mwifiex_wmm_delete_all_ralist(priv);
560 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid)); 560 memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid));
561 561
562 if (priv->adapter->if_ops.clean_pcie_ring) 562 if (priv->adapter->if_ops.clean_pcie_ring &&
563 !priv->adapter->surprise_removed)
563 priv->adapter->if_ops.clean_pcie_ring(priv->adapter); 564 priv->adapter->if_ops.clean_pcie_ring(priv->adapter);
564 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); 565 spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
565} 566}