Skip to contentSkip to conversation

wcn36xx: reduce verbosity of drivers messages

PATCH Superseded Ramon Fried 2 participants 2 messages Feb 27, 2018 Qualcomm WCN36XX wireless driver

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wcn36xx: reduce verbosity of drivers messages

Whenever the WLAN interface is started the FW version and caps are printed.
The caps now will be displayed only in debug mode. Firmware version will be displayed only once on first startup of the interface.

---
v2: print the firwmare version as info but only
onetime.

 drivers/net/wireless/ath/wcn36xx/main.c |  2 +-
 drivers/net/wireless/ath/wcn36xx/smd.c  | 19 +++++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/wcn36xx/main.c +1 -1
index ab5be6d2c691..8c2654075eb8 100644
@@ -261,7 +261,7 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)
 
 	for (i = 0; i < MAX_FEATURE_SUPPORTED; i++) {
 		if (get_feat_caps(wcn->fw_feat_caps, i))
-			wcn36xx_info("FW Cap %s\n", wcn36xx_get_cap_name(i));
+			wcn36xx_dbg(WCN36XX_DBG_MAC, "FW Cap %s\n", wcn36xx_get_cap_name(i));
 	}
 }
 
drivers/net/wireless/ath/wcn36xx/smd.c +11 -8
index 2a4871ca9c72..3048722f0484 100644
@@ -385,6 +385,7 @@ out:	return ret;
 
 static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
 {
+	static bool first = true;
 	struct wcn36xx_hal_mac_start_rsp_msg *rsp;
 
 	if (len < sizeof(*rsp))
@@ -409,15 +410,17 @@ static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
 	wcn->fw_minor = rsp->start_rsp_params.version.minor;
 	wcn->fw_major = rsp->start_rsp_params.version.major;
 
-	wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
-		     wcn->wlan_version, wcn->crm_version);
-
-	wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
-		     wcn->fw_major, wcn->fw_minor,
-		     wcn->fw_version, wcn->fw_revision,
-		     rsp->start_rsp_params.stations,
-		     rsp->start_rsp_params.bssids);
+	if (first) {
+		first = false;
+		wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
+			     wcn->wlan_version, wcn->crm_version);
 
+		wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
+			     wcn->fw_major, wcn->fw_minor,
+			     wcn->fw_version, wcn->fw_revision,
+			     rsp->start_rsp_params.stations,
+			     rsp->start_rsp_params.bssids);
+	}
 	return 0;
 }
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 10 lines · Ramon Fried

Whenever the WLAN interface is started the FW version and caps are printed.
The caps now will be displayed only in debug mode. Firmware version will be displayed only once on first startup of the interface.

---
v2: print the firwmare version as info but only
onetime.

[...]

Quoted 10 lines

static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len) {

drivers/net/wireless/ath/wcn36xx/smd.c +1 -0
+	static bool first = true;
 	struct wcn36xx_hal_mac_start_rsp_msg *rsp;
 
 	if (len < sizeof(*rsp))
@@ -409,15 +410,17 @@ static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len)
 	wcn->fw_minor = rsp->start_rsp_params.version.minor;
 	wcn->fw_major = rsp->start_rsp_params.version.major;
 

drivers/net/wireless/ath/wcn36xx/smd.c static int wcn36xx_smd_start_rsp(struct wcn36xx *wcn, void *buf, size_t len) · line 414

Quoted 10 lines
drivers/net/wireless/ath/wcn36xx/smd.c +2 -8
-	wcn36xx_info("firmware WLAN version '%s' and CRM version '%s'\n",
-		     wcn->wlan_version, wcn->crm_version);
-
-	wcn36xx_info("firmware API %u.%u.%u.%u, %u stations, %u bssids\n",
-		     wcn->fw_major, wcn->fw_minor,
-		     wcn->fw_version, wcn->fw_revision,
-		     rsp->start_rsp_params.stations,
-		     rsp->start_rsp_params.bssids);
+	if (first) {
+		first = false;

static variables are evil if you have more than one device on the same host. Sure, I guess all current hardware only have one wcn36xx device per hardware but still we should not endorse this bad practise. A much better approach is to add a new field to struct wcn36xx.

Signature · 1 line
Kalle Valo