Skip to contentSkip to conversation

rsi: Fix module dev_oper_mode parameter description

PATCH Superseded Marek Vasut 3 participants 4 messages Sep 15, 2021 – Sep 16, 2021

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsi: Fix module dev_oper_mode parameter description

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")
Cc Amitkumar Karwar <[email protected]>
Cc Angus Ainslie <[email protected]>
Cc David S. Miller <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Kalle Valo <[email protected]>
Cc Karun Eagalapati <[email protected]>
Cc Martin Fuzzey <[email protected]>
Cc Martin Kepplinger <[email protected]>
Cc Prameela Rani Garnepudi <[email protected]>
Cc Sebastian Krzyszkowiak <[email protected]>
Cc Siva Rebbagondla <[email protected]>

To: [email protected]
Cc: <[email protected]> # 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(-)
drivers/net/wireless/rsi/rsi_91x_sdio.c +1 -4
index e0c502bc42707..9f16128e4ffab 100644
@@ -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.
drivers/net/wireless/rsi/rsi_91x_usb.c +1 -4
index 416976f098882..6a120211800db 100644
@@ -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);
 
drivers/net/wireless/rsi/rsi_hal.h +11 -0
index d044a440fa080..e435df73ccce3 100644
@@ -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)
 
Signature · 1 line
2.33.0
#1 lore raw

+ linux-wireless

Quoted 27 lines · Marek Vasut

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")
Cc Amitkumar Karwar <[email protected]>
Cc Angus Ainslie <[email protected]>
Cc David S. Miller <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Kalle Valo <[email protected]>
Cc Karun Eagalapati <[email protected]>
Cc Martin Fuzzey <[email protected]>
Cc Martin Kepplinger <[email protected]>
Cc Prameela Rani Garnepudi <[email protected]>
Cc Sebastian Krzyszkowiak <[email protected]>
Cc Siva Rebbagondla <[email protected]>
Quoted 7 lines

To: [email protected]
Cc: <[email protected]> # 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.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Marek Vasut

drivers/net/wireless/rsi/rsi_hal.h

Quoted 4 lines · On środa, 15 września 2021 10:08:41 CEST Marek Vasut wrote:
drivers/net/wireless/rsi/rsi_hal.h +4 -0
+#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], "		

\

Review

Quoted 1 line
(quoted diff) +1 -0
+	__stringify(DEV_OPMODE_BT_DUAL)		"[BT Dual], "		

\

Review

Quoted 1 line
(quoted diff) +1 -0
+	__stringify(DEV_OPMODE_STA_BT)		"[Wi-Fi STA + BT 

classic], " \

Review

Quoted 2 lines
(quoted diff) +2 -0
+	__stringify(DEV_OPMODE_STA_BT_LE)	"[Wi-Fi STA + BT LE], "	\
+	__stringify(DEV_OPMODE_STA_BT_DUAL)	"[Wi-Fi STA + BT 

classic + BT LE], " \

Review

Quoted 1 line
(quoted diff) +1 -0
+	__stringify(DEV_OPMODE_AP_BT)		"[AP + BT classic], "	

\

drivers/net/wireless/rsi/rsi_hal.h line 40

Quoted 1 line
drivers/net/wireless/rsi/rsi_hal.h +1 -0
+	__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

#3 lore raw
Quoted 13 lines · Sebastian Krzyszkowiak

drivers/net/wireless/rsi/rsi_hal.h

Quoted 4 lines · On środa, 15 września 2021 10:08:41 CEST Marek Vasut wrote:
drivers/net/wireless/rsi/rsi_hal.h +4 -0
+#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], "		

\

Review

Quoted 1 line
(quoted diff) +1 -0
+	__stringify(DEV_OPMODE_BT_DUAL)		"[BT Dual], "		

\

Review

Quoted 1 line
(quoted diff) +1 -0
+	__stringify(DEV_OPMODE_STA_BT)		"[Wi-Fi STA + BT

classic], " \

Review

Quoted 2 lines
(quoted diff) +2 -0
+	__stringify(DEV_OPMODE_STA_BT_LE)	"[Wi-Fi STA + BT LE], "	\
+	__stringify(DEV_OPMODE_STA_BT_DUAL)	"[Wi-Fi STA + BT

classic + BT LE], " \

Quoted 7 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	__stringify(DEV_OPMODE_AP_BT)		"[AP + BT classic], "	

\

drivers/net/wireless/rsi/rsi_hal.h line 40

Quoted 1 line
drivers/net/wireless/rsi/rsi_hal.h +1 -0
+	__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

Quoted 10 lines

- 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.