Skip to content

Commit 5a20ef3

Browse files
haukelinvjw
authored andcommitted
ssb: remove rev from boardinfo
Previously the rev contained the revision read from the pci config space and was used as board_rev in the wireless drivers. This is wrong the board_rev is only fetched from the sprom accordingly to the open source part of the Broadcom SDK and brcmsmac. This patch removes the rev from the boardinfo structure and uses the board_rev attribute from sprom instead. This attribute is filled by PCI, PCMCIA, SDIO and SoC code. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 12d9568 commit 5a20ef3

8 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎arch/mips/bcm47xx/setup.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
115115
iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
116116
if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
117117
iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
118-
if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
119-
iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
120118

121119
bcm47xx_fill_sprom(&iv->sprom, NULL);
122120

‎drivers/net/wireless/b43/bus.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev)
210210

211211
dev->board_vendor = sdev->bus->boardinfo.vendor;
212212
dev->board_type = sdev->bus->boardinfo.type;
213-
dev->board_rev = sdev->bus->boardinfo.rev;
213+
dev->board_rev = sdev->bus->sprom.board_rev;
214214

215215
dev->chip_id = sdev->bus->chip_id;
216216
dev->chip_rev = sdev->bus->chip_rev;

‎drivers/net/wireless/b43/main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5243,10 +5243,10 @@ static void b43_sprom_fixup(struct ssb_bus *bus)
52435243

52445244
/* boardflags workarounds */
52455245
if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL &&
5246-
bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74)
5246+
bus->chip_id == 0x4301 && bus->sprom.board_rev == 0x74)
52475247
bus->sprom.boardflags_lo |= B43_BFL_BTCOEXIST;
52485248
if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
5249-
bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40)
5249+
bus->boardinfo.type == 0x4E && bus->sprom.board_rev > 0x40)
52505250
bus->sprom.boardflags_lo |= B43_BFL_PACTRL;
52515251
if (bus->bustype == SSB_BUSTYPE_PCI) {
52525252
pdev = bus->host_pci;

‎drivers/net/wireless/b43legacy/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3779,7 +3779,7 @@ static void b43legacy_sprom_fixup(struct ssb_bus *bus)
37793779
/* boardflags workarounds */
37803780
if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
37813781
bus->boardinfo.type == 0x4E &&
3782-
bus->boardinfo.rev > 0x40)
3782+
bus->sprom.board_rev > 0x40)
37833783
bus->sprom.boardflags_lo |= B43legacy_BFL_PACTRL;
37843784
}
37853785

‎drivers/net/wireless/b43legacy/phy.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static void b43legacy_phy_setupg(struct b43legacy_wldev *dev)
408408

409409
if (is_bcm_board_vendor(dev) &&
410410
(dev->dev->bus->boardinfo.type == 0x0416) &&
411-
(dev->dev->bus->boardinfo.rev == 0x0017))
411+
(dev->dev->bus->sprom.board_rev == 0x0017))
412412
return;
413413

414414
b43legacy_ilt_write(dev, 0x5001, 0x0002);
@@ -424,7 +424,7 @@ static void b43legacy_phy_setupg(struct b43legacy_wldev *dev)
424424

425425
if (is_bcm_board_vendor(dev) &&
426426
(dev->dev->bus->boardinfo.type == 0x0416) &&
427-
(dev->dev->bus->boardinfo.rev == 0x0017))
427+
(dev->dev->bus->sprom.board_rev == 0x0017))
428428
return;
429429

430430
b43legacy_ilt_write(dev, 0x0401, 0x0002);

‎drivers/net/wireless/b43legacy/radio.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
19981998
if (phy->type == B43legacy_PHYTYPE_G) {
19991999
if (is_bcm_board_vendor(dev) &&
20002000
dev->dev->bus->boardinfo.type == 0x421 &&
2001-
dev->dev->bus->boardinfo.rev >= 30)
2001+
dev->dev->bus->sprom.board_rev >= 30)
20022002
att = 3;
20032003
else if (is_bcm_board_vendor(dev) &&
20042004
dev->dev->bus->boardinfo.type == 0x416)
@@ -2008,7 +2008,7 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
20082008
} else {
20092009
if (is_bcm_board_vendor(dev) &&
20102010
dev->dev->bus->boardinfo.type == 0x421 &&
2011-
dev->dev->bus->boardinfo.rev >= 30)
2011+
dev->dev->bus->sprom.board_rev >= 30)
20122012
att = 7;
20132013
else
20142014
att = 6;
@@ -2018,7 +2018,7 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
20182018
if (phy->type == B43legacy_PHYTYPE_G) {
20192019
if (is_bcm_board_vendor(dev) &&
20202020
dev->dev->bus->boardinfo.type == 0x421 &&
2021-
dev->dev->bus->boardinfo.rev >= 30)
2021+
dev->dev->bus->sprom.board_rev >= 30)
20222022
att = 3;
20232023
else if (is_bcm_board_vendor(dev) &&
20242024
dev->dev->bus->boardinfo.type ==
@@ -2052,9 +2052,9 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
20522052
}
20532053
if (is_bcm_board_vendor(dev) &&
20542054
dev->dev->bus->boardinfo.type == 0x421) {
2055-
if (dev->dev->bus->boardinfo.rev < 0x43)
2055+
if (dev->dev->bus->sprom.board_rev < 0x43)
20562056
att = 2;
2057-
else if (dev->dev->bus->boardinfo.rev < 0x51)
2057+
else if (dev->dev->bus->sprom.board_rev < 0x51)
20582058
att = 3;
20592059
}
20602060
if (att == 0xFFFF)

‎drivers/ssb/pci.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ static void ssb_pci_get_boardinfo(struct ssb_bus *bus,
784784
{
785785
bi->vendor = bus->host_pci->subsystem_vendor;
786786
bi->type = bus->host_pci->subsystem_device;
787-
bi->rev = bus->host_pci->revision;
788787
}
789788

790789
int ssb_pci_get_invariants(struct ssb_bus *bus,

‎include/linux/ssb/ssb.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ struct ssb_sprom {
188188
struct ssb_boardinfo {
189189
u16 vendor;
190190
u16 type;
191-
u8 rev;
192191
};
193192

194193

0 commit comments

Comments
 (0)