diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-01-09 12:39:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:32 -0500 |
commit | 5250703e3144e50fbeceb4d1fc01ea2fd159fd4a (patch) | |
tree | b3512b57ba5cfee3f838f87697f428931a098771 /drivers/net/wireless/b43/lo.c | |
parent | 424047e6c684bef2872bd7af7d0e3961c6503981 (diff) |
b43: Fix PHY register routing
This fixes the PHY routing bit handling.
This is needed for N-PHY.
No functional change to A-PHY and G-PHY code.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/lo.c')
-rw-r--r-- | drivers/net/wireless/b43/lo.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c index 88f35e67e226..d890f366a23b 100644 --- a/drivers/net/wireless/b43/lo.c +++ b/drivers/net/wireless/b43/lo.c | |||
@@ -555,20 +555,20 @@ struct lo_g_saved_values { | |||
555 | u16 phy_extg_01; | 555 | u16 phy_extg_01; |
556 | u16 phy_dacctl_hwpctl; | 556 | u16 phy_dacctl_hwpctl; |
557 | u16 phy_dacctl; | 557 | u16 phy_dacctl; |
558 | u16 phy_base_14; | 558 | u16 phy_cck_14; |
559 | u16 phy_hpwr_tssictl; | 559 | u16 phy_hpwr_tssictl; |
560 | u16 phy_analogover; | 560 | u16 phy_analogover; |
561 | u16 phy_analogoverval; | 561 | u16 phy_analogoverval; |
562 | u16 phy_rfover; | 562 | u16 phy_rfover; |
563 | u16 phy_rfoverval; | 563 | u16 phy_rfoverval; |
564 | u16 phy_classctl; | 564 | u16 phy_classctl; |
565 | u16 phy_base_3E; | 565 | u16 phy_cck_3E; |
566 | u16 phy_crs0; | 566 | u16 phy_crs0; |
567 | u16 phy_pgactl; | 567 | u16 phy_pgactl; |
568 | u16 phy_base_2A; | 568 | u16 phy_cck_2A; |
569 | u16 phy_syncctl; | 569 | u16 phy_syncctl; |
570 | u16 phy_base_30; | 570 | u16 phy_cck_30; |
571 | u16 phy_base_06; | 571 | u16 phy_cck_06; |
572 | 572 | ||
573 | /* Radio registers */ | 573 | /* Radio registers */ |
574 | u16 radio_43; | 574 | u16 radio_43; |
@@ -588,7 +588,7 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
588 | sav->phy_lo_mask = b43_phy_read(dev, B43_PHY_LO_MASK); | 588 | sav->phy_lo_mask = b43_phy_read(dev, B43_PHY_LO_MASK); |
589 | sav->phy_extg_01 = b43_phy_read(dev, B43_PHY_EXTG(0x01)); | 589 | sav->phy_extg_01 = b43_phy_read(dev, B43_PHY_EXTG(0x01)); |
590 | sav->phy_dacctl_hwpctl = b43_phy_read(dev, B43_PHY_DACCTL); | 590 | sav->phy_dacctl_hwpctl = b43_phy_read(dev, B43_PHY_DACCTL); |
591 | sav->phy_base_14 = b43_phy_read(dev, B43_PHY_BASE(0x14)); | 591 | sav->phy_cck_14 = b43_phy_read(dev, B43_PHY_CCK(0x14)); |
592 | sav->phy_hpwr_tssictl = b43_phy_read(dev, B43_PHY_HPWR_TSSICTL); | 592 | sav->phy_hpwr_tssictl = b43_phy_read(dev, B43_PHY_HPWR_TSSICTL); |
593 | 593 | ||
594 | b43_phy_write(dev, B43_PHY_HPWR_TSSICTL, | 594 | b43_phy_write(dev, B43_PHY_HPWR_TSSICTL, |
@@ -600,14 +600,14 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
600 | b43_phy_write(dev, B43_PHY_DACCTL, | 600 | b43_phy_write(dev, B43_PHY_DACCTL, |
601 | b43_phy_read(dev, B43_PHY_DACCTL) | 601 | b43_phy_read(dev, B43_PHY_DACCTL) |
602 | | 0x40); | 602 | | 0x40); |
603 | b43_phy_write(dev, B43_PHY_BASE(0x14), | 603 | b43_phy_write(dev, B43_PHY_CCK(0x14), |
604 | b43_phy_read(dev, B43_PHY_BASE(0x14)) | 604 | b43_phy_read(dev, B43_PHY_CCK(0x14)) |
605 | | 0x200); | 605 | | 0x200); |
606 | } | 606 | } |
607 | if (phy->type == B43_PHYTYPE_B && | 607 | if (phy->type == B43_PHYTYPE_B && |
608 | phy->radio_ver == 0x2050 && phy->radio_rev < 6) { | 608 | phy->radio_ver == 0x2050 && phy->radio_rev < 6) { |
609 | b43_phy_write(dev, B43_PHY_BASE(0x16), 0x410); | 609 | b43_phy_write(dev, B43_PHY_CCK(0x16), 0x410); |
610 | b43_phy_write(dev, B43_PHY_BASE(0x17), 0x820); | 610 | b43_phy_write(dev, B43_PHY_CCK(0x17), 0x820); |
611 | } | 611 | } |
612 | if (!lo->rebuild && b43_has_hardware_pctl(phy)) | 612 | if (!lo->rebuild && b43_has_hardware_pctl(phy)) |
613 | lo_read_power_vector(dev); | 613 | lo_read_power_vector(dev); |
@@ -618,7 +618,7 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
618 | sav->phy_rfover = b43_phy_read(dev, B43_PHY_RFOVER); | 618 | sav->phy_rfover = b43_phy_read(dev, B43_PHY_RFOVER); |
619 | sav->phy_rfoverval = b43_phy_read(dev, B43_PHY_RFOVERVAL); | 619 | sav->phy_rfoverval = b43_phy_read(dev, B43_PHY_RFOVERVAL); |
620 | sav->phy_classctl = b43_phy_read(dev, B43_PHY_CLASSCTL); | 620 | sav->phy_classctl = b43_phy_read(dev, B43_PHY_CLASSCTL); |
621 | sav->phy_base_3E = b43_phy_read(dev, B43_PHY_BASE(0x3E)); | 621 | sav->phy_cck_3E = b43_phy_read(dev, B43_PHY_CCK(0x3E)); |
622 | sav->phy_crs0 = b43_phy_read(dev, B43_PHY_CRS0); | 622 | sav->phy_crs0 = b43_phy_read(dev, B43_PHY_CRS0); |
623 | 623 | ||
624 | b43_phy_write(dev, B43_PHY_CLASSCTL, | 624 | b43_phy_write(dev, B43_PHY_CLASSCTL, |
@@ -642,14 +642,14 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
642 | } else { | 642 | } else { |
643 | b43_phy_write(dev, B43_PHY_RFOVER, 0); | 643 | b43_phy_write(dev, B43_PHY_RFOVER, 0); |
644 | } | 644 | } |
645 | b43_phy_write(dev, B43_PHY_BASE(0x3E), 0); | 645 | b43_phy_write(dev, B43_PHY_CCK(0x3E), 0); |
646 | } | 646 | } |
647 | sav->reg_3F4 = b43_read16(dev, 0x3F4); | 647 | sav->reg_3F4 = b43_read16(dev, 0x3F4); |
648 | sav->reg_3E2 = b43_read16(dev, 0x3E2); | 648 | sav->reg_3E2 = b43_read16(dev, 0x3E2); |
649 | sav->radio_43 = b43_radio_read16(dev, 0x43); | 649 | sav->radio_43 = b43_radio_read16(dev, 0x43); |
650 | sav->radio_7A = b43_radio_read16(dev, 0x7A); | 650 | sav->radio_7A = b43_radio_read16(dev, 0x7A); |
651 | sav->phy_pgactl = b43_phy_read(dev, B43_PHY_PGACTL); | 651 | sav->phy_pgactl = b43_phy_read(dev, B43_PHY_PGACTL); |
652 | sav->phy_base_2A = b43_phy_read(dev, B43_PHY_BASE(0x2A)); | 652 | sav->phy_cck_2A = b43_phy_read(dev, B43_PHY_CCK(0x2A)); |
653 | sav->phy_syncctl = b43_phy_read(dev, B43_PHY_SYNCCTL); | 653 | sav->phy_syncctl = b43_phy_read(dev, B43_PHY_SYNCCTL); |
654 | sav->phy_dacctl = b43_phy_read(dev, B43_PHY_DACCTL); | 654 | sav->phy_dacctl = b43_phy_read(dev, B43_PHY_DACCTL); |
655 | 655 | ||
@@ -658,10 +658,10 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
658 | sav->radio_52 &= 0x00F0; | 658 | sav->radio_52 &= 0x00F0; |
659 | } | 659 | } |
660 | if (phy->type == B43_PHYTYPE_B) { | 660 | if (phy->type == B43_PHYTYPE_B) { |
661 | sav->phy_base_30 = b43_phy_read(dev, B43_PHY_BASE(0x30)); | 661 | sav->phy_cck_30 = b43_phy_read(dev, B43_PHY_CCK(0x30)); |
662 | sav->phy_base_06 = b43_phy_read(dev, B43_PHY_BASE(0x06)); | 662 | sav->phy_cck_06 = b43_phy_read(dev, B43_PHY_CCK(0x06)); |
663 | b43_phy_write(dev, B43_PHY_BASE(0x30), 0x00FF); | 663 | b43_phy_write(dev, B43_PHY_CCK(0x30), 0x00FF); |
664 | b43_phy_write(dev, B43_PHY_BASE(0x06), 0x3F3F); | 664 | b43_phy_write(dev, B43_PHY_CCK(0x06), 0x3F3F); |
665 | } else { | 665 | } else { |
666 | b43_write16(dev, 0x3E2, b43_read16(dev, 0x3E2) | 666 | b43_write16(dev, 0x3E2, b43_read16(dev, 0x3E2) |
667 | | 0x8000); | 667 | | 0x8000); |
@@ -670,7 +670,7 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
670 | & 0xF000); | 670 | & 0xF000); |
671 | 671 | ||
672 | tmp = | 672 | tmp = |
673 | (phy->type == B43_PHYTYPE_G) ? B43_PHY_LO_MASK : B43_PHY_BASE(0x2E); | 673 | (phy->type == B43_PHYTYPE_G) ? B43_PHY_LO_MASK : B43_PHY_CCK(0x2E); |
674 | b43_phy_write(dev, tmp, 0x007F); | 674 | b43_phy_write(dev, tmp, 0x007F); |
675 | 675 | ||
676 | tmp = sav->phy_syncctl; | 676 | tmp = sav->phy_syncctl; |
@@ -678,26 +678,26 @@ static void lo_measure_setup(struct b43_wldev *dev, | |||
678 | tmp = sav->radio_7A; | 678 | tmp = sav->radio_7A; |
679 | b43_radio_write16(dev, 0x007A, tmp & 0xFFF0); | 679 | b43_radio_write16(dev, 0x007A, tmp & 0xFFF0); |
680 | 680 | ||
681 | b43_phy_write(dev, B43_PHY_BASE(0x2A), 0x8A3); | 681 | b43_phy_write(dev, B43_PHY_CCK(0x2A), 0x8A3); |
682 | if (phy->type == B43_PHYTYPE_G || | 682 | if (phy->type == B43_PHYTYPE_G || |
683 | (phy->type == B43_PHYTYPE_B && | 683 | (phy->type == B43_PHYTYPE_B && |
684 | phy->radio_ver == 0x2050 && phy->radio_rev >= 6)) { | 684 | phy->radio_ver == 0x2050 && phy->radio_rev >= 6)) { |
685 | b43_phy_write(dev, B43_PHY_BASE(0x2B), 0x1003); | 685 | b43_phy_write(dev, B43_PHY_CCK(0x2B), 0x1003); |
686 | } else | 686 | } else |
687 | b43_phy_write(dev, B43_PHY_BASE(0x2B), 0x0802); | 687 | b43_phy_write(dev, B43_PHY_CCK(0x2B), 0x0802); |
688 | if (phy->rev >= 2) | 688 | if (phy->rev >= 2) |
689 | b43_dummy_transmission(dev); | 689 | b43_dummy_transmission(dev); |
690 | b43_radio_selectchannel(dev, 6, 0); | 690 | b43_radio_selectchannel(dev, 6, 0); |
691 | b43_radio_read16(dev, 0x51); /* dummy read */ | 691 | b43_radio_read16(dev, 0x51); /* dummy read */ |
692 | if (phy->type == B43_PHYTYPE_G) | 692 | if (phy->type == B43_PHYTYPE_G) |
693 | b43_phy_write(dev, B43_PHY_BASE(0x2F), 0); | 693 | b43_phy_write(dev, B43_PHY_CCK(0x2F), 0); |
694 | if (lo->rebuild) | 694 | if (lo->rebuild) |
695 | lo_measure_txctl_values(dev); | 695 | lo_measure_txctl_values(dev); |
696 | if (phy->type == B43_PHYTYPE_G && phy->rev >= 3) { | 696 | if (phy->type == B43_PHYTYPE_G && phy->rev >= 3) { |
697 | b43_phy_write(dev, B43_PHY_LO_MASK, 0xC078); | 697 | b43_phy_write(dev, B43_PHY_LO_MASK, 0xC078); |
698 | } else { | 698 | } else { |
699 | if (phy->type == B43_PHYTYPE_B) | 699 | if (phy->type == B43_PHYTYPE_B) |
700 | b43_phy_write(dev, B43_PHY_BASE(0x2E), 0x8078); | 700 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x8078); |
701 | else | 701 | else |
702 | b43_phy_write(dev, B43_PHY_LO_MASK, 0x8078); | 702 | b43_phy_write(dev, B43_PHY_LO_MASK, 0x8078); |
703 | } | 703 | } |
@@ -732,17 +732,17 @@ static void lo_measure_restore(struct b43_wldev *dev, | |||
732 | } | 732 | } |
733 | if (phy->type == B43_PHYTYPE_G) { | 733 | if (phy->type == B43_PHYTYPE_G) { |
734 | if (phy->rev >= 3) | 734 | if (phy->rev >= 3) |
735 | b43_phy_write(dev, B43_PHY_BASE(0x2E), 0xC078); | 735 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0xC078); |
736 | else | 736 | else |
737 | b43_phy_write(dev, B43_PHY_BASE(0x2E), 0x8078); | 737 | b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x8078); |
738 | if (phy->rev >= 2) | 738 | if (phy->rev >= 2) |
739 | b43_phy_write(dev, B43_PHY_BASE(0x2F), 0x0202); | 739 | b43_phy_write(dev, B43_PHY_CCK(0x2F), 0x0202); |
740 | else | 740 | else |
741 | b43_phy_write(dev, B43_PHY_BASE(0x2F), 0x0101); | 741 | b43_phy_write(dev, B43_PHY_CCK(0x2F), 0x0101); |
742 | } | 742 | } |
743 | b43_write16(dev, 0x3F4, sav->reg_3F4); | 743 | b43_write16(dev, 0x3F4, sav->reg_3F4); |
744 | b43_phy_write(dev, B43_PHY_PGACTL, sav->phy_pgactl); | 744 | b43_phy_write(dev, B43_PHY_PGACTL, sav->phy_pgactl); |
745 | b43_phy_write(dev, B43_PHY_BASE(0x2A), sav->phy_base_2A); | 745 | b43_phy_write(dev, B43_PHY_CCK(0x2A), sav->phy_cck_2A); |
746 | b43_phy_write(dev, B43_PHY_SYNCCTL, sav->phy_syncctl); | 746 | b43_phy_write(dev, B43_PHY_SYNCCTL, sav->phy_syncctl); |
747 | b43_phy_write(dev, B43_PHY_DACCTL, sav->phy_dacctl); | 747 | b43_phy_write(dev, B43_PHY_DACCTL, sav->phy_dacctl); |
748 | b43_radio_write16(dev, 0x43, sav->radio_43); | 748 | b43_radio_write16(dev, 0x43, sav->radio_43); |
@@ -755,8 +755,8 @@ static void lo_measure_restore(struct b43_wldev *dev, | |||
755 | b43_write16(dev, 0x3E2, sav->reg_3E2); | 755 | b43_write16(dev, 0x3E2, sav->reg_3E2); |
756 | if (phy->type == B43_PHYTYPE_B && | 756 | if (phy->type == B43_PHYTYPE_B && |
757 | phy->radio_ver == 0x2050 && phy->radio_rev <= 5) { | 757 | phy->radio_ver == 0x2050 && phy->radio_rev <= 5) { |
758 | b43_phy_write(dev, B43_PHY_BASE(0x30), sav->phy_base_30); | 758 | b43_phy_write(dev, B43_PHY_CCK(0x30), sav->phy_cck_30); |
759 | b43_phy_write(dev, B43_PHY_BASE(0x06), sav->phy_base_06); | 759 | b43_phy_write(dev, B43_PHY_CCK(0x06), sav->phy_cck_06); |
760 | } | 760 | } |
761 | if (phy->rev >= 2) { | 761 | if (phy->rev >= 2) { |
762 | b43_phy_write(dev, B43_PHY_ANALOGOVER, sav->phy_analogover); | 762 | b43_phy_write(dev, B43_PHY_ANALOGOVER, sav->phy_analogover); |
@@ -765,7 +765,7 @@ static void lo_measure_restore(struct b43_wldev *dev, | |||
765 | b43_phy_write(dev, B43_PHY_CLASSCTL, sav->phy_classctl); | 765 | b43_phy_write(dev, B43_PHY_CLASSCTL, sav->phy_classctl); |
766 | b43_phy_write(dev, B43_PHY_RFOVER, sav->phy_rfover); | 766 | b43_phy_write(dev, B43_PHY_RFOVER, sav->phy_rfover); |
767 | b43_phy_write(dev, B43_PHY_RFOVERVAL, sav->phy_rfoverval); | 767 | b43_phy_write(dev, B43_PHY_RFOVERVAL, sav->phy_rfoverval); |
768 | b43_phy_write(dev, B43_PHY_BASE(0x3E), sav->phy_base_3E); | 768 | b43_phy_write(dev, B43_PHY_CCK(0x3E), sav->phy_cck_3E); |
769 | b43_phy_write(dev, B43_PHY_CRS0, sav->phy_crs0); | 769 | b43_phy_write(dev, B43_PHY_CRS0, sav->phy_crs0); |
770 | } | 770 | } |
771 | if (b43_has_hardware_pctl(phy)) { | 771 | if (b43_has_hardware_pctl(phy)) { |
@@ -773,7 +773,7 @@ static void lo_measure_restore(struct b43_wldev *dev, | |||
773 | b43_phy_write(dev, B43_PHY_LO_MASK, tmp); | 773 | b43_phy_write(dev, B43_PHY_LO_MASK, tmp); |
774 | b43_phy_write(dev, B43_PHY_EXTG(0x01), sav->phy_extg_01); | 774 | b43_phy_write(dev, B43_PHY_EXTG(0x01), sav->phy_extg_01); |
775 | b43_phy_write(dev, B43_PHY_DACCTL, sav->phy_dacctl_hwpctl); | 775 | b43_phy_write(dev, B43_PHY_DACCTL, sav->phy_dacctl_hwpctl); |
776 | b43_phy_write(dev, B43_PHY_BASE(0x14), sav->phy_base_14); | 776 | b43_phy_write(dev, B43_PHY_CCK(0x14), sav->phy_cck_14); |
777 | b43_phy_write(dev, B43_PHY_HPWR_TSSICTL, sav->phy_hpwr_tssictl); | 777 | b43_phy_write(dev, B43_PHY_HPWR_TSSICTL, sav->phy_hpwr_tssictl); |
778 | } | 778 | } |
779 | b43_radio_selectchannel(dev, sav->old_channel, 1); | 779 | b43_radio_selectchannel(dev, sav->old_channel, 1); |