diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-12-22 15:51:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:14 -0500 |
commit | e861b98d5e1be769ca6483b6df97149b956ea834 (patch) | |
tree | 88754e03eddc9a7b1441421125a776c5cbd597d1 /drivers/net | |
parent | 66c6b139f77e8568f03611422967bfaa4c4a3bbd (diff) |
ssb: Fix extraction of values from SPROM
This fixes extraction of some values from the SPROM.
It mainly fixes extraction of antenna related values, which
is needed for another b43 fix sent later.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/phy.c | 2 |
3 files changed, 1 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index d7ea671394a8..68bbe8eafd6d 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3884,16 +3884,6 @@ static void b43_sprom_fixup(struct ssb_bus *bus) | |||
3884 | if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && | 3884 | if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && |
3885 | bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40) | 3885 | bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40) |
3886 | bus->sprom.boardflags_lo |= B43_BFL_PACTRL; | 3886 | bus->sprom.boardflags_lo |= B43_BFL_PACTRL; |
3887 | |||
3888 | /* Handle case when gain is not set in sprom */ | ||
3889 | if (bus->sprom.antenna_gain_a == 0xFF) | ||
3890 | bus->sprom.antenna_gain_a = 2; | ||
3891 | if (bus->sprom.antenna_gain_bg == 0xFF) | ||
3892 | bus->sprom.antenna_gain_bg = 2; | ||
3893 | |||
3894 | /* Convert Antennagain values to Q5.2 */ | ||
3895 | bus->sprom.antenna_gain_a <<= 2; | ||
3896 | bus->sprom.antenna_gain_bg <<= 2; | ||
3897 | } | 3887 | } |
3898 | 3888 | ||
3899 | static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl) | 3889 | static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl) |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 14087fc20f3a..575fd9a5874d 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -3572,11 +3572,6 @@ static void b43legacy_sprom_fixup(struct ssb_bus *bus) | |||
3572 | bus->boardinfo.type == 0x4E && | 3572 | bus->boardinfo.type == 0x4E && |
3573 | bus->boardinfo.rev > 0x40) | 3573 | bus->boardinfo.rev > 0x40) |
3574 | bus->sprom.boardflags_lo |= B43legacy_BFL_PACTRL; | 3574 | bus->sprom.boardflags_lo |= B43legacy_BFL_PACTRL; |
3575 | |||
3576 | /* Convert Antennagain values to Q5.2 */ | ||
3577 | if (bus->sprom.antenna_gain_bg == 0xFF) | ||
3578 | bus->sprom.antenna_gain_bg = 2; /* if unset, use 2 dBm */ | ||
3579 | bus->sprom.antenna_gain_bg <<= 2; | ||
3580 | } | 3575 | } |
3581 | 3576 | ||
3582 | static void b43legacy_wireless_exit(struct ssb_device *dev, | 3577 | static void b43legacy_wireless_exit(struct ssb_device *dev, |
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c index 9d527e6d6ced..57c668f575fc 100644 --- a/drivers/net/wireless/b43legacy/phy.c +++ b/drivers/net/wireless/b43legacy/phy.c | |||
@@ -1859,7 +1859,7 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1859 | * which accounts for the factor of 4 */ | 1859 | * which accounts for the factor of 4 */ |
1860 | #define REG_MAX_PWR 20 | 1860 | #define REG_MAX_PWR 20 |
1861 | max_pwr = min(REG_MAX_PWR * 4 | 1861 | max_pwr = min(REG_MAX_PWR * 4 |
1862 | - dev->dev->bus->sprom.antenna_gain_bg | 1862 | - dev->dev->bus->sprom.antenna_gain.ghz24.a0 |
1863 | - 0x6, max_pwr); | 1863 | - 0x6, max_pwr); |
1864 | 1864 | ||
1865 | /* find the desired power in Q5.2 - power_level is in dBm | 1865 | /* find the desired power in Q5.2 - power_level is in dBm |