ath9k: convert tasklets to use new tasklet_setup() API
authorAllen Pais <allen.lkml@gmail.com>
Mon, 17 Aug 2020 09:06:23 +0000 (14:36 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Aug 2020 10:16:18 +0000 (13:16 +0300)
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200817090637.26887-3-allen.cryptic@gmail.com
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/wmi.c
drivers/net/wireless/ath/ath9k/wmi.h

index a412b352182c8fb0d8a6b4d86b83daf9a2f54a51..e06b74a54a6979faf76f3649793f64b1ec334651 100644 (file)
@@ -713,7 +713,7 @@ struct ath_beacon {
        bool tx_last;
 };
 
-void ath9k_beacon_tasklet(unsigned long data);
+void ath9k_beacon_tasklet(struct tasklet_struct *t);
 void ath9k_beacon_config(struct ath_softc *sc, struct ieee80211_vif *main_vif,
                         bool beacons);
 void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif);
@@ -1117,7 +1117,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
        common->bus_ops->read_cachesize(common, csz);
 }
 
-void ath9k_tasklet(unsigned long data);
+void ath9k_tasklet(struct tasklet_struct *t);
 int ath_cabq_update(struct ath_softc *);
 u8 ath9k_parse_mpdudensity(u8 mpdudensity);
 irqreturn_t ath_isr(int irq, void *dev);
index e36f947e19fcecf41def79933a895bf801c74724..4876bff2dc2c67b570411d2e9c834c19e85c8041 100644 (file)
@@ -385,9 +385,9 @@ void ath9k_csa_update(struct ath_softc *sc)
                                                   ath9k_csa_update_vif, sc);
 }
 
-void ath9k_beacon_tasklet(unsigned long data)
+void ath9k_beacon_tasklet(struct tasklet_struct *t)
 {
-       struct ath_softc *sc = (struct ath_softc *)data;
+       struct ath_softc *sc = from_tasklet(sc, t, bcon_tasklet);
        struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(ah);
        struct ath_buf *bf = NULL;
index 9f64e32381f9451cc2cb2949c03a697172758685..0a1634238e67314b963fecc916abbd304986e734 100644 (file)
@@ -583,14 +583,14 @@ int ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv);
 void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
 void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
 void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
-void ath9k_tx_failed_tasklet(unsigned long data);
+void ath9k_tx_failed_tasklet(struct tasklet_struct *t);
 void ath9k_htc_tx_cleanup_timer(struct timer_list *t);
 bool ath9k_htc_csa_is_finished(struct ath9k_htc_priv *priv);
 
 int ath9k_rx_init(struct ath9k_htc_priv *priv);
 void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
 void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
-void ath9k_rx_tasklet(unsigned long data);
+void ath9k_rx_tasklet(struct tasklet_struct *t);
 u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
 
 void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);
index ac79dfd5be7ab2b0a79eb747a2a94ff2b8077bcf..db0c6fa9c9dc40dcdb728b82323b8a9393775d04 100644 (file)
@@ -645,10 +645,8 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
        spin_lock_init(&priv->tx.tx_lock);
        mutex_init(&priv->mutex);
        mutex_init(&priv->htc_pm_lock);
-       tasklet_init(&priv->rx_tasklet, ath9k_rx_tasklet,
-                    (unsigned long)priv);
-       tasklet_init(&priv->tx_failed_tasklet, ath9k_tx_failed_tasklet,
-                    (unsigned long)priv);
+       tasklet_setup(&priv->rx_tasklet, ath9k_rx_tasklet);
+       tasklet_setup(&priv->tx_failed_tasklet, ath9k_tx_failed_tasklet);
        INIT_DELAYED_WORK(&priv->ani_work, ath9k_htc_ani_work);
        INIT_WORK(&priv->ps_work, ath9k_ps_work);
        INIT_WORK(&priv->fatal_work, ath9k_fatal_work);
index f4c2a8d83f50dbef7a4ef67a43582ce2915cf1d1..0bdc4dcb7b8fee33dadcf97bab27fd66600eefed 100644 (file)
@@ -570,9 +570,9 @@ void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv)
        spin_unlock_bh(&priv->tx.tx_lock);
 }
 
-void ath9k_tx_failed_tasklet(unsigned long data)
+void ath9k_tx_failed_tasklet(struct tasklet_struct *t)
 {
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
+       struct ath9k_htc_priv *priv = from_tasklet(priv, t, tx_failed_tasklet);
 
        spin_lock(&priv->tx.tx_lock);
        if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) {
@@ -1062,9 +1062,9 @@ rx_next:
 /*
  * FIXME: Handle FLUSH later on.
  */
-void ath9k_rx_tasklet(unsigned long data)
+void ath9k_rx_tasklet(struct tasklet_struct *t)
 {
-       struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
+       struct ath9k_htc_priv *priv = from_tasklet(priv, t, rx_tasklet);
        struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
        struct ieee80211_rx_status rx_status;
        struct sk_buff *skb;
index 9af9fa71c1c2d73e6bd38612915d7aa460da6d0d..690fe3a1b516ec040b4991c4b354d8f3d5853274 100644 (file)
@@ -728,9 +728,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
        spin_lock_init(&sc->sc_pm_lock);
        spin_lock_init(&sc->chan_lock);
        mutex_init(&sc->mutex);
-       tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
-       tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
-                    (unsigned long)sc);
+       tasklet_setup(&sc->intr_tq, ath9k_tasklet);
+       tasklet_setup(&sc->bcon_tasklet, ath9k_beacon_tasklet);
 
        timer_setup(&sc->sleep_timer, ath_ps_full_sleep, 0);
        INIT_WORK(&sc->hw_reset_work, ath_reset_work);
index 411eece01bb1aade1e84f7dbb1e9984bb01e3b55..8dbf68b94228c8a96661bd0ec6129089cca8070a 100644 (file)
@@ -371,9 +371,9 @@ static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta)
        ath_dynack_node_deinit(sc->sc_ah, an);
 }
 
-void ath9k_tasklet(unsigned long data)
+void ath9k_tasklet(struct tasklet_struct *t)
 {
-       struct ath_softc *sc = (struct ath_softc *)data;
+       struct ath_softc *sc = from_tasklet(sc, t, intr_tq);
        struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(ah);
        enum ath_reset_type type;
index 9cf5ae3f7298be96fed8c85a8b9603824822302c..fe29ad4b9023cd68f8fcda77aa5a3311b2180d06 100644 (file)
@@ -106,8 +106,7 @@ struct wmi *ath9k_init_wmi(struct ath9k_htc_priv *priv)
        mutex_init(&wmi->multi_rmw_mutex);
        init_completion(&wmi->cmd_wait);
        INIT_LIST_HEAD(&wmi->pending_tx_events);
-       tasklet_init(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet,
-                    (unsigned long)wmi);
+       tasklet_setup(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet);
 
        return wmi;
 }
@@ -136,9 +135,9 @@ void ath9k_wmi_event_drain(struct ath9k_htc_priv *priv)
        spin_unlock_irqrestore(&priv->wmi->wmi_lock, flags);
 }
 
-void ath9k_wmi_event_tasklet(unsigned long data)
+void ath9k_wmi_event_tasklet(struct tasklet_struct *t)
 {
-       struct wmi *wmi = (struct wmi *)data;
+       struct wmi *wmi = from_tasklet(wmi, t, wmi_event_tasklet);
        struct ath9k_htc_priv *priv = wmi->drv_priv;
        struct wmi_cmd_hdr *hdr;
        void *wmi_event;
index 9386b3a9d30370ef23ee3072401c615fd16041d9..5c3b710b8f3190ba6bcc362683c243610aaa5123 100644 (file)
@@ -185,7 +185,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
                  u8 *cmd_buf, u32 cmd_len,
                  u8 *rsp_buf, u32 rsp_len,
                  u32 timeout);
-void ath9k_wmi_event_tasklet(unsigned long data);
+void ath9k_wmi_event_tasklet(struct tasklet_struct *t);
 void ath9k_fatal_work(struct work_struct *work);
 void ath9k_wmi_event_drain(struct ath9k_htc_priv *priv);
 void ath9k_stop_wmi(struct ath9k_htc_priv *priv);