forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
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 /*
....@@ -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 }
....@@ -1279,6 +1282,9 @@
12791282 {
12801283 int *power = data;
12811284
1285
+ if (vif->bss_conf.txpower == INT_MIN)
1286
+ return;
1287
+
12821288 if (*power < vif->bss_conf.txpower)
12831289 *power = vif->bss_conf.txpower;
12841290 }
....@@ -1556,6 +1562,7 @@
15561562 FIF_OTHER_BSS | \
15571563 FIF_BCN_PRBRESP_PROMISC | \
15581564 FIF_PROBE_REQ | \
1565
+ FIF_MCAST_ACTION | \
15591566 FIF_FCSFAIL)
15601567
15611568 /* FIXME: sc->sc_full_reset ? */
....@@ -1777,6 +1784,15 @@
17771784 * frames is a acceptable to allow RSN IBSS to be used.
17781785 */
17791786 return -EOPNOTSUPP;
1787
+ }
1788
+
1789
+ /* There may be MPDUs queued for the outgoing PTK key. Flush queues to
1790
+ * make sure these are not send unencrypted or with a wrong (new) key
1791
+ */
1792
+ if (cmd == DISABLE_KEY && key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
1793
+ ieee80211_stop_queues(hw);
1794
+ ath9k_flush(hw, vif, 0, true);
1795
+ ieee80211_wake_queues(hw);
17801796 }
17811797
17821798 mutex_lock(&sc->mutex);
....@@ -2020,13 +2036,13 @@
20202036 ath9k_ps_wakeup(sc);
20212037 ret = ath_tx_aggr_start(sc, sta, tid, ssn);
20222038 if (!ret)
2023
- ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
2039
+ ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
20242040 ath9k_ps_restore(sc);
20252041 break;
20262042 case IEEE80211_AMPDU_TX_STOP_FLUSH:
20272043 case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
20282044 flush = true;
2029
- /* fall through */
2045
+ fallthrough;
20302046 case IEEE80211_AMPDU_TX_STOP_CONT:
20312047 ath9k_ps_wakeup(sc);
20322048 ath_tx_aggr_stop(sc, sta, tid);
....@@ -2491,7 +2507,8 @@
24912507 return ret;
24922508 }
24932509
2494
-static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw)
2510
+static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw,
2511
+ struct ieee80211_vif *vif)
24952512 {
24962513 struct ath_softc *sc = hw->priv;
24972514 struct ath_common *common = ath9k_hw_common(sc->sc_ah);