aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2007-11-09 17:57:34 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:43 -0500
commit7797aa384870e3bb5bfd3b6a0eae61e7c7a4c993 (patch)
tree9d48b112dc1c973a17860fe39e82554724f7ed4b
parent95de2841aad971867851b59c0c5253ecc2e19832 (diff)
b43legacy: Convert to use of the new SPROM structure
The b43legacy driver is modified to use the new SPROM structure. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43legacy/leds.c8
-rw-r--r--drivers/net/wireless/b43legacy/main.c20
-rw-r--r--drivers/net/wireless/b43legacy/phy.c38
-rw-r--r--drivers/net/wireless/b43legacy/radio.c12
-rw-r--r--drivers/net/wireless/b43legacy/xmit.c2
5 files changed, 41 insertions, 39 deletions
diff --git a/drivers/net/wireless/b43legacy/leds.c b/drivers/net/wireless/b43legacy/leds.c
index b4319c99cf70..f0affb781002 100644
--- a/drivers/net/wireless/b43legacy/leds.c
+++ b/drivers/net/wireless/b43legacy/leds.c
@@ -189,10 +189,10 @@ void b43legacy_leds_init(struct b43legacy_wldev *dev)
189 enum b43legacy_led_behaviour behaviour; 189 enum b43legacy_led_behaviour behaviour;
190 bool activelow; 190 bool activelow;
191 191
192 sprom[0] = bus->sprom.r1.gpio0; 192 sprom[0] = bus->sprom.gpio0;
193 sprom[1] = bus->sprom.r1.gpio1; 193 sprom[1] = bus->sprom.gpio1;
194 sprom[2] = bus->sprom.r1.gpio2; 194 sprom[2] = bus->sprom.gpio2;
195 sprom[3] = bus->sprom.r1.gpio3; 195 sprom[3] = bus->sprom.gpio3;
196 196
197 for (i = 0; i < 4; i++) { 197 for (i = 0; i < 4; i++) {
198 if (sprom[i] == 0xFF) { 198 if (sprom[i] == 0xFF) {
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index e545f79ac747..1a8b67619077 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -1745,7 +1745,7 @@ static int b43legacy_gpio_init(struct b43legacy_wldev *dev)
1745 mask |= 0x0060; 1745 mask |= 0x0060;
1746 set |= 0x0060; 1746 set |= 0x0060;
1747 } 1747 }
1748 if (dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_PACTRL) { 1748 if (dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_PACTRL) {
1749 b43legacy_write16(dev, B43legacy_MMIO_GPIO_MASK, 1749 b43legacy_write16(dev, B43legacy_MMIO_GPIO_MASK,
1750 b43legacy_read16(dev, 1750 b43legacy_read16(dev,
1751 B43legacy_MMIO_GPIO_MASK) 1751 B43legacy_MMIO_GPIO_MASK)
@@ -2122,7 +2122,7 @@ static void b43legacy_periodic_every120sec(struct b43legacy_wldev *dev)
2122static void b43legacy_periodic_every60sec(struct b43legacy_wldev *dev) 2122static void b43legacy_periodic_every60sec(struct b43legacy_wldev *dev)
2123{ 2123{
2124 b43legacy_phy_lo_mark_all_unused(dev); 2124 b43legacy_phy_lo_mark_all_unused(dev);
2125 if (dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_RSSI) { 2125 if (dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_RSSI) {
2126 b43legacy_mac_suspend(dev); 2126 b43legacy_mac_suspend(dev);
2127 b43legacy_calc_nrssi_slope(dev); 2127 b43legacy_calc_nrssi_slope(dev);
2128 b43legacy_mac_enable(dev); 2128 b43legacy_mac_enable(dev);
@@ -3064,7 +3064,7 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev)
3064 hf |= B43legacy_HF_SYMW; 3064 hf |= B43legacy_HF_SYMW;
3065 if (phy->rev == 1) 3065 if (phy->rev == 1)
3066 hf |= B43legacy_HF_GDCW; 3066 hf |= B43legacy_HF_GDCW;
3067 if (sprom->r1.boardflags_lo & B43legacy_BFL_PACTRL) 3067 if (sprom->boardflags_lo & B43legacy_BFL_PACTRL)
3068 hf |= B43legacy_HF_OFDMPABOOST; 3068 hf |= B43legacy_HF_OFDMPABOOST;
3069 } else if (phy->type == B43legacy_PHYTYPE_B) { 3069 } else if (phy->type == B43legacy_PHYTYPE_B) {
3070 hf |= B43legacy_HF_SYMW; 3070 hf |= B43legacy_HF_SYMW;
@@ -3556,12 +3556,12 @@ static void b43legacy_sprom_fixup(struct ssb_bus *bus)
3556 if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && 3556 if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
3557 bus->boardinfo.type == 0x4E && 3557 bus->boardinfo.type == 0x4E &&
3558 bus->boardinfo.rev > 0x40) 3558 bus->boardinfo.rev > 0x40)
3559 bus->sprom.r1.boardflags_lo |= B43legacy_BFL_PACTRL; 3559 bus->sprom.boardflags_lo |= B43legacy_BFL_PACTRL;
3560 3560
3561 /* Convert Antennagain values to Q5.2 */ 3561 /* Convert Antennagain values to Q5.2 */
3562 if (bus->sprom.r1.antenna_gain_bg == 0xFF) 3562 if (bus->sprom.antenna_gain_bg == 0xFF)
3563 bus->sprom.r1.antenna_gain_bg = 2; /* if unset, use 2 dBm */ 3563 bus->sprom.antenna_gain_bg = 2; /* if unset, use 2 dBm */
3564 bus->sprom.r1.antenna_gain_bg <<= 2; 3564 bus->sprom.antenna_gain_bg <<= 2;
3565} 3565}
3566 3566
3567static void b43legacy_wireless_exit(struct ssb_device *dev, 3567static void b43legacy_wireless_exit(struct ssb_device *dev,
@@ -3596,10 +3596,10 @@ static int b43legacy_wireless_init(struct ssb_device *dev)
3596 hw->max_noise = -110; 3596 hw->max_noise = -110;
3597 hw->queues = 1; /* FIXME: hardware has more queues */ 3597 hw->queues = 1; /* FIXME: hardware has more queues */
3598 SET_IEEE80211_DEV(hw, dev->dev); 3598 SET_IEEE80211_DEV(hw, dev->dev);
3599 if (is_valid_ether_addr(sprom->r1.et1mac)) 3599 if (is_valid_ether_addr(sprom->et1mac))
3600 SET_IEEE80211_PERM_ADDR(hw, sprom->r1.et1mac); 3600 SET_IEEE80211_PERM_ADDR(hw, sprom->et1mac);
3601 else 3601 else
3602 SET_IEEE80211_PERM_ADDR(hw, sprom->r1.il0mac); 3602 SET_IEEE80211_PERM_ADDR(hw, sprom->il0mac);
3603 3603
3604 /* Get and initialize struct b43legacy_wl */ 3604 /* Get and initialize struct b43legacy_wl */
3605 wl = hw_to_b43legacy_wl(hw); 3605 wl = hw_to_b43legacy_wl(hw);
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c
index d121fae53aa0..9d527e6d6ced 100644
--- a/drivers/net/wireless/b43legacy/phy.c
+++ b/drivers/net/wireless/b43legacy/phy.c
@@ -441,7 +441,7 @@ static void b43legacy_phy_inita(struct b43legacy_wldev *dev)
441 might_sleep(); 441 might_sleep();
442 442
443 b43legacy_phy_setupg(dev); 443 b43legacy_phy_setupg(dev);
444 if (dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_PACTRL) 444 if (dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_PACTRL)
445 b43legacy_phy_write(dev, 0x046E, 0x03CF); 445 b43legacy_phy_write(dev, 0x046E, 0x03CF);
446} 446}
447 447
@@ -543,7 +543,7 @@ static void b43legacy_phy_initb4(struct b43legacy_wldev *dev)
543 if (phy->radio_ver == 0x2050) 543 if (phy->radio_ver == 0x2050)
544 b43legacy_phy_write(dev, 0x002A, 0x88C2); 544 b43legacy_phy_write(dev, 0x002A, 0x88C2);
545 b43legacy_radio_set_txpower_bg(dev, 0xFFFF, 0xFFFF, 0xFFFF); 545 b43legacy_radio_set_txpower_bg(dev, 0xFFFF, 0xFFFF, 0xFFFF);
546 if (dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_RSSI) { 546 if (dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_RSSI) {
547 b43legacy_calc_nrssi_slope(dev); 547 b43legacy_calc_nrssi_slope(dev);
548 b43legacy_calc_nrssi_threshold(dev); 548 b43legacy_calc_nrssi_threshold(dev);
549 } 549 }
@@ -699,7 +699,7 @@ static void b43legacy_phy_initb6(struct b43legacy_wldev *dev)
699 b43legacy_radio_write16(dev, 0x005A, 0x0088); 699 b43legacy_radio_write16(dev, 0x005A, 0x0088);
700 b43legacy_radio_write16(dev, 0x005B, 0x006B); 700 b43legacy_radio_write16(dev, 0x005B, 0x006B);
701 b43legacy_radio_write16(dev, 0x005C, 0x000F); 701 b43legacy_radio_write16(dev, 0x005C, 0x000F);
702 if (dev->dev->bus->sprom.r1.boardflags_lo & 0x8000) { 702 if (dev->dev->bus->sprom.boardflags_lo & 0x8000) {
703 b43legacy_radio_write16(dev, 0x005D, 0x00FA); 703 b43legacy_radio_write16(dev, 0x005D, 0x00FA);
704 b43legacy_radio_write16(dev, 0x005E, 0x00D8); 704 b43legacy_radio_write16(dev, 0x005E, 0x00D8);
705 } else { 705 } else {
@@ -797,7 +797,7 @@ static void b43legacy_phy_initb6(struct b43legacy_wldev *dev)
797 b43legacy_phy_write(dev, 0x0062, 0x0007); 797 b43legacy_phy_write(dev, 0x0062, 0x0007);
798 b43legacy_radio_init2050(dev); 798 b43legacy_radio_init2050(dev);
799 b43legacy_phy_lo_g_measure(dev); 799 b43legacy_phy_lo_g_measure(dev);
800 if (dev->dev->bus->sprom.r1.boardflags_lo & 800 if (dev->dev->bus->sprom.boardflags_lo &
801 B43legacy_BFL_RSSI) { 801 B43legacy_BFL_RSSI) {
802 b43legacy_calc_nrssi_slope(dev); 802 b43legacy_calc_nrssi_slope(dev);
803 b43legacy_calc_nrssi_threshold(dev); 803 b43legacy_calc_nrssi_threshold(dev);
@@ -921,7 +921,7 @@ static void b43legacy_calc_loopback_gain(struct b43legacy_wldev *dev)
921 b43legacy_phy_read(dev, 0x0811) | 0x0100); 921 b43legacy_phy_read(dev, 0x0811) | 0x0100);
922 b43legacy_phy_write(dev, 0x0812, 922 b43legacy_phy_write(dev, 0x0812,
923 b43legacy_phy_read(dev, 0x0812) & 0xCFFF); 923 b43legacy_phy_read(dev, 0x0812) & 0xCFFF);
924 if (dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_EXTLNA) { 924 if (dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_EXTLNA) {
925 if (phy->rev >= 7) { 925 if (phy->rev >= 7) {
926 b43legacy_phy_write(dev, 0x0811, 926 b43legacy_phy_write(dev, 0x0811,
927 b43legacy_phy_read(dev, 0x0811) 927 b43legacy_phy_read(dev, 0x0811)
@@ -1072,7 +1072,7 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev)
1072 b43legacy_phy_write(dev, 0x0036, 1072 b43legacy_phy_write(dev, 0x0036,
1073 (b43legacy_phy_read(dev, 0x0036) 1073 (b43legacy_phy_read(dev, 0x0036)
1074 & 0x0FFF) | (phy->txctl2 << 12)); 1074 & 0x0FFF) | (phy->txctl2 << 12));
1075 if (dev->dev->bus->sprom.r1.boardflags_lo & 1075 if (dev->dev->bus->sprom.boardflags_lo &
1076 B43legacy_BFL_PACTRL) 1076 B43legacy_BFL_PACTRL)
1077 b43legacy_phy_write(dev, 0x002E, 0x8075); 1077 b43legacy_phy_write(dev, 0x002E, 0x8075);
1078 else 1078 else
@@ -1087,7 +1087,7 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev)
1087 b43legacy_phy_write(dev, 0x080F, 0x8078); 1087 b43legacy_phy_write(dev, 0x080F, 0x8078);
1088 } 1088 }
1089 1089
1090 if (!(dev->dev->bus->sprom.r1.boardflags_lo & B43legacy_BFL_RSSI)) { 1090 if (!(dev->dev->bus->sprom.boardflags_lo & B43legacy_BFL_RSSI)) {
1091 /* The specs state to update the NRSSI LT with