rtl8xxxu: Setup RX aggregation
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 29 Feb 2016 22:05:08 +0000 (17:05 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 10 Mar 2016 13:29:10 +0000 (15:29 +0200)
This initializes RX DMA aggregation on 8723bu. We should do this for
all parts eventually, and also init TX aggregation.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h

index ad6371985402cfdf05f83192a44afef6b7934fcb..04dad19402e50b6b90031bd7df06f132957899b1 100644 (file)
@@ -5962,6 +5962,25 @@ static void rtl8723bu_init_bt(struct rtl8xxxu_priv *priv)
        rtl8723a_h2c_cmd(priv, &h2c, sizeof(h2c.ignore_wlan));
 }
 
+static void rtl8723bu_init_aggregation(struct rtl8xxxu_priv *priv)
+{
+       u32 agg_rx;
+       u8 agg_ctrl;
+
+       /*
+        * For now simply disable RX aggregation
+        */
+       agg_ctrl = rtl8xxxu_read8(priv, REG_TRXDMA_CTRL);
+       agg_ctrl &= ~TRXDMA_CTRL_RXDMA_AGG_EN;
+
+       agg_rx = rtl8xxxu_read32(priv, REG_RXDMA_AGG_PG_TH);
+       agg_rx &= ~RXDMA_USB_AGG_ENABLE;
+       agg_rx &= ~0xff0f;
+
+       rtl8xxxu_write8(priv, REG_TRXDMA_CTRL, agg_ctrl);
+       rtl8xxxu_write32(priv, REG_RXDMA_AGG_PG_TH, agg_rx);
+}
+
 static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
 {
        struct rtl8xxxu_priv *priv = hw->priv;
@@ -6320,6 +6339,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
                rtl8xxxu_write8(priv, REG_RSV_CTRL, val8);
        }
 
+       if (priv->fops->init_aggregation)
+               priv->fops->init_aggregation(priv);
+
        /*
         * Enable CCK and OFDM block
         */
@@ -7998,6 +8020,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
        .config_channel = rtl8723bu_config_channel,
        .init_bt = rtl8723bu_init_bt,
        .parse_rx_desc = rtl8723bu_parse_rx_desc,
+       .init_aggregation = rtl8723bu_init_aggregation,
        .writeN_block_size = 1024,
        .mbox_ext_reg = REG_HMBOX_EXT0_8723B,
        .mbox_ext_width = 4,
index 2250e1b17d6056cdabab27d80014ecd54a45cc5b..14b7a35bc05b41ac974399df8b988081d88bdd39 100644 (file)
@@ -1133,6 +1133,7 @@ struct rtl8xxxu_fileops {
        void (*init_bt) (struct rtl8xxxu_priv *priv);
        int (*parse_rx_desc) (struct rtl8xxxu_priv *priv, struct sk_buff *skb,
                              struct ieee80211_rx_status *rx_status);
+       void (*init_aggregation) (struct rtl8xxxu_priv *priv);
        int writeN_block_size;
        u16 mbox_ext_reg;
        char mbox_ext_width;
index ec6f40f2dbc7c1771b5eeb370bcc9fb39a86acaf..d6c7ad30a87b863851eb93375d87c8068b9739fd 100644 (file)
 #define  PBP_PAGE_SIZE_1024            0x4
 
 #define REG_TRXDMA_CTRL                        0x010c
+#define  TRXDMA_CTRL_RXDMA_AGG_EN      BIT(2)
 #define  TRXDMA_CTRL_VOQ_SHIFT         4
 #define  TRXDMA_CTRL_VIQ_SHIFT         6
 #define  TRXDMA_CTRL_BEQ_SHIFT         8