diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-05-17 20:06:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-01 15:10:57 -0400 |
commit | 0581483afe1a6f90f828b36111b05a70c162137d (patch) | |
tree | b5aa95708e5146bccf46f652bdb4498af23e10a3 /drivers | |
parent | 21d889d433eb962b70ad88d554a4a7658067596f (diff) |
b43: bus: abstract SPROM
SPROM is another frequently used struct. We decided to share SPROM
struct between ssb na bcma as long as we will not need any hacks.
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 | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43/bus.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43/leds.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/b43/lo.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_a.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_g.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 93 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_lpphy.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/b43/wa.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/b43/xmit.c | 2 |
12 files changed, 107 insertions, 99 deletions
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index be3d206e356f..c116f123aea4 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c | |||
@@ -70,6 +70,8 @@ struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) | |||
70 | dev->block_read = b43_bus_ssb_block_read; | 70 | dev->block_read = b43_bus_ssb_block_read; |
71 | dev->block_write = b43_bus_ssb_block_write; | 71 | dev->block_write = b43_bus_ssb_block_write; |
72 | 72 | ||
73 | dev->bus_sprom = &sdev->bus->sprom; | ||
74 | |||
73 | dev->core_id = sdev->id.coreid; | 75 | dev->core_id = sdev->id.coreid; |
74 | dev->core_rev = sdev->id.revision; | 76 | dev->core_rev = sdev->id.revision; |
75 | 77 | ||
diff --git a/drivers/net/wireless/b43/bus.h b/drivers/net/wireless/b43/bus.h index 742f08441949..6d575d6c8111 100644 --- a/drivers/net/wireless/b43/bus.h +++ b/drivers/net/wireless/b43/bus.h | |||
@@ -20,6 +20,8 @@ struct b43_bus_dev { | |||
20 | void (*block_write)(struct b43_bus_dev *dev, const void *buffer, | 20 | void (*block_write)(struct b43_bus_dev *dev, const void *buffer, |
21 | size_t count, u16 offset, u8 reg_width); | 21 | size_t count, u16 offset, u8 reg_width); |
22 | 22 | ||
23 | struct ssb_sprom *bus_sprom; | ||
24 | |||
23 | u16 core_id; | 25 | u16 core_id; |
24 | u8 core_rev; | 26 | u8 core_rev; |
25 | }; | 27 | }; |
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c index 0cafafe368af..26d37ef01084 100644 --- a/drivers/net/wireless/b43/leds.c +++ b/drivers/net/wireless/b43/leds.c | |||
@@ -218,10 +218,10 @@ static void b43_led_get_sprominfo(struct b43_wldev *dev, | |||
218 | struct ssb_bus *bus = dev->sdev->bus; | 218 | struct ssb_bus *bus = dev->sdev->bus; |
219 | u8 sprom[4]; | 219 | u8 sprom[4]; |
220 | 220 | ||
221 | sprom[0] = bus->sprom.gpio0; | 221 | sprom[0] = dev->dev->bus_sprom->gpio0; |
222 | sprom[1] = bus->sprom.gpio1; | 222 | sprom[1] = dev->dev->bus_sprom->gpio1; |
223 | sprom[2] = bus->sprom.gpio2; | 223 | sprom[2] = dev->dev->bus_sprom->gpio2; |
224 | sprom[3] = bus->sprom.gpio3; | 224 | sprom[3] = dev->dev->bus_sprom->gpio3; |
225 | 225 | ||
226 | if (sprom[led_index] == 0xFF) { | 226 | if (sprom[led_index] == 0xFF) { |
227 | /* There is no LED information in the SPROM | 227 | /* There is no LED information in the SPROM |
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c index 2ef7d4b38540..b32efd45c080 100644 --- a/drivers/net/wireless/b43/lo.c +++ b/drivers/net/wireless/b43/lo.c | |||
@@ -98,7 +98,7 @@ static u16 lo_measure_feedthrough(struct b43_wldev *dev, | |||
98 | rfover |= pga; | 98 | rfover |= pga; |
99 | rfover |= lna; | 99 | rfover |= lna; |
100 | rfover |= trsw_rx; | 100 | rfover |= trsw_rx; |
101 | if ((dev->sdev->bus->sprom.boardflags_lo & B43_BFL_EXTLNA) | 101 | if ((dev->dev->bus_sprom->boardflags_lo & B43_BFL_EXTLNA) |
102 | && phy->rev > 6) | 102 | && phy->rev > 6) |
103 | rfover |= B43_PHY_RFOVERVAL_EXTLNA; | 103 | rfover |= B43_PHY_RFOVERVAL_EXTLNA; |
104 | 104 | ||
@@ -387,7 +387,7 @@ struct lo_g_saved_values { | |||
387 | static void lo_measure_setup(struct b43_wldev *dev, | 387 | static void lo_measure_setup(struct b43_wldev *dev, |
388 | struct lo_g_saved_values *sav) | 388 | struct lo_g_saved_values *sav) |
389 | { | 389 | { |
390 | struct ssb_sprom *sprom = &dev->sdev->bus->sprom; | 390 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
391 | struct b43_phy *phy = &dev->phy; | 391 | struct b43_phy *phy = &dev->phy; |
392 | struct b43_phy_g *gphy = phy->g; | 392 | struct b43_phy_g *gphy = phy->g; |
393 | struct b43_txpower_lo_control *lo = gphy->lo_control; | 393 | struct b43_txpower_lo_control *lo = gphy->lo_control; |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 971ec1b56b06..0f3a104a0ac8 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1427,9 +1427,9 @@ u8 b43_ieee80211_antenna_sanitize(struct b43_wldev *dev, | |||
1427 | 1427 | ||
1428 | /* Get the mask of available antennas. */ | 1428 | /* Get the mask of available antennas. */ |
1429 | if (dev->phy.gmode) | 1429 | if (dev->phy.gmode) |
1430 | antenna_mask = dev->sdev->bus->sprom.ant_available_bg; | 1430 | antenna_mask = dev->dev->bus_sprom->ant_available_bg; |
1431 | else | 1431 | else |
1432 | antenna_mask = dev->sdev->bus->sprom.ant_available_a; | 1432 | antenna_mask = dev->dev->bus_sprom->ant_available_a; |
1433 | 1433 | ||
1434 | if (!(antenna_mask & (1 << (antenna_nr - 1)))) { | 1434 | if (!(antenna_mask & (1 << (antenna_nr - 1)))) { |
1435 | /* This antenna is not available. Fall back to default. */ | 1435 | /* This antenna is not available. Fall back to default. */ |
@@ -2599,7 +2599,7 @@ static int b43_gpio_init(struct b43_wldev *dev) | |||
2599 | mask |= 0x0180; | 2599 | mask |= 0x0180; |
2600 | set |= 0x0180; | 2600 | set |= 0x0180; |
2601 | } | 2601 | } |
2602 | if (dev->sdev->bus->sprom.boardflags_lo & B43_BFL_PACTRL) { | 2602 | if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) { |
2603 | b43_write16(dev, B43_MMIO_GPIO_MASK, | 2603 | b43_write16(dev, B43_MMIO_GPIO_MASK, |
2604 | b43_read16(dev, B43_MMIO_GPIO_MASK) | 2604 | b43_read16(dev, B43_MMIO_GPIO_MASK) |
2605 | | 0x0200); | 2605 | | 0x0200); |
@@ -4204,7 +4204,7 @@ static void setup_struct_wldev_for_init(struct b43_wldev *dev) | |||
4204 | 4204 | ||
4205 | static void b43_bluetooth_coext_enable(struct b43_wldev *dev) | 4205 | static void b43_bluetooth_coext_enable(struct b43_wldev *dev) |
4206 | { | 4206 | { |
4207 | struct ssb_sprom *sprom = &dev->sdev->bus->sprom; | 4207 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
4208 | u64 hf; | 4208 | u64 hf; |
4209 | 4209 | ||
4210 | if (!modparam_btcoex) | 4210 | if (!modparam_btcoex) |
@@ -4318,7 +4318,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev) | |||
4318 | static int b43_wireless_core_init(struct b43_wldev *dev) | 4318 | static int b43_wireless_core_init(struct b43_wldev *dev) |
4319 | { | 4319 | { |
4320 | struct ssb_bus *bus = dev->sdev->bus; | 4320 | struct ssb_bus *bus = dev->sdev->bus; |
4321 | struct ssb_sprom *sprom = &bus->sprom; | 4321 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
4322 | struct b43_phy *phy = &dev->phy; | 4322 | struct b43_phy *phy = &dev->phy; |
4323 | int err; | 4323 | int err; |
4324 | u64 hf; | 4324 | u64 hf; |
diff --git a/drivers/net/wireless/b43/phy_a.c b/drivers/net/wireless/b43/phy_a.c index b01c8ced57c3..821b516fe9e4 100644 --- a/drivers/net/wireless/b43/phy_a.c +++ b/drivers/net/wireless/b43/phy_a.c | |||
@@ -311,7 +311,7 @@ void b43_phy_inita(struct b43_wldev *dev) | |||
311 | } | 311 | } |
312 | 312 | ||
313 | if ((phy->type == B43_PHYTYPE_G) && | 313 | if ((phy->type == B43_PHYTYPE_G) && |
314 | (dev->sdev->bus->sprom.boardflags_lo & B43_BFL_PACTRL)) { | 314 | (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL)) { |
315 | b43_phy_maskset(dev, B43_PHY_OFDM(0x6E), 0xE000, 0x3CF); | 315 | b43_phy_maskset(dev, B43_PHY_OFDM(0x6E), 0xE000, 0x3CF); |
316 | } | 316 | } |
317 | } | 317 | } |
@@ -323,17 +323,17 @@ static int b43_aphy_init_tssi2dbm_table(struct b43_wldev *dev) | |||
323 | struct b43_phy_a *aphy = phy->a; | 323 | struct b43_phy_a *aphy = phy->a; |
324 | s16 pab0, pab1, pab2; | 324 | s16 pab0, pab1, pab2; |
325 | 325 | ||
326 | pab0 = (s16) (dev->sdev->bus->sprom.pa1b0); | 326 | pab0 = (s16) (dev->dev->bus_sprom->pa1b0); |
327 | pab1 = (s16) (dev->sdev->bus->sprom.pa1b1); | 327 | pab1 = (s16) (dev->dev->bus_sprom->pa1b1); |
328 | pab2 = (s16) (dev->sdev->bus->sprom.pa1b2); | 328 | pab2 = (s16) (dev->dev->bus_sprom->pa1b2); |
329 | 329 | ||
330 | if (pab0 != 0 && pab1 != 0 && pab2 != 0 && | 330 | if (pab0 != 0 && pab1 != 0 && pab2 != 0 && |
331 | pab0 != -1 && pab1 != -1 && pab2 != -1) { | 331 | pab0 != -1 && pab1 != -1 && pab2 != -1) { |
332 | /* The pabX values are set in SPROM. Use them. */ | 332 | /* The pabX values are set in SPROM. Use them. */ |
333 | if ((s8) dev->sdev->bus->sprom.itssi_a != 0 && | 333 | if ((s8) dev->dev->bus_sprom->itssi_a != 0 && |
334 | (s8) dev->sdev->bus->sprom.itssi_a != -1) | 334 | (s8) dev->dev->bus_sprom->itssi_a != -1) |
335 | aphy->tgt_idle_tssi = | 335 | aphy->tgt_idle_tssi = |
336 | (s8) (dev->sdev->bus->sprom.itssi_a); | 336 | (s8) (dev->dev->bus_sprom->itssi_a); |
337 | else | 337 | else |
338 | aphy->tgt_idle_tssi = 62; | 338 | aphy->tgt_idle_tssi = 62; |
339 | aphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0, | 339 | aphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0, |
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c index 1758a282f913..ccb02afca62e 100644 --- a/drivers/net/wireless/b43/phy_g.c +++ b/drivers/net/wireless/b43/phy_g.c | |||
@@ -718,7 +718,7 @@ static void b43_calc_nrssi_threshold(struct b43_wldev *dev) | |||
718 | B43_WARN_ON(phy->type != B43_PHYTYPE_G); | 718 | B43_WARN_ON(phy->type != B43_PHYTYPE_G); |
719 | 719 | ||
720 | if (!phy->gmode || | 720 | if (!phy->gmode || |
721 | !(dev->sdev->bus->sprom.boardflags_lo & B43_BFL_RSSI)) { | 721 | !(dev->dev->bus_sprom->boardflags_lo & B43_BFL_RSSI)) { |
722 | tmp16 = b43_nrssi_hw_read(dev, 0x20); | 722 | tmp16 = b43_nrssi_hw_read(dev, 0x20); |
723 | if (tmp16 >= 0x20) | 723 | if (tmp16 >= 0x20) |
724 | tmp16 -= 0x40; | 724 | tmp16 -= 0x40; |
@@ -1114,7 +1114,7 @@ static u16 radio2050_rfover_val(struct b43_wldev *dev, | |||
1114 | { | 1114 | { |
1115 | struct b43_phy *phy = &dev->phy; | 1115 | struct b43_phy *phy = &dev->phy; |
1116 | struct b43_phy_g *gphy = phy->g; | 1116 | struct b43_phy_g *gphy = phy->g; |
1117 | struct ssb_sprom *sprom = &(dev->sdev->bus->sprom); | 1117 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
1118 | 1118 | ||
1119 | if (!phy->gmode) | 1119 | if (!phy->gmode) |
1120 | return 0; | 1120 | return 0; |
@@ -1620,7 +1620,7 @@ static void b43_phy_initb6(struct b43_wldev *dev) | |||
1620 | b43_radio_write16(dev, 0x5A, 0x88); | 1620 | b43_radio_write16(dev, 0x5A, 0x88); |
1621 | b43_radio_write16(dev, 0x5B, 0x6B); | 1621 | b43_radio_write16(dev, 0x5B, 0x6B); |
1622 | b43_radio_write16(dev, 0x5C, 0x0F); | 1622 | b43_radio_write16(dev, 0x5C, 0x0F); |
1623 | if (dev->sdev->bus->sprom.boardflags_lo & B43_BFL_ALTIQ) { | 1623 | if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_ALTIQ) { |
1624 | b43_radio_write16(dev, 0x5D, 0xFA); | 1624 | b43_radio_write16(dev, 0x5D, 0xFA); |
1625 | b43_radio_write16(dev, 0x5E, 0xD8); | 1625 | b43_radio_write16(dev, 0x5E, 0xD8); |
1626 | } else { | 1626 | } else { |
@@ -1787,7 +1787,7 @@ static void b43_calc_loopback_gain(struct b43_wldev *dev) | |||
1787 | b43_phy_set(dev, B43_PHY_RFOVER, 0x0100); | 1787 | b43_phy_set(dev, B43_PHY_RFOVER, 0x0100); |
1788 | b43_phy_mask(dev, B43_PHY_RFOVERVAL, 0xCFFF); | 1788 | b43_phy_mask(dev, B43_PHY_RFOVERVAL, 0xCFFF); |
1789 | 1789 | ||
1790 | if (dev->sdev->bus->sprom.boardflags_lo & B43_BFL_EXTLNA) { | 1790 | if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_EXTLNA) { |
1791 | if (phy->rev >= 7) { | 1791 | if (phy->rev >= 7) { |
1792 | b43_phy_set(dev, B43_PHY_RFOVER, 0x0800); | 1792 | b43_phy_set(dev, B43_PHY_RFOVER, 0x0800); |
1793 | b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x8000); | 1793 | b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x8000); |
@@ -2053,7 +2053,7 @@ static void b43_phy_initg(struct b43_wldev *dev) | |||
2053 | if (phy->rev >= 6) { | 2053 | if (phy->rev >= 6) { |
2054 | b43_phy_maskset(dev, B43_PHY_CCK(0x36), 0x0FFF, (gphy->lo_control->tx_bias << 12)); | 2054 | b43_phy_maskset(dev, B43_PHY_CCK(0x36), 0x0FFF, (gphy->lo_control->tx_bias << 12)); |
2055 | } | 2055 | } |
2056 | if (dev->sdev->bus->sprom.boardflags_lo & B43_BFL_PACTRL) | 2056 | if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) |
2057 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x8075); | 2057 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x8075); |
2058 | else | 2058 | else |
2059 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x807F); | 2059 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x807F); |
@@ -2066,7 +2066,7 @@ static void b43_phy_initg(struct b43_wldev *dev) | |||
2066 | b43_phy_write(dev, B43_PHY_LO_MASK, 0x8078); | 2066 | b43_phy_write(dev, B43_PHY_LO_MASK, 0x8078); |
2067 | } | 2067 | } |
2068 | 2068 | ||
2069 | if (!(dev->sdev->bus->sprom.boardflags_lo & B43_BFL_RSSI)) { | 2069 | if (!(dev->dev->bus_sprom->boardflags_lo & B43_BFL_RSSI)) { |
2070 | /* The specs state to update the NRSSI LT with | 2070 | /* The specs state to update the NRSSI LT with |
2071 | * the value 0x7FFFFFFF here. I think that is some weird | 2071 | * the value 0x7FFFFFFF here. I think that is some weird |
2072 | * compiler optimization in the original driver. | 2072 | * compiler optimization in the original driver. |
@@ -2105,7 +2105,7 @@ void b43_gphy_channel_switch(struct b43_wldev *dev, | |||
2105 | b43_write16(dev, B43_MMIO_CHANNEL, channel2freq_bg(channel)); | 2105 | b43_write16(dev, B43_MMIO_CHANNEL, channel2freq_bg(channel)); |
2106 | 2106 | ||
2107 | if (channel == 14) { | 2107 | if (channel == 14) { |
2108 | if (dev->sdev->bus->sprom.country_code == | 2108 | if (dev->dev->bus_sprom->country_code == |
2109 | SSB_SPROM1CCODE_JAPAN) | 2109 | SSB_SPROM1CCODE_JAPAN) |
2110 | b43_hf_write(dev, | 2110 | b43_hf_write(dev, |
2111 | b43_hf_read(dev) & ~B43_HF_ACPR); | 2111 | b43_hf_read(dev) & ~B43_HF_ACPR); |
@@ -2384,9 +2384,9 @@ static int b43_gphy_init_tssi2dbm_table(struct b43_wldev *dev) | |||
2384 | struct b43_phy_g *gphy = phy->g; | 2384 | struct b43_phy_g *gphy = phy->g; |
2385 | s16 pab0, pab1, pab2; | 2385 | s16 pab0, pab1, pab2; |
2386 | 2386 | ||
2387 | pab0 = (s16) (dev->sdev->bus->sprom.pa0b0); | 2387 | pab0 = (s16) (dev->dev->bus_sprom->pa0b0); |
2388 | pab1 = (s16) (dev->sdev->bus->sprom.pa0b1); | 2388 | pab1 = (s16) (dev->dev->bus_sprom->pa0b1); |
2389 | pab2 = (s16) (dev->sdev->bus->sprom.pa0b2); | 2389 | pab2 = (s16) (dev->dev->bus_sprom->pa0b2); |
2390 | 2390 | ||
2391 | B43_WARN_ON((dev->sdev->bus->chip_id == 0x4301) && | 2391 | B43_WARN_ON((dev->sdev->bus->chip_id == 0x4301) && |
2392 | (phy->radio_ver != 0x2050)); /* Not supported anymore */ | 2392 | (phy->radio_ver != 0x2050)); /* Not supported anymore */ |
@@ -2396,10 +2396,10 @@ static int b43_gphy_init_tssi2dbm_table(struct b43_wldev *dev) | |||
2396 | if (pab0 != 0 && pab1 != 0 && pab2 != 0 && | 2396 | if (pab0 != 0 && pab1 != 0 && pab2 != 0 && |
2397 | pab0 != -1 && pab1 != -1 && pab2 != -1) { | 2397 | pab0 != -1 && pab1 != -1 && pab2 != -1) { |
2398 | /* The pabX values are set in SPROM. Use them. */ | 2398 | /* The pabX values are set in SPROM. Use them. */ |
2399 | if ((s8) dev->sdev->bus->sprom.itssi_bg != 0 && | 2399 | if ((s8) dev->dev->bus_sprom->itssi_bg != 0 && |
2400 | (s8) dev->sdev->bus->sprom.itssi_bg != -1) { | 2400 | (s8) dev->dev->bus_sprom->itssi_bg != -1) { |
2401 | gphy->tgt_idle_tssi = | 2401 | gphy->tgt_idle_tssi = |
2402 | (s8) (dev->sdev->bus->sprom.itssi_bg); | 2402 | (s8) (dev->dev->bus_sprom->itssi_bg); |
2403 | } else | 2403 | } else |
2404 | gphy->tgt_idle_tssi = 62; | 2404 | gphy->tgt_idle_tssi = 62; |
2405 | gphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0, | 2405 | gphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0, |
@@ -2840,7 +2840,7 @@ static void b43_gphy_op_adjust_txpower(struct b43_wldev *dev) | |||
2840 | B43_TXCTL_TXMIX; | 2840 | B43_TXCTL_TXMIX; |
2841 | rfatt += 2; | 2841 | rfatt += 2; |
2842 | bbatt += 2; | 2842 | bbatt += 2; |
2843 | } else if (dev->sdev->bus->sprom. | 2843 | } else if (dev->dev->bus_sprom-> |
2844 | boardflags_lo & | 2844 | boardflags_lo & |
2845 | B43_BFL_PACTRL) { | 2845 | B43_BFL_PACTRL) { |
2846 | bbatt += 4 * (rfatt - 2); | 2846 | bbatt += 4 * (rfatt - 2); |
@@ -2914,14 +2914,14 @@ static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev, | |||
2914 | estimated_pwr = b43_gphy_estimate_power_out(dev, average_tssi); | 2914 | estimated_pwr = b43_gphy_estimate_power_out(dev, average_tssi); |
2915 | 2915 | ||
2916 | B43_WARN_ON(phy->type != B43_PHYTYPE_G); | 2916 | B43_WARN_ON(phy->type != B43_PHYTYPE_G); |
2917 | max_pwr = dev->sdev->bus->sprom.maxpwr_bg; | 2917 | max_pwr = dev->dev->bus_sprom->maxpwr_bg; |
2918 | if (dev->sdev->bus->sprom.boardflags_lo & B43_BFL_PACTRL) | 2918 | if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) |
2919 | max_pwr -= 3; /* minus 0.75 */ | 2919 | max_pwr -= 3; /* minus 0.75 */ |
2920 | if (unlikely(max_pwr >= INT_TO_Q52(30/*dBm*/))) { | 2920 | if (unlikely(max_pwr >= INT_TO_Q52(30/*dBm*/))) { |
2921 | b43warn(dev->wl, | 2921 | b43warn(dev->wl, |
2922 | "Invalid max-TX-power value in SPROM.\n"); | 2922 | "Invalid max-TX-power value in SPROM.\n"); |
2923 | max_pwr = INT_TO_Q52(20); /* fake it */ | 2923 | max_pwr = INT_TO_Q52(20); /* fake it */ |
2924 | dev->sdev->bus->sprom.maxpwr_bg = max_pwr; | 2924 | dev->dev->bus_sprom->maxpwr_bg = max_pwr; |
2925 | } | 2925 | } |
2926 | 2926 | ||
2927 | /* Get desired power (in Q5.2) */ | 2927 | /* Get desired power (in Q5.2) */ |
@@ -3014,7 +3014,7 @@ static void b43_gphy_op_pwork_60sec(struct b43_wldev *dev) | |||
3014 | { | 3014 | { |
3015 | struct b43_phy *phy = &dev->phy; | 3015 | struct b43_phy *phy = &dev->phy; |
3016 | 3016 | ||
3017 | if (!(dev->sdev->bus->sprom.boardflags_lo & B43_BFL_RSSI)) | 3017 | if (!(dev->dev->bus_sprom->boardflags_lo & B43_BFL_RSSI)) |
3018 | return; | 3018 | return; |
3019 | 3019 | ||
3020 | b43_mac_suspend(dev); | 3020 | b43_mac_suspend(dev); |
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c index 012c8da2f944..41d02810d6d2 100644 --- a/drivers/net/wireless/b43/phy_lp.c +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -85,39 +85,39 @@ static void b43_lpphy_op_free(struct b43_wldev *dev) | |||
85 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/LP/ReadBandSrom */ | 85 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/LP/ReadBandSrom */ |
86 | static void lpphy_read_band_sprom(struct b43_wldev *dev) | 86 | static void lpphy_read_band_sprom(struct b43_wldev *dev) |
87 | { | 87 | { |
88 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
88 | struct b43_phy_lp *lpphy = dev->phy.lp; | 89 | struct b43_phy_lp *lpphy = dev->phy.lp; |
89 | struct ssb_bus *bus = dev->sdev->bus; | ||
90 | u16 cckpo, maxpwr; | 90 | u16 cckpo, maxpwr; |
91 | u32 ofdmpo; | 91 | u32 ofdmpo; |
92 | int i; | 92 | int i; |
93 | 93 | ||
94 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { | 94 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { |
95 | lpphy->tx_isolation_med_band = bus->sprom.tri2g; | 95 | lpphy->tx_isolation_med_band = sprom->tri2g; |
96 | lpphy->bx_arch = bus->sprom.bxa2g; | 96 | lpphy->bx_arch = sprom->bxa2g; |
97 | lpphy->rx_pwr_offset = bus->sprom.rxpo2g; | 97 | lpphy->rx_pwr_offset = sprom->rxpo2g; |
98 | lpphy->rssi_vf = bus->sprom.rssismf2g; | 98 | lpphy->rssi_vf = sprom->rssismf2g; |
99 | lpphy->rssi_vc = bus->sprom.rssismc2g; | 99 | lpphy->rssi_vc = sprom->rssismc2g; |
100 | lpphy->rssi_gs = bus->sprom.rssisav2g; | 100 | lpphy->rssi_gs = sprom->rssisav2g; |
101 | lpphy->txpa[0] = bus->sprom.pa0b0; | 101 | lpphy->txpa[0] = sprom->pa0b0; |
102 | lpphy->txpa[1] = bus->sprom.pa0b1; | 102 | lpphy->txpa[1] = sprom->pa0b1; |
103 | lpphy->txpa[2] = bus->sprom.pa0b2; | 103 | lpphy->txpa[2] = sprom->pa0b2; |
104 | maxpwr = bus->sprom.maxpwr_bg; | 104 | maxpwr = sprom->maxpwr_bg; |
105 | lpphy->max_tx_pwr_med_band = maxpwr; | 105 | lpphy->max_tx_pwr_med_band = maxpwr; |
106 | cckpo = bus->sprom.cck2gpo; | 106 | cckpo = sprom->cck2gpo; |
107 | /* | 107 | /* |
108 | * We don't read SPROM's opo as specs say. On rev8 SPROMs | 108 | * We don't read SPROM's opo as specs say. On rev8 SPROMs |
109 | * opo == ofdm2gpo and we don't know any SSB with LP-PHY | 109 | * opo == ofdm2gpo and we don't know any SSB with LP-PHY |
110 | * and SPROM rev below 8. | 110 | * and SPROM rev below 8. |
111 | */ | 111 | */ |
112 | B43_WARN_ON(bus->sprom.revision < 8); | 112 | B43_WARN_ON(sprom->revision < 8); |
113 | ofdmpo = bus->sprom.ofdm2gpo; | 113 | ofdmpo = sprom->ofdm2gpo; |
114 | if (cckpo) { | 114 | if (cckpo) { |
115 | for (i = 0; i < 4; i++) { | 115 | for (i = 0; i < 4; i++) { |
116 | lpphy->tx_max_rate[i] = | 116 | lpphy->tx_max_rate[i] = |
117 | maxpwr - (ofdmpo & 0xF) * 2; | 117 | maxpwr - (ofdmpo & 0xF) * 2; |
118 | ofdmpo >>= 4; | 118 | ofdmpo >>= 4; |
119 | } | 119 | } |
120 | ofdmpo = bus->sprom.ofdm2gpo; | 120 | ofdmpo = sprom->ofdm2gpo; |
121 | for (i = 4; i < 15; i++) { | 121 | for (i = 4; i < 15; i++) { |
122 | lpphy->tx_max_rate[i] = | 122 | lpphy->tx_max_rate[i] = |
123 | maxpwr - (ofdmpo & 0xF) * 2; | 123 | maxpwr - (ofdmpo & 0xF) * 2; |
@@ -131,39 +131,39 @@ static void lpphy_read_band_sprom(struct b43_wldev *dev) | |||
131 | lpphy->tx_max_rate[i] = maxpwr - ofdmpo; | 131 | lpphy->tx_max_rate[i] = maxpwr - ofdmpo; |
132 | } | 132 | } |
133 | } else { /* 5GHz */ | 133 | } else { /* 5GHz */ |
134 | lpphy->tx_isolation_low_band = bus->sprom.tri5gl; | 134 | lpphy->tx_isolation_low_band = sprom->tri5gl; |
135 | lpphy->tx_isolation_med_band = bus->sprom.tri5g; | 135 | lpphy->tx_isolation_med_band = sprom->tri5g; |
136 | lpphy->tx_isolation_hi_band = bus->sprom.tri5gh; | 136 | lpphy->tx_isolation_hi_band = sprom->tri5gh; |
137 | lpphy->bx_arch = bus->sprom.bxa5g; | 137 | lpphy->bx_arch = sprom->bxa5g; |
138 | lpphy->rx_pwr_offset = bus->sprom.rxpo5g; | 138 | lpphy->rx_pwr_offset = sprom->rxpo5g; |
139 | lpphy->rssi_vf = bus->sprom.rssismf5g; | 139 | lpphy->rssi_vf = sprom->rssismf5g; |
140 | lpphy->rssi_vc = bus->sprom.rssismc5g; | 140 | lpphy->rssi_vc = sprom->rssismc5g; |
141 | lpphy->rssi_gs = bus->sprom.rssisav5g; | 141 | lpphy->rssi_gs = sprom->rssisav5g; |
142 | lpphy->txpa[0] = bus->sprom.pa1b0; | 142 | lpphy->txpa[0] = sprom->pa1b0; |
143 | lpphy->txpa[1] = bus->sprom.pa1b1; | 143 | lpphy->txpa[1] = sprom->pa1b1; |
144 | lpphy->txpa[2] = bus->sprom.pa1b2; | 144 | lpphy->txpa[2] = sprom->pa1b2; |
145 | lpphy->txpal[0] = bus->sprom.pa1lob0; | 145 | lpphy->txpal[0] = sprom->pa1lob0; |
146 | lpphy->txpal[1] = bus->sprom.pa1lob1; | 146 | lpphy->txpal[1] = sprom->pa1lob1; |
147 | lpphy->txpal[2] = bus->sprom.pa1lob2; | 147 | lpphy->txpal[2] = sprom->pa1lob2; |
148 | lpphy->txpah[0] = bus->sprom.pa1hib0; | 148 | lpphy->txpah[0] = sprom->pa1hib0; |
149 | lpphy->txpah[1] = bus->sprom.pa1hib1; | 149 | lpphy->txpah[1] = sprom->pa1hib1; |
150 | lpphy->txpah[2] = bus->sprom.pa1hib2; | 150 | lpphy->txpah[2] = sprom->pa1hib2; |
151 | maxpwr = bus->sprom.maxpwr_al; | 151 | maxpwr = sprom->maxpwr_al; |
152 | ofdmpo = bus->sprom.ofdm5glpo; | 152 | ofdmpo = sprom->ofdm5glpo; |
153 | lpphy->max_tx_pwr_low_band = maxpwr; | 153 | lpphy->max_tx_pwr_low_band = maxpwr; |
154 | for (i = 4; i < 12; i++) { | 154 | for (i = 4; i < 12; i++) { |
155 | lpphy->tx_max_ratel[i] = maxpwr - (ofdmpo & 0xF) * 2; | 155 | lpphy->tx_max_ratel[i] = maxpwr - (ofdmpo & 0xF) * 2; |
156 | ofdmpo >>= 4; | 156 | ofdmpo >>= 4; |
157 | } | 157 | } |
158 | maxpwr = bus->sprom.maxpwr_a; | 158 | maxpwr = sprom->maxpwr_a; |
159 | ofdmpo = bus->sprom.ofdm5gpo; | 159 | ofdmpo = sprom->ofdm5gpo; |
160 | lpphy->max_tx_pwr_med_band = maxpwr; | 160 | lpphy->max_tx_pwr_med_band = maxpwr; |
161 | for (i = 4; i < 12; i++) { | 161 | for (i = 4; i < 12; i++) { |
162 | lpphy->tx_max_rate[i] = maxpwr - (ofdmpo & 0xF) * 2; | 162 | lpphy->tx_max_rate[i] = maxpwr - (ofdmpo & 0xF) * 2; |
163 | ofdmpo >>= 4; | 163 | ofdmpo >>= 4; |
164 | } | 164 | } |
165 | maxpwr = bus->sprom.maxpwr_ah; | 165 | maxpwr = sprom->maxpwr_ah; |
166 | ofdmpo = bus->sprom.ofdm5ghpo; | 166 | ofdmpo = sprom->ofdm5ghpo; |
167 | lpphy->max_tx_pwr_hi_band = maxpwr; | 167 | lpphy->max_tx_pwr_hi_band = maxpwr; |
168 | for (i = 4; i < 12; i++) { | 168 | for (i = 4; i < 12; i++) { |
169 | lpphy->tx_max_rateh[i] = maxpwr - (ofdmpo & 0xF) * 2; | 169 | lpphy->tx_max_rateh[i] = maxpwr - (ofdmpo & 0xF) * 2; |
@@ -215,6 +215,7 @@ static void lpphy_table_init(struct b43_wldev *dev) | |||
215 | static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | 215 | static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) |
216 | { | 216 | { |
217 | struct ssb_bus *bus = dev->sdev->bus; | 217 | struct ssb_bus *bus = dev->sdev->bus; |
218 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
218 | struct b43_phy_lp *lpphy = dev->phy.lp; | 219 | struct b43_phy_lp *lpphy = dev->phy.lp; |
219 | u16 tmp, tmp2; | 220 | u16 tmp, tmp2; |
220 | 221 | ||
@@ -242,9 +243,9 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
242 | b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0x00FF, 0xAD00); | 243 | b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0x00FF, 0xAD00); |
243 | b43_phy_maskset(dev, B43_LPPHY_INPUT_PWRDB, | 244 | b43_phy_maskset(dev, B43_LPPHY_INPUT_PWRDB, |
244 | 0xFF00, lpphy->rx_pwr_offset); | 245 | 0xFF00, lpphy->rx_pwr_offset); |
245 | if ((bus->sprom.boardflags_lo & B43_BFL_FEM) && | 246 | if ((sprom->boardflags_lo & B43_BFL_FEM) && |
246 | ((b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) || | 247 | ((b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) || |
247 | (bus->sprom.boardflags_hi & B43_BFH_PAREF))) { | 248 | (sprom->boardflags_hi & B43_BFH_PAREF))) { |
248 | ssb_pmu_set_ldo_voltage(&bus->chipco, LDO_PAREF, 0x28); | 249 | ssb_pmu_set_ldo_voltage(&bus->chipco, LDO_PAREF, 0x28); |
249 | ssb_pmu_set_ldo_paref(&bus->chipco, true); | 250 | ssb_pmu_set_ldo_paref(&bus->chipco, true); |
250 | if (dev->phy.rev == 0) { | 251 | if (dev->phy.rev == 0) { |
@@ -260,7 +261,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
260 | } | 261 | } |
261 | tmp = lpphy->rssi_vf | lpphy->rssi_vc << 4 | 0xA000; | 262 | tmp = lpphy->rssi_vf | lpphy->rssi_vc << 4 | 0xA000; |
262 | b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_0, tmp); | 263 | b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_0, tmp); |
263 | if (bus->sprom.boardflags_hi & B43_BFH_RSSIINV) | 264 | if (sprom->boardflags_hi & B43_BFH_RSSIINV) |
264 | b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x0AAA); | 265 | b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x0AAA); |
265 | else | 266 | else |
266 | b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x02AA); | 267 | b43_phy_maskset(dev, B43_LPPHY_AFE_RSSI_CTL_1, 0xF000, 0x02AA); |
@@ -268,7 +269,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
268 | b43_phy_maskset(dev, B43_LPPHY_RX_RADIO_CTL, | 269 | b43_phy_maskset(dev, B43_LPPHY_RX_RADIO_CTL, |
269 | 0xFFF9, (lpphy->bx_arch << 1)); | 270 | 0xFFF9, (lpphy->bx_arch << 1)); |
270 | if (dev->phy.rev == 1 && | 271 | if (dev->phy.rev == 1 && |
271 | (bus->sprom.boardflags_hi & B43_BFH_FEM_BT)) { | 272 | (sprom->boardflags_hi & B43_BFH_FEM_BT)) { |
272 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x000A); | 273 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x000A); |
273 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0x3F00, 0x0900); | 274 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0x3F00, 0x0900); |
274 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_2, 0xFFC0, 0x000A); | 275 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_2, 0xFFC0, 0x000A); |
@@ -287,7 +288,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
287 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_8, 0xC0FF, 0x0B00); | 288 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_8, 0xC0FF, 0x0B00); |
288 | } else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ || | 289 | } else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ || |
289 | (bus->boardinfo.type == 0x048A) || ((dev->phy.rev == 0) && | 290 | (bus->boardinfo.type == 0x048A) || ((dev->phy.rev == 0) && |
290 | (bus->sprom.boardflags_lo & B43_BFL_FEM))) { | 291 | (sprom->boardflags_lo & B43_BFL_FEM))) { |
291 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x0001); | 292 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x0001); |
292 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xC0FF, 0x0400); | 293 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xC0FF, 0x0400); |
293 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_2, 0xFFC0, 0x0001); | 294 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_2, 0xFFC0, 0x0001); |
@@ -297,7 +298,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
297 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0002); | 298 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0002); |
298 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0A00); | 299 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0A00); |
299 | } else if (dev->phy.rev == 1 || | 300 | } else if (dev->phy.rev == 1 || |
300 | (bus->sprom.boardflags_lo & B43_BFL_FEM)) { | 301 | (sprom->boardflags_lo & B43_BFL_FEM)) { |
301 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x0004); | 302 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xFFC0, 0x0004); |
302 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xC0FF, 0x0800); | 303 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_1, 0xC0FF, 0x0800); |
303 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_2, 0xFFC0, 0x0004); | 304 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_2, 0xFFC0, 0x0004); |
@@ -316,13 +317,13 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
316 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0006); | 317 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xFFC0, 0x0006); |
317 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0700); | 318 | b43_phy_maskset(dev, B43_LPPHY_TR_LOOKUP_4, 0xC0FF, 0x0700); |
318 | } | 319 | } |
319 | if (dev->phy.rev == 1 && (bus->sprom.boardflags_hi & B43_BFH_PAREF)) { | 320 | if (dev->phy.rev == 1 && (sprom->boardflags_hi & B43_BFH_PAREF)) { |
320 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_5, B43_LPPHY_TR_LOOKUP_1); | 321 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_5, B43_LPPHY_TR_LOOKUP_1); |
321 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_6, B43_LPPHY_TR_LOOKUP_2); | 322 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_6, B43_LPPHY_TR_LOOKUP_2); |
322 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_7, B43_LPPHY_TR_LOOKUP_3); | 323 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_7, B43_LPPHY_TR_LOOKUP_3); |
323 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_8, B43_LPPHY_TR_LOOKUP_4); | 324 | b43_phy_copy(dev, B43_LPPHY_TR_LOOKUP_8, B43_LPPHY_TR_LOOKUP_4); |
324 | } | 325 | } |
325 | if ((bus->sprom.boardflags_hi & B43_BFH_FEM_BT) && | 326 | if ((sprom->boardflags_hi & B43_BFH_FEM_BT) && |
326 | (bus->chip_id == 0x5354) && | 327 | (bus->chip_id == 0x5354) && |
327 | (bus->chip_package == SSB_CHIPPACK_BCM4712S)) { | 328 | (bus->chip_package == SSB_CHIPPACK_BCM4712S)) { |
328 | b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006); | 329 | b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x0006); |
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index e395550222d6..46428ad5ab84 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -299,7 +299,7 @@ static void b43_nphy_tx_power_ctrl(struct b43_wldev *dev, bool enable) | |||
299 | static void b43_nphy_tx_power_fix(struct b43_wldev *dev) | 299 | static void b43_nphy_tx_power_fix(struct b43_wldev *dev) |
300 | { | 300 | { |
301 | struct b43_phy_n *nphy = dev->phy.n; | 301 | struct b43_phy_n *nphy = dev->phy.n; |
302 | struct ssb_sprom *sprom = &(dev->sdev->bus->sprom); | 302 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
303 | 303 | ||
304 | u8 txpi[2], bbmult, i; | 304 | u8 txpi[2], bbmult, i; |
305 | u16 tmp, radio_gain, dac_gain; | 305 | u16 tmp, radio_gain, dac_gain; |
@@ -423,7 +423,7 @@ static void b43_radio_init2055_pre(struct b43_wldev *dev) | |||
423 | static void b43_radio_init2055_post(struct b43_wldev *dev) | 423 | 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->sdev->bus->sprom); | 426 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
427 | struct ssb_boardinfo *binfo = &(dev->sdev->bus->boardinfo); | 427 | struct ssb_boardinfo *binfo = &(dev->sdev->bus->boardinfo); |
428 | int i; | 428 | int i; |
429 | u16 val; | 429 | u16 val; |
@@ -1168,7 +1168,7 @@ static void b43_nphy_adjust_lna_gain_table(struct b43_wldev *dev) | |||
1168 | static void b43_nphy_gain_ctrl_workarounds(struct b43_wldev *dev) | 1168 | static void b43_nphy_gain_ctrl_workarounds(struct b43_wldev *dev) |
1169 | { | 1169 | { |
1170 | struct b43_phy_n *nphy = dev->phy.n; | 1170 | struct b43_phy_n *nphy = dev->phy.n; |
1171 | struct ssb_sprom *sprom = &(dev->sdev->bus->sprom); | 1171 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
1172 | 1172 | ||
1173 | /* PHY rev 0, 1, 2 */ | 1173 | /* PHY rev 0, 1, 2 */ |
1174 | u8 i, j; | 1174 | u8 i, j; |
@@ -1374,6 +1374,7 @@ static void b43_nphy_gain_ctrl_workarounds(struct b43_wldev *dev) | |||
1374 | static void b43_nphy_workarounds(struct b43_wldev *dev) | 1374 | static void b43_nphy_workarounds(struct b43_wldev *dev) |
1375 | { | 1375 | { |
1376 | struct ssb_bus *bus = dev->sdev->bus; | 1376 | struct ssb_bus *bus = dev->sdev->bus; |
1377 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
1377 | struct b43_phy *phy = &dev->phy; | 1378 | struct b43_phy *phy = &dev->phy; |
1378 | struct b43_phy_n *nphy = phy->n; | 1379 | struct b43_phy_n *nphy = phy->n; |
1379 | 1380 | ||
@@ -1443,9 +1444,9 @@ static void b43_nphy_workarounds(struct b43_wldev *dev) | |||
1443 | 1444 | ||
1444 | /* N PHY WAR TX Chain Update with hw_phytxchain as argument */ | 1445 | /* N PHY WAR TX Chain Update with hw_phytxchain as argument */ |
1445 | 1446 | ||
1446 | if ((bus->sprom.boardflags2_lo & B43_BFL2_APLL_WAR && | 1447 | if ((sprom->boardflags2_lo & B43_BFL2_APLL_WAR && |
1447 | b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) || | 1448 | b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) || |
1448 | (bus->sprom.boardflags2_lo & B43_BFL2_GPLL_WAR && | 1449 | (sprom->boardflags2_lo & B43_BFL2_GPLL_WAR && |
1449 | b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)) | 1450 | b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)) |
1450 | tmp32 = 0x00088888; | 1451 | tmp32 = 0x00088888; |
1451 | else | 1452 | else |
@@ -1503,7 +1504,7 @@ static void b43_nphy_workarounds(struct b43_wldev *dev) | |||
1503 | b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_LO2, 0x2D8); | 1504 | b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_LO2, 0x2D8); |
1504 | b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0x301); | 1505 | b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0x301); |
1505 | 1506 | ||
1506 | if (bus->sprom.boardflags2_lo & 0x100 && | 1507 | if (sprom->boardflags2_lo & 0x100 && |
1507 | bus->boardinfo.type == 0x8B) { | 1508 | bus->boardinfo.type == 0x8B) { |
1508 | delays1[0] = 0x1; | 1509 | delays1[0] = 0x1; |
1509 | delays1[5] = 0x14; | 1510 | delays1[5] = 0x14; |
@@ -3587,6 +3588,7 @@ static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask) | |||
3587 | int b43_phy_initn(struct b43_wldev *dev) | 3588 | int b43_phy_initn(struct b43_wldev *dev) |
3588 | { | 3589 | { |
3589 | struct ssb_bus *bus = dev->sdev->bus; | 3590 | struct ssb_bus *bus = dev->sdev->bus; |
3591 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
3590 | struct b43_phy *phy = &dev->phy; | 3592 | struct b43_phy *phy = &dev->phy; |
3591 | struct b43_phy_n *nphy = phy->n; | 3593 | struct b43_phy_n *nphy = phy->n; |
3592 | u8 tx_pwr_state; | 3594 | u8 tx_pwr_state; |
@@ -3599,7 +3601,7 @@ int b43_phy_initn(struct b43_wldev *dev) | |||
3599 | bool do_cal = false; | 3601 | bool do_cal = false; |
3600 | 3602 | ||
3601 | if ((dev->phy.rev >= 3) && | 3603 | if ((dev->phy.rev >= 3) && |
3602 | (bus->sprom.boardflags_lo & B43_BFL_EXTLNA) && | 3604 | (sprom->boardflags_lo & B43_BFL_EXTLNA) && |
3603 | (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)) { | 3605 | (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)) { |
3604 | chipco_set32(&dev->sdev->bus->chipco, SSB_CHIPCO_CHIPCTL, 0x40); | 3606 | chipco_set32(&dev->sdev->bus->chipco, SSB_CHIPCO_CHIPCTL, 0x40); |
3605 | } | 3607 | } |
@@ -3639,7 +3641,7 @@ int b43_phy_initn(struct b43_wldev *dev) | |||
3639 | b43_phy_write(dev, B43_NPHY_AFESEQ_TX2RX_PUD_20M, 0x20); | 3641 | b43_phy_write(dev, B43_NPHY_AFESEQ_TX2RX_PUD_20M, 0x20); |
3640 | b43_phy_write(dev, B43_NPHY_AFESEQ_TX2RX_PUD_40M, 0x20); | 3642 | b43_phy_write(dev, B43_NPHY_AFESEQ_TX2RX_PUD_40M, 0x20); |
3641 | 3643 | ||
3642 | if (bus->sprom.boardflags2_lo & 0x100 || | 3644 | if (sprom->boardflags2_lo & 0x100 || |
3643 | (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && | 3645 | (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE && |
3644 | bus->boardinfo.type == 0x8B)) | 3646 | bus->boardinfo.type == 0x8B)) |
3645 | b43_phy_write(dev, B43_NPHY_TXREALFD, 0xA0); | 3647 | b43_phy_write(dev, B43_NPHY_TXREALFD, 0xA0); |
diff --git a/drivers/net/wireless/b43/tables_lpphy.c b/drivers/net/wireless/b43/tables_lpphy.c index 59df3c64af63..aa117550e6c0 100644 --- a/drivers/net/wireless/b43/tables_lpphy.c +++ b/drivers/net/wireless/b43/tables_lpphy.c | |||
@@ -2416,12 +2416,12 @@ void lpphy_write_gain_table_bulk(struct b43_wldev *dev, int offset, int count, | |||
2416 | 2416 | ||
2417 | void lpphy_init_tx_gain_table(struct b43_wldev *dev) | 2417 | void lpphy_init_tx_gain_table(struct b43_wldev *dev) |
2418 | { | 2418 | { |
2419 | struct ssb_bus *bus = dev->sdev->bus; | 2419 | struct ssb_sprom *sprom = dev->dev->bus_sprom; |
2420 | 2420 | ||
2421 | switch (dev->phy.rev) { | 2421 | switch (dev->phy.rev) { |
2422 | case 0: | 2422 | case 0: |
2423 | if ((bus->sprom.boardflags_hi & B43_BFH_NOPA) || | 2423 | if ((sprom->boardflags_hi & B43_BFH_NOPA) || |
2424 | (bus->sprom.boardflags_lo & B43_BFL_HGPA)) | 2424 | (sprom->boardflags_lo & B43_BFL_HGPA)) |
2425 | lpphy_write_gain_table_bulk(dev, 0, 128, | 2425 | lpphy_write_gain_table_bulk(dev, 0, 128, |
2426 | lpphy_rev0_nopa_tx_gain_table); | 2426 | lpphy_rev0_nopa_tx_gain_table); |
2427 | else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 2427 | else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
@@ -2432,8 +2432,8 @@ void lpphy_init_tx_gain_table(struct b43_wldev *dev) | |||
2432 | lpphy_rev0_5ghz_tx_gain_table); | 2432 | lpphy_rev0_5ghz_tx_gain_table); |
2433 | break; | 2433 | break; |
2434 | case 1: | 2434 | case 1: |
2435 | if ((bus->sprom.boardflags_hi & B43_BFH_NOPA) || | 2435 | if ((sprom->boardflags_hi & B43_BFH_NOPA) || |
2436 | (bus->sprom.boardflags_lo & B43_BFL_HGPA)) | 2436 | (sprom->boardflags_lo & B43_BFL_HGPA)) |
2437 | lpphy_write_gain_table_bulk(dev, 0, 128, | 2437 | lpphy_write_gain_table_bulk(dev, 0, 128, |
2438 | lpphy_rev1_nopa_tx_gain_table); | 2438 | lpphy_rev1_nopa_tx_gain_table); |
2439 | else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 2439 | else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
@@ -2444,7 +2444,7 @@ void lpphy_init_tx_gain_table(struct b43_wldev *dev) | |||
2444 | lpphy_rev1_5ghz_tx_gain_table); | 2444 | lpphy_rev1_5ghz_tx_gain_table); |
2445 | break; | 2445 | break; |
2446 | default: | 2446 | default: |
2447 | if (bus->sprom.boardflags_hi & B43_BFH_NOPA) | 2447 | if (sprom->boardflags_hi & B43_BFH_NOPA) |
2448 | lpphy_write_gain_table_bulk(dev, 0, 128, | 2448 | lpphy_write_gain_table_bulk(dev, 0, 128, |
2449 | lpphy_rev2_nopa_tx_gain_table); | 2449 | lpphy_rev2_nopa_tx_gain_table); |
2450 | else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 2450 | else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c index 8f4db448ec33..2829ee1872c9 100644 --- a/drivers/net/wireless/b43/wa.c +++ b/drivers/net/wireless/b43/wa.c | |||
@@ -487,6 +487,7 @@ static void b43_wa_boards_a(struct b43_wldev *dev) | |||
487 | static void b43_wa_boards_g(struct b43_wldev *dev) | 487 | static void b43_wa_boards_g(struct b43_wldev *dev) |
488 | { | 488 | { |
489 | struct ssb_bus *bus = dev->sdev->bus; | 489 | struct ssb_bus *bus = dev->sdev->bus; |
490 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
490 | struct b43_phy *phy = &dev->phy; | 491 | struct b43_phy *phy = &dev->phy; |
491 | 492 | ||
492 | if (bus->boardinfo.vendor != SSB_BOARDVENDOR_BCM || | 493 | if (bus->boardinfo.vendor != SSB_BOARDVENDOR_BCM || |
@@ -498,7 +499,7 @@ static void b43_wa_boards_g(struct b43_wldev *dev) | |||
498 | } else { | 499 | } else { |
499 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 1, 0x0002); | 500 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 1, 0x0002); |
500 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 2, 0x0001); | 501 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 2, 0x0001); |
501 | if ((bus->sprom.boardflags_lo & B43_BFL_EXTLNA) && | 502 | if ((sprom->boardflags_lo & B43_BFL_EXTLNA) && |
502 | (phy->rev >= 7)) { | 503 | (phy->rev >= 7)) { |
503 | b43_phy_mask(dev, B43_PHY_EXTG(0x11), 0xF7FF); | 504 | b43_phy_mask(dev, B43_PHY_EXTG(0x11), 0xF7FF); |
504 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0020, 0x0001); | 505 | b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0020, 0x0001); |
@@ -510,7 +511,7 @@ static void b43_wa_boards_g(struct b43_wldev *dev) | |||
510 | } | 511 | } |
511 | } | 512 | } |
512 | } | 513 | } |
513 | if (bus->sprom.boardflags_lo & B43_BFL_FEM) { | 514 | if (sprom->boardflags_lo & B43_BFL_FEM) { |
514 | b43_phy_write(dev, B43_PHY_GTABCTL, 0x3120); | 515 | b43_phy_write(dev, B43_PHY_GTABCTL, 0x3120); |
515 | b43_phy_write(dev, B43_PHY_GTABDATA, 0xC480); | 516 | b43_phy_write(dev, B43_PHY_GTABDATA, 0xC480); |
516 | } | 517 | } |
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c index c8f99aebe01f..488b898418a3 100644 --- a/drivers/net/wireless/b43/xmit.c +++ b/drivers/net/wireless/b43/xmit.c | |||
@@ -547,7 +547,7 @@ static s8 b43_rssi_postprocess(struct b43_wldev *dev, | |||
547 | else | 547 | else |
548 | tmp -= 3; | 548 | tmp -= 3; |
549 | } else { | 549 | } else { |
550 | if (dev->sdev->bus->sprom. | 550 | if (dev->dev->bus_sprom-> |
551 | boardflags_lo & B43_BFL_RSSI) { | 551 | boardflags_lo & B43_BFL_RSSI) { |
552 | if (in_rssi > 63) | 552 | if (in_rssi > 63) |
553 | in_rssi = 63; | 553 | in_rssi = 63; |