diff mbox series

[3/3] brcmfmac: make firmware frameburst mode a module parameter

Message ID 1540808552-28738-4-git-send-email-wright.feng@cypress.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series brcmfmac: throughput enhancement for SDIO and flow control mode | expand

Commit Message

Wright Feng Oct. 29, 2018, 10:27 a.m. UTC
This patch is for adding a new module parameter "frameburst".
With setting "frameburst=1" in module parameters, firmware frameburst mode
will be enabled. The feature can enable per-packet framebursting in
firmware side and get higher TX throughput in High Throughput(HT) mode.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++++
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c   | 5 +++++
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h   | 2 ++
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h     | 1 +
 4 files changed, 15 insertions(+)

Comments

Arend van Spriel Oct. 30, 2018, 11:33 a.m. UTC | #1
On 10/29/2018 11:27 AM, Wright Feng wrote:
> This patch is for adding a new module parameter "frameburst".
> With setting "frameburst=1" in module parameters, firmware frameburst mode
> will be enabled. The feature can enable per-packet framebursting in
> firmware side and get higher TX throughput in High Throughput(HT) mode.

I am not sure about every firmware image, but in recent branches here I 
see firmware enables frameburst by default. So not sure about the 
motivation to add this. You could also consider adding this to the 
nl80211 api. I am sure other vendors have similar features.

Regards,
Arend

> Signed-off-by: Wright Feng <wright.feng@cypress.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++++
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c   | 5 +++++
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h   | 2 ++
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h     | 1 +
>  4 files changed, 15 insertions(+)
Wright Feng Nov. 2, 2018, 3:22 a.m. UTC | #2
On 2018/10/30 下午 07:33, Arend van Spriel wrote:
> On 10/29/2018 11:27 AM, Wright Feng wrote:
>> This patch is for adding a new module parameter "frameburst".
>> With setting "frameburst=1" in module parameters, firmware frameburst 
>> mode
>> will be enabled. The feature can enable per-packet framebursting in
>> firmware side and get higher TX throughput in High Throughput(HT) mode.
> 
> I am not sure about every firmware image, but in recent branches here I 
> see firmware enables frameburst by default. So not sure about the 
> motivation to add this. You could also consider adding this to the 
> nl80211 api. I am sure other vendors have similar features.
> 
> Regards,
> Arend
> 
The newer firmware may set firmware by default, but Some
firmwares in upstream do not, like 7.35.349.28 for 4354-sdio.

Before adding new API in ops and ATTR in nl80211, I think keeping the
frameburst module parameter is good for user to enhance TX throughput.
And I will find time to add new API after finishing my internal task.

-Wright
>> Signed-off-by: Wright Feng <wright.feng@cypress.com>
>> ---
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++++
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c   | 5 +++++
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h   | 2 ++
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h     | 1 +
>>  4 files changed, 15 insertions(+)
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 230a378..4a05d3f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6638,6 +6638,13 @@  static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
 
 	brcmf_configure_arp_nd_offload(ifp, true);
 
+	if (ifp->drvr->settings->frameburst) {
+		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1);
+			if (err)
+				brcmf_info("setting frameburst mode failed\n");
+		brcmf_dbg(INFO, "frameburst mode enabled\n");
+	}
+
 	cfg->dongle_up = true;
 default_conf_out:
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index 94044a7..0ad4c31 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -78,6 +78,10 @@ 
 module_param_named(iapp, brcmf_iapp_enable, int, 0);
 MODULE_PARM_DESC(iapp, "Enable partial support for the obsoleted Inter-Access Point Protocol");
 
+static int brcmf_frameburst;
+module_param_named(frameburst, brcmf_frameburst, int, 0);
+MODULE_PARM_DESC(frameburst, "Enable firmware frameburst feature");
+
 #ifdef DEBUG
 /* always succeed brcmf_bus_started() */
 static int brcmf_ignore_probe_fail;
@@ -419,6 +423,7 @@  struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
 	settings->fcmode = brcmf_fcmode;
 	settings->roamoff = !!brcmf_roamoff;
 	settings->iapp = !!brcmf_iapp_enable;
+	settings->frameburst = !!brcmf_frameburst;
 #ifdef DEBUG
 	settings->ignore_probe_fail = !!brcmf_ignore_probe_fail;
 #endif
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
index a34642c..b919752 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
@@ -47,6 +47,7 @@  struct brcmf_mp_global_t {
  * @feature_disable: Feature_disable bitmask.
  * @fcmode: FWS flow control.
  * @roamoff: Firmware roaming off?
+ * @frameburst: Firmware frame burst mode.
  * @ignore_probe_fail: Ignore probe failure.
  * @country_codes: If available, pointer to struct for translating country codes
  * @bus: Bus specific platform data. Only SDIO at the mmoment.
@@ -57,6 +58,7 @@  struct brcmf_mp_device {
 	int		fcmode;
 	bool		roamoff;
 	bool		iapp;
+	bool		frameburst;
 	bool		ignore_probe_fail;
 	struct brcmfmac_pd_cc *country_codes;
 	union {
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
index 63b1287..b6b183b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h
@@ -80,6 +80,7 @@ 
 #define BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON	201
 #define BRCMF_C_SET_ASSOC_PREFER		205
 #define BRCMF_C_GET_VALID_CHANNELS		217
+#define BRCMF_C_SET_FAKEFRAG			219
 #define BRCMF_C_GET_KEY_PRIMARY			235
 #define BRCMF_C_SET_KEY_PRIMARY			236
 #define BRCMF_C_SET_SCAN_PASSIVE_TIME		258