ssb: remove rev from boardinfo
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 29 Apr 2012 00:04:06 +0000 (02:04 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 16:45:20 +0000 (12:45 -0400)
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>
arch/mips/bcm47xx/setup.c
drivers/net/wireless/b43/bus.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/b43legacy/phy.c
drivers/net/wireless/b43legacy/radio.c
drivers/ssb/pci.c
include/linux/ssb/ssb.h

index 19780aa917081e0ce547c63e1ffc8fff9d8723be..d9278a82e003bdb98f2f00d2d5af3dedc4c089c1 100644 (file)
@@ -115,8 +115,6 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
                iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
        if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
                iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
-       if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
-               iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
 
        bcm47xx_fill_sprom(&iv->sprom, NULL);
 
index 424692df239d40232f6da1e0849a875064087ecd..8f3c0a889a4ee5d6f2ee95502a51df5d1e87fcd3 100644 (file)
@@ -210,7 +210,7 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev)
 
        dev->board_vendor = sdev->bus->boardinfo.vendor;
        dev->board_type = sdev->bus->boardinfo.type;
-       dev->board_rev = sdev->bus->boardinfo.rev;
+       dev->board_rev = sdev->bus->sprom.board_rev;
 
        dev->chip_id = sdev->bus->chip_id;
        dev->chip_rev = sdev->bus->chip_rev;
index 617afc8211b288ad91397f1e0f86c500da441f3b..5a39b226b2e3193958bf29472c3112c7361de0e5 100644 (file)
@@ -5243,10 +5243,10 @@ static void b43_sprom_fixup(struct ssb_bus *bus)
 
        /* boardflags workarounds */
        if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL &&
-           bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74)
+           bus->chip_id == 0x4301 && bus->sprom.board_rev == 0x74)
                bus->sprom.boardflags_lo |= B43_BFL_BTCOEXIST;
        if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
-           bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40)
+           bus->boardinfo.type == 0x4E && bus->sprom.board_rev > 0x40)
                bus->sprom.boardflags_lo |= B43_BFL_PACTRL;
        if (bus->bustype == SSB_BUSTYPE_PCI) {
                pdev = bus->host_pci;
index 1deafaac43e349c94a33245ba016c21caa71043a..cd9c9bc186d93099f56b8b912e905255ee7411c9 100644 (file)
@@ -3779,7 +3779,7 @@ static void b43legacy_sprom_fixup(struct ssb_bus *bus)
        /* boardflags workarounds */
        if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
            bus->boardinfo.type == 0x4E &&
-           bus->boardinfo.rev > 0x40)
+           bus->sprom.board_rev > 0x40)
                bus->sprom.boardflags_lo |= B43legacy_BFL_PACTRL;
 }
 
index 950334197f403e12daaaf274b31bb78c9a792cee..995c7d0c212ae317363f024521d4c520332ffd0f 100644 (file)
@@ -408,7 +408,7 @@ static void b43legacy_phy_setupg(struct b43legacy_wldev *dev)
 
                if (is_bcm_board_vendor(dev) &&
                    (dev->dev->bus->boardinfo.type == 0x0416) &&
-                   (dev->dev->bus->boardinfo.rev == 0x0017))
+                   (dev->dev->bus->sprom.board_rev == 0x0017))
                        return;
 
                b43legacy_ilt_write(dev, 0x5001, 0x0002);
@@ -424,7 +424,7 @@ static void b43legacy_phy_setupg(struct b43legacy_wldev *dev)
 
                if (is_bcm_board_vendor(dev) &&
                    (dev->dev->bus->boardinfo.type == 0x0416) &&
-                   (dev->dev->bus->boardinfo.rev == 0x0017))
+                   (dev->dev->bus->sprom.board_rev == 0x0017))
                        return;
 
                b43legacy_ilt_write(dev, 0x0401, 0x0002);
index fcbafcd603ccf1549c112012845dcd4a73a1b10c..8961776903942322961bca6573b0759cde5e0511 100644 (file)
@@ -1998,7 +1998,7 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
                        if (phy->type == B43legacy_PHYTYPE_G) {
                                if (is_bcm_board_vendor(dev) &&
                                    dev->dev->bus->boardinfo.type == 0x421 &&
-                                   dev->dev->bus->boardinfo.rev >= 30)
+                                   dev->dev->bus->sprom.board_rev >= 30)
                                        att = 3;
                                else if (is_bcm_board_vendor(dev) &&
                                         dev->dev->bus->boardinfo.type == 0x416)
@@ -2008,7 +2008,7 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
                        } else {
                                if (is_bcm_board_vendor(dev) &&
                                    dev->dev->bus->boardinfo.type == 0x421 &&
-                                   dev->dev->bus->boardinfo.rev >= 30)
+                                   dev->dev->bus->sprom.board_rev >= 30)
                                        att = 7;
                                else
                                        att = 6;
@@ -2018,7 +2018,7 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
                        if (phy->type == B43legacy_PHYTYPE_G) {
                                if (is_bcm_board_vendor(dev) &&
                                    dev->dev->bus->boardinfo.type == 0x421 &&
-                                   dev->dev->bus->boardinfo.rev >= 30)
+                                   dev->dev->bus->sprom.board_rev >= 30)
                                        att = 3;
                                else if (is_bcm_board_vendor(dev) &&
                                         dev->dev->bus->boardinfo.type ==
@@ -2052,9 +2052,9 @@ u16 b43legacy_default_radio_attenuation(struct b43legacy_wldev *dev)
        }
        if (is_bcm_board_vendor(dev) &&
            dev->dev->bus->boardinfo.type == 0x421) {
-               if (dev->dev->bus->boardinfo.rev < 0x43)
+               if (dev->dev->bus->sprom.board_rev < 0x43)
                        att = 2;
-               else if (dev->dev->bus->boardinfo.rev < 0x51)
+               else if (dev->dev->bus->sprom.board_rev < 0x51)
                        att = 3;
        }
        if (att == 0xFFFF)
index ed4124469a3a34493088db68b725c081620ab81d..113208e0ae33bc65efddf60b229fc0a3e95f475c 100644 (file)
@@ -784,7 +784,6 @@ static void ssb_pci_get_boardinfo(struct ssb_bus *bus,
 {
        bi->vendor = bus->host_pci->subsystem_vendor;
        bi->type = bus->host_pci->subsystem_device;
-       bi->rev = bus->host_pci->revision;
 }
 
 int ssb_pci_get_invariants(struct ssb_bus *bus,
index d2768318002519510971a60a156ff32591f6790c..bc14bd738ade2f456af80dfc94bdc259b4ceb5aa 100644 (file)
@@ -188,7 +188,6 @@ struct ssb_sprom {
 struct ssb_boardinfo {
        u16 vendor;
        u16 type;
-       u8  rev;
 };