hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/ath/ath9k/main.c
....@@ -19,6 +19,9 @@
1919 #include "ath9k.h"
2020 #include "btcoex.h"
2121
22
+static void ath9k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
23
+ u32 queues, bool drop);
24
+
2225 u8 ath9k_parse_mpdudensity(u8 mpdudensity)
2326 {
2427 /*
....@@ -200,7 +203,7 @@
200203 void ath_restart_work(struct ath_softc *sc)
201204 {
202205 ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work,
203
- ATH_HW_CHECK_POLL_INT);
206
+ msecs_to_jiffies(ATH_HW_CHECK_POLL_INT));
204207
205208 if (AR_SREV_9340(sc->sc_ah) || AR_SREV_9330(sc->sc_ah))
206209 ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work,
....@@ -373,9 +376,9 @@
373376 ath_dynack_node_deinit(sc->sc_ah, an);
374377 }
375378
376
-void ath9k_tasklet(unsigned long data)
379
+void ath9k_tasklet(struct tasklet_struct *t)
377380 {
378
- struct ath_softc *sc = (struct ath_softc *)data;
381
+ struct ath_softc *sc = from_tasklet(sc, t, intr_tq);
379382 struct ath_hw *ah = sc->sc_ah;
380383 struct ath_common *common = ath9k_hw_common(ah);
381384 enum ath_reset_type type;
....@@ -816,7 +819,7 @@
816819
817820 if (ath_tx_start(hw, skb, &txctl) != 0) {
818821 ath_dbg(common, XMIT, "TX failed\n");
819
- TX_STAT_INC(txctl.txq->axq_qnum, txfailed);
822
+ TX_STAT_INC(sc, txctl.txq->axq_qnum, txfailed);
820823 goto exit;
821824 }
822825
....@@ -836,7 +839,7 @@
836839 continue;
837840
838841 txinfo = IEEE80211_SKB_CB(bf->bf_mpdu);
839
- fi = (struct ath_frame_info *)&txinfo->rate_driver_data[0];
842
+ fi = (struct ath_frame_info *)&txinfo->status.status_driver_data[0];
840843 if (fi->keyix == keyix)
841844 return true;
842845 }
....@@ -847,7 +850,7 @@
847850 static bool ath9k_txq_has_key(struct ath_softc *sc, u32 keyix)
848851 {
849852 struct ath_hw *ah = sc->sc_ah;
850
- int i;
853
+ int i, j;
851854 struct ath_txq *txq;
852855 bool key_in_use = false;
853856
....@@ -865,8 +868,9 @@
865868 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
866869 int idx = txq->txq_tailidx;
867870
868
- while (!key_in_use &&
869
- !list_empty(&txq->txq_fifo[idx])) {
871
+ for (j = 0; !key_in_use &&
872
+ !list_empty(&txq->txq_fifo[idx]) &&
873
+ j < ATH_TXFIFO_DEPTH; j++) {
870874 key_in_use = ath9k_txq_list_has_key(
871875 &txq->txq_fifo[idx], keyix);
872876 INCR(idx, ATH_TXFIFO_DEPTH);
....@@ -1279,6 +1283,9 @@
12791283 {
12801284 int *power = data;
12811285
1286
+ if (vif->bss_conf.txpower == INT_MIN)
1287
+ return;
1288
+
12821289 if (*power < vif->bss_conf.txpower)
12831290 *power = vif->bss_conf.txpower;
12841291 }
....@@ -1556,6 +1563,7 @@
15561563 FIF_OTHER_BSS | \
15571564 FIF_BCN_PRBRESP_PROMISC | \
15581565 FIF_PROBE_REQ | \
1566
+ FIF_MCAST_ACTION | \
15591567 FIF_FCSFAIL)
15601568
15611569 /* FIXME: sc->sc_full_reset ? */
....@@ -1777,6 +1785,15 @@
17771785 * frames is a acceptable to allow RSN IBSS to be used.
17781786 */
17791787 return -EOPNOTSUPP;
1788
+ }
1789
+
1790
+ /* There may be MPDUs queued for the outgoing PTK key. Flush queues to
1791
+ * make sure these are not send unencrypted or with a wrong (new) key
1792
+ */
1793
+ if (cmd == DISABLE_KEY && key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
1794
+ ieee80211_stop_queues(hw);
1795
+ ath9k_flush(hw, vif, 0, true);
1796
+ ieee80211_wake_queues(hw);
17801797 }
17811798
17821799 mutex_lock(&sc->mutex);
....@@ -2020,13 +2037,13 @@
20202037 ath9k_ps_wakeup(sc);
20212038 ret = ath_tx_aggr_start(sc, sta, tid, ssn);
20222039 if (!ret)
2023
- ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
2040
+ ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
20242041 ath9k_ps_restore(sc);
20252042 break;
20262043 case IEEE80211_AMPDU_TX_STOP_FLUSH:
20272044 case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
20282045 flush = true;
2029
- /* fall through */
2046
+ fallthrough;
20302047 case IEEE80211_AMPDU_TX_STOP_CONT:
20312048 ath9k_ps_wakeup(sc);
20322049 ath_tx_aggr_stop(sc, sta, tid);
....@@ -2227,7 +2244,7 @@
22272244 }
22282245
22292246 ieee80211_queue_delayed_work(hw, &sc->hw_check_work,
2230
- ATH_HW_CHECK_POLL_INT);
2247
+ msecs_to_jiffies(ATH_HW_CHECK_POLL_INT));
22312248 }
22322249
22332250 static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw)
....@@ -2491,7 +2508,8 @@
24912508 return ret;
24922509 }
24932510
2494
-static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw)
2511
+static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw,
2512
+ struct ieee80211_vif *vif)
24952513 {
24962514 struct ath_softc *sc = hw->priv;
24972515 struct ath_common *common = ath9k_hw_common(sc->sc_ah);