diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-04-15 16:21:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-15 16:21:34 -0400 |
commit | 5c01d5669356e13f0fb468944c1dd4c6a7e978ad (patch) | |
tree | fa43345288d7b25fac92b3b35360a177c4947313 /drivers/net/wireless/b43 | |
parent | fea069152614cdeefba4b2bf80afcddb9c217fc8 (diff) | |
parent | a5e944f1d955f3819503348426763e21e0413ba6 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
Documentation/feature-removal-schedule.txt
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/wl12xx/wl1271_main.c
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 54 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.h | 28 |
3 files changed, 63 insertions, 41 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index c4dc369ce703..3d6b33775964 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -105,7 +105,7 @@ static enum b43_txpwr_result b43_nphy_op_recalc_txpower(struct b43_wldev *dev, | |||
105 | } | 105 | } |
106 | 106 | ||
107 | static void b43_chantab_radio_upload(struct b43_wldev *dev, | 107 | static void b43_chantab_radio_upload(struct b43_wldev *dev, |
108 | const struct b43_nphy_channeltab_entry *e) | 108 | const struct b43_nphy_channeltab_entry_rev2 *e) |
109 | { | 109 | { |
110 | b43_radio_write(dev, B2055_PLL_REF, e->radio_pll_ref); | 110 | b43_radio_write(dev, B2055_PLL_REF, e->radio_pll_ref); |
111 | b43_radio_write(dev, B2055_RF_PLLMOD0, e->radio_rf_pllmod0); | 111 | b43_radio_write(dev, B2055_RF_PLLMOD0, e->radio_rf_pllmod0); |
@@ -142,7 +142,7 @@ static void b43_chantab_radio_upload(struct b43_wldev *dev, | |||
142 | } | 142 | } |
143 | 143 | ||
144 | static void b43_chantab_phy_upload(struct b43_wldev *dev, | 144 | static void b43_chantab_phy_upload(struct b43_wldev *dev, |
145 | const struct b43_nphy_channeltab_entry *e) | 145 | const struct b43_phy_n_sfo_cfg *e) |
146 | { | 146 | { |
147 | b43_phy_write(dev, B43_NPHY_BW1A, e->phy_bw1a); | 147 | b43_phy_write(dev, B43_NPHY_BW1A, e->phy_bw1a); |
148 | b43_phy_write(dev, B43_NPHY_BW2, e->phy_bw2); | 148 | b43_phy_write(dev, B43_NPHY_BW2, e->phy_bw2); |
@@ -160,16 +160,16 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev) | |||
160 | 160 | ||
161 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2055Setup */ | 161 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2055Setup */ |
162 | static void b43_radio_2055_setup(struct b43_wldev *dev, | 162 | static void b43_radio_2055_setup(struct b43_wldev *dev, |
163 | const struct b43_nphy_channeltab_entry *e) | 163 | const struct b43_nphy_channeltab_entry_rev2 *e) |
164 | { | 164 | { |
165 | B43_WARN_ON(dev->phy.rev >= 3); | 165 | B43_WARN_ON(dev->phy.rev >= 3); |
166 | 166 | ||
167 | b43_chantab_radio_upload(dev, e); | 167 | b43_chantab_radio_upload(dev, e); |
168 | udelay(50); | 168 | udelay(50); |
169 | b43_radio_write(dev, B2055_VCO_CAL10, 5); | 169 | b43_radio_write(dev, B2055_VCO_CAL10, 0x05); |
170 | b43_radio_write(dev, B2055_VCO_CAL10, 45); | 170 | b43_radio_write(dev, B2055_VCO_CAL10, 0x45); |
171 | b43_read32(dev, B43_MMIO_MACCTL); /* flush writes */ | 171 | b43_read32(dev, B43_MMIO_MACCTL); /* flush writes */ |
172 | b43_radio_write(dev, B2055_VCO_CAL10, 65); | 172 | b43_radio_write(dev, B2055_VCO_CAL10, 0x65); |
173 | udelay(300); | 173 | udelay(300); |
174 | } | 174 | } |
175 | 175 | ||
@@ -255,6 +255,16 @@ static void b43_radio_init2055(struct b43_wldev *dev) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | /* | 257 | /* |
258 | * Initialize a Broadcom 2056 N-radio | ||
259 | * http://bcm-v4.sipsolutions.net/802.11/Radio/2056/Init | ||
260 | */ | ||
261 | static void b43_radio_init2056(struct b43_wldev *dev) | ||
262 | { | ||
263 | /* TODO */ | ||
264 | } | ||
265 | |||
266 | |||
267 | /* | ||
258 | * Upload the N-PHY tables. | 268 | * Upload the N-PHY tables. |
259 | * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables | 269 | * http://bcm-v4.sipsolutions.net/802.11/PHY/N/InitTables |
260 | */ | 270 | */ |
@@ -2791,7 +2801,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev, | |||
2791 | } | 2801 | } |
2792 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4, | 2802 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4, |
2793 | buffer); | 2803 | buffer); |
2794 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 101), 2, | 2804 | b43_ntab_read_bulk(dev, B43_NTAB16(15, 101), 2, |
2795 | buffer); | 2805 | buffer); |
2796 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2, | 2806 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2, |
2797 | buffer); | 2807 | buffer); |
@@ -3261,7 +3271,7 @@ int b43_phy_initn(struct b43_wldev *dev) | |||
3261 | 3271 | ||
3262 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */ | 3272 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */ |
3263 | static void b43_nphy_chanspec_setup(struct b43_wldev *dev, | 3273 | static void b43_nphy_chanspec_setup(struct b43_wldev *dev, |
3264 | const struct b43_nphy_channeltab_entry *e, | 3274 | const struct b43_phy_n_sfo_cfg *e, |
3265 | struct b43_chanspec chanspec) | 3275 | struct b43_chanspec chanspec) |
3266 | { | 3276 | { |
3267 | struct b43_phy *phy = &dev->phy; | 3277 | struct b43_phy *phy = &dev->phy; |
@@ -3327,13 +3337,21 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev, | |||
3327 | { | 3337 | { |
3328 | struct b43_phy_n *nphy = dev->phy.n; | 3338 | struct b43_phy_n *nphy = dev->phy.n; |
3329 | 3339 | ||
3330 | const struct b43_nphy_channeltab_entry *tabent; | 3340 | const struct b43_nphy_channeltab_entry_rev2 *tabent_r2; |
3341 | const struct b43_nphy_channeltab_entry_rev3 *tabent_r3; | ||
3331 | 3342 | ||
3332 | u8 tmp; | 3343 | u8 tmp; |
3333 | u8 channel = chanspec.channel; | 3344 | u8 channel = chanspec.channel; |
3334 | 3345 | ||
3335 | if (dev->phy.rev >= 3) { | 3346 | if (dev->phy.rev >= 3) { |
3336 | /* TODO */ | 3347 | /* TODO */ |
3348 | tabent_r3 = NULL; | ||
3349 | if (!tabent_r3) | ||
3350 | return -ESRCH; | ||
3351 | } else { | ||
3352 | tabent_r2 = b43_nphy_get_chantabent_rev2(dev, channel); | ||
3353 | if (!tabent_r2) | ||
3354 | return -ESRCH; | ||
3337 | } | 3355 | } |
3338 | 3356 | ||
3339 | nphy->radio_chanspec = chanspec; | 3357 | nphy->radio_chanspec = chanspec; |
@@ -3354,17 +3372,13 @@ static int b43_nphy_set_chanspec(struct b43_wldev *dev, | |||
3354 | if (dev->phy.rev >= 3) { | 3372 | if (dev->phy.rev >= 3) { |
3355 | tmp = (chanspec.b_freq == 1) ? 4 : 0; | 3373 | tmp = (chanspec.b_freq == 1) ? 4 : 0; |
3356 | b43_radio_maskset(dev, 0x08, 0xFFFB, tmp); | 3374 | b43_radio_maskset(dev, 0x08, 0xFFFB, tmp); |
3357 | /* TODO: PHY Radio2056 Setup (chan_info_ptr[i]) */ | 3375 | /* TODO: PHY Radio2056 Setup (dev, tabent_r3); */ |
3358 | /* TODO: N PHY Chanspec Setup (chan_info_ptr[i]) */ | 3376 | b43_nphy_chanspec_setup(dev, &(tabent_r3->phy_regs), chanspec); |
3359 | } else { | 3377 | } else { |
3360 | tabent = b43_nphy_get_chantabent(dev, channel); | ||
3361 | if (!tabent) | ||
3362 | return -ESRCH; | ||
3363 | |||
3364 | tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050; | 3378 | tmp = (chanspec.b_freq == 1) ? 0x0020 : 0x0050; |
3365 | b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp); | 3379 | b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, tmp); |
3366 | b43_radio_2055_setup(dev, tabent); | 3380 | b43_radio_2055_setup(dev, tabent_r2); |
3367 | b43_nphy_chanspec_setup(dev, tabent, chanspec); | 3381 | b43_nphy_chanspec_setup(dev, &(tabent_r2->phy_regs), chanspec); |
3368 | } | 3382 | } |
3369 | 3383 | ||
3370 | return 0; | 3384 | return 0; |
@@ -3474,6 +3488,8 @@ static void b43_nphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value) | |||
3474 | static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, | 3488 | static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, |
3475 | bool blocked) | 3489 | bool blocked) |
3476 | { | 3490 | { |
3491 | struct b43_phy_n *nphy = dev->phy.n; | ||
3492 | |||
3477 | if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED) | 3493 | if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED) |
3478 | b43err(dev->wl, "MAC not suspended\n"); | 3494 | b43err(dev->wl, "MAC not suspended\n"); |
3479 | 3495 | ||
@@ -3499,8 +3515,8 @@ static void b43_nphy_op_software_rfkill(struct b43_wldev *dev, | |||
3499 | } | 3515 | } |
3500 | } else { | 3516 | } else { |
3501 | if (dev->phy.rev >= 3) { | 3517 | if (dev->phy.rev >= 3) { |
3502 | /* TODO: b43_radio_init2056(dev); */ | 3518 | b43_radio_init2056(dev); |
3503 | /* TODO: PHY Set Channel Spec (dev, radio_chanspec) */ | 3519 | b43_nphy_set_chanspec(dev, nphy->radio_chanspec); |
3504 | } else { | 3520 | } else { |
3505 | b43_radio_init2055(dev); | 3521 | b43_radio_init2055(dev); |
3506 | } | 3522 | } |
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index a00d509150f7..d96e870ab8fe 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c | |||
@@ -318,14 +318,14 @@ void b2055_upload_inittab(struct b43_wldev *dev, | |||
318 | .radio_c2_tx_mxbgtrim = r21 | 318 | .radio_c2_tx_mxbgtrim = r21 |
319 | 319 | ||
320 | #define PHYREGS(r0, r1, r2, r3, r4, r5) \ | 320 | #define PHYREGS(r0, r1, r2, r3, r4, r5) \ |
321 | .phy_bw1a = r0, \ | 321 | .phy_regs.phy_bw1a = r0, \ |
322 | .phy_bw2 = r1, \ | 322 | .phy_regs.phy_bw2 = r1, \ |
323 | .phy_bw3 = r2, \ | 323 | .phy_regs.phy_bw3 = r2, \ |
324 | .phy_bw4 = r3, \ | 324 | .phy_regs.phy_bw4 = r3, \ |
325 | .phy_bw5 = r4, \ | 325 | .phy_regs.phy_bw5 = r4, \ |
326 | .phy_bw6 = r5 | 326 | .phy_regs.phy_bw6 = r5 |
327 | 327 | ||
328 | static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = { | 328 | static const struct b43_nphy_channeltab_entry_rev2 b43_nphy_channeltab[] = { |
329 | { .channel = 184, | 329 | { .channel = 184, |
330 | .freq = 4920, /* MHz */ | 330 | .freq = 4920, /* MHz */ |
331 | .unk2 = 3280, | 331 | .unk2 = 3280, |
@@ -1320,10 +1320,10 @@ static const struct b43_nphy_channeltab_entry b43_nphy_channeltab[] = { | |||
1320 | }, | 1320 | }, |
1321 | }; | 1321 | }; |
1322 | 1322 | ||
1323 | const struct b43_nphy_channeltab_entry * | 1323 | const struct b43_nphy_channeltab_entry_rev2 * |
1324 | b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel) | 1324 | b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel) |
1325 | { | 1325 | { |
1326 | const struct b43_nphy_channeltab_entry *e; | 1326 | const struct b43_nphy_channeltab_entry_rev2 *e; |
1327 | unsigned int i; | 1327 | unsigned int i; |
1328 | 1328 | ||
1329 | for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab); i++) { | 1329 | for (i = 0; i < ARRAY_SIZE(b43_nphy_channeltab); i++) { |
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h index b23036f7dc19..8fc1da9f8fe5 100644 --- a/drivers/net/wireless/b43/tables_nphy.h +++ b/drivers/net/wireless/b43/tables_nphy.h | |||
@@ -13,9 +13,13 @@ struct b43_phy_n_sfo_cfg { | |||
13 | u16 phy_bw6; | 13 | u16 phy_bw6; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct b43_nphy_channeltab_entry { | 16 | struct b43_nphy_channeltab_entry_rev2 { |
17 | /* The channel number */ | 17 | /* The channel number */ |
18 | u8 channel; | 18 | u8 channel; |
19 | /* The channel frequency in MHz */ | ||
20 | u16 freq; | ||
21 | /* An unknown value */ | ||
22 | u16 unk2; | ||
19 | /* Radio register values on channelswitch */ | 23 | /* Radio register values on channelswitch */ |
20 | u8 radio_pll_ref; | 24 | u8 radio_pll_ref; |
21 | u8 radio_rf_pllmod0; | 25 | u8 radio_rf_pllmod0; |
@@ -40,16 +44,18 @@ struct b43_nphy_channeltab_entry { | |||
40 | u8 radio_c2_tx_pgapadtn; | 44 | u8 radio_c2_tx_pgapadtn; |
41 | u8 radio_c2_tx_mxbgtrim; | 45 | u8 radio_c2_tx_mxbgtrim; |
42 | /* PHY register values on channelswitch */ | 46 | /* PHY register values on channelswitch */ |
43 | u16 phy_bw1a; | 47 | struct b43_phy_n_sfo_cfg phy_regs; |
44 | u16 phy_bw2; | 48 | }; |
45 | u16 phy_bw3; | 49 | |
46 | u16 phy_bw4; | 50 | struct b43_nphy_channeltab_entry_rev3 { |
47 | u16 phy_bw5; | 51 | /* The channel number */ |
48 | u16 phy_bw6; | 52 | u8 channel; |
49 | /* The channel frequency in MHz */ | 53 | /* The channel frequency in MHz */ |
50 | u16 freq; | 54 | u16 freq; |
51 | /* An unknown value */ | 55 | /* Radio register values on channelswitch */ |
52 | u16 unk2; | 56 | /* TODO */ |
57 | /* PHY register values on channelswitch */ | ||
58 | struct b43_phy_n_sfo_cfg phy_regs; | ||
53 | }; | 59 | }; |
54 | 60 | ||
55 | 61 | ||
@@ -86,8 +92,8 @@ void b2055_upload_inittab(struct b43_wldev *dev, | |||
86 | 92 | ||
87 | /* Get the NPHY Channel Switch Table entry for a channel number. | 93 | /* Get the NPHY Channel Switch Table entry for a channel number. |
88 | * Returns NULL on failure to find an entry. */ | 94 | * Returns NULL on failure to find an entry. */ |
89 | const struct b43_nphy_channeltab_entry * | 95 | const struct b43_nphy_channeltab_entry_rev2 * |
90 | b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel); | 96 | b43_nphy_get_chantabent_rev2(struct b43_wldev *dev, u8 channel); |
91 | 97 | ||
92 | 98 | ||
93 | /* The N-PHY tables. */ | 99 | /* The N-PHY tables. */ |