All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wcn36xx: reduce verbosity of drivers messages
@ 2018-02-27 13:31 Ramon Fried
  2018-02-27 13:43 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Ramon Fried @ 2018-02-27 13:31 UTC (permalink / raw)
  To: k.eugene.e, kvalo, wcn36xx, linux-wireless; +Cc: 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.

Signed-off-by: Ramon Fried <rfried@codeaurora.org>
---
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(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index ab5be6d2c691..8c2654075eb8 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -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));
 	}
 }
 
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 2a4871ca9c72..3048722f0484 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -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;
 }
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH v2] wcn36xx: reduce verbosity of drivers messages
  2018-02-27 13:31 [PATCH v2] wcn36xx: reduce verbosity of drivers messages Ramon Fried
@ 2018-02-27 13:43 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2018-02-27 13:43 UTC (permalink / raw)
  To: Ramon Fried; +Cc: k.eugene.e, wcn36xx, linux-wireless

Ramon Fried <rfried@codeaurora.org> writes:

> 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.
>
> Signed-off-by: Ramon Fried <rfried@codeaurora.org>
> ---
> v2: print the firwmare version as info but only
> 	onetime.

[...]

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

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.

-- 
Kalle Valo

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

end of thread, other threads:[~2018-02-27 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 13:31 [PATCH v2] wcn36xx: reduce verbosity of drivers messages Ramon Fried
2018-02-27 13:43 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.