diff options
author | John W. Linville <linville@tuxdriver.com> | 2007-02-17 18:26:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-02-17 18:26:09 -0500 |
commit | b312362be6d9155b66f3a26d9159e0a680fbd6c5 (patch) | |
tree | 52ebaad6117abf806dab4e738d01b509839f7b12 /drivers/net/wireless/bcm43xx | |
parent | bdcac1878c80b068d8e073c1691d4bd09ba9996d (diff) | |
parent | bb52a653eaef4aee877b2fa36de8699926f788bd (diff) |
Merge branch 'upstream' into upstream-jgarzik
Conflicts:
net/ieee80211/softmac/ieee80211softmac_module.c
net/ieee80211/softmac/ieee80211softmac_wx.c
Diffstat (limited to 'drivers/net/wireless/bcm43xx')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ilt.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_ilt.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_phy.c | 195 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_radio.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_xmit.h | 10 |
7 files changed, 121 insertions, 141 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index 0e790efae683..95ff175d8f33 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #define PFX KBUILD_MODNAME ": " | 21 | #define PFX KBUILD_MODNAME ": " |
22 | 22 | ||
23 | #define BCM43xx_SWITCH_CORE_MAX_RETRIES 50 | 23 | #define BCM43xx_SWITCH_CORE_MAX_RETRIES 50 |
24 | #define BCM43xx_IRQWAIT_MAX_RETRIES 50 | 24 | #define BCM43xx_IRQWAIT_MAX_RETRIES 100 |
25 | 25 | ||
26 | #define BCM43xx_IO_SIZE 8192 | 26 | #define BCM43xx_IO_SIZE 8192 |
27 | 27 | ||
@@ -333,7 +333,7 @@ | |||
333 | #define BCM43xx_SBF_PS2 0x04000000 | 333 | #define BCM43xx_SBF_PS2 0x04000000 |
334 | #define BCM43xx_SBF_NO_SSID_BCAST 0x08000000 | 334 | #define BCM43xx_SBF_NO_SSID_BCAST 0x08000000 |
335 | #define BCM43xx_SBF_TIME_UPDATE 0x10000000 | 335 | #define BCM43xx_SBF_TIME_UPDATE 0x10000000 |
336 | #define BCM43xx_SBF_80000000 0x80000000 /*FIXME: fix name*/ | 336 | #define BCM43xx_SBF_MODE_G 0x80000000 |
337 | 337 | ||
338 | /* Microcode */ | 338 | /* Microcode */ |
339 | #define BCM43xx_UCODE_REVISION 0x0000 | 339 | #define BCM43xx_UCODE_REVISION 0x0000 |
@@ -507,8 +507,6 @@ struct bcm43xx_sprominfo { | |||
507 | u8 et1macaddr[6]; | 507 | u8 et1macaddr[6]; |
508 | u8 et0phyaddr:5; | 508 | u8 et0phyaddr:5; |
509 | u8 et1phyaddr:5; | 509 | u8 et1phyaddr:5; |
510 | u8 et0mdcport:1; | ||
511 | u8 et1mdcport:1; | ||
512 | u8 boardrev; | 510 | u8 boardrev; |
513 | u8 locale:4; | 511 | u8 locale:4; |
514 | u8 antennas_aphy:2; | 512 | u8 antennas_aphy:2; |
@@ -542,7 +540,7 @@ struct bcm43xx_lopair { | |||
542 | 540 | ||
543 | struct bcm43xx_phyinfo { | 541 | struct bcm43xx_phyinfo { |
544 | /* Hardware Data */ | 542 | /* Hardware Data */ |
545 | u8 version; | 543 | u8 analog; |
546 | u8 type; | 544 | u8 type; |
547 | u8 rev; | 545 | u8 rev; |
548 | u16 antenna_diversity; | 546 | u16 antenna_diversity; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c index ad8e569d1faf..f2b8dbac55a4 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.c | |||
@@ -325,6 +325,21 @@ void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val) | |||
325 | } | 325 | } |
326 | } | 326 | } |
327 | 327 | ||
328 | void bcm43xx_ilt_write32(struct bcm43xx_private *bcm, u16 offset, u32 val) | ||
329 | { | ||
330 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) { | ||
331 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, offset); | ||
332 | mmiowb(); | ||
333 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA2, (val & 0xFFFF0000) >> 16); | ||
334 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_DATA1, val & 0x0000FFFF); | ||
335 | } else { | ||
336 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_CTRL, offset); | ||
337 | mmiowb(); | ||
338 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA2, (val & 0xFFFF0000) >> 16); | ||
339 | bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_G_DATA1, val & 0x0000FFFF); | ||
340 | } | ||
341 | } | ||
342 | |||
328 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset) | 343 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset) |
329 | { | 344 | { |
330 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) { | 345 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) { |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h index 464521abf73c..d7eaf5f25b7f 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_ilt.h | |||
@@ -27,6 +27,7 @@ extern const u16 bcm43xx_ilt_sigmasqr2[BCM43xx_ILT_SIGMASQR_SIZE]; | |||
27 | 27 | ||
28 | 28 | ||
29 | void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val); | 29 | void bcm43xx_ilt_write(struct bcm43xx_private *bcm, u16 offset, u16 val); |
30 | void bcm43xx_ilt_write32(struct bcm43xx_private *bcm, u16 offset, u32 val); | ||
30 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset); | 31 | u16 bcm43xx_ilt_read(struct bcm43xx_private *bcm, u16 offset); |
31 | 32 | ||
32 | #endif /* BCM43xx_ILT_H_ */ | 33 | #endif /* BCM43xx_ILT_H_ */ |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 2e400aacc436..73c831a3b747 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -851,8 +851,6 @@ static int bcm43xx_sprom_extract(struct bcm43xx_private *bcm) | |||
851 | value = sprom[BCM43xx_SPROM_ETHPHY]; | 851 | value = sprom[BCM43xx_SPROM_ETHPHY]; |
852 | bcm->sprom.et0phyaddr = (value & 0x001F); | 852 | bcm->sprom.et0phyaddr = (value & 0x001F); |
853 | bcm->sprom.et1phyaddr = (value & 0x03E0) >> 5; | 853 | bcm->sprom.et1phyaddr = (value & 0x03E0) >> 5; |
854 | bcm->sprom.et0mdcport = (value & (1 << 14)) >> 14; | ||
855 | bcm->sprom.et1mdcport = (value & (1 << 15)) >> 15; | ||
856 | 854 | ||
857 | /* boardrev, antennas, locale */ | 855 | /* boardrev, antennas, locale */ |
858 | value = sprom[BCM43xx_SPROM_BOARDREV]; | 856 | value = sprom[BCM43xx_SPROM_BOARDREV]; |
@@ -1449,12 +1447,10 @@ static void handle_irq_transmit_status(struct bcm43xx_private *bcm) | |||
1449 | 1447 | ||
1450 | bcm43xx_debugfs_log_txstat(bcm, &stat); | 1448 | bcm43xx_debugfs_log_txstat(bcm, &stat); |
1451 | 1449 | ||
1452 | if (stat.flags & BCM43xx_TXSTAT_FLAG_IGNORE) | 1450 | if (stat.flags & BCM43xx_TXSTAT_FLAG_AMPDU) |
1451 | continue; | ||
1452 | if (stat.flags & BCM43xx_TXSTAT_FLAG_INTER) | ||
1453 | continue; | 1453 | continue; |
1454 | if (!(stat.flags & BCM43xx_TXSTAT_FLAG_ACK)) { | ||
1455 | //TODO: packet was not acked (was lost) | ||
1456 | } | ||
1457 | //TODO: There are more (unknown) flags to test. see bcm43xx_main.h | ||
1458 | 1454 | ||
1459 | if (bcm43xx_using_pio(bcm)) | 1455 | if (bcm43xx_using_pio(bcm)) |
1460 | bcm43xx_pio_handle_xmitstatus(bcm, &stat); | 1456 | bcm43xx_pio_handle_xmitstatus(bcm, &stat); |
@@ -3696,7 +3692,7 @@ static int bcm43xx_read_phyinfo(struct bcm43xx_private *bcm) | |||
3696 | { | 3692 | { |
3697 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); | 3693 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); |
3698 | u16 value; | 3694 | u16 value; |
3699 | u8 phy_version; | 3695 | u8 phy_analog; |
3700 | u8 phy_type; | 3696 | u8 phy_type; |
3701 | u8 phy_rev; | 3697 | u8 phy_rev; |
3702 | int phy_rev_ok = 1; | 3698 | int phy_rev_ok = 1; |
@@ -3704,12 +3700,12 @@ static int bcm43xx_read_phyinfo(struct bcm43xx_private *bcm) | |||
3704 | 3700 | ||
3705 | value = bcm43xx_read16(bcm, BCM43xx_MMIO_PHY_VER); | 3701 | value = bcm43xx_read16(bcm, BCM43xx_MMIO_PHY_VER); |
3706 | 3702 | ||
3707 | phy_version = (value & 0xF000) >> 12; | 3703 | phy_analog = (value & 0xF000) >> 12; |
3708 | phy_type = (value & 0x0F00) >> 8; | 3704 | phy_type = (value & 0x0F00) >> 8; |
3709 | phy_rev = (value & 0x000F); | 3705 | phy_rev = (value & 0x000F); |
3710 | 3706 | ||
3711 | dprintk(KERN_INFO PFX "Detected PHY: Version: %x, Type %x, Revision %x\n", | 3707 | dprintk(KERN_INFO PFX "Detected PHY: Analog: %x, Type %x, Revision %x\n", |
3712 | phy_version, phy_type, phy_rev); | 3708 | phy_analog, phy_type, phy_rev); |
3713 | 3709 | ||
3714 | switch (phy_type) { | 3710 | switch (phy_type) { |
3715 | case BCM43xx_PHYTYPE_A: | 3711 | case BCM43xx_PHYTYPE_A: |
@@ -3752,7 +3748,7 @@ static int bcm43xx_read_phyinfo(struct bcm43xx_private *bcm) | |||
3752 | phy_rev); | 3748 | phy_rev); |
3753 | } | 3749 | } |
3754 | 3750 | ||
3755 | phy->version = phy_version; | 3751 | phy->analog = phy_analog; |
3756 | phy->type = phy_type; | 3752 | phy->type = phy_type; |
3757 | phy->rev = phy_rev; | 3753 | phy->rev = phy_rev; |
3758 | if ((phy_type == BCM43xx_PHYTYPE_B) || (phy_type == BCM43xx_PHYTYPE_G)) { | 3754 | if ((phy_type == BCM43xx_PHYTYPE_B) || (phy_type == BCM43xx_PHYTYPE_G)) { |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index 52ce2a9334fb..3a5c9c2b2150 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -205,8 +205,8 @@ static void bcm43xx_phy_init_pctl(struct bcm43xx_private *bcm) | |||
205 | (bcm->board_type == 0x0416)) | 205 | (bcm->board_type == 0x0416)) |
206 | return; | 206 | return; |
207 | 207 | ||
208 | bcm43xx_write16(bcm, 0x03E6, bcm43xx_read16(bcm, 0x03E6) & 0xFFDF); | ||
209 | bcm43xx_phy_write(bcm, 0x0028, 0x8018); | 208 | bcm43xx_phy_write(bcm, 0x0028, 0x8018); |
209 | bcm43xx_write16(bcm, 0x03E6, bcm43xx_read16(bcm, 0x03E6) & 0xFFDF); | ||
210 | 210 | ||
211 | if (phy->type == BCM43xx_PHYTYPE_G) { | 211 | if (phy->type == BCM43xx_PHYTYPE_G) { |
212 | if (!phy->connected) | 212 | if (!phy->connected) |
@@ -317,6 +317,13 @@ static void bcm43xx_phy_agcsetup(struct bcm43xx_private *bcm) | |||
317 | bcm43xx_ilt_write(bcm, offset + 0x0801, 7); | 317 | bcm43xx_ilt_write(bcm, offset + 0x0801, 7); |
318 | bcm43xx_ilt_write(bcm, offset + 0x0802, 16); | 318 | bcm43xx_ilt_write(bcm, offset + 0x0802, 16); |
319 | bcm43xx_ilt_write(bcm, offset + 0x0803, 28); | 319 | bcm43xx_ilt_write(bcm, offset + 0x0803, 28); |
320 | |||
321 | if (phy->rev >= 6) { | ||
322 | bcm43xx_phy_write(bcm, 0x0426, (bcm43xx_phy_read(bcm, 0x0426) | ||
323 | & 0xFFFC)); | ||
324 | bcm43xx_phy_write(bcm, 0x0426, (bcm43xx_phy_read(bcm, 0x0426) | ||
325 | & 0xEFFF)); | ||
326 | } | ||
320 | } | 327 | } |
321 | 328 | ||
322 | static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) | 329 | static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) |
@@ -337,7 +344,7 @@ static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) | |||
337 | for (i = 0; i < BCM43xx_ILT_NOISEG1_SIZE; i++) | 344 | for (i = 0; i < BCM43xx_ILT_NOISEG1_SIZE; i++) |
338 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noiseg1[i]); | 345 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noiseg1[i]); |
339 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) | 346 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) |
340 | bcm43xx_ilt_write(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); | 347 | bcm43xx_ilt_write32(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); |
341 | } else { | 348 | } else { |
342 | /* nrssi values are signed 6-bit values. Not sure why we write 0x7654 here... */ | 349 | /* nrssi values are signed 6-bit values. Not sure why we write 0x7654 here... */ |
343 | bcm43xx_nrssi_hw_write(bcm, 0xBA98, (s16)0x7654); | 350 | bcm43xx_nrssi_hw_write(bcm, 0xBA98, (s16)0x7654); |
@@ -377,7 +384,7 @@ static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) | |||
377 | 384 | ||
378 | if (phy->rev == 1) { | 385 | if (phy->rev == 1) { |
379 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) | 386 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) |
380 | bcm43xx_ilt_write(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); | 387 | bcm43xx_ilt_write32(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); |
381 | for (i = 0; i < 4; i++) { | 388 | for (i = 0; i < 4; i++) { |
382 | bcm43xx_ilt_write(bcm, 0x5404 + i, 0x0020); | 389 | bcm43xx_ilt_write(bcm, 0x5404 + i, 0x0020); |
383 | bcm43xx_ilt_write(bcm, 0x5408 + i, 0x0020); | 390 | bcm43xx_ilt_write(bcm, 0x5408 + i, 0x0020); |
@@ -500,10 +507,10 @@ static void bcm43xx_phy_setupa(struct bcm43xx_private *bcm) | |||
500 | for (i = 0; i < BCM43xx_ILT_NOISEA2_SIZE; i++) | 507 | for (i = 0; i < BCM43xx_ILT_NOISEA2_SIZE; i++) |
501 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noisea2[i]); | 508 | bcm43xx_ilt_write(bcm, 0x1800 + i, bcm43xx_ilt_noisea2[i]); |
502 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) | 509 | for (i = 0; i < BCM43xx_ILT_ROTOR_SIZE; i++) |
503 | bcm43xx_ilt_write(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); | 510 | bcm43xx_ilt_write32(bcm, 0x2000 + i, bcm43xx_ilt_rotor[i]); |
504 | bcm43xx_phy_init_noisescaletbl(bcm); | 511 | bcm43xx_phy_init_noisescaletbl(bcm); |
505 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) | 512 | for (i = 0; i < BCM43xx_ILT_RETARD_SIZE; i++) |
506 | bcm43xx_ilt_write(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); | 513 | bcm43xx_ilt_write32(bcm, 0x2400 + i, bcm43xx_ilt_retard[i]); |
507 | break; | 514 | break; |
508 | case 3: | 515 | case 3: |
509 | for (i = 0; i < 64; i++) | 516 | for (i = 0; i < 64; i++) |
@@ -729,19 +736,19 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) | |||
729 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); | 736 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); |
730 | struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm); | 737 | struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm); |
731 | u16 offset; | 738 | u16 offset; |
739 | u16 value; | ||
740 | u8 old_channel; | ||
732 | 741 | ||
733 | if (phy->version == 1 && | 742 | if (phy->analog == 1) |
734 | radio->version == 0x2050) { | ||
735 | bcm43xx_radio_write16(bcm, 0x007A, | 743 | bcm43xx_radio_write16(bcm, 0x007A, |
736 | bcm43xx_radio_read16(bcm, 0x007A) | 744 | bcm43xx_radio_read16(bcm, 0x007A) |
737 | | 0x0050); | 745 | | 0x0050); |
738 | } | ||
739 | if ((bcm->board_vendor != PCI_VENDOR_ID_BROADCOM) && | 746 | if ((bcm->board_vendor != PCI_VENDOR_ID_BROADCOM) && |
740 | (bcm->board_type != 0x0416)) { | 747 | (bcm->board_type != 0x0416)) { |
748 | value = 0x2120; | ||
741 | for (offset = 0x00A8 ; offset < 0x00C7; offset++) { | 749 | for (offset = 0x00A8 ; offset < 0x00C7; offset++) { |
742 | bcm43xx_phy_write(bcm, offset, | 750 | bcm43xx_phy_write(bcm, offset, value); |
743 | (bcm43xx_phy_read(bcm, offset) + 0x2020) | 751 | value += 0x0202; |
744 | & 0x3F3F); | ||
745 | } | 752 | } |
746 | } | 753 | } |
747 | bcm43xx_phy_write(bcm, 0x0035, | 754 | bcm43xx_phy_write(bcm, 0x0035, |
@@ -750,7 +757,7 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) | |||
750 | if (radio->version == 0x2050) | 757 | if (radio->version == 0x2050) |
751 | bcm43xx_phy_write(bcm, 0x0038, 0x0667); | 758 | bcm43xx_phy_write(bcm, 0x0038, 0x0667); |
752 | 759 | ||
753 | if (phy->connected) { | 760 | if (phy->type == BCM43xx_PHYTYPE_G) { |
754 | if (radio->version == 0x2050) { | 761 | if (radio->version == 0x2050) { |
755 | bcm43xx_radio_write16(bcm, 0x007A, | 762 | bcm43xx_radio_write16(bcm, 0x007A, |
756 | bcm43xx_radio_read16(bcm, 0x007A) | 763 | bcm43xx_radio_read16(bcm, 0x007A) |
@@ -776,7 +783,7 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) | |||
776 | bcm43xx_phy_read(bcm, BCM43xx_PHY_RADIO_BITFIELD) | (1 << 11)); | 783 | bcm43xx_phy_read(bcm, BCM43xx_PHY_RADIO_BITFIELD) | (1 << 11)); |
777 | } | 784 | } |
778 | 785 | ||
779 | if (phy->version == 1 && radio->version == 0x2050) { | 786 | if (phy->analog == 1) { |
780 | bcm43xx_phy_write(bcm, 0x0026, 0xCE00); | 787 | bcm43xx_phy_write(bcm, 0x0026, 0xCE00); |
781 | bcm43xx_phy_write(bcm, 0x0021, 0x3763); | 788 | bcm43xx_phy_write(bcm, 0x0021, 0x3763); |
782 | bcm43xx_phy_write(bcm, 0x0022, 0x1BC3); | 789 | bcm43xx_phy_write(bcm, 0x0022, 0x1BC3); |
@@ -787,14 +794,15 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) | |||
787 | bcm43xx_phy_write(bcm, 0x0030, 0x00C6); | 794 | bcm43xx_phy_write(bcm, 0x0030, 0x00C6); |
788 | bcm43xx_write16(bcm, 0x03EC, 0x3F22); | 795 | bcm43xx_write16(bcm, 0x03EC, 0x3F22); |
789 | 796 | ||
790 | if (phy->version == 1 && radio->version == 0x2050) | 797 | if (phy->analog == 1) |
791 | bcm43xx_phy_write(bcm, 0x0020, 0x3E1C); | 798 | bcm43xx_phy_write(bcm, 0x0020, 0x3E1C); |
792 | else | 799 | else |
793 | bcm43xx_phy_write(bcm, 0x0020, 0x301C); | 800 | bcm43xx_phy_write(bcm, 0x0020, 0x301C); |
794 | 801 | ||
795 | if (phy->version == 0) | 802 | if (phy->analog == 0) |
796 | bcm43xx_write16(bcm, 0x03E4, 0x3000); | 803 | bcm43xx_write16(bcm, 0x03E4, 0x3000); |
797 | 804 | ||
805 | old_channel = radio->channel; | ||
798 | /* Force to channel 7, even if not supported. */ | 806 | /* Force to channel 7, even if not supported. */ |
799 | bcm43xx_radio_selectchannel(bcm, 7, 0); | 807 | bcm43xx_radio_selectchannel(bcm, 7, 0); |
800 | 808 | ||
@@ -816,11 +824,11 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) | |||
816 | 824 | ||
817 | bcm43xx_radio_write16(bcm, 0x007A, bcm43xx_radio_read16(bcm, 0x007A) | 0x0007); | 825 | bcm43xx_radio_write16(bcm, 0x007A, bcm43xx_radio_read16(bcm, 0x007A) | 0x0007); |
818 | 826 | ||
819 | bcm43xx_radio_selectchannel(bcm, BCM43xx_RADIO_DEFAULT_CHANNEL_BG, 0); | 827 | bcm43xx_radio_selectchannel(bcm, old_channel, 0); |
820 | 828 | ||
821 | bcm43xx_phy_write(bcm, 0x0014, 0x0080); | 829 | bcm43xx_phy_write(bcm, 0x0014, 0x0080); |
822 | bcm43xx_phy_write(bcm, 0x0032, 0x00CA); | 830 | bcm43xx_phy_write(bcm, 0x0032, 0x00CA); |
823 | bcm43xx_phy_write(bcm, 0x88A3, 0x002A); | 831 | bcm43xx_phy_write(bcm, 0x002A, 0x88A3); |
824 | 832 | ||
825 | bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); | 833 | bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); |
826 | 834 | ||
@@ -835,61 +843,24 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) | |||
835 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); | 843 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); |
836 | struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm); | 844 | struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm); |
837 | u16 offset, val; | 845 | u16 offset, val; |
846 | u8 old_channel; | ||
838 | 847 | ||
839 | bcm43xx_phy_write(bcm, 0x003E, 0x817A); | 848 | bcm43xx_phy_write(bcm, 0x003E, 0x817A); |
840 | bcm43xx_radio_write16(bcm, 0x007A, | 849 | bcm43xx_radio_write16(bcm, 0x007A, |
841 | (bcm43xx_radio_read16(bcm, 0x007A) | 0x0058)); | 850 | (bcm43xx_radio_read16(bcm, 0x007A) | 0x0058)); |
842 | if ((radio->manufact == 0x17F) && | 851 | if (radio->revision == 4 || |
843 | (radio->version == 0x2050) && | 852 | radio->revision == 5) { |
844 | (radio->revision == 3 || | 853 | bcm43xx_radio_write16(bcm, 0x0051, 0x0037); |
845 | radio->revision == 4 || | 854 | bcm43xx_radio_write16(bcm, 0x0052, 0x0070); |
846 | radio->revision == 5)) { | 855 | bcm43xx_radio_write16(bcm, 0x0053, 0x00B3); |
847 | bcm43xx_radio_write16(bcm, 0x0051, 0x001F); | 856 | bcm43xx_radio_write16(bcm, 0x0054, 0x009B); |
848 | bcm43xx_radio_write16(bcm, 0x0052, 0x0040); | ||
849 | bcm43xx_radio_write16(bcm, 0x0053, 0x005B); | ||
850 | bcm43xx_radio_write16(bcm, 0x0054, 0x0098); | ||
851 | bcm43xx_radio_write16(bcm, 0x005A, 0x0088); | 857 | bcm43xx_radio_write16(bcm, 0x005A, 0x0088); |
852 | bcm43xx_radio_write16(bcm, 0x005B, 0x0088); | 858 | bcm43xx_radio_write16(bcm, 0x005B, 0x0088); |
853 | bcm43xx_radio_write16(bcm, 0x005D, 0x0088); | 859 | bcm43xx_radio_write16(bcm, 0x005D, 0x0088); |
854 | bcm43xx_radio_write16(bcm, 0x005E, 0x0088); | 860 | bcm43xx_radio_write16(bcm, 0x005E, 0x0088); |
855 | bcm43xx_radio_write16(bcm, 0x007D, 0x0088); | 861 | bcm43xx_radio_write16(bcm, 0x007D, 0x0088); |
856 | } | 862 | } |
857 | if ((radio->manufact == 0x17F) && | 863 | if (radio->revision == 8) { |
858 | (radio->version == 0x2050) && | ||
859 | (radio->revision == 6)) { | ||
860 | bcm43xx_radio_write16(bcm, 0x0051, 0x0000); | ||
861 | bcm43xx_radio_write16(bcm, 0x0052, 0x0040); | ||
862 | bcm43xx_radio_write16(bcm, 0x0053, 0x00B7); | ||
863 | bcm43xx_radio_write16(bcm, 0x0054, 0x0098); | ||
864 | bcm43xx_radio_write16(bcm, 0x005A, 0x0088); | ||
865 | bcm43xx_radio_write16(bcm, 0x005B, 0x008B); | ||
866 | bcm43xx_radio_write16(bcm, 0x005C, 0x00B5); | ||
867 | bcm43xx_radio_write16(bcm, 0x005D, 0x0088); | ||
868 | bcm43xx_radio_write16(bcm, 0x005E, 0x0088); | ||
869 | bcm43xx_radio_write16(bcm, 0x007D, 0x0088); | ||
870 | bcm43xx_radio_write16(bcm, 0x007C, 0x0001); | ||
871 | bcm43xx_radio_write16(bcm, 0x007E, 0x0008); | ||
872 | } | ||
873 | if ((radio->manufact == 0x17F) && | ||
874 | (radio->version == 0x2050) && | ||
875 | (radio->revision == 7)) { | ||
876 | bcm43xx_radio_write16(bcm, 0x0051, 0x0000); | ||
877 | bcm43xx_radio_write16(bcm, 0x0052, 0x0040); | ||
878 | bcm43xx_radio_write16(bcm, 0x0053, 0x00B7); | ||
879 | bcm43xx_radio_write16(bcm, 0x0054, 0x0098); | ||
880 | bcm43xx_radio_write16(bcm, 0x005A, 0x0088); | ||
881 | bcm43xx_radio_write16(bcm, 0x005B, 0x00A8); | ||
882 | bcm43xx_radio_write16(bcm, 0x005C, 0x0075); | ||
883 | bcm43xx_radio_write16(bcm, 0x005D, 0x00F5); | ||
884 | bcm43xx_radio_write16(bcm, 0x005E, 0x00B8); | ||
885 | bcm43xx_radio_write16(bcm, 0x007D, 0x00E8); | ||
886 | bcm43xx_radio_write16(bcm, 0x007C, 0x0001); | ||
887 | bcm43xx_radio_write16(bcm, 0x007E, 0x0008); | ||
888 | bcm43xx_radio_write16(bcm, 0x007B, 0x0000); | ||
889 | } | ||
890 | if ((radio->manufact == 0x17F) && | ||
891 | (radio->version == 0x2050) && | ||
892 | (radio->revision == 8)) { | ||
893 | bcm43xx_radio_write16(bcm, 0x0051, 0x0000); | 864 | bcm43xx_radio_write16(bcm, 0x0051, 0x0000); |
894 | bcm43xx_radio_write16(bcm, 0x0052, 0x0040); | 865 | bcm43xx_radio_write16(bcm, 0x0052, 0x0040); |
895 | bcm43xx_radio_write16(bcm, 0x0053, 0x00B7); | 866 | bcm43xx_radio_write16(bcm, 0x0053, 0x00B7); |
@@ -933,20 +904,26 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) | |||
933 | bcm43xx_phy_read(bcm, 0x0802) | 0x0100); | 904 | bcm43xx_phy_read(bcm, 0x0802) | 0x0100); |
934 | bcm43xx_phy_write(bcm, 0x042B, | 905 | bcm43xx_phy_write(bcm, 0x042B, |
935 | bcm43xx_phy_read(bcm, 0x042B) | 0x2000); | 906 | bcm43xx_phy_read(bcm, 0x042B) | 0x2000); |
907 | bcm43xx_phy_write(bcm, 0x5B, 0x0000); | ||
908 | bcm43xx_phy_write(bcm, 0x5C, 0x0000); | ||
936 | } | 909 | } |
937 | 910 | ||
938 | /* Force to channel 7, even if not supported. */ | 911 | old_channel = radio->channel; |
939 | bcm43xx_radio_selectchannel(bcm, 7, 0); | 912 | if (old_channel >= 8) |
913 | bcm43xx_radio_selectchannel(bcm, 1, 0); | ||
914 | else | ||
915 | bcm43xx_radio_selectchannel(bcm, 13, 0); | ||
940 | 916 | ||
941 | bcm43xx_radio_write16(bcm, 0x0050, 0x0020); | 917 | bcm43xx_radio_write16(bcm, 0x0050, 0x0020); |
942 | bcm43xx_radio_write16(bcm, 0x0050, 0x0023); | 918 | bcm43xx_radio_write16(bcm, 0x0050, 0x0023); |
943 | udelay(40); | 919 | udelay(40); |
944 | bcm43xx_radio_write16(bcm, 0x007C, (bcm43xx_radio_read16(bcm, 0x007C) | 0x0002)); | 920 | if (radio->revision < 6 || radio-> revision == 8) { |
945 | bcm43xx_radio_write16(bcm, 0x0050, 0x0020); | 921 | bcm43xx_radio_write16(bcm, 0x007C, (bcm43xx_radio_read16(bcm, 0x007C) |
946 | if (radio->manufact == 0x17F && | 922 | | 0x0002)); |
947 | radio->version == 0x2050 && | ||
948 | radio->revision <= 2) { | ||
949 | bcm43xx_radio_write16(bcm, 0x0050, 0x0020); | 923 | bcm43xx_radio_write16(bcm, 0x0050, 0x0020); |
924 | } | ||
925 | if (radio->revision <= 2) { | ||
926 | bcm43xx_radio_write16(bcm, 0x007C, 0x0020); | ||
950 | bcm43xx_radio_write16(bcm, 0x005A, 0x0070); | 927 | bcm43xx_radio_write16(bcm, 0x005A, 0x0070); |
951 | bcm43xx_radio_write16(bcm, 0x005B, 0x007B); | 928 | bcm43xx_radio_write16(bcm, 0x005B, 0x007B); |
952 | bcm43xx_radio_write16(bcm, 0x005C, 0x00B0); | 929 | bcm43xx_radio_write16(bcm, 0x005C, 0x00B0); |
@@ -954,46 +931,41 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) | |||
954 | bcm43xx_radio_write16(bcm, 0x007A, | 931 | bcm43xx_radio_write16(bcm, 0x007A, |
955 | (bcm43xx_radio_read16(bcm, 0x007A) & 0x00F8) | 0x0007); | 932 | (bcm43xx_radio_read16(bcm, 0x007A) & 0x00F8) | 0x0007); |
956 | 933 | ||
957 | bcm43xx_radio_selectchannel(bcm, BCM43xx_RADIO_DEFAULT_CHANNEL_BG, 0); | 934 | bcm43xx_radio_selectchannel(bcm, old_channel, 0); |
958 | 935 | ||
959 | bcm43xx_phy_write(bcm, 0x0014, 0x0200); | 936 | bcm43xx_phy_write(bcm, 0x0014, 0x0200); |
960 | if (radio->version == 0x2050){ | 937 | if (radio->revision >= 6) |
961 | if (radio->revision == 3 || | 938 | bcm43xx_phy_write(bcm, 0x002A, 0x88C2); |
962 | radio->revision == 4 || | 939 | else |
963 | radio->revision == 5) | 940 | bcm43xx_phy_write(bcm, 0x002A, 0x8AC0); |
964 | bcm43xx_phy_write(bcm, 0x002A, 0x8AC0); | ||
965 | else | ||
966 | bcm43xx_phy_write(bcm, 0x002A, 0x88C2); | ||
967 | } | ||
968 | bcm43xx_phy_write(bcm, 0x0038, 0x0668); | 941 | bcm43xx_phy_write(bcm, 0x0038, 0x0668); |
969 | bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); | 942 | bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); |
970 | if (radio->version == 0x2050) { | 943 | if (radio->revision <= 5) |
971 | if (radio->revision == 3 || | 944 | bcm43xx_phy_write(bcm, 0x005D, bcm43xx_phy_read(bcm, 0x005D) | 0x0003); |
972 | radio->revision == 4 || | 945 | if (radio->revision <= 2) |
973 | radio->revision == 5) | 946 | bcm43xx_radio_write16(bcm, 0x005D, 0x000D); |
974 | bcm43xx_phy_write(bcm, 0x005D, bcm43xx_phy_read(bcm, 0x005D) | 0x0003); | ||
975 | else if (radio->revision <= 2) | ||
976 | bcm43xx_radio_write16(bcm, 0x005D, 0x000D); | ||
977 | } | ||
978 | 947 | ||
979 | if (phy->rev == 4) | 948 | if (phy->analog == 4){ |
980 | bcm43xx_phy_write(bcm, 0x0002, (bcm43xx_phy_read(bcm, 0x0002) & 0xFFC0) | 0x0004); | ||
981 | else | ||
982 | bcm43xx_write16(bcm, 0x03E4, 0x0009); | 949 | bcm43xx_write16(bcm, 0x03E4, 0x0009); |
950 | bcm43xx_phy_write(bcm, 0x61, bcm43xx_phy_read(bcm, 0x61) & 0xFFF); | ||
951 | } else { | ||
952 | bcm43xx_phy_write(bcm, 0x0002, (bcm43xx_phy_read(bcm, 0x0002) & 0xFFC0) | 0x0004); | ||
953 | } | ||
954 | if (phy->type == BCM43xx_PHYTYPE_G) | ||
955 | bcm43xx_write16(bcm, 0x03E6, 0x0); | ||
983 | if (phy->type == BCM43xx_PHYTYPE_B) { | 956 | if (phy->type == BCM43xx_PHYTYPE_B) { |
984 | bcm43xx_write16(bcm, 0x03E6, 0x8140); | 957 | bcm43xx_write16(bcm, 0x03E6, 0x8140); |
985 | bcm43xx_phy_write(bcm, 0x0016, 0x0410); | 958 | bcm43xx_phy_write(bcm, 0x0016, 0x0410); |
986 | bcm43xx_phy_write(bcm, 0x0017, 0x0820); | 959 | bcm43xx_phy_write(bcm, 0x0017, 0x0820); |
987 | bcm43xx_phy_write(bcm, 0x0062, 0x0007); | 960 | bcm43xx_phy_write(bcm, 0x0062, 0x0007); |
988 | (void) bcm43xx_radio_calibrationvalue(bcm); | 961 | (void) bcm43xx_radio_calibrationvalue(bcm); |
989 | bcm43xx_phy_lo_b_measure(bcm); | 962 | bcm43xx_phy_lo_g_measure(bcm); |
990 | if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) { | 963 | if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) { |
991 | bcm43xx_calc_nrssi_slope(bcm); | 964 | bcm43xx_calc_nrssi_slope(bcm); |
992 | bcm43xx_calc_nrssi_threshold(bcm); | 965 | bcm43xx_calc_nrssi_threshold(bcm); |
993 | } | 966 | } |
994 | bcm43xx_phy_init_pctl(bcm); | 967 | bcm43xx_phy_init_pctl(bcm); |
995 | } else | 968 | } |
996 | bcm43xx_write16(bcm, 0x03E6, 0x0); | ||
997 | } | 969 | } |
998 | 970 | ||
999 | static void bcm43xx_calc_loopback_gain(struct bcm43xx_private *bcm) | 971 | static void bcm43xx_calc_loopback_gain(struct bcm43xx_private *bcm) |
@@ -1063,7 +1035,7 @@ static void bcm43xx_calc_loopback_gain(struct bcm43xx_private *bcm) | |||
1063 | bcm43xx_phy_write(bcm, 0x005A, 0x0780); | 1035 | bcm43xx_phy_write(bcm, 0x005A, 0x0780); |
1064 | bcm43xx_phy_write(bcm, 0x0059, 0xC810); | 1036 | bcm43xx_phy_write(bcm, 0x0059, 0xC810); |
1065 | bcm43xx_phy_write(bcm, 0x0058, 0x000D); | 1037 | bcm43xx_phy_write(bcm, 0x0058, 0x000D); |
1066 | if (phy->version == 0) { | 1038 | if (phy->analog == 0) { |
1067 | bcm43xx_phy_write(bcm, 0x0003, 0x0122); | 1039 | bcm43xx_phy_write(bcm, 0x0003, 0x0122); |
1068 | } else { | 1040 | } else { |
1069 | bcm43xx_phy_write(bcm, 0x000A, | 1041 | bcm43xx_phy_write(bcm, 0x000A, |
@@ -1205,27 +1177,30 @@ static void bcm43xx_phy_initg(struct bcm43xx_private *bcm) | |||
1205 | if (phy->rev >= 2) { | 1177 | if (phy->rev >= 2) { |
1206 | bcm43xx_phy_write(bcm, 0x0814, 0x0000); | 1178 | bcm43xx_phy_write(bcm, 0x0814, 0x0000); |
1207 | bcm43xx_phy_write(bcm, 0x0815, 0x0000); | 1179 | bcm43xx_phy_write(bcm, 0x0815, 0x0000); |
1208 | if (phy->rev == 2) | 1180 | } |
1209 | bcm43xx_phy_write(bcm, 0x0811, 0x0000); | 1181 | if (phy->rev == 2) { |
1210 | else if (phy->rev >= 3) | 1182 | bcm43xx_phy_write(bcm, 0x0811, 0x0000); |
1211 | bcm43xx_phy_write(bcm, 0x0811, 0x0400); | ||
1212 | bcm43xx_phy_write(bcm, 0x0015, 0x00C0); | 1183 | bcm43xx_phy_write(bcm, 0x0015, 0x00C0); |
1213 | if (phy->connected) { | 1184 | } |
1214 | tmp = bcm43xx_phy_read(bcm, 0x0400) & 0xFF; | 1185 | if (phy->rev >= 3) { |
1215 | if (tmp < 6) { | 1186 | bcm43xx_phy_write(bcm, 0x0811, 0x0400); |
1216 | bcm43xx_phy_write(bcm, 0x04C2, 0x1816); | 1187 | bcm43xx_phy_write(bcm, 0x0015, 0x00C0); |
1217 | bcm43xx_phy_write(bcm, 0x04C3, 0x8006); | 1188 | } |
1218 | if (tmp != 3) { | 1189 | if (phy->connected) { |
1219 | bcm43xx_phy_write(bcm, 0x04CC, | 1190 | tmp = bcm43xx_phy_read(bcm, 0x0400) & 0xFF; |
1220 | (bcm43xx_phy_read(bcm, 0x04CC) | 1191 | if (tmp < 6) { |
1221 | & 0x00FF) | 0x1F00); | 1192 | bcm43xx_phy_write(bcm, 0x04C2, 0x1816); |
1222 | } | 1193 | bcm43xx_phy_write(bcm, 0x04C3, 0x8006); |
1194 | if (tmp != 3) { | ||
1195 | bcm43xx_phy_write(bcm, 0x04CC, | ||
1196 | (bcm43xx_phy_read(bcm, 0x04CC) | ||
1197 | & 0x00FF) | 0x1F00); | ||
1223 | } | 1198 | } |
1224 | } | 1199 | } |
1225 | } | 1200 | } |
1226 | if (phy->rev < 3 && phy->connected) | 1201 | if (phy->rev < 3 && phy->connected) |
1227 | bcm43xx_phy_write(bcm, 0x047E, 0x0078); | 1202 | bcm43xx_phy_write(bcm, 0x047E, 0x0078); |
1228 | if (phy->rev >= 6 && phy->rev <= 8) { | 1203 | if (radio->revision == 8) { |
1229 | bcm43xx_phy_write(bcm, 0x0801, bcm43xx_phy_read(bcm, 0x0801) | 0x0080); | 1204 | bcm43xx_phy_write(bcm, 0x0801, bcm43xx_phy_read(bcm, 0x0801) | 0x0080); |
1230 | bcm43xx_phy_write(bcm, 0x043E, bcm43xx_phy_read(bcm, 0x043E) | 0x0004); | 1205 | bcm43xx_phy_write(bcm, 0x043E, bcm43xx_phy_read(bcm, 0x043E) | 0x0004); |
1231 | } | 1206 | } |
@@ -1638,14 +1613,14 @@ void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm, | |||
1638 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); | 1613 | struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm); |
1639 | u16 value; | 1614 | u16 value; |
1640 | 1615 | ||
1641 | if (phy->version == 0) { | 1616 | if (phy->analog == 0) { |
1642 | value = (bcm43xx_read16(bcm, 0x03E6) & 0xFFF0); | 1617 | value = (bcm43xx_read16(bcm, 0x03E6) & 0xFFF0); |
1643 | value |= (baseband_attenuation & 0x000F); | 1618 | value |= (baseband_attenuation & 0x000F); |
1644 | bcm43xx_write16(bcm, 0x03E6, value); | 1619 | bcm43xx_write16(bcm, 0x03E6, value); |
1645 | return; | 1620 | return; |
1646 | } | 1621 | } |
1647 | 1622 | ||
1648 | if (phy->version > 1) { | 1623 | if (phy->analog > 1) { |
1649 | value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C; | 1624 | value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C; |
1650 | value |= (baseband_attenuation << 2) & 0x003C; | 1625 | value |= (baseband_attenuation << 2) & 0x003C; |
1651 | } else { | 1626 | } else { |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c index af19a07032a3..32beb91b7164 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c | |||
@@ -1393,11 +1393,12 @@ u16 bcm43xx_radio_init2050(struct bcm43xx_private *bcm) | |||
1393 | backup[12] = bcm43xx_read16(bcm, BCM43xx_MMIO_CHANNEL_EXT); | 1393 | backup[12] = bcm43xx_read16(bcm, BCM43xx_MMIO_CHANNEL_EXT); |
1394 | 1394 | ||
1395 | // Initialization | 1395 | // Initialization |
1396 | if (phy->version == 0) { | 1396 | if (phy->analog == 0) { |
1397 | bcm43xx_write16(bcm, 0x03E6, 0x0122); | 1397 | bcm43xx_write16(bcm, 0x03E6, 0x0122); |
1398 | } else { | 1398 | } else { |
1399 | if (phy->version >= 2) | 1399 | if (phy->analog >= 2) |
1400 | bcm43xx_write16(bcm, 0x03E6, 0x0040); | 1400 | bcm43xx_phy_write(bcm, 0x0003, (bcm43xx_phy_read(bcm, 0x0003) |
1401 | & 0xFFBF) | 0x0040); | ||
1401 | bcm43xx_write16(bcm, BCM43xx_MMIO_CHANNEL_EXT, | 1402 | bcm43xx_write16(bcm, BCM43xx_MMIO_CHANNEL_EXT, |
1402 | (bcm43xx_read16(bcm, BCM43xx_MMIO_CHANNEL_EXT) | 0x2000)); | 1403 | (bcm43xx_read16(bcm, BCM43xx_MMIO_CHANNEL_EXT) | 0x2000)); |
1403 | } | 1404 | } |
@@ -1405,7 +1406,7 @@ u16 bcm43xx_radio_init2050(struct bcm43xx_private *bcm) | |||
1405 | ret = bcm43xx_radio_calibrationvalue(bcm); | 1406 | ret = bcm43xx_radio_calibrationvalue(bcm); |
1406 | 1407 | ||
1407 | if (phy->type == BCM43xx_PHYTYPE_B) | 1408 | if (phy->type == BCM43xx_PHYTYPE_B) |
1408 | bcm43xx_radio_write16(bcm, 0x0078, 0x0003); | 1409 | bcm43xx_radio_write16(bcm, 0x0078, 0x0026); |
1409 | 1410 | ||
1410 | bcm43xx_phy_write(bcm, 0x0015, 0xBFAF); | 1411 | bcm43xx_phy_write(bcm, 0x0015, 0xBFAF); |
1411 | bcm43xx_phy_write(bcm, 0x002B, 0x1403); | 1412 | bcm43xx_phy_write(bcm, 0x002B, 0x1403); |
@@ -1416,7 +1417,7 @@ u16 bcm43xx_radio_init2050(struct bcm43xx_private *bcm) | |||
1416 | (bcm43xx_radio_read16(bcm, 0x0051) | 0x0004)); | 1417 | (bcm43xx_radio_read16(bcm, 0x0051) | 0x0004)); |
1417 | bcm43xx_radio_write16(bcm, 0x0052, 0x0000); | 1418 | bcm43xx_radio_write16(bcm, 0x0052, 0x0000); |
1418 | bcm43xx_radio_write16(bcm, 0x0043, | 1419 | bcm43xx_radio_write16(bcm, 0x0043, |
1419 | bcm43xx_radio_read16(bcm, 0x0043) | 0x0009); | 1420 | (bcm43xx_radio_read16(bcm, 0x0043) & 0xFFF0) | 0x0009); |
1420 | bcm43xx_phy_write(bcm, 0x0058, 0x0000); | 1421 | bcm43xx_phy_write(bcm, 0x0058, 0x0000); |
1421 | 1422 | ||
1422 | for (i = 0; i < 16; i++) { | 1423 | for (i = 0; i < 16; i++) { |
@@ -1488,7 +1489,7 @@ u16 bcm43xx_radio_init2050(struct bcm43xx_private *bcm) | |||
1488 | bcm43xx_phy_write(bcm, 0x0059, backup[17]); | 1489 | bcm43xx_phy_write(bcm, 0x0059, backup[17]); |
1489 | bcm43xx_phy_write(bcm, 0x0058, backup[18]); | 1490 | bcm43xx_phy_write(bcm, 0x0058, backup[18]); |
1490 | bcm43xx_write16(bcm, 0x03E6, backup[11]); | 1491 | bcm43xx_write16(bcm, 0x03E6, backup[11]); |
1491 | if (phy->version != 0) | 1492 | if (phy->analog != 0) |
1492 | bcm43xx_write16(bcm, BCM43xx_MMIO_CHANNEL_EXT, backup[12]); | 1493 | bcm43xx_write16(bcm, BCM43xx_MMIO_CHANNEL_EXT, backup[12]); |
1493 | bcm43xx_phy_write(bcm, 0x0035, backup[10]); | 1494 | bcm43xx_phy_write(bcm, 0x0035, backup[10]); |
1494 | bcm43xx_radio_selectchannel(bcm, radio->channel, 1); | 1495 | bcm43xx_radio_selectchannel(bcm, radio->channel, 1); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h b/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h index 2aed19e35c77..9ecf2bf0d25d 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h | |||
@@ -137,14 +137,8 @@ struct bcm43xx_xmitstatus { | |||
137 | u16 unknown; //FIXME | 137 | u16 unknown; //FIXME |
138 | }; | 138 | }; |
139 | 139 | ||
140 | #define BCM43xx_TXSTAT_FLAG_ACK 0x01 | 140 | #define BCM43xx_TXSTAT_FLAG_AMPDU 0x10 |
141 | //TODO #define BCM43xx_TXSTAT_FLAG_??? 0x02 | 141 | #define BCM43xx_TXSTAT_FLAG_INTER 0x20 |
142 | //TODO #define BCM43xx_TXSTAT_FLAG_??? 0x04 | ||
143 | //TODO #define BCM43xx_TXSTAT_FLAG_??? 0x08 | ||
144 | //TODO #define BCM43xx_TXSTAT_FLAG_??? 0x10 | ||
145 | #define BCM43xx_TXSTAT_FLAG_IGNORE 0x20 | ||
146 | //TODO #define BCM43xx_TXSTAT_FLAG_??? 0x40 | ||
147 | //TODO #define BCM43xx_TXSTAT_FLAG_??? 0x80 | ||
148 | 142 | ||
149 | u8 bcm43xx_plcp_get_ratecode_cck(const u8 bitrate); | 143 | u8 bcm43xx_plcp_get_ratecode_cck(const u8 bitrate); |
150 | u8 bcm43xx_plcp_get_ratecode_ofdm(const u8 bitrate); | 144 | u8 bcm43xx_plcp_get_ratecode_ofdm(const u8 bitrate); |