diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-05-17 20:06:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-01 15:10:57 -0400 |
commit | 79d2232fed23e8e0d1b11abe2f9b78fb09084506 (patch) | |
tree | 6b5a26596f0e489858109e58c5ced7baeef4e441 /drivers | |
parent | c244e08c7aa30abea3c29ff17a40f4b0a58a7913 (diff) |
b43: bus: abstract board info
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/bus.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43/bus.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43/leds.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_a.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_common.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_g.c | 48 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/b43/wa.c | 19 |
9 files changed, 54 insertions, 57 deletions
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index 8d0e7584eafd..f897b7054a0a 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c | |||
@@ -74,6 +74,10 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) | |||
74 | dev->dma_dev = sdev->dma_dev; | 74 | dev->dma_dev = sdev->dma_dev; |
75 | dev->irq = sdev->irq; | 75 | dev->irq = sdev->irq; |
76 | 76 | ||
77 | dev->board_vendor = sdev->bus->boardinfo.vendor; | ||
78 | dev->board_type = sdev->bus->boardinfo.type; | ||
79 | dev->board_rev = sdev->bus->boardinfo.rev; | ||
80 | |||
77 | dev->chip_id = sdev->bus->chip_id; | 81 | dev->chip_id = sdev->bus->chip_id; |
78 | dev->chip_rev = sdev->bus->chip_rev; | 82 | dev->chip_rev = sdev->bus->chip_rev; |
79 | dev->chip_pkg = sdev->bus->chip_package; | 83 | dev->chip_pkg = sdev->bus->chip_package; |
diff --git a/drivers/net/wireless/b43/bus.h b/drivers/net/wireless/b43/bus.h index 14942fb605d9..e88b4494beaa 100644 --- a/drivers/net/wireless/b43/bus.h +++ b/drivers/net/wireless/b43/bus.h | |||
@@ -24,6 +24,10 @@ struct b43_bus_dev { | |||
24 | struct device *dma_dev; | 24 | struct device *dma_dev; |
25 | unsigned int irq; | 25 | unsigned int irq; |
26 | 26 | ||
27 | u16 board_vendor; | ||
28 | u16 board_type; | ||
29 | u16 board_rev; | ||
30 | |||
27 | u16 chip_id; | 31 | u16 chip_id; |
28 | u8 chip_rev; | 32 | u8 chip_rev; |
29 | u8 chip_pkg; | 33 | u8 chip_pkg; |
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c index 70bcf4276146..b56ed41fc1bd 100644 --- a/drivers/net/wireless/b43/leds.c +++ b/drivers/net/wireless/b43/leds.c | |||
@@ -215,7 +215,6 @@ static void b43_led_get_sprominfo(struct b43_wldev *dev, | |||
215 | enum b43_led_behaviour *behaviour, | 215 | enum b43_led_behaviour *behaviour, |
216 | bool *activelow) | 216 | bool *activelow) |
217 | { | 217 | { |
218 | struct ssb_bus *bus = dev->sdev->bus; | ||
219 | u8 sprom[4]; | 218 | u8 sprom[4]; |
220 | 219 | ||
221 | sprom[0] = dev->dev->bus_sprom->gpio0; | 220 | sprom[0] = dev->dev->bus_sprom->gpio0; |
@@ -231,12 +230,12 @@ static void b43_led_get_sprominfo(struct b43_wldev *dev, | |||
231 | case 0: | 230 | case 0: |
232 | *behaviour = B43_LED_ACTIVITY; | 231 | *behaviour = B43_LED_ACTIVITY; |
233 | *activelow = 1; | 232 | *activelow = 1; |
234 | if (bus->boardinfo.vendor == PCI_VENDOR_ID_COMPAQ) | 233 | if (dev->dev->board_vendor == PCI_VENDOR_ID_COMPAQ) |
235 | *behaviour = B43_LED_RADIO_ALL; | 234 | *behaviour = B43_LED_RADIO_ALL; |
236 | break; | 235 | break; |
237 | case 1: | 236 | case 1: |
238 | *behaviour = B43_LED_RADIO_B; | 237 | *behaviour = B43_LED_RADIO_B; |
239 | if (bus->boardinfo.vendor == PCI_VENDOR_ID_ASUSTEK) | 238 | if (dev->dev->board_vendor == PCI_VENDOR_ID_ASUSTEK) |
240 | *behaviour = B43_LED_ASSOC; | 239 | *behaviour = B43_LED_ASSOC; |
241 | break; | 240 | break; |
242 | case 2: | 241 | case 2: |
diff --git a/drivers/net/wireless/b43/phy_a.c b/drivers/net/wireless/b43/phy_a.c index 821b516fe9e4..73ace5552bad 100644 --- a/drivers/net/wireless/b43/phy_a.c +++ b/drivers/net/wireless/b43/phy_a.c | |||
@@ -265,7 +265,6 @@ static void hardware_pctl_init_aphy(struct b43_wldev *dev) | |||
265 | 265 | ||
266 | void b43_phy_inita(struct b43_wldev *dev) | 266 | void b43_phy_inita(struct b43_wldev *dev) |
267 | { | 267 | { |
268 | struct ssb_bus *bus = dev->sdev->bus; | ||
269 | struct b43_phy *phy = &dev->phy; | 268 | struct b43_phy *phy = &dev->phy; |
270 | 269 | ||
271 | /* This lowlevel A-PHY init is also called from G-PHY init. | 270 | /* This lowlevel A-PHY init is also called from G-PHY init. |
@@ -296,9 +295,9 @@ void b43_phy_inita(struct b43_wldev *dev) | |||
296 | 295 | ||
297 | b43_radio_init2060(dev); | 296 | b43_radio_init2060(dev); |
298 | 297 | ||
299 | if ((bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM) && | 298 | if ((dev->dev->board_vendor == SSB_BOARDVENDOR_BCM) && |
300 | ((bus->boardinfo.type == SSB_BOARD_BU4306) || | 299 | ((dev->dev->board_type == SSB_BOARD_BU4306) || |
301 | (bus->boardinfo.type == SSB_BOARD_BU4309))) { | 300 | (dev->dev->board_type == SSB_BOARD_BU4309))) { |
302 | ; //TODO: A PHY LO | 301 | ; //TODO: A PHY LO |
303 | } | 302 | } |
304 | 303 | ||
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c index 3f7bdf845446..425af28ea4e5 100644 --- a/drivers/net/wireless/b43/phy_common.c +++ b/drivers/net/wireless/b43/phy_common.c | |||
@@ -368,8 +368,8 @@ void b43_phy_txpower_check(struct b43_wldev *dev, unsigned int flags) | |||
368 | /* The next check will be needed in two seconds, or later. */ | 368 | /* The next check will be needed in two seconds, or later. */ |
369 | phy->next_txpwr_check_time = round_jiffies(now + (HZ * 2)); | 369 | phy->next_txpwr_check_time = round_jiffies(now + (HZ * 2)); |
370 | 370 | ||
371 | if ((dev->sdev->bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM) && | 371 | if ((dev->dev->board_vendor == SSB_BOARDVENDOR_BCM) && |
372 | (dev->sdev->bus->boardinfo.type == SSB_BOARD_BU4306)) | 372 | (dev->dev->board_type == SSB_BOARD_BU4306)) |
373 | return; /* No software txpower adjustment needed */ | 373 | return; /* No software txpower adjustment needed */ |
374 | 374 | ||
375 | result = phy->ops->recalc_txpower(dev, !!(flags & B43_TXPWR_IGNORE_TSSI)); | 375 | result = phy->ops->recalc_txpower(dev, !!(flags & B43_TXPWR_IGNORE_TSSI)); |
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c index 40ce9e6d104e..684be1fd59ae 100644 --- a/drivers/net/wireless/b43/phy_g.c +++ b/drivers/net/wireless/b43/phy_g.c | |||
@@ -1491,7 +1491,6 @@ static u16 b43_radio_init2050(struct b43_wldev *dev) | |||
1491 | 1491 | ||
1492 | static void b43_phy_initb5(struct b43_wldev *dev) | 1492 | static void b43_phy_initb5(struct b43_wldev *dev) |
1493 | { | 1493 | { |
1494 | struct ssb_bus *bus = dev->sdev->bus; | ||
1495 | struct b43_phy *phy = &dev->phy; | 1494 | struct b43_phy *phy = &dev->phy; |
1496 | struct b43_phy_g *gphy = phy->g; | 1495 | struct b43_phy_g *gphy = phy->g; |
1497 | u16 offset, value; | 1496 | u16 offset, value; |
@@ -1500,8 +1499,8 @@ static void b43_phy_initb5(struct b43_wldev *dev) | |||
1500 | if (phy->analog == 1) { | 1499 | if (phy->analog == 1) { |
1501 | b43_radio_set(dev, 0x007A, 0x0050); | 1500 | b43_radio_set(dev, 0x007A, 0x0050); |
1502 | } | 1501 | } |
1503 | if ((bus->boardinfo.vendor != SSB_BOARDVENDOR_BCM) && | 1502 | if ((dev->dev->board_vendor != SSB_BOARDVENDOR_BCM) && |
1504 | (bus->boardinfo.type != SSB_BOARD_BU4306)) { | 1503 | (dev->dev->board_type != SSB_BOARD_BU4306)) { |
1505 | value = 0x2120; | 1504 | value = 0x2120; |
1506 | for (offset = 0x00A8; offset < 0x00C7; offset++) { | 1505 | for (offset = 0x00A8; offset < 0x00C7; offset++) { |
1507 | b43_phy_write(dev, offset, value); | 1506 | b43_phy_write(dev, offset, value); |
@@ -1922,7 +1921,6 @@ static void b43_hardware_pctl_init_gphy(struct b43_wldev *dev) | |||
1922 | /* Initialize B/G PHY power control */ | 1921 | /* Initialize B/G PHY power control */ |
1923 | static void b43_phy_init_pctl(struct b43_wldev *dev) | 1922 | static void b43_phy_init_pctl(struct b43_wldev *dev) |
1924 | { | 1923 | { |
1925 | struct ssb_bus *bus = dev->sdev->bus; | ||
1926 | struct b43_phy *phy = &dev->phy; | 1924 | struct b43_phy *phy = &dev->phy; |
1927 | struct b43_phy_g *gphy = phy->g; | 1925 | struct b43_phy_g *gphy = phy->g; |
1928 | struct b43_rfatt old_rfatt; | 1926 | struct b43_rfatt old_rfatt; |
@@ -1931,8 +1929,8 @@ static void b43_phy_init_pctl(struct b43_wldev *dev) | |||
1931 | 1929 | ||
1932 | B43_WARN_ON(phy->type != B43_PHYTYPE_G); | 1930 | B43_WARN_ON(phy->type != B43_PHYTYPE_G); |
1933 | 1931 | ||
1934 | if ((bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM) && | 1932 | if ((dev->dev->board_vendor == SSB_BOARDVENDOR_BCM) && |
1935 | (bus->boardinfo.type == SSB_BOARD_BU4306)) | 1933 | (dev->dev->board_type == SSB_BOARD_BU4306)) |
1936 | return; | 1934 | return; |
1937 | 1935 | ||
1938 | b43_phy_write(dev, 0x0028, 0x8018); | 1936 | b43_phy_write(dev, 0x0028, 0x8018); |
@@ -2136,17 +2134,17 @@ static void default_baseband_attenuation(struct b43_wldev *dev, | |||
2136 | static void default_radio_attenuation(struct b43_wldev *dev, | 2134 | static void default_radio_attenuation(struct b43_wldev *dev, |
2137 | struct b43_rfatt *rf) | 2135 | struct b43_rfatt *rf) |
2138 | { | 2136 | { |
2139 | struct ssb_bus *bus = dev->sdev->bus; | 2137 | struct b43_bus_dev *bdev = dev->dev; |
2140 | struct b43_phy *phy = &dev->phy; | 2138 | struct b43_phy *phy = &dev->phy; |
2141 | 2139 | ||
2142 | rf->with_padmix = 0; | 2140 | rf->with_padmix = 0; |
2143 | 2141 | ||
2144 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM && | 2142 | if (dev->dev->board_vendor == SSB_BOARDVENDOR_BCM && |
2145 | bus->boardinfo.type == SSB_BOARD_BCM4309G) { | 2143 | dev->dev->board_type == SSB_BOARD_BCM4309G) { |
2146 | if (bus->boardinfo.rev < 0x43) { | 2144 | if (dev->dev->board_rev < 0x43) { |
2147 | rf->att = 2; | 2145 | rf->att = 2; |
2148 | return; | 2146 | return; |
2149 | } else if (bus->boardinfo.rev < 0x51) { | 2147 | } else if (dev->dev->board_rev < 0x51) { |
2150 | rf->att = 3; | 2148 | rf->att = 3; |
2151 | return; | 2149 | return; |
2152 | } | 2150 | } |
@@ -2172,21 +2170,21 @@ static void default_radio_attenuation(struct b43_wldev *dev, | |||
2172 | return; | 2170 | return; |
2173 | case 1: | 2171 | case 1: |
2174 | if (phy->type == B43_PHYTYPE_G) { | 2172 | if (phy->type == B43_PHYTYPE_G) { |
2175 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM | 2173 | if (bdev->board_vendor == SSB_BOARDVENDOR_BCM |
2176 | && bus->boardinfo.type == SSB_BOARD_BCM4309G | 2174 | && bdev->board_type == SSB_BOARD_BCM4309G |
2177 | && bus->boardinfo.rev >= 30) | 2175 | && bdev->board_rev >= 30) |
2178 | rf->att = 3; | 2176 | rf->att = 3; |
2179 | else if (bus->boardinfo.vendor == | 2177 | else if (bdev->board_vendor == |
2180 | SSB_BOARDVENDOR_BCM | 2178 | SSB_BOARDVENDOR_BCM |
2181 | && bus->boardinfo.type == | 2179 | && bdev->board_type == |
2182 | SSB_BOARD_BU4306) | 2180 | SSB_BOARD_BU4306) |
2183 | rf->att = 3; | 2181 | rf->att = 3; |
2184 | else | 2182 | else |
2185 | rf->att = 1; | 2183 | rf->att = 1; |
2186 | } else { | 2184 | } else { |
2187 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM | 2185 | if (bdev->board_vendor == SSB_BOARDVENDOR_BCM |
2188 | && bus->boardinfo.type == SSB_BOARD_BCM4309G | 2186 | && bdev->board_type == SSB_BOARD_BCM4309G |
2189 | && bus->boardinfo.rev >= 30) | 2187 | && bdev->board_rev >= 30) |
2190 | rf->att = 7; | 2188 | rf->att = 7; |
2191 | else | 2189 | else |
2192 | rf->att = 6; | 2190 | rf->att = 6; |
@@ -2194,16 +2192,16 @@ static void default_radio_attenuation(struct b43_wldev *dev, | |||
2194 | return; | 2192 | return; |
2195 | case 2: | 2193 | case 2: |
2196 | if (phy->type == B43_PHYTYPE_G) { | 2194 | if (phy->type == B43_PHYTYPE_G) { |
2197 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM | 2195 | if (bdev->board_vendor == SSB_BOARDVENDOR_BCM |
2198 | && bus->boardinfo.type == SSB_BOARD_BCM4309G | 2196 | && bdev->board_type == SSB_BOARD_BCM4309G |
2199 | && bus->boardinfo.rev >= 30) | 2197 | && bdev->board_rev >= 30) |
2200 | rf->att = 3; | 2198 | rf->att = 3; |
2201 | else if (bus->boardinfo.vendor == | 2199 | else if (bdev->board_vendor == |
2202 | SSB_BOARDVENDOR_BCM | 2200 | SSB_BOARDVENDOR_BCM |
2203 | && bus->boardinfo.type == | 2201 | && bdev->board_type == |
2204 | SSB_BOARD_BU4306) | 2202 | SSB_BOARD_BU4306) |
2205 | rf->att = 5; | 2203 | rf->att = 5; |
2206 | else if (dev->dev->chip_id == 0x4320) | 2204 | else if (bdev->chip_id == 0x4320) |
2207 | rf->att = 4; | 2205 | rf->att = 4; |
2208 | else | 2206 | else |
2209 | rf->att = 3; | 2207 | rf->att = 3; |
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c index bb78be319bd3..2606c25e574f 100644 --- a/drivers/net/wireless/b43/phy_lp.c +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -287,7 +287,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
287 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_8, 0xFFC0, 0x000A); | 287 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_8, 0xFFC0, 0x000A); |
288 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_8, 0xC0FF, 0x0B00); | 288 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_8, 0xC0FF, 0x0B00); |
289 | } else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ || | 289 | } else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ || |
290 | (bus->boardinfo.type == 0x048A) || ((dev->phy.rev == 0) && | 290 | (dev->dev->board_type == 0x048A) || ((dev->phy.rev == 0) && |
291 | (sprom->boardflags_lo & B43_BFL_FEM))) { | 291 | (sprom->boardflags_lo & B43_BFL_FEM))) { |
292 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x0001); | 292 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x0001); |
293 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xC0FF, 0x0400); | 293 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xC0FF, 0x0400); |
@@ -413,7 +413,6 @@ static void lpphy_restore_dig_flt_state(struct b43_wldev *dev) | |||
413 | 413 | ||
414 | static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev) | 414 | static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev) |
415 | { | 415 | { |
416 | struct ssb_bus *bus = dev->sdev->bus; | ||
417 | struct b43_phy_lp *lpphy = dev->phy.lp; | 416 | struct b43_phy_lp *lpphy = dev->phy.lp; |
418 | 417 | ||
419 | b43_phy_write(dev, B43_LPPHY_AFE_DAC_CTL, 0x50); | 418 | b43_phy_write(dev, B43_LPPHY_AFE_DAC_CTL, 0x50); |
@@ -433,7 +432,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev) | |||
433 | b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x4000); | 432 | b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x4000); |
434 | b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x2000); | 433 | b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x2000); |
435 | b43_phy_set(dev, B43_PHY_OFDM(0x10A), 0x1); | 434 | b43_phy_set(dev, B43_PHY_OFDM(0x10A), 0x1); |
436 | if (bus->boardinfo.rev >= 0x18) { | 435 | if (dev->dev->board_rev >= 0x18) { |
437 | b43_lptab_write(dev, B43_LPTAB32(17, 65), 0xEC); | 436 | b43_lptab_write(dev, B43_LPTAB32(17, 65), 0xEC); |
438 | b43_phy_maskset(dev, B43_PHY_OFDM(0x10A), 0xFF01, 0x14); | 437 | b43_phy_maskset(dev, B43_PHY_OFDM(0x10A), 0xFF01, 0x14); |
439 | } else { | 438 | } else { |
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 46428ad5ab84..ad14f3b428c5 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -424,15 +424,14 @@ static void b43_radio_init2055_post(struct b43_wldev *dev) | |||
424 | { | 424 | { |
425 | struct b43_phy_n *nphy = dev->phy.n; | 425 | struct b43_phy_n *nphy = dev->phy.n; |
426 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | 426 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
427 | struct ssb_boardinfo *binfo = &(dev->sdev->bus->boardinfo); | ||
428 | int i; | 427 | int i; |
429 | u16 val; | 428 | u16 val; |
430 | bool workaround = false; | 429 | bool workaround = false; |
431 | 430 | ||
432 | if (sprom->revision < 4) | 431 | if (sprom->revision < 4) |
433 | workaround = (binfo->vendor != PCI_VENDOR_ID_BROADCOM && | 432 | workaround = (dev->dev->board_vendor != PCI_VENDOR_ID_BROADCOM |
434 | binfo->type == 0x46D && | 433 | && dev->dev->board_type == 0x46D |
435 | binfo->rev >= 0x41); | 434 | && dev->dev->board_rev >= 0x41); |
436 | else | 435 | else |
437 | workaround = | 436 | workaround = |
438 | !(sprom->boardflags2_lo & B43_BFL2_RXBB_INT_REG_DIS); | 437 | !(sprom->boardflags2_lo & B43_BFL2_RXBB_INT_REG_DIS); |
@@ -1373,7 +1372,6 @@ static void b43_nphy_gain_ctrl_workarounds(struct b43_wldev *dev) | |||
1373 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/Workarounds */ | 1372 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/Workarounds */ |
1374 | static void b43_nphy_workarounds(struct b43_wldev *dev) | 1373 | static void b43_nphy_workarounds(struct b43_wldev *dev) |
1375 | { | 1374 | { |
1376 | struct ssb_bus *bus = dev->sdev->bus; | ||
1377 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | 1375 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
1378 | struct b43_phy *phy = &dev->phy; | 1376 | struct b43_phy *phy = &dev->phy; |
1379 | struct b43_phy_n *nphy = phy->n; | 1377 | struct b43_phy_n *nphy = phy->n; |
@@ -1505,7 +1503,7 @@ static void b43_nphy_workarounds(struct b43_wldev *dev) | |||
1505 | b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0x301); | 1503 | b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0x301); |
1506 | 1504 | ||
1507 | if (sprom->boardflags2_lo & 0x100 && | 1505 | if (sprom->boardflags2_lo & 0x100 && |
1508 | bus->boardinfo.type == 0x8B) { | 1506 | dev->dev->board_type == 0x8B) { |
1509 | delays1[0] = 0x1; | 1507 | delays1[0] = 0x1; |
1510 | delays1[5] = 0x14; | 1508 | delays1[5] = 0x14; |
1511 | } | 1509 | } |
@@ -3587,7 +3585,6 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask) | |||
3587 | */ | 3585 | */ |
3588 | int b43_phy_initn(struct b43_wldev *dev) | 3586 | int b43_phy_initn(struct b43_wldev *dev) |
3589 | { | 3587 | { |
3590 | struct ssb_bus *bus = dev->sdev->bus; | ||
3591 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | 3588 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
3592 | struct b43_phy *phy = &dev->phy; | 3589 | struct b43_phy *phy = &dev->phy; |
3593 | struct b43_phy_n *nphy = phy->n; | 3590 | struct b43_phy_n *nphy = phy->n; |
@@ -3642,8 +3639,8 @@ int b43_phy_initn(struct b43_wldev *dev) | |||
3642 | b43_phy_write(dev, B43_NPHY_AFESEQ_TX2RX_PUD_40M, 0x20); | 3639 | b43_phy_write(dev, B43_NPHY_AFESEQ_TX2RX_PUD_40M, 0x20); |
3643 | 3640 | ||
3644 | if (sprom->boardflags2_lo & 0x100 || | 3641 | if (sprom->boardflags2_lo & 0x100 || |
3645 | (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && | 3642 | (dev->dev->board_vendor == PCI_VENDOR_ID_APPLE && |
3646 | bus->boardinfo.type == 0x8B)) | 3643 | dev->dev->board_type == 0x8B)) |
3647 | b43_phy_write(dev, B43_NPHY_TXREALFD, 0xA0); | 3644 | b43_phy_write(dev, B43_NPHY_TXREALFD, 0xA0); |
3648 | else | 3645 | else |
3649 | b43_phy_write(dev, B43_NPHY_TXREALFD, 0xB8); | 3646 | b43_phy_write(dev, B43_NPHY_TXREALFD, 0xB8); |
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c index 2829ee1872c9..5d00d0eaf2e7 100644 --- a/drivers/net/wireless/b43/wa.c +++ b/drivers/net/wireless/b43/wa.c | |||
@@ -458,17 +458,15 @@ static void b43_wa_rssi_adc(struct b43_wldev *dev) | |||
458 | 458 | ||
459 | static void b43_wa_boards_a(struct b43_wldev *dev) | 459 | static void b43_wa_boards_a(struct b43_wldev *dev) |
460 | { | 460 | { |
461 | struct ssb_bus *bus = dev->sdev->bus; | 461 | if (dev->dev->board_vendor == SSB_BOARDVENDOR_BCM && |
462 | 462 | dev->dev->board_type == SSB_BOARD_BU4306 && | |
463 | if (bus->boardinfo.vendor == SSB_BOARDVENDOR_BCM && | 463 | dev->dev->board_rev < 0x30) { |
464 | bus->boardinfo.type == SSB_BOARD_BU4306 && | ||
465 | bus->boardinfo.rev < 0x30) { | ||
466 | b43_phy_write(dev, 0x0010, 0xE000); | 464 | b43_phy_write(dev, 0x0010, 0xE000); |
467 | b43_phy_write(dev, 0x0013, 0x0140); | 465 | b43_phy_write(dev, 0x0013, 0x0140); |
468 | b43_phy_write(dev, 0x0014, 0x0280); | 466 | b43_phy_write(dev, 0x0014, 0x0280); |
469 | } else { | 467 | } else { |
470 | if (bus->boardinfo.type == SSB_BOARD_MP4318 && | 468 | if (dev->dev->board_type == SSB_BOARD_MP4318 && |
471 | bus->boardinfo.rev < 0x20) { | 469 | dev->dev->board_rev < 0x20) { |
472 | b43_phy_write(dev, 0x0013, 0x0210); | 470 | b43_phy_write(dev, 0x0013, 0x0210); |
473 | b43_phy_write(dev, 0x0014, 0x0840); | 471 | b43_phy_write(dev, 0x0014, 0x0840); |
474 | } else { | 472 | } else { |
@@ -486,13 +484,12 @@ static void b43_wa_boards_a(struct b43_wldev *dev) | |||
486 | 484 | ||
487 | static void b43_wa_boards_g(struct b43_wldev *dev) | 485 | static void b43_wa_boards_g(struct b43_wldev *dev) |
488 | { | 486 | { |
489 | struct ssb_bus *bus = dev->sdev->bus; | ||
490 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | 487 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
491 | struct b43_phy *phy = &dev->phy; | 488 | struct b43_phy *phy = &dev->phy; |
492 | 489 | ||
493 | if (bus->boardinfo.vendor != SSB_BOARDVENDOR_BCM || | 490 | if (dev->dev->board_vendor != SSB_BOARDVENDOR_BCM || |
494 | bus->boardinfo.type != SSB_BOARD_BU4306 || | 491 | dev->dev->board_type != SSB_BOARD_BU4306 || |
495 | bus->boardinfo.rev != 0x17) { | 492 | dev->dev->board_rev != 0x17) { |
496 | if (phy->rev < 2) { | 493 | if (phy->rev < 2) { |
497 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX_R1, 1, 0x0002); | 494 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX_R1, 1, 0x0002); |
498 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX_R1, 2, 0x0001); | 495 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX_R1, 2, 0x0001); |