forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/wireless/ath/ath9k/htc.h
....@@ -281,6 +281,7 @@
281281 struct ath9k_htc_rx {
282282 struct list_head rxbuf;
283283 spinlock_t rxbuflock;
284
+ bool initialized;
284285 };
285286
286287 #define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */
....@@ -305,6 +306,7 @@
305306 DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM);
306307 struct timer_list cleanup_timer;
307308 spinlock_t tx_lock;
309
+ bool initialized;
308310 };
309311
310312 struct ath9k_htc_tx_ctl {
....@@ -325,14 +327,18 @@
325327 }
326328
327329 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
330
+#define __STAT_SAFE(hif_dev, expr) do { ((hif_dev)->htc_handle->drv_priv ? (expr) : 0); } while (0)
331
+#define CAB_STAT_INC(priv) do { ((priv)->debug.tx_stats.cab_queued++); } while (0)
332
+#define TX_QSTAT_INC(priv, q) do { ((priv)->debug.tx_stats.queue_stats[q]++); } while (0)
328333
329
-#define TX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c++)
330
-#define TX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c += a)
331
-#define RX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.skbrx_stats.c++)
332
-#define RX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.skbrx_stats.c += a)
333
-#define CAB_STAT_INC priv->debug.tx_stats.cab_queued++
334
-
335
-#define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)
334
+#define TX_STAT_INC(hif_dev, c) \
335
+ __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c++)
336
+#define TX_STAT_ADD(hif_dev, c, a) \
337
+ __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c += a)
338
+#define RX_STAT_INC(hif_dev, c) \
339
+ __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.skbrx_stats.c++)
340
+#define RX_STAT_ADD(hif_dev, c, a) \
341
+ __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.skbrx_stats.c += a)
336342
337343 void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
338344 struct ath_rx_status *rs);
....@@ -372,13 +378,13 @@
372378 struct ethtool_stats *stats, u64 *data);
373379 #else
374380
375
-#define TX_STAT_INC(c) do { } while (0)
376
-#define TX_STAT_ADD(c, a) do { } while (0)
377
-#define RX_STAT_INC(c) do { } while (0)
378
-#define RX_STAT_ADD(c, a) do { } while (0)
379
-#define CAB_STAT_INC do { } while (0)
381
+#define TX_STAT_INC(hif_dev, c) do { } while (0)
382
+#define TX_STAT_ADD(hif_dev, c, a) do { } while (0)
383
+#define RX_STAT_INC(hif_dev, c) do { } while (0)
384
+#define RX_STAT_ADD(hif_dev, c, a) do { } while (0)
380385
381
-#define TX_QSTAT_INC(c) do { } while (0)
386
+#define CAB_STAT_INC(priv)
387
+#define TX_QSTAT_INC(priv, c)
382388
383389 static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
384390 struct ath_rx_status *rs)
....@@ -583,14 +589,14 @@
583589 void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
584590 void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
585591 void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
586
-void ath9k_tx_failed_tasklet(unsigned long data);
592
+void ath9k_tx_failed_tasklet(struct tasklet_struct *t);
587593 void ath9k_htc_tx_cleanup_timer(struct timer_list *t);
588594 bool ath9k_htc_csa_is_finished(struct ath9k_htc_priv *priv);
589595
590596 int ath9k_rx_init(struct ath9k_htc_priv *priv);
591597 void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
592598 void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
593
-void ath9k_rx_tasklet(unsigned long data);
599
+void ath9k_rx_tasklet(struct tasklet_struct *t);
594600 u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
595601
596602 void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);