Commit 89d3e8ab authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtlwifi: rtl_pci: Add fill_tx_special_desc to issue H2C data, and process TXOK in interrupt.

With the RTL8822BE, an H2C tx queue is added to download FW and special
data. This change implements the support code in rtl_pci.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 57869e4b
...@@ -926,6 +926,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -926,6 +926,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
unsigned long flags; unsigned long flags;
u32 inta = 0; u32 inta = 0;
u32 intb = 0; u32 intb = 0;
u32 intd = 0;
irqreturn_t ret = IRQ_HANDLED; irqreturn_t ret = IRQ_HANDLED;
if (rtlpci->irq_enabled == 0) if (rtlpci->irq_enabled == 0)
...@@ -1007,6 +1008,16 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id) ...@@ -1007,6 +1008,16 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
_rtl_pci_tx_isr(hw, VO_QUEUE); _rtl_pci_tx_isr(hw, VO_QUEUE);
} }
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8822BE) {
if (intd & rtlpriv->cfg->maps[RTL_IMR_H2CDOK]) {
rtlpriv->link_info.num_tx_inperiod++;
RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
"H2C TX OK interrupt!\n");
_rtl_pci_tx_isr(hw, H2C_QUEUE);
}
}
if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) { if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) {
if (inta & rtlpriv->cfg->maps[RTL_IMR_COMDOK]) { if (inta & rtlpriv->cfg->maps[RTL_IMR_COMDOK]) {
rtlpriv->link_info.num_tx_inperiod++; rtlpriv->link_info.num_tx_inperiod++;
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#define MGNT_QUEUE 6 #define MGNT_QUEUE 6
#define HIGH_QUEUE 7 #define HIGH_QUEUE 7
#define HCCA_QUEUE 8 #define HCCA_QUEUE 8
#define H2C_QUEUE TXCMD_QUEUE /* In 8822B */
#define RTL_PCI_DEVICE(vend, dev, cfg) \ #define RTL_PCI_DEVICE(vend, dev, cfg) \
.vendor = (vend), \ .vendor = (vend), \
......
...@@ -709,6 +709,7 @@ enum rtl_var_map { ...@@ -709,6 +709,7 @@ enum rtl_var_map {
RTL_IMR_RXFOVW, /*Receive FIFO Overflow */ RTL_IMR_RXFOVW, /*Receive FIFO Overflow */
RTL_IMR_RDU, /*Receive Descriptor Unavailable */ RTL_IMR_RDU, /*Receive Descriptor Unavailable */
RTL_IMR_ATIMEND, /*For 92C,ATIM Window End Interrupt */ RTL_IMR_ATIMEND, /*For 92C,ATIM Window End Interrupt */
RTL_IMR_H2CDOK, /*H2C Queue DMA OK Interrupt */
RTL_IMR_BDOK, /*Beacon Queue DMA OK Interrup */ RTL_IMR_BDOK, /*Beacon Queue DMA OK Interrup */
RTL_IMR_HIGHDOK, /*High Queue DMA OK Interrupt */ RTL_IMR_HIGHDOK, /*High Queue DMA OK Interrupt */
RTL_IMR_COMDOK, /*Command Queue DMA OK Interrupt*/ RTL_IMR_COMDOK, /*Command Queue DMA OK Interrupt*/
...@@ -2144,6 +2145,9 @@ struct rtl_hal_ops { ...@@ -2144,6 +2145,9 @@ struct rtl_hal_ops {
void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc,
bool firstseg, bool lastseg, bool firstseg, bool lastseg,
struct sk_buff *skb); struct sk_buff *skb);
void (*fill_tx_special_desc)(struct ieee80211_hw *hw,
u8 *pdesc, u8 *pbd_desc,
struct sk_buff *skb, u8 hw_queue);
bool (*query_rx_desc) (struct ieee80211_hw *hw, bool (*query_rx_desc) (struct ieee80211_hw *hw,
struct rtl_stats *stats, struct rtl_stats *stats,
struct ieee80211_rx_status *rx_status, struct ieee80211_rx_status *rx_status,
......
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