hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
....@@ -570,16 +570,16 @@
570570 spin_unlock_bh(&priv->tx.tx_lock);
571571 }
572572
573
-void ath9k_tx_failed_tasklet(unsigned long data)
573
+void ath9k_tx_failed_tasklet(struct tasklet_struct *t)
574574 {
575
- struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
575
+ struct ath9k_htc_priv *priv = from_tasklet(priv, t, tx_failed_tasklet);
576576
577
- spin_lock_bh(&priv->tx.tx_lock);
577
+ spin_lock(&priv->tx.tx_lock);
578578 if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) {
579
- spin_unlock_bh(&priv->tx.tx_lock);
579
+ spin_unlock(&priv->tx.tx_lock);
580580 return;
581581 }
582
- spin_unlock_bh(&priv->tx.tx_lock);
582
+ spin_unlock(&priv->tx.tx_lock);
583583
584584 ath9k_htc_tx_drainq(priv, &priv->tx.tx_failed);
585585 }
....@@ -808,6 +808,11 @@
808808 skb_queue_head_init(&priv->tx.data_vi_queue);
809809 skb_queue_head_init(&priv->tx.data_vo_queue);
810810 skb_queue_head_init(&priv->tx.tx_failed);
811
+
812
+ /* Allow ath9k_wmi_event_tasklet(WMI_TXSTATUS_EVENTID) to operate. */
813
+ smp_wmb();
814
+ priv->tx.initialized = true;
815
+
811816 return 0;
812817 }
813818
....@@ -893,7 +898,8 @@
893898 if (priv->rxfilter & FIF_PSPOLL)
894899 rfilt |= ATH9K_RX_FILTER_PSPOLL;
895900
896
- if (priv->nvifs > 1 || priv->rxfilter & FIF_OTHER_BSS)
901
+ if (priv->nvifs > 1 ||
902
+ priv->rxfilter & (FIF_OTHER_BSS | FIF_MCAST_ACTION))
897903 rfilt |= ATH9K_RX_FILTER_MCAST_BCAST_ALL;
898904
899905 return rfilt;
....@@ -1005,6 +1011,14 @@
10051011 goto rx_next;
10061012 }
10071013
1014
+ if (rxstatus->rs_keyix >= ATH_KEYMAX &&
1015
+ rxstatus->rs_keyix != ATH9K_RXKEYIX_INVALID) {
1016
+ ath_dbg(common, ANY,
1017
+ "Invalid keyix, dropping (keyix: %d)\n",
1018
+ rxstatus->rs_keyix);
1019
+ goto rx_next;
1020
+ }
1021
+
10081022 /* Get the RX status information */
10091023
10101024 memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
....@@ -1061,9 +1075,9 @@
10611075 /*
10621076 * FIXME: Handle FLUSH later on.
10631077 */
1064
-void ath9k_rx_tasklet(unsigned long data)
1078
+void ath9k_rx_tasklet(struct tasklet_struct *t)
10651079 {
1066
- struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
1080
+ struct ath9k_htc_priv *priv = from_tasklet(priv, t, rx_tasklet);
10671081 struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
10681082 struct ieee80211_rx_status rx_status;
10691083 struct sk_buff *skb;
....@@ -1124,6 +1138,10 @@
11241138 struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
11251139 unsigned long flags;
11261140
1141
+ /* Check if ath9k_rx_init() completed. */
1142
+ if (!data_race(priv->rx.initialized))
1143
+ goto err;
1144
+
11271145 spin_lock_irqsave(&priv->rx.rxbuflock, flags);
11281146 list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
11291147 if (!tmp_buf->in_process) {
....@@ -1179,6 +1197,10 @@
11791197 list_add_tail(&rxbuf->list, &priv->rx.rxbuf);
11801198 }
11811199
1200
+ /* Allow ath9k_htc_rxep() to operate. */
1201
+ smp_wmb();
1202
+ priv->rx.initialized = true;
1203
+
11821204 return 0;
11831205
11841206 err: