openwrt/target/linux
Daniel González Cabanelas a0e0e621ca bcm63xx: sprom: override the PCI device ID
The PCI device ID detected by the wifi drivers on devices using a fallback
SPROM is wrong. Currently the chipnum is used for this parameter.

Most SSB based Broadcom wifi chips are 2.4 and 5GHz capable. But on
devices without a physical SPROM, the only one way to detect if the device
suports both bands or only the 5GHz band, is by reading the device ID from
the fallback SPROM.

In some devices, this may lead to a non working wifi on a 5GHz-only card,
or in the best case a working 2.4GHz-only in a dual band wifi card.

The offset for the deviceid in SSB SPROMs is 0x0008, whereas in BCMA is
0x0060. This is true for any SPROM version.

Override the PCI device ID with the one defined at the fallback SPROM, to
detect the correct wifi card model and allow using the 5GHz band if
supported.

The patch has been tested with the following wifi radios:

BCM43222: b43: both 2.4/5GHz working
          brcm-wl: both 2.4/5GHz working

BCM43225: b43: 2.4GHz, working
	 brcmsmac: working
	 brcm-wl: it lacks support

BCM43217: b43: 2.4GHz, working
	 brcmsmac: it lacks support
	 brcm-wl: it lacks support

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
[amend commit description, rework patch to avoid using a new global variable
and keep ssb sprom extraction code as close to ssb/pci.c as possible]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-02-02 20:40:31 +01:00
..
apm821xx treewide: provide global default for SUPPORTED_DEVICES 2021-01-23 12:45:21 +01:00
arc770 arc770: drop support for kernel 4.14 2020-09-02 16:29:22 +02:00
archs38 config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-25 14:37:41 +01:00
armvirt armvirt: README: rename it from LEDE to OpenWrt 2020-12-14 21:38:10 +00:00
at91 treewide: provide global default for SUPPORTED_DEVICES 2021-01-23 12:45:21 +01:00
ath25 kernel: bump 5.4 to 5.4.86 2021-01-01 17:07:28 +01:00
ath79 ath79: ag71xx: add ethtool statistics support 2021-02-01 00:48:12 +01:00
bcm27xx kernel: bump 5.4 to 5.4.94 2021-02-01 19:10:43 +01:00
bcm47xx kernel: drop empty kmod-ledtrig-* packages 2021-01-15 18:24:31 +01:00
bcm53xx bcm53xx: use default SUPPORTED_DEVICES for Meraki MR32 2021-01-23 23:42:47 +01:00
bcm63xx bcm63xx: sprom: override the PCI device ID 2021-02-02 20:40:31 +01:00
bcm4908 bcm4908: sort and wrap build recipes 2021-01-27 21:31:20 +01:00
gemini treewide: provide global default for SUPPORTED_DEVICES 2021-01-23 12:45:21 +01:00
generic mac80211: convert UniFi Outdoor+ HSR support to OF 2021-02-01 00:47:36 +01:00
imx6 imx6: disable unrequired pcie host driver 2021-01-07 12:08:31 +01:00
ipq40xx ipq40xx: remove generic profile 2021-01-27 21:31:20 +01:00
ipq806x ipq806x: remove generic profile 2021-01-27 21:31:20 +01:00
ipq807x config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-25 14:37:41 +01:00
kirkwood kirkwood: remove generic profile 2021-01-27 21:31:20 +01:00
lantiq treewide: drop shebang from non-executable lib files 2021-01-29 14:29:41 +01:00
layerscape kernel: bump 5.4 to 5.4.94 2021-02-01 19:10:43 +01:00
malta config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-25 14:37:41 +01:00
mediatek treewide: drop shebang from non-executable lib files 2021-01-29 14:29:41 +01:00
mpc85xx treewide: provide global default for SUPPORTED_DEVICES 2021-01-23 12:45:21 +01:00
mvebu kernel: bump 5.4 to 5.4.94 2021-02-01 19:10:43 +01:00
mxs kernel: drop empty kmod-ledtrig-* packages 2021-01-15 18:24:31 +01:00
octeon kernel: bump 5.4 to 5.4.75 2020-11-10 13:11:32 +01:00
octeontx kernel: move F2FS_FS_XATTR and F2FS_STAT_FS symbols to generic 2020-10-09 23:20:19 +01:00
omap treewide: provide global default for SUPPORTED_DEVICES 2021-01-23 12:45:21 +01:00
oxnas config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-25 14:37:41 +01:00
pistachio kernel: move some disabled symbols to generic 2020-12-22 19:11:50 +01:00
ramips ramips: add support for ELECOM WRC-2533GHBK-I 2021-01-29 15:32:07 +01:00
realtek kernel: bump 5.4 to 5.4.93 2021-01-29 14:22:09 +01:00
rockchip rockchip: fix SUPPORTED_DEVICES for Radxa ROCK Pi 4 2021-01-27 21:31:20 +01:00
sunxi sunxi: add support for linksprite pcDuino3 nano board 2021-01-27 23:14:30 +01:00
tegra treewide: drop shebang from non-executable lib files 2021-01-29 14:29:41 +01:00
uml kernel: bump 5.4 to 5.4.71 2020-10-15 17:46:54 +02:00
x86 config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-25 14:37:41 +01:00
zynq config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-25 14:37:41 +01:00
Makefile build: add 'make kernel_xconfig' command 2020-07-08 16:07:05 +02:00