diff options
author | Zong-Zhe Yang <kevin_yang@realtek.com> | 2021-03-19 08:42:12 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2021-04-11 12:24:31 +0300 |
commit | 7b33ec8b93c9fa401a8fcd92ebde3129a1beb844 (patch) | |
tree | 0abcb9caa7e9fb7f4a0c3904e51e2ab90d2ffd58 /drivers/net/wireless/realtek/rtw88/hci.h | |
parent | 13ce240a932fe9c809ec6e79ffc5a4d4ecf534ee (diff) | |
download | linux-7b33ec8b93c9fa401a8fcd92ebde3129a1beb844.tar.xz |
rtw88: add flush hci support
Though mac queue flushing has been supported, sometimes data may be waiting
on interface from host to chip. If it occurs, there may still be data that
flows into mac just after we do flush. To avoid that, we add the hci part
of flushing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210319054218.3319-2-pkshih@realtek.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/hci.h')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/hci.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/hci.h b/drivers/net/wireless/realtek/rtw88/hci.h index 2cba327e6218..4c6fc6fb3f83 100644 --- a/drivers/net/wireless/realtek/rtw88/hci.h +++ b/drivers/net/wireless/realtek/rtw88/hci.h @@ -11,6 +11,7 @@ struct rtw_hci_ops { struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb); void (*tx_kick_off)(struct rtw_dev *rtwdev); + void (*flush_queues)(struct rtw_dev *rtwdev, u32 queues, bool drop); int (*setup)(struct rtw_dev *rtwdev); int (*start)(struct rtw_dev *rtwdev); void (*stop)(struct rtw_dev *rtwdev); @@ -258,4 +259,19 @@ static inline enum rtw_hci_type rtw_hci_type(struct rtw_dev *rtwdev) return rtwdev->hci.type; } +static inline void rtw_hci_flush_queues(struct rtw_dev *rtwdev, u32 queues, + bool drop) +{ + if (rtwdev->hci.ops->flush_queues) + rtwdev->hci.ops->flush_queues(rtwdev, queues, drop); +} + +static inline void rtw_hci_flush_all_queues(struct rtw_dev *rtwdev, bool drop) +{ + if (rtwdev->hci.ops->flush_queues) + rtwdev->hci.ops->flush_queues(rtwdev, + BIT(rtwdev->hw->queues) - 1, + drop); +} + #endif |