Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH] mt76: mt7915: add device name in eeprom request
       [not found] <20220411142309.886165-1-daniel@dd-wrt.com>
@ 2022-04-12  7:09 ` Felix Fietkau
  0 siblings, 0 replies; only message in thread
From: Felix Fietkau @ 2022-04-12  7:09 UTC (permalink / raw)
  To: Daniel Danzberger, linux-wireless


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-12  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220411142309.886165-1-daniel@dd-wrt.com>
2022-04-12  7:09 ` [PATCH] mt76: mt7915: add device name in eeprom request Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox