Commit d3ccc14d authored by Allen Pais's avatar Allen Pais Committed by Kalle Valo

rtlwifi/rtw88: convert tasklets to use new tasklet_setup() API

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
and remove .data field.
Signed-off-by: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAllen Pais <allen.lkml@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200817090637.26887-16-allen.cryptic@gmail.com
parent a0d6ea9b
...@@ -1061,16 +1061,18 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1061,16 +1061,18 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
return ret; return ret;
} }
static void _rtl_pci_irq_tasklet(unsigned long data) static void _rtl_pci_irq_tasklet(struct tasklet_struct *t)
{ {
struct ieee80211_hw *hw = (struct ieee80211_hw *)data; struct rtl_priv *rtlpriv = from_tasklet(rtlpriv, t, works.irq_tasklet);
struct ieee80211_hw *hw = rtlpriv->hw;
_rtl_pci_tx_chk_waitq(hw); _rtl_pci_tx_chk_waitq(hw);
} }
static void _rtl_pci_prepare_bcn_tasklet(unsigned long data) static void _rtl_pci_prepare_bcn_tasklet(struct tasklet_struct *t)
{ {
struct ieee80211_hw *hw = (struct ieee80211_hw *)data; struct rtl_priv *rtlpriv = from_tasklet(rtlpriv, t,
struct rtl_priv *rtlpriv = rtl_priv(hw); works.irq_prepare_bcn_tasklet);
struct ieee80211_hw *hw = rtlpriv->hw;
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl8192_tx_ring *ring = NULL; struct rtl8192_tx_ring *ring = NULL;
...@@ -1194,12 +1196,9 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw, ...@@ -1194,12 +1196,9 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,
rtlpci->acm_method = EACMWAY2_SW; rtlpci->acm_method = EACMWAY2_SW;
/*task */ /*task */
tasklet_init(&rtlpriv->works.irq_tasklet, tasklet_setup(&rtlpriv->works.irq_tasklet, _rtl_pci_irq_tasklet);
_rtl_pci_irq_tasklet, tasklet_setup(&rtlpriv->works.irq_prepare_bcn_tasklet,
(unsigned long)hw); _rtl_pci_prepare_bcn_tasklet);
tasklet_init(&rtlpriv->works.irq_prepare_bcn_tasklet,
_rtl_pci_prepare_bcn_tasklet,
(unsigned long)hw);
INIT_WORK(&rtlpriv->works.lps_change_work, INIT_WORK(&rtlpriv->works.lps_change_work,
rtl_lps_change_work_callback); rtl_lps_change_work_callback);
} }
......
...@@ -289,7 +289,7 @@ static int _rtl_usb_init_tx(struct ieee80211_hw *hw) ...@@ -289,7 +289,7 @@ static int _rtl_usb_init_tx(struct ieee80211_hw *hw)
return 0; return 0;
} }
static void _rtl_rx_work(unsigned long param); static void _rtl_rx_work(struct tasklet_struct *t);
static int _rtl_usb_init_rx(struct ieee80211_hw *hw) static int _rtl_usb_init_rx(struct ieee80211_hw *hw)
{ {
...@@ -310,8 +310,7 @@ static int _rtl_usb_init_rx(struct ieee80211_hw *hw) ...@@ -310,8 +310,7 @@ static int _rtl_usb_init_rx(struct ieee80211_hw *hw)
init_usb_anchor(&rtlusb->rx_cleanup_urbs); init_usb_anchor(&rtlusb->rx_cleanup_urbs);
skb_queue_head_init(&rtlusb->rx_queue); skb_queue_head_init(&rtlusb->rx_queue);
rtlusb->rx_work_tasklet.func = _rtl_rx_work; rtlusb->rx_work_tasklet.func = (void(*)(unsigned long))_rtl_rx_work;
rtlusb->rx_work_tasklet.data = (unsigned long)rtlusb;
return 0; return 0;
} }
...@@ -528,9 +527,9 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -528,9 +527,9 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb)
#define __RX_SKB_MAX_QUEUED 64 #define __RX_SKB_MAX_QUEUED 64
static void _rtl_rx_work(unsigned long param) static void _rtl_rx_work(struct tasklet_struct *t)
{ {
struct rtl_usb *rtlusb = (struct rtl_usb *)param; struct rtl_usb *rtlusb = from_tasklet(rtlusb, t, rx_work_tasklet);
struct ieee80211_hw *hw = usb_get_intfdata(rtlusb->intf); struct ieee80211_hw *hw = usb_get_intfdata(rtlusb->intf);
struct sk_buff *skb; struct sk_buff *skb;
......
...@@ -1422,8 +1422,7 @@ int rtw_core_init(struct rtw_dev *rtwdev) ...@@ -1422,8 +1422,7 @@ int rtw_core_init(struct rtw_dev *rtwdev)
timer_setup(&rtwdev->tx_report.purge_timer, timer_setup(&rtwdev->tx_report.purge_timer,
rtw_tx_report_purge_timer, 0); rtw_tx_report_purge_timer, 0);
tasklet_init(&rtwdev->tx_tasklet, rtw_tx_tasklet, tasklet_setup(&rtwdev->tx_tasklet, rtw_tx_tasklet);
(unsigned long)rtwdev);
INIT_DELAYED_WORK(&rtwdev->watch_dog_work, rtw_watch_dog_work); INIT_DELAYED_WORK(&rtwdev->watch_dog_work, rtw_watch_dog_work);
INIT_DELAYED_WORK(&coex->bt_relink_work, rtw_coex_bt_relink_work); INIT_DELAYED_WORK(&coex->bt_relink_work, rtw_coex_bt_relink_work);
......
...@@ -587,9 +587,9 @@ static void rtw_txq_push(struct rtw_dev *rtwdev, ...@@ -587,9 +587,9 @@ static void rtw_txq_push(struct rtw_dev *rtwdev,
rcu_read_unlock(); rcu_read_unlock();
} }
void rtw_tx_tasklet(unsigned long data) void rtw_tx_tasklet(struct tasklet_struct *t)
{ {
struct rtw_dev *rtwdev = (void *)data; struct rtw_dev *rtwdev = from_tasklet(rtwdev, t, tx_tasklet);
struct rtw_txq *rtwtxq, *tmp; struct rtw_txq *rtwtxq, *tmp;
spin_lock_bh(&rtwdev->txq_lock); spin_lock_bh(&rtwdev->txq_lock);
......
...@@ -94,7 +94,7 @@ void rtw_tx(struct rtw_dev *rtwdev, ...@@ -94,7 +94,7 @@ void rtw_tx(struct rtw_dev *rtwdev,
struct sk_buff *skb); struct sk_buff *skb);
void rtw_txq_init(struct rtw_dev *rtwdev, struct ieee80211_txq *txq); void rtw_txq_init(struct rtw_dev *rtwdev, struct ieee80211_txq *txq);
void rtw_txq_cleanup(struct rtw_dev *rtwdev, struct ieee80211_txq *txq); void rtw_txq_cleanup(struct rtw_dev *rtwdev, struct ieee80211_txq *txq);
void rtw_tx_tasklet(unsigned long data); void rtw_tx_tasklet(struct tasklet_struct *t);
void rtw_tx_pkt_info_update(struct rtw_dev *rtwdev, void rtw_tx_pkt_info_update(struct rtw_dev *rtwdev,
struct rtw_tx_pkt_info *pkt_info, struct rtw_tx_pkt_info *pkt_info,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment