immortalwrt/target/linux
Daniel González Cabanelas dddfa88c1c 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-03 12:27:21 +08:00
..
apm821xx treewide: use upstream caldata script 2021-01-30 12:18:02 +08:00
arc770 treewide: remove support for kernel 4.x 2020-10-31 11:39:45 +08:00
archs38 config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-26 12:03:41 +08:00
armvirt Merge Mainline 2020-12-17 23:24:15 +08:00
at91 treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 15:20:43 +08:00
ath25 kernel: bump 5.4 to 5.4.86 2021-01-02 12:00:30 +08:00
ath79 ath79: ag71xx: add ethtool statistics support 2021-02-02 01:04:11 +08:00
bcm27xx kernel: bump 5.4 to 5.4.94 2021-02-02 12:28:14 +08:00
bcm47xx kernel: drop empty kmod-ledtrig-* packages 2021-01-16 12:20:58 +08:00
bcm53xx Merge Mainline 2021-01-30 20:17:18 +08:00
bcm63xx bcm63xx: sprom: override the PCI device ID 2021-02-03 12:27:21 +08:00
bcm4908 bcm4908: sort and wrap build recipes 2021-01-28 12:08:50 +08:00
gemini treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 22:47:58 +08:00
generic kernel: bump 5.4 to 5.4.93 2021-01-29 22:34:20 +08:00
imx6 imx6: disable unrequired pcie host driver 2021-01-08 16:10:48 +08:00
ipq40xx treewide: use upstream caldata script 2021-01-30 12:18:02 +08:00
ipq806x treewide: use upstream caldata script 2021-01-30 12:18:02 +08:00
ipq807x config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-26 12:03:41 +08:00
kirkwood treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 22:47:58 +08:00
lantiq treewide: use upstream caldata script 2021-01-30 12:18:02 +08:00
layerscape kernel: bump 5.4 to 5.4.94 2021-02-02 12:28:14 +08:00
malta config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-26 12:03:41 +08:00
mediatek treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 22:47:58 +08:00
mpc85xx treewide: use upstream caldata script 2021-01-30 12:18:02 +08:00
mvebu kernel: bump 5.4 to 5.4.94 2021-02-02 12:28:14 +08:00
mxs kernel: drop empty kmod-ledtrig-* packages 2021-01-16 12:20:58 +08:00
octeon kernel: bump 5.4 to 5.4.75 2020-11-12 11:14:24 +08:00
octeontx treewide: remove support for kernel 4.x 2020-10-31 11:39:45 +08:00
omap treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 22:47:58 +08:00
oxnas treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 22:47:58 +08:00
pistachio kernel: move some disabled symbols to generic 2020-12-23 11:33:15 +08:00
ramips treewide: use upstream caldata script 2021-01-30 12:18:02 +08:00
realtek kernel: bump 5.4 to 5.4.93 2021-01-29 22:34:20 +08:00
rockchip treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 15:20:43 +08:00
sunxi treewide: provide global default for SUPPORTED_DEVICES 2021-01-29 22:47:58 +08:00
tegra Merge Mainline 2021-01-29 23:01:13 +08:00
uml kernel: bump to 4.9.240, 4.14.202, 4.19.152 2020-10-17 19:46:46 +08:00
x86 Merge Mainline 2021-01-29 23:01:13 +08:00
zynq config: limit CONFIG_PERF_EVENTS to top-level generic configs 2021-01-26 12:03:41 +08:00
Makefile