linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/6] ath10k: Add support to create boardname for non-bmi target
@ 2018-06-05 12:34 Govind Singh
  2018-06-19 22:46 ` Niklas Cassel
  2018-07-03 15:40 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Govind Singh @ 2018-06-05 12:34 UTC (permalink / raw)
  To: andy.gross, bjorn.andersson, david.brown, linux-wireless, ath10k
  Cc: Rakesh Pillai, Govind Singh

From: Rakesh Pillai <pillair@codeaurora.org>

Add support to create the boardname for non-bmi targets
like WCN3990, which uses qmi for bdf download. This
boardname is used to parse the board data from board-2.bin.

Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Govind Singh <govinds@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++++++++
 drivers/net/wireless/ath/ath10k/core.h |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 4cf54a7ef09a..8a592019cc4d 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1429,6 +1429,20 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 		goto out;
 	}
 
+	if (ar->id.qmi_ids_valid) {
+		if (ar->id.qmi_board_id > 0x99)
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=%03x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		else
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=b%02x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		goto out;
+	}
+
 	scnprintf(name, name_len,
 		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
 		  ath10k_bus_str(ar->hif.bus),
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 951dbdd1c9eb..0a2e4a5c3612 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -940,7 +940,9 @@ struct ath10k {
 		u32 subsystem_device;
 
 		bool bmi_ids_valid;
+		bool qmi_ids_valid;
 		u8 bmi_board_id;
+		u8 qmi_board_id;
 		u8 bmi_chip_id;
 
 		char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
-- 
2.17.0

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

* Re: [PATCH v2 2/6] ath10k: Add support to create boardname for non-bmi target
  2018-06-05 12:34 [PATCH v2 2/6] ath10k: Add support to create boardname for non-bmi target Govind Singh
@ 2018-06-19 22:46 ` Niklas Cassel
  2018-07-03 15:40 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Niklas Cassel @ 2018-06-19 22:46 UTC (permalink / raw)
  To: Govind Singh
  Cc: andy.gross, bjorn.andersson, david.brown, linux-wireless, ath10k,
	Rakesh Pillai

Acked-by: Niklas Cassel <niklas.cassel@linaro.org>

On Tue, Jun 05, 2018 at 06:04:48PM +0530, Govind Singh wrote:
> From: Rakesh Pillai <pillair@codeaurora.org>
> 
> Add support to create the boardname for non-bmi targets
> like WCN3990, which uses qmi for bdf download. This
> boardname is used to parse the board data from board-2.bin.
> 
> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
> Signed-off-by: Govind Singh <govinds@codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++++++++
>  drivers/net/wireless/ath/ath10k/core.h |  2 ++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 4cf54a7ef09a..8a592019cc4d 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1429,6 +1429,20 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
>  		goto out;
>  	}
>  
> +	if (ar->id.qmi_ids_valid) {
> +		if (ar->id.qmi_board_id > 0x99)
> +			scnprintf(name, name_len,
> +				  "bus=%s,qmi-board-id=%03x",
> +				  ath10k_bus_str(ar->hif.bus),
> +				  ar->id.qmi_board_id);
> +		else
> +			scnprintf(name, name_len,
> +				  "bus=%s,qmi-board-id=b%02x",
> +				  ath10k_bus_str(ar->hif.bus),
> +				  ar->id.qmi_board_id);
> +		goto out;
> +	}
> +
>  	scnprintf(name, name_len,
>  		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
>  		  ath10k_bus_str(ar->hif.bus),
> diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
> index 951dbdd1c9eb..0a2e4a5c3612 100644
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -940,7 +940,9 @@ struct ath10k {
>  		u32 subsystem_device;
>  
>  		bool bmi_ids_valid;
> +		bool qmi_ids_valid;
>  		u8 bmi_board_id;
> +		u8 qmi_board_id;
>  		u8 bmi_chip_id;
>  
>  		char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH v2 2/6] ath10k: Add support to create boardname for non-bmi target
  2018-06-05 12:34 [PATCH v2 2/6] ath10k: Add support to create boardname for non-bmi target Govind Singh
  2018-06-19 22:46 ` Niklas Cassel
@ 2018-07-03 15:40 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2018-07-03 15:40 UTC (permalink / raw)
  To: Govind Singh
  Cc: andy.gross, bjorn.andersson, david.brown, linux-wireless, ath10k,
	Rakesh Pillai

Govind Singh <govinds@codeaurora.org> writes:

> From: Rakesh Pillai <pillair@codeaurora.org>
>
> Add support to create the boardname for non-bmi targets
> like WCN3990, which uses qmi for bdf download. This
> boardname is used to parse the board data from board-2.bin.
>
> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
> Signed-off-by: Govind Singh <govinds@codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++++++++
>  drivers/net/wireless/ath/ath10k/core.h |  2 ++
>  2 files changed, 16 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 4cf54a7ef09a..8a592019cc4d 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1429,6 +1429,20 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
>  		goto out;
>  	}
>  
> +	if (ar->id.qmi_ids_valid) {
> +		if (ar->id.qmi_board_id > 0x99)
> +			scnprintf(name, name_len,
> +				  "bus=%s,qmi-board-id=%03x",
> +				  ath10k_bus_str(ar->hif.bus),
> +				  ar->id.qmi_board_id);
> +		else
> +			scnprintf(name, name_len,
> +				  "bus=%s,qmi-board-id=b%02x",
> +				  ath10k_bus_str(ar->hif.bus),
> +				  ar->id.qmi_board_id);
> +		goto out;
> +	}

Why not just use %d? What benefit would hexadecimal format bring?

And why %02 and %03? I don't see the need for that.

-- 
Kalle Valo

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

end of thread, other threads:[~2018-07-03 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-05 12:34 [PATCH v2 2/6] ath10k: Add support to create boardname for non-bmi target Govind Singh
2018-06-19 22:46 ` Niklas Cassel
2018-07-03 15:40 ` Kalle Valo

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