ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Jouni Malinen <jouni@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Wen Gong <wgong@codeaurora.org>
Subject: Re: [PATCH] ath11k: add string type to search board data in board-2.bin for WCN6855
Date: Mon, 08 Nov 2021 15:15:44 +0200	[thread overview]
Message-ID: <87mtmepz3z.fsf@codeaurora.org> (raw)
In-Reply-To: <20210913181131.194024-1-jouni@codeaurora.org> (Jouni Malinen's message of "Mon, 13 Sep 2021 21:11:31 +0300")

Jouni Malinen <jouni@codeaurora.org> writes:

> From: Wen Gong <wgong@codeaurora.org>
>
> Currently ath11k only support string type with bus, chip id and board id
> such as "bus=ahb,qmi-chip-id=1,qmi-board-id=4" for ahb bus chip and
> "bus=pci,qmi-chip-id=0,qmi-board-id=255" for PCIe bus chip in
> board-2.bin. For WCN6855, it is not enough to distinguish all different
> chips.
>
> This is to add a new string type which include bus, chip id, board id,
> vendor, device, subsystem-vendor and subsystem-device for WCN6855.
>
> ath11k will first load board-2.bin and search in it for the board data
> with the above parameters, if matched one board data, then download it
> to firmware, if not matched any one, then ath11k will download the file
> board.bin to firmware.
>
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath11k/core.c | 27 ++++++++++++++++++++------
>  drivers/net/wireless/ath/ath11k/core.h | 13 +++++++++++++
>  drivers/net/wireless/ath/ath11k/pci.c  | 10 ++++++++++
>  drivers/net/wireless/ath/ath11k/qmi.h  |  3 +++
>  4 files changed, 47 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> index 8f09ae827170..a8c6f7cf33d5 100644
> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -406,11 +406,26 @@ static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name,
>  		scnprintf(variant, sizeof(variant), ",variant=%s",
>  			  ab->qmi.target.bdf_ext);
>  
> -	scnprintf(name, name_len,
> -		  "bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s",
> -		  ath11k_bus_str(ab->hif.bus),
> -		  ab->qmi.target.chip_id,
> -		  ab->qmi.target.board_id, variant);
> +	switch (ab->id.bdf_search) {
> +	case ATH11K_BDF_SEARCH_BUS_AND_BOARD:
> +		scnprintf(name, name_len,
> +			  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s",
> +			  ath11k_bus_str(ab->hif.bus),
> +			  ab->id.vendor, ab->id.device,
> +			  ab->id.subsystem_vendor,
> +			  ab->id.subsystem_device,
> +			  FIELD_GET(ATH11K_CHIP_ID_MASK, ab->qmi.target.chip_id),
> +			  ab->qmi.target.board_id & 0xFF,

Why are chip_id and board_id masked? Why cannot we use values directly
provided by the firmware?

And if we need to mask those, it's better to do them in qmi.c where they
are stored:

	if (resp.chip_info_valid) {
		ab->qmi.target.chip_id = resp.chip_info.chip_id;
		ab->qmi.target.chip_family = resp.chip_info.chip_family;
	}

	if (resp.board_info_valid)
		ab->qmi.target.board_id = resp.board_info.board_id;
	else
		ab->qmi.target.board_id = 0xFF;

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

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

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  reply	other threads:[~2021-11-08 13:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 18:11 [PATCH] ath11k: add string type to search board data in board-2.bin for WCN6855 Jouni Malinen
2021-11-08 13:15 ` Kalle Valo [this message]
2021-11-09  9:51   ` Wen Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtmepz3z.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=jouni@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wgong@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox