From: Kalle Valo <kvalo@codeaurora.org>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org
Subject: Re: [PATCH] ath11k: Support loading ELF board files.
Date: Wed, 16 Sep 2020 17:21:57 +0300 [thread overview]
Message-ID: <874knxkdiy.fsf@codeaurora.org> (raw)
In-Reply-To: <20200826232044.6799-1-greearb@candelatech.com> (greearb@candelatech.com's message of "Wed, 26 Aug 2020 16:20:44 -0700")
greearb@candelatech.com writes:
> From: Ben Greear <greearb@candelatech.com>
>
> The QCA6390 board I have, model 8291M-PR comes with an ELF board
> file. To get this to at least somewhat work, I renamed bdwlan.e04
> to 'board.bin' and then added this patch to check for .ELF as
> starting bytes of the board file. If that is found, use type
> ELF. After this the driver loads.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>
> This is on top of recent kvallo ath tree.
>
> drivers/net/wireless/ath/ath11k/qmi.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
> index 91134510364c..f87f1d1564f4 100644
> --- a/drivers/net/wireless/ath/ath11k/qmi.c
> +++ b/drivers/net/wireless/ath/ath11k/qmi.c
> @@ -1992,6 +1992,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
> struct qmi_txn txn = {};
> int ret;
> const u8 *temp;
> + int bdf_type = ATH11K_QMI_BDF_TYPE_BIN;
>
> req = kzalloc(sizeof(*req), GFP_KERNEL);
> if (!req)
> @@ -2008,6 +2009,15 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
> temp = bd.data;
> remaining = bd.len;
>
> + if (bd.len >= 4) {
> + char* edata = (char*)(temp);
> + if (edata[1] == 'E' &&
> + edata[2] == 'L' &&
> + edata[3] == 'F') {
> + bdf_type = ATH11K_QMI_BDF_TYPE_ELF;
> + }
> + }
Thanks, looks good. Expect that the ELF magic check can be simplified to:
strncmp(edata, ELFMAG, SELFMAG)
But I can send v2, I'll soon send some more QCA6390 patches and I'll
include this to the set.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@codeaurora.org>
To: greearb@candelatech.com
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath11k: Support loading ELF board files.
Date: Wed, 16 Sep 2020 17:21:57 +0300 [thread overview]
Message-ID: <874knxkdiy.fsf@codeaurora.org> (raw)
In-Reply-To: <20200826232044.6799-1-greearb@candelatech.com> (greearb@candelatech.com's message of "Wed, 26 Aug 2020 16:20:44 -0700")
greearb@candelatech.com writes:
> From: Ben Greear <greearb@candelatech.com>
>
> The QCA6390 board I have, model 8291M-PR comes with an ELF board
> file. To get this to at least somewhat work, I renamed bdwlan.e04
> to 'board.bin' and then added this patch to check for .ELF as
> starting bytes of the board file. If that is found, use type
> ELF. After this the driver loads.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>
> This is on top of recent kvallo ath tree.
>
> drivers/net/wireless/ath/ath11k/qmi.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
> index 91134510364c..f87f1d1564f4 100644
> --- a/drivers/net/wireless/ath/ath11k/qmi.c
> +++ b/drivers/net/wireless/ath/ath11k/qmi.c
> @@ -1992,6 +1992,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
> struct qmi_txn txn = {};
> int ret;
> const u8 *temp;
> + int bdf_type = ATH11K_QMI_BDF_TYPE_BIN;
>
> req = kzalloc(sizeof(*req), GFP_KERNEL);
> if (!req)
> @@ -2008,6 +2009,15 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
> temp = bd.data;
> remaining = bd.len;
>
> + if (bd.len >= 4) {
> + char* edata = (char*)(temp);
> + if (edata[1] == 'E' &&
> + edata[2] == 'L' &&
> + edata[3] == 'F') {
> + bdf_type = ATH11K_QMI_BDF_TYPE_ELF;
> + }
> + }
Thanks, looks good. Expect that the ELF magic check can be simplified to:
strncmp(edata, ELFMAG, SELFMAG)
But I can send v2, I'll soon send some more QCA6390 patches and I'll
include this to the set.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2020-09-16 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 23:20 [PATCH] ath11k: Support loading ELF board files greearb
2020-08-26 23:20 ` greearb
2020-09-16 14:21 ` Kalle Valo [this message]
2020-09-16 14:21 ` Kalle Valo
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=874knxkdiy.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=ath11k@lists.infradead.org \
--cc=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.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 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.