rtlwifi: rtl_pci: Add fill_tx_special_desc to issue H2C data, and process TXOK in...
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 1 Nov 2017 15:29:20 +0000 (10:29 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 8 Nov 2017 12:30:17 +0000 (14:30 +0200)
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: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry 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: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/pci.h
drivers/net/wireless/realtek/rtlwifi/wifi.h

index e8c8ce601229868f7d82a2549156b73569dfe69d..0c30f4bf657b39ee16cfcdb0ddb562ed280cf61a 100644 (file)
@@ -926,6 +926,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
        unsigned long flags;
        u32 inta = 0;
        u32 intb = 0;
+       u32 intd = 0;
        irqreturn_t ret = IRQ_HANDLED;
 
        if (rtlpci->irq_enabled == 0)
@@ -1007,6 +1008,16 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
                _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 (inta & rtlpriv->cfg->maps[RTL_IMR_COMDOK]) {
                        rtlpriv->link_info.num_tx_inperiod++;
index 0f1a0f8585b67eeb14da74bf6fbd9e0f66967e67..6bf346ec46163b6218234f3fe798f27a45fe89bf 100644 (file)
@@ -51,6 +51,7 @@
 #define MGNT_QUEUE                             6
 #define HIGH_QUEUE                             7
 #define HCCA_QUEUE                             8
+#define H2C_QUEUE                              TXCMD_QUEUE     /* In 8822B */
 
 #define RTL_PCI_DEVICE(vend, dev, cfg)  \
        .vendor = (vend), \
index 22afc14c3da695cb7073f10e04121b04ec95b743..f6b00505a69f02f89ae1201a16cac07f9bce381d 100644 (file)
@@ -709,6 +709,7 @@ enum rtl_var_map {
        RTL_IMR_RXFOVW,         /*Receive FIFO Overflow */
        RTL_IMR_RDU,            /*Receive Descriptor Unavailable */
        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_HIGHDOK,        /*High Queue DMA OK Interrupt */
        RTL_IMR_COMDOK,         /*Command Queue DMA OK Interrupt*/
@@ -2144,6 +2145,9 @@ struct rtl_hal_ops {
        void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc,
                                 bool firstseg, bool lastseg,
                                 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,
                               struct rtl_stats *stats,
                               struct ieee80211_rx_status *rx_status,