kernel: add missing config symbols
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 650-0016-rtl8xxxu-gen1-Set-aggregation-timeout-REG_RXDMA_AGG_.patch
1 From 0338642c5eeaaf03cd4a63e211b94596c559e6e5 Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Wed, 22 Jun 2016 22:09:35 -0400
4 Subject: [PATCH] rtl8xxxu: gen1: Set aggregation timeout (REG_RXDMA_AGG_PG_TH
5 + 1) as well
6
7 gen2 chips as well as 8188eu seems to use this register for setting
8 DMA timeout threshold values, however the 8192cu is using
9 REG_USB_DMA_AGG_TO. Set both to be on the safe side.
10
11 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
12 ---
13 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 +++++++++--
14 1 file changed, 9 insertions(+), 2 deletions(-)
15
16 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
17 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
18 @@ -4410,7 +4410,7 @@ void rtl8xxxu_gen2_report_connect(struct
19
20 void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv)
21 {
22 - u8 agg_ctrl, usb_spec, page_thresh;
23 + u8 agg_ctrl, usb_spec, page_thresh, timeout;
24
25 usb_spec = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
26 usb_spec &= ~USB_SPEC_USB_AGG_ENABLE;
27 @@ -4442,7 +4442,14 @@ void rtl8xxxu_gen1_init_aggregation(stru
28
29 page_thresh = (priv->fops->rx_agg_buf_size / 512);
30 rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH, page_thresh);
31 - rtl8xxxu_write8(priv, REG_USB_DMA_AGG_TO, 4);
32 + /*
33 + * REG_RXDMA_AGG_PG_TH + 1 seems to be the timeout register on
34 + * gen2 chips and rtl8188eu. The rtl8723au seems unhappy if we
35 + * don't set it, so better set both.
36 + */
37 + timeout = 4;
38 + rtl8xxxu_write8(priv, REG_RXDMA_AGG_PG_TH + 1, timeout);
39 + rtl8xxxu_write8(priv, REG_USB_DMA_AGG_TO, timeout);
40 priv->rx_buf_aggregation = 1;
41 }
42