2018-04-10 15:01:40

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 0/7] rsi driver improvements

From: Siva Rebbagondla <[email protected]>

This patch series brings in some improvements in power save, Tx data
path etc.

Changes in v2:
Below patches are split and created smaller incremental patches[Kalle]
[08/10] rsi: device disconnect changes
[09/10] rsi: tx improvements

Amitkumar Karwar (7):
rsi: disable fw watchdog timer during reset
rsi: device bootup parameter configuration
rsi: use appropriate interface for power save configuration
rsi: increase max supported aggregation subframes
rsi: parse TID from data frame correctly
rsi: enable power save by default for coex
rsi: advertise 5GHz support based on device capability

drivers/net/wireless/rsi/rsi_91x_core.c | 4 +++-
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 29 ++++++++++++++++++++---------
drivers/net/wireless/rsi/rsi_91x_usb.c | 7 +++++++
drivers/net/wireless/rsi/rsi_boot_params.h | 3 ++-
drivers/net/wireless/rsi/rsi_hal.h | 1 +
drivers/net/wireless/rsi/rsi_mgmt.h | 3 +++
drivers/net/wireless/rsi/rsi_usb.h | 1 +
7 files changed, 37 insertions(+), 11 deletions(-)

--
2.7.4


2018-04-10 15:01:58

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 6/7] rsi: enable power save by default for coex

From: Amitkumar Karwar <[email protected]>

Power save is by default enabled for WLAN and BT coex mode.

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index 2a77743..bb497bd 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -2008,6 +2008,9 @@ int rsi_mac80211_attach(struct rsi_common *common)
wiphy->iface_combinations = rsi_iface_combinations;
wiphy->n_iface_combinations = ARRAY_SIZE(rsi_iface_combinations);

+ if (common->coex_mode > 1)
+ wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
+
status = ieee80211_register_hw(hw);
if (status)
return status;
--
2.7.4

2018-04-10 15:01:53

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 4/7] rsi: increase max supported aggregation subframes

From: Amitkumar Karwar <[email protected]>

Maximum number of supported aggregation subframes has been increased
to 8. This is the optimal number for the driver.

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 3 ++-
drivers/net/wireless/rsi/rsi_mgmt.h | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index 77aa3bb..2a77743 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -1955,7 +1955,8 @@ int rsi_mac80211_attach(struct rsi_common *common)
hw->uapsd_queues = RSI_IEEE80211_UAPSD_QUEUES;
hw->uapsd_max_sp_len = IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL;

- hw->max_tx_aggregation_subframes = 6;
+ hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS;
+ hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS;
rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ);
rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ);
hw->rate_control_algorithm = "AARF";
diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h b/drivers/net/wireless/rsi/rsi_mgmt.h
index 5f946f3..1462093 100644
--- a/drivers/net/wireless/rsi/rsi_mgmt.h
+++ b/drivers/net/wireless/rsi/rsi_mgmt.h
@@ -225,6 +225,9 @@
#define RSI_WOW_DISCONNECT BIT(5)
#endif

+#define RSI_MAX_TX_AGGR_FRMS 8
+#define RSI_MAX_RX_AGGR_FRMS 8
+
enum opmode {
RSI_OPMODE_UNSUPPORTED = -1,
RSI_OPMODE_AP = 0,
--
2.7.4

2018-04-10 15:01:43

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 1/7] rsi: disable fw watchdog timer during reset

From: Amitkumar Karwar <[email protected]>

Firmware's watchdog timer should be disabled as a part of reset
sequence. This change fixes a firmware hang issue observed during
stress tests.

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_usb.c | 7 +++++++
drivers/net/wireless/rsi/rsi_hal.h | 1 +
drivers/net/wireless/rsi/rsi_usb.h | 1 +
3 files changed, 9 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 7b8bae3..b065438 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -687,6 +687,13 @@ static int rsi_reset_card(struct rsi_hw *adapter)
*/
msleep(100);

+ if (rsi_usb_master_reg_write(adapter, SWBL_REGOUT,
+ RSI_FW_WDT_DISABLE_REQ,
+ RSI_COMMON_REG_SIZE) < 0) {
+ rsi_dbg(ERR_ZONE, "Disabling firmware watchdog timer failed\n");
+ goto fail;
+ }
+
ret = usb_ulp_read_write(adapter, RSI_WATCH_DOG_TIMER_1,
RSI_ULP_WRITE_2, 32);
if (ret < 0)
diff --git a/drivers/net/wireless/rsi/rsi_hal.h b/drivers/net/wireless/rsi/rsi_hal.h
index d6c2baa..327638c 100644
--- a/drivers/net/wireless/rsi/rsi_hal.h
+++ b/drivers/net/wireless/rsi/rsi_hal.h
@@ -115,6 +115,7 @@
#define FW_FLASH_OFFSET 0x820
#define LMAC_VER_OFFSET (FW_FLASH_OFFSET + 0x200)
#define MAX_DWORD_ALIGN_BYTES 64
+#define RSI_COMMON_REG_SIZE 2

struct bl_header {
__le32 flags;
diff --git a/drivers/net/wireless/rsi/rsi_usb.h b/drivers/net/wireless/rsi/rsi_usb.h
index a88d592..b6fe79f 100644
--- a/drivers/net/wireless/rsi/rsi_usb.h
+++ b/drivers/net/wireless/rsi/rsi_usb.h
@@ -26,6 +26,7 @@
#define RSI_USB_READY_MAGIC_NUM 0xab
#define FW_STATUS_REG 0x41050012
#define RSI_TA_HOLD_REG 0x22000844
+#define RSI_FW_WDT_DISABLE_REQ 0x69

#define USB_VENDOR_REGISTER_READ 0x15
#define USB_VENDOR_REGISTER_WRITE 0x16
--
2.7.4

2018-04-10 15:01:55

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 5/7] rsi: parse TID from data frame correctly

From: Amitkumar Karwar <[email protected]>

Currently TID is extracted by checking at specific offset in data frame.
This approach doesn't work for some of the frames. This patch uses mac80211
API and do it correctly

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c
index 3ca468b9..1f1b972 100644
--- a/drivers/net/wireless/rsi/rsi_91x_core.c
+++ b/drivers/net/wireless/rsi/rsi_91x_core.c
@@ -432,7 +432,9 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
}
} else {
if (ieee80211_is_data_qos(wh->frame_control)) {
- tid = (skb->data[24] & IEEE80211_QOS_TID);
+ u8 *qos = ieee80211_get_qos_ctl(wh);
+
+ tid = *qos & IEEE80211_QOS_CTL_TID_MASK;
skb->priority = TID_TO_WME_AC(tid);
} else {
tid = IEEE80211_NONQOS_TID;
--
2.7.4

2018-04-10 15:01:49

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 3/7] rsi: use appropriate interface for power save configuration

From: Amitkumar Karwar <[email protected]>

Power save request should be sent on station interface. Virtual
interface which is connected should be preferred. This patch
resolves device not entering power save problem in certain
situations

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index 5edc3a9..77aa3bb 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -614,7 +614,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,

/* Power save parameters */
if (changed & IEEE80211_CONF_CHANGE_PS) {
- struct ieee80211_vif *vif;
+ struct ieee80211_vif *vif, *sta_vif = NULL;
unsigned long flags;
int i, set_ps = 1;

@@ -628,13 +628,17 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
set_ps = 0;
break;
}
+ if ((vif->type == NL80211_IFTYPE_STATION ||
+ vif->type == NL80211_IFTYPE_P2P_CLIENT) &&
+ (!sta_vif || vif->bss_conf.assoc))
+ sta_vif = vif;
}
- if (set_ps) {
+ if (set_ps && sta_vif) {
spin_lock_irqsave(&adapter->ps_lock, flags);
if (conf->flags & IEEE80211_CONF_PS)
- rsi_enable_ps(adapter, vif);
+ rsi_enable_ps(adapter, sta_vif);
else
- rsi_disable_ps(adapter, vif);
+ rsi_disable_ps(adapter, sta_vif);
spin_unlock_irqrestore(&adapter->ps_lock, flags);
}
}
--
2.7.4

2018-04-10 15:02:00

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 7/7] rsi: advertise 5GHz support based on device capability

From: Amitkumar Karwar <[email protected]>

Currently 5GHz gets advertised even for the device which supports
only 2.4Ghz band. This patch fixes the issue

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index bb497bd..766d874 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -1957,8 +1957,6 @@ int rsi_mac80211_attach(struct rsi_common *common)

hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS;
hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS;
- rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ);
- rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ);
hw->rate_control_algorithm = "AARF";

SET_IEEE80211_PERM_ADDR(hw, common->mac_addr);
@@ -1979,10 +1977,15 @@ int rsi_mac80211_attach(struct rsi_common *common)

wiphy->available_antennas_rx = 1;
wiphy->available_antennas_tx = 1;
+
+ rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ);
wiphy->bands[NL80211_BAND_2GHZ] =
&adapter->sbands[NL80211_BAND_2GHZ];
- wiphy->bands[NL80211_BAND_5GHZ] =
- &adapter->sbands[NL80211_BAND_5GHZ];
+ if (common->num_supp_bands > 1) {
+ rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ);
+ wiphy->bands[NL80211_BAND_5GHZ] =
+ &adapter->sbands[NL80211_BAND_5GHZ];
+ }

/* AP Parameters */
wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1];
--
2.7.4

2018-04-24 17:25:48

by Kalle Valo

[permalink] [raw]
Subject: Re: [v2,1/7] rsi: disable fw watchdog timer during reset

Siva Rebbagondla <[email protected]> wrote:

> From: Amitkumar Karwar <[email protected]>
>
> Firmware's watchdog timer should be disabled as a part of reset
> sequence. This change fixes a firmware hang issue observed during
> stress tests.
>
> Signed-off-by: Amitkumar Karwar <[email protected]>
> Signed-off-by: Siva Rebbagondla <[email protected]>

7 patches applied to wireless-drivers-next.git, thanks.

16d3bb7b2f37 rsi: disable fw watchdog timer during reset
8c1475bdfc3a rsi: device bootup parameter configuration
cbbfdd6c700f rsi: use appropriate interface for power save configuration
a55e50f0672e rsi: increase max supported aggregation subframes
3334306a086e rsi: parse TID from data frame correctly
1e9c410f26a2 rsi: enable power save by default for coex
f0b147b8f1d2 rsi: advertise 5GHz support based on device capability

--
https://patchwork.kernel.org/patch/10333303/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2018-04-10 15:01:47

by Siva Rebbagondla

[permalink] [raw]
Subject: [v2 2/7] rsi: device bootup parameter configuration

From: Amitkumar Karwar <[email protected]>

Some device configuration flags need to be enabled while sending 'bootup
params' internal frame to firmware. This patch takes care of it.

Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Siva Rebbagondla <[email protected]>
---
drivers/net/wireless/rsi/rsi_boot_params.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_boot_params.h b/drivers/net/wireless/rsi/rsi_boot_params.h
index 238ee96..ad903b22 100644
--- a/drivers/net/wireless/rsi/rsi_boot_params.h
+++ b/drivers/net/wireless/rsi/rsi_boot_params.h
@@ -46,7 +46,8 @@
(((TA_PLL_M_VAL_20 + 1) * 40) / \
((TA_PLL_N_VAL_20 + 1) * (TA_PLL_P_VAL_20 + 1)))
#define VALID_20 \
- (WIFI_PLL960_CONFIGS | WIFI_AFEPLL_CONFIGS | WIFI_SWITCH_CLK_CONFIGS)
+ (WIFI_TAPLL_CONFIGS | WIFI_PLL960_CONFIGS | WIFI_AFEPLL_CONFIGS | \
+ WIFI_SWITCH_CLK_CONFIGS | BOOTUP_MODE_INFO | CRYSTAL_GOOD_TIME)
#define UMAC_CLK_40BW \
(((TA_PLL_M_VAL_40 + 1) * 40) / \
((TA_PLL_N_VAL_40 + 1) * (TA_PLL_P_VAL_40 + 1)))
--
2.7.4