brcmfmac: expose firmware config files through modinfo
PATCH v2 1/1 brcmfmac: expose firmware config files through modinfo
From: Matthias Brugger <[email protected]>
Apart from a firmware binary the chip needs a config file used by the FW. Add the config files to modinfo so that they can be read by userspace.
---
Changes in v2:
In comparison to first version [0] we use wildcards to enumerate the firmware configuration files. Wildcard support was added to dracut
recently [1].
[0] https://lore.kernel.org/linux-wireless/[email protected]/
[1] https://github.com/dracutdevs/dracut/pull/860
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +9 -0
@@ -625,6 +625,15 @@ BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");BRCMF_FW_DEF (4373 ,"brcmfmac4373-sdio" );BRCMF_FW_DEF (43012 ,"brcmfmac43012-sdio" ); +/* firmware config files */ +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4330-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43340-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43362-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430a0-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43455-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4356-pcie.*.txt" ); +static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {BRCMF_FW_ENTRY (BRCM_CC_43143_CHIP_ID ,0xFFFFFFFF ,43143 ), BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
Signature · 1 line
2.29.2
20.11.2020 12:52, [email protected] пишет:
Quoted 26 lines
From: Matthias Brugger <[email protected]>
Apart from a firmware binary the chip needs a config file used by the FW. Add the config files to modinfo so that they can be read by userspace.
Signed-off-by Matthias Brugger <[email protected]>---
Changes in v2:
In comparison to first version [0] we use wildcards to enumerate the firmware configuration files. Wildcard support was added to dracut
recently [1].
[0] https://lore.kernel.org/linux-wireless/[email protected]/
[1] https://github.com/dracutdevs/dracut/pull/860drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +0
-0@@ -625,6 +625,15 @@ BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");BRCMF_FW_DEF (4373 ,"brcmfmac4373-sdio" );
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c BRCMF_FW_DEF(4359, "brcmfmac4359-sdio"); · line 635
Quoted 10 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +8
-0BRCMF_FW_DEF (43012 ,"brcmfmac43012-sdio" ); +/* firmware config files */ +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4330-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43340-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43362-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430a0-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43455-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4356-pcie.*.txt" );
This doesn't cover all hardware models. Note that the upstream linux-firmware has files only for a few hardware models.
I suppose that the correct mask should be "brcm/brcmfmac*-sdio.*.txt".
Quoted 41 lines · Dmitry Osipenko
20.11.2020 12:52, [email protected] пишет:
Quoted 26 lines
From: Matthias Brugger <[email protected]>
Apart from a firmware binary the chip needs a config file used by the FW. Add the config files to modinfo so that they can be read by userspace.
Signed-off-by Matthias Brugger <[email protected]>---
Changes in v2:
In comparison to first version [0] we use wildcards to enumerate the firmware configuration files. Wildcard support was added to dracut
recently [1].
[0] https://lore.kernel.org/linux-wireless/[email protected]/
[1] https://github.com/dracutdevs/dracut/pull/860drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +0
-0@@ -625,6 +625,15 @@ BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");BRCMF_FW_DEF (4373 ,"brcmfmac4373-sdio" );drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c BRCMF_FW_DEF(4359, "brcmfmac4359-sdio"); · line 635
Quoted 10 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +8
-0BRCMF_FW_DEF (43012 ,"brcmfmac43012-sdio" ); +/* firmware config files */ +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4330-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43340-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43362-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430a0-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43455-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4356-pcie.*.txt" );This doesn't cover all hardware models. Note that the upstream linux-firmware has files only for a few hardware models.
Quoted 2 lines
I suppose that the correct mask should be "
brcm/brcmfmac*-sdio.*.txt".
We can use the two "brcm/brcmfmac*-sdio.*.txt" and "brcm/brcmfmac*-pcie.*.txt" to also include firmware files for chips that don't have any config file in linux-firmware. I'm indifferent to that, although I think we should make incentivize to upstream firmware config files to linux-firmware.
Regards,
Matthias
Hi,
Quoted 43 lines · Matthias Brugger
Quoted 40 lines · Dmitry Osipenko
20.11.2020 12:52, [email protected] пишет:
Quoted 28 lines
From: Matthias Brugger <[email protected]>
Apart from a firmware binary the chip needs a config file used by the FW. Add the config files to modinfo so that they can be read by userspace.
Signed-off-by Matthias Brugger <[email protected]>---
Changes in v2:
In comparison to first version [0] we use wildcards to enumerate the firmware configuration files. Wildcard support was added to dracut
recently [1].
[0] https://lore.kernel.org/linux-wireless/[email protected]/
[1] https://github.com/dracutdevs/dracut/pull/860
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c| 9 +++++++++1 file changed, 9 insertions(+)drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +0
-0@@ -625,6 +625,15 @@ BRCMF_FW_DEF(4359, "brcmfmac4359-sdio"); BRCMF_FW_DEF(4373, "brcmfmac4373-sdio"); BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");+/* firmware config files */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c BRCMF_FW_DEF(4359, "brcmfmac4359-sdio"); · line 635
Quoted 7 lines
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +7
-0+MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4330-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43340-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43362-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430a0-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43430-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac43455-sdio.*.txt" ); +MODULE_FIRMWARE (BRCMF_FW_DEFAULT_PATH "brcm/brcmfmac4356-pcie.*.txt" );This doesn't cover all hardware models. Note that the upstream linux-firmware has files only for a few hardware models.
Quoted 4 lines
Quoted 2 lines
I suppose that the correct mask should be "
brcm/brcmfmac*-sdio.*.txt".We can use the two "
brcm/brcmfmac*-sdio.*.txt" and "brcm/brcmfmac*-pcie.*.txt" to also include firmware files for chips that don't have any config file in linux-firmware.
Yes, lets just go with those 2 wildcard matches, that should catch all the files the driver needs without needing to add a lot of extra MODULE_FIRMWARE() entries to the module's firmware.
Quoted 1 line
I'm indifferent to that, although I think we should make incentivize to upstream firmware config files to linux-firmware.
I completely agree with you. Actually, if you take a look you will see that most of these were submitted to linux-firmware by me :)
But this is really orthogonal to which MODULE_FIRMWARE() entries we should add.
Regards,
Hans