From: Felix Fietkau <nbd@nbd.name>
To: Daniel Danzberger <daniel@dd-wrt.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mt76: mt7915: add device name in eeprom request
Date: Tue, 12 Apr 2022 09:09:04 +0200 [thread overview]
Message-ID: <35ae1b48-e9e6-3c05-1abe-7d11dfb03797@nbd.name> (raw)
In-Reply-To: <20220411142309.886165-1-daniel@dd-wrt.com>
On 11.04.22 16:23, Daniel Danzberger wrote:
> When an eerpom is requested from userspace via request_firmware, the
> device name is appened to the firmware name so the userspace can load
> different eeproms/caldata for different devices.
>
> Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
> ---
> mt7915/eeprom.c | 7 ++++++-
> mt7915/mt7915.h | 16 ++++++++--------
> 2 files changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
> index 4b1a9811..99c1d650 100644
> --- a/mt7915/eeprom.c
> +++ b/mt7915/eeprom.c
> @@ -76,8 +76,13 @@ mt7915_eeprom_load_default(struct mt7915_dev *dev)
> u8 *eeprom = dev->mt76.eeprom.data;
> const struct firmware *fw = NULL;
> int ret;
> + char eeprom_name[100];
>
> - ret = request_firmware(&fw, mt7915_eeprom_name(dev), dev->mt76.dev);
> + scnprintf(eeprom_name, sizeof(eeprom_name),
> + "mediatek/%s-%s.bin",
> + mt7915_eeprom_name(dev), dev_name(dev->mt76.dev));
In order to not break compatibility, please keep the existing code that
loads eeprom files based on the chip name.
For the device name based eeprom file, you don't need to include the
chip id. Just make it mt76-eeprom-<name>.bin or something like that.
I also think you don't need the mediatek/ prefix here, since that's
usually used for files shipped with linux-firmware.git
- Felix
parent reply other threads:[~2022-04-12 9:54 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20220411142309.886165-1-daniel@dd-wrt.com>]
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=35ae1b48-e9e6-3c05-1abe-7d11dfb03797@nbd.name \
--to=nbd@nbd.name \
--cc=daniel@dd-wrt.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox