stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rsi: Fix module dev_oper_mode parameter description
@ 2021-09-15  8:08 Marek Vasut
  2021-09-16  4:39 ` Kalle Valo
  2021-09-16  7:03 ` Sebastian Krzyszkowiak
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2021-09-15  8:08 UTC (permalink / raw)
  To: netdev
  Cc: Marek Vasut, Amitkumar Karwar, Angus Ainslie, David S . Miller,
	Jakub Kicinski, Kalle Valo, Karun Eagalapati, Martin Fuzzey,
	Martin Kepplinger, Prameela Rani Garnepudi,
	Sebastian Krzyszkowiak, Siva Rebbagondla, stable

The module parameters are missing dev_oper_mode 12, BT classic alone,
add it. Moreover, the parameters encode newlines, which ends up being
printed malformed e.g. by modinfo, so fix that too.

However, the module parameter string is duplicated in both USB and SDIO
modules and the dev_oper_mode mode enumeration in those module parameters
is a duplicate of macros used by the driver. Furthermore, the enumeration
is confusing.

So, deduplicate the module parameter string and use __stringify() to
encode the correct mode enumeration values into the module parameter
string. Finally, replace 'Wi-Fi' with 'Wi-Fi alone' and 'BT' with
'BT classic alone' to clarify what those modes really mean.

Fixes: 898b255339310 ("rsi: add module parameter operating mode")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Karun Eagalapati <karun256@gmail.com>
Cc: Martin Fuzzey <martin.fuzzey@flowbird.group>
Cc: Martin Kepplinger <martink@posteo.de>
Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Cc: Siva Rebbagondla <siva8118@gmail.com>
To: netdev@vger.kernel.org
Cc: <stable@vger.kernel.org> # 4.17+
---
 drivers/net/wireless/rsi/rsi_91x_sdio.c |  5 +----
 drivers/net/wireless/rsi/rsi_91x_usb.c  |  5 +----
 drivers/net/wireless/rsi/rsi_hal.h      | 11 +++++++++++
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index e0c502bc42707..9f16128e4ffab 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -24,10 +24,7 @@
 /* Default operating mode is wlan STA + BT */
 static u16 dev_oper_mode = DEV_OPMODE_STA_BT_DUAL;
 module_param(dev_oper_mode, ushort, 0444);
-MODULE_PARM_DESC(dev_oper_mode,
-		 "1[Wi-Fi], 4[BT], 8[BT LE], 5[Wi-Fi STA + BT classic]\n"
-		 "9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n"
-		 "6[AP + BT classic], 14[AP + BT classic + BT LE]");
+MODULE_PARM_DESC(dev_oper_mode, DEV_OPMODE_PARAM_DESC);
 
 /**
  * rsi_sdio_set_cmd52_arg() - This function prepares cmd 52 read/write arg.
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 416976f098882..6a120211800db 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -25,10 +25,7 @@
 /* Default operating mode is wlan STA + BT */
 static u16 dev_oper_mode = DEV_OPMODE_STA_BT_DUAL;
 module_param(dev_oper_mode, ushort, 0444);
-MODULE_PARM_DESC(dev_oper_mode,
-		 "1[Wi-Fi], 4[BT], 8[BT LE], 5[Wi-Fi STA + BT classic]\n"
-		 "9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n"
-		 "6[AP + BT classic], 14[AP + BT classic + BT LE]");
+MODULE_PARM_DESC(dev_oper_mode, DEV_OPMODE_PARAM_DESC);
 
 static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num, gfp_t flags);
 
diff --git a/drivers/net/wireless/rsi/rsi_hal.h b/drivers/net/wireless/rsi/rsi_hal.h
index d044a440fa080..e435df73ccce3 100644
--- a/drivers/net/wireless/rsi/rsi_hal.h
+++ b/drivers/net/wireless/rsi/rsi_hal.h
@@ -28,6 +28,17 @@
 #define DEV_OPMODE_AP_BT		6
 #define DEV_OPMODE_AP_BT_DUAL		14
 
+#define DEV_OPMODE_PARAM_DESC		\
+	__stringify(DEV_OPMODE_WIFI_ALONE)	"[Wi-Fi alone], "	\
+	__stringify(DEV_OPMODE_BT_ALONE)	"[BT classic alone], "	\
+	__stringify(DEV_OPMODE_BT_LE_ALONE)	"[BT LE], "		\
+	__stringify(DEV_OPMODE_BT_DUAL)		"[BT Dual], "		\
+	__stringify(DEV_OPMODE_STA_BT)		"[Wi-Fi STA + BT classic], " \
+	__stringify(DEV_OPMODE_STA_BT_LE)	"[Wi-Fi STA + BT LE], "	\
+	__stringify(DEV_OPMODE_STA_BT_DUAL)	"[Wi-Fi STA + BT classic + BT LE], " \
+	__stringify(DEV_OPMODE_AP_BT)		"[AP + BT classic], "	\
+	__stringify(DEV_OPMODE_AP_BT_DUAL)	"[AP + BT classic + BT LE]"
+
 #define FLASH_WRITE_CHUNK_SIZE		(4 * 1024)
 #define FLASH_SECTOR_SIZE		(4 * 1024)
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rsi: Fix module dev_oper_mode parameter description
  2021-09-15  8:08 [PATCH] rsi: Fix module dev_oper_mode parameter description Marek Vasut
@ 2021-09-16  4:39 ` Kalle Valo
  2021-09-16  7:03 ` Sebastian Krzyszkowiak
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2021-09-16  4:39 UTC (permalink / raw)
  To: Marek Vasut
  Cc: netdev, Amitkumar Karwar, Angus Ainslie, David S . Miller,
	Jakub Kicinski, Karun Eagalapati, Martin Fuzzey,
	Martin Kepplinger, Prameela Rani Garnepudi,
	Sebastian Krzyszkowiak, Siva Rebbagondla, stable, linux-wireless

+ linux-wireless

Marek Vasut <marex@denx.de> writes:

> The module parameters are missing dev_oper_mode 12, BT classic alone,
> add it. Moreover, the parameters encode newlines, which ends up being
> printed malformed e.g. by modinfo, so fix that too.
>
> However, the module parameter string is duplicated in both USB and SDIO
> modules and the dev_oper_mode mode enumeration in those module parameters
> is a duplicate of macros used by the driver. Furthermore, the enumeration
> is confusing.
>
> So, deduplicate the module parameter string and use __stringify() to
> encode the correct mode enumeration values into the module parameter
> string. Finally, replace 'Wi-Fi' with 'Wi-Fi alone' and 'BT' with
> 'BT classic alone' to clarify what those modes really mean.
>
> Fixes: 898b255339310 ("rsi: add module parameter operating mode")
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Amitkumar Karwar <amit.karwar@redpinesignals.com>
> Cc: Angus Ainslie <angus@akkea.ca>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: Karun Eagalapati <karun256@gmail.com>
> Cc: Martin Fuzzey <martin.fuzzey@flowbird.group>
> Cc: Martin Kepplinger <martink@posteo.de>
> Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
> Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
> Cc: Siva Rebbagondla <siva8118@gmail.com>
> To: netdev@vger.kernel.org
> Cc: <stable@vger.kernel.org> # 4.17+
> ---
>  drivers/net/wireless/rsi/rsi_91x_sdio.c |  5 +----
>  drivers/net/wireless/rsi/rsi_91x_usb.c  |  5 +----
>  drivers/net/wireless/rsi/rsi_hal.h      | 11 +++++++++++
>  3 files changed, 13 insertions(+), 8 deletions(-)

linux-wireless is not included so patchwork won't see this patch. Please
resubmit (as v2) and include linux-wireless, more info in the wiki
below.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rsi: Fix module dev_oper_mode parameter description
  2021-09-15  8:08 [PATCH] rsi: Fix module dev_oper_mode parameter description Marek Vasut
  2021-09-16  4:39 ` Kalle Valo
@ 2021-09-16  7:03 ` Sebastian Krzyszkowiak
  2021-09-16 14:39   ` Marek Vasut
  1 sibling, 1 reply; 4+ messages in thread
From: Sebastian Krzyszkowiak @ 2021-09-16  7:03 UTC (permalink / raw)
  To: netdev, Marek Vasut
  Cc: Marek Vasut, Amitkumar Karwar, Angus Ainslie, David S . Miller,
	Jakub Kicinski, Kalle Valo, Karun Eagalapati, Martin Fuzzey,
	Martin Kepplinger, Prameela Rani Garnepudi, Siva Rebbagondla,
	stable

On środa, 15 września 2021 10:08:41 CEST Marek Vasut wrote:
> +#define DEV_OPMODE_PARAM_DESC		\
> +	__stringify(DEV_OPMODE_WIFI_ALONE)	"[Wi-Fi alone], "	\
> +	__stringify(DEV_OPMODE_BT_ALONE)	"[BT classic alone], "	\
> +	__stringify(DEV_OPMODE_BT_LE_ALONE)	"[BT LE], "		
\
> +	__stringify(DEV_OPMODE_BT_DUAL)		"[BT Dual], "		
\
> +	__stringify(DEV_OPMODE_STA_BT)		"[Wi-Fi STA + BT 
classic], " \
> +	__stringify(DEV_OPMODE_STA_BT_LE)	"[Wi-Fi STA + BT LE], "	\
> +	__stringify(DEV_OPMODE_STA_BT_DUAL)	"[Wi-Fi STA + BT 
classic + BT LE], " \
> +	__stringify(DEV_OPMODE_AP_BT)		"[AP + BT classic], "	
\
> +	__stringify(DEV_OPMODE_AP_BT_DUAL)	"[AP + BT classic + BT LE]"

There's still some inconsistency in mode naming - how about: 

- Wi-Fi STA
- BT classic
- BT LE
- BT classic + BT LE
- Wi-Fi STA + BT classic
- Wi-Fi STA + BT LE
- Wi-Fi STA + BT classic + BT LE
- Wi-Fi AP + BT classic
- Wi-Fi AP + BT classic + BT LE

"alone" could be added to the first three modes (you missed it in BT LE).

Cheers,
Sebastian



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rsi: Fix module dev_oper_mode parameter description
  2021-09-16  7:03 ` Sebastian Krzyszkowiak
@ 2021-09-16 14:39   ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2021-09-16 14:39 UTC (permalink / raw)
  To: Sebastian Krzyszkowiak, netdev
  Cc: Amitkumar Karwar, Angus Ainslie, David S . Miller,
	Jakub Kicinski, Kalle Valo, Karun Eagalapati, Martin Fuzzey,
	Martin Kepplinger, Prameela Rani Garnepudi, Siva Rebbagondla,
	stable

On 9/16/21 9:03 AM, Sebastian Krzyszkowiak wrote:
> On środa, 15 września 2021 10:08:41 CEST Marek Vasut wrote:
>> +#define DEV_OPMODE_PARAM_DESC		\
>> +	__stringify(DEV_OPMODE_WIFI_ALONE)	"[Wi-Fi alone], "	\
>> +	__stringify(DEV_OPMODE_BT_ALONE)	"[BT classic alone], "	\
>> +	__stringify(DEV_OPMODE_BT_LE_ALONE)	"[BT LE], "		
> \
>> +	__stringify(DEV_OPMODE_BT_DUAL)		"[BT Dual], "		
> \
>> +	__stringify(DEV_OPMODE_STA_BT)		"[Wi-Fi STA + BT
> classic], " \
>> +	__stringify(DEV_OPMODE_STA_BT_LE)	"[Wi-Fi STA + BT LE], "	\
>> +	__stringify(DEV_OPMODE_STA_BT_DUAL)	"[Wi-Fi STA + BT
> classic + BT LE], " \
>> +	__stringify(DEV_OPMODE_AP_BT)		"[AP + BT classic], "	
> \
>> +	__stringify(DEV_OPMODE_AP_BT_DUAL)	"[AP + BT classic + BT LE]"
> 
> There's still some inconsistency in mode naming - how about:
> 
> - Wi-Fi STA

This mode is also AP capable

> - BT classic
> - BT LE
> - BT classic + BT LE
> - Wi-Fi STA + BT classic
> - Wi-Fi STA + BT LE
> - Wi-Fi STA + BT classic + BT LE
> - Wi-Fi AP + BT classic
> - Wi-Fi AP + BT classic + BT LE
> 
> "alone" could be added to the first three modes (you missed it in BT LE).

I can add the alone consistently, yes -- that's the point of the first 
three modes, that the "other" radio is disabled by the firmware.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-16 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15  8:08 [PATCH] rsi: Fix module dev_oper_mode parameter description Marek Vasut
2021-09-16  4:39 ` Kalle Valo
2021-09-16  7:03 ` Sebastian Krzyszkowiak
2021-09-16 14:39   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).