aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2010-11-10 08:03:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-16 16:37:06 -0500
commit3092354970381fb8b6439fb4def0c34632277ae9 (patch)
tree9270ff12bc3d9ce12f8d73aafc0ebadda3a90ab7
parent3ceb801bffb62bc486f9662cd4dbca2cbdc6f5c7 (diff)
ath9k_hw: add eeprom templates for ar9003 family chipsets
We are currently using the default eeprom default and it doesn't work properly for all ar9003 family chipsets. So add eeprom templates for different versisons and select the eeprom table based on the template version programmed in the eeprom. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c2338
1 files changed, 2336 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 29a138631f75..3d467fc13883 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -633,6 +633,2338 @@ static const struct ar9300_eeprom ar9300_default = {
633 } 633 }
634}; 634};
635 635
636static const struct ar9300_eeprom ar9300_x113 = {
637 .eepromVersion = 2,
638 .templateVersion = 6,
639 .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
640 .custData = {"x113-023-f0000"},
641 .baseEepHeader = {
642 .regDmn = { LE16(0), LE16(0x1f) },
643 .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
644 .opCapFlags = {
645 .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
646 .eepMisc = 0,
647 },
648 .rfSilent = 0,
649 .blueToothOptions = 0,
650 .deviceCap = 0,
651 .deviceType = 5, /* takes lower byte in eeprom location */
652 .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
653 .params_for_tuning_caps = {0, 0},
654 .featureEnable = 0x0d,
655 /*
656 * bit0 - enable tx temp comp - disabled
657 * bit1 - enable tx volt comp - disabled
658 * bit2 - enable fastClock - enabled
659 * bit3 - enable doubling - enabled
660 * bit4 - enable internal regulator - disabled
661 * bit5 - enable pa predistortion - disabled
662 */
663 .miscConfiguration = 0, /* bit0 - turn down drivestrength */
664 .eepromWriteEnableGpio = 6,
665 .wlanDisableGpio = 0,
666 .wlanLedGpio = 8,
667 .rxBandSelectGpio = 0xff,
668 .txrxgain = 0x21,
669 .swreg = 0,
670 },
671 .modalHeader2G = {
672 /* ar9300_modal_eep_header 2g */
673 /* 4 idle,t1,t2,b(4 bits per setting) */
674 .antCtrlCommon = LE32(0x110),
675 /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
676 .antCtrlCommon2 = LE32(0x44444),
677
678 /*
679 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
680 * rx1, rx12, b (2 bits each)
681 */
682 .antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
683
684 /*
685 * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
686 * for ar9280 (0xa20c/b20c 5:0)
687 */
688 .xatten1DB = {0, 0, 0},
689
690 /*
691 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
692 * for ar9280 (0xa20c/b20c 16:12
693 */
694 .xatten1Margin = {0, 0, 0},
695 .tempSlope = 25,
696 .voltSlope = 0,
697
698 /*
699 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
700 * channels in usual fbin coding format
701 */
702 .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
703
704 /*
705 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
706 * if the register is per chain
707 */
708 .noiseFloorThreshCh = {-1, 0, 0},
709 .ob = {1, 1, 1},/* 3 chain */
710 .db_stage2 = {1, 1, 1}, /* 3 chain */
711 .db_stage3 = {0, 0, 0},
712 .db_stage4 = {0, 0, 0},
713 .xpaBiasLvl = 0,
714 .txFrameToDataStart = 0x0e,
715 .txFrameToPaOn = 0x0e,
716 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
717 .antennaGain = 0,
718 .switchSettling = 0x2c,
719 .adcDesiredSize = -30,
720 .txEndToXpaOff = 0,
721 .txEndToRxOn = 0x2,
722 .txFrameToXpaOn = 0xe,
723 .thresh62 = 28,
724 .papdRateMaskHt20 = LE32(0x0c80c080),
725 .papdRateMaskHt40 = LE32(0x0080c080),
726 .futureModal = {
727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
728 },
729 },
730 .base_ext1 = {
731 .ant_div_control = 0,
732 .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
733 },
734 .calFreqPier2G = {
735 FREQ2FBIN(2412, 1),
736 FREQ2FBIN(2437, 1),
737 FREQ2FBIN(2472, 1),
738 },
739 /* ar9300_cal_data_per_freq_op_loop 2g */
740 .calPierData2G = {
741 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
742 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
743 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
744 },
745 .calTarget_freqbin_Cck = {
746 FREQ2FBIN(2412, 1),
747 FREQ2FBIN(2472, 1),
748 },
749 .calTarget_freqbin_2G = {
750 FREQ2FBIN(2412, 1),
751 FREQ2FBIN(2437, 1),
752 FREQ2FBIN(2472, 1)
753 },
754 .calTarget_freqbin_2GHT20 = {
755 FREQ2FBIN(2412, 1),
756 FREQ2FBIN(2437, 1),
757 FREQ2FBIN(2472, 1)
758 },
759 .calTarget_freqbin_2GHT40 = {
760 FREQ2FBIN(2412, 1),
761 FREQ2FBIN(2437, 1),
762 FREQ2FBIN(2472, 1)
763 },
764 .calTargetPowerCck = {
765 /* 1L-5L,5S,11L,11S */
766 { {34, 34, 34, 34} },
767 { {34, 34, 34, 34} },
768 },
769 .calTargetPower2G = {
770 /* 6-24,36,48,54 */
771 { {34, 34, 32, 32} },
772 { {34, 34, 32, 32} },
773 { {34, 34, 32, 32} },
774 },
775 .calTargetPower2GHT20 = {
776 { {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
777 { {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
778 { {32, 32, 32, 32, 32, 28, 32, 32, 30, 28, 0, 0, 0, 0} },
779 },
780 .calTargetPower2GHT40 = {
781 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
782 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
783 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
784 },
785 .ctlIndex_2G = {
786 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
787 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
788 },
789 .ctl_freqbin_2G = {
790 {
791 FREQ2FBIN(2412, 1),
792 FREQ2FBIN(2417, 1),
793 FREQ2FBIN(2457, 1),
794 FREQ2FBIN(2462, 1)
795 },
796 {
797 FREQ2FBIN(2412, 1),
798 FREQ2FBIN(2417, 1),
799 FREQ2FBIN(2462, 1),
800 0xFF,
801 },
802
803 {
804 FREQ2FBIN(2412, 1),
805 FREQ2FBIN(2417, 1),
806 FREQ2FBIN(2462, 1),
807 0xFF,
808 },
809 {
810 FREQ2FBIN(2422, 1),
811 FREQ2FBIN(2427, 1),
812 FREQ2FBIN(2447, 1),
813 FREQ2FBIN(2452, 1)
814 },
815
816 {
817 /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
818 /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
819 /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
820 /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
821 },
822
823 {
824 /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
825 /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
826 /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
827 0,
828 },
829
830 {
831 /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
832 /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
833 FREQ2FBIN(2472, 1),
834 0,
835 },
836
837 {
838 /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
839 /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
840 /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
841 /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
842 },
843
844 {
845 /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
846 /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
847 /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
848 },
849
850 {
851 /* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
852 /* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
853 /* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
854 0
855 },
856
857 {
858 /* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
859 /* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
860 /* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
861 0
862 },
863
864 {
865 /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
866 /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
867 /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
868 /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
869 }
870 },
871 .ctlPowerData_2G = {
872 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
873 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
874 { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
875
876 { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
877 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
878 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
879
880 { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
881 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
882 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
883
884 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
885 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
886 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
887 },
888 .modalHeader5G = {
889 /* 4 idle,t1,t2,b (4 bits per setting) */
890 .antCtrlCommon = LE32(0x220),
891 /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
892 .antCtrlCommon2 = LE32(0x11111),
893 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
894 .antCtrlChain = {
895 LE16(0x150), LE16(0x150), LE16(0x150),
896 },
897 /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
898 .xatten1DB = {0, 0, 0},
899
900 /*
901 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
902 * for merlin (0xa20c/b20c 16:12
903 */
904 .xatten1Margin = {0, 0, 0},
905 .tempSlope = 68,
906 .voltSlope = 0,
907 /* spurChans spur channels in usual fbin coding format */
908 .spurChans = {FREQ2FBIN(5500, 0), 0, 0, 0, 0},
909 /* noiseFloorThreshCh Check if the register is per chain */
910 .noiseFloorThreshCh = {-1, 0, 0},
911 .ob = {3, 3, 3}, /* 3 chain */
912 .db_stage2 = {3, 3, 3}, /* 3 chain */
913 .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
914 .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
915 .xpaBiasLvl = 0,
916 .txFrameToDataStart = 0x0e,
917 .txFrameToPaOn = 0x0e,
918 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
919 .antennaGain = 0,
920 .switchSettling = 0x2d,
921 .adcDesiredSize = -30,
922 .txEndToXpaOff = 0,
923 .txEndToRxOn = 0x2,
924 .txFrameToXpaOn = 0xe,
925 .thresh62 = 28,
926 .papdRateMaskHt20 = LE32(0x0cf0e0e0),
927 .papdRateMaskHt40 = LE32(0x6cf0e0e0),
928 .futureModal = {
929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
930 },
931 },
932 .base_ext2 = {
933 .tempSlopeLow = 72,
934 .tempSlopeHigh = 105,
935 .xatten1DBLow = {0, 0, 0},
936 .xatten1MarginLow = {0, 0, 0},
937 .xatten1DBHigh = {0, 0, 0},
938 .xatten1MarginHigh = {0, 0, 0}
939 },
940 .calFreqPier5G = {
941 FREQ2FBIN(5180, 0),
942 FREQ2FBIN(5240, 0),
943 FREQ2FBIN(5320, 0),
944 FREQ2FBIN(5400, 0),
945 FREQ2FBIN(5500, 0),
946 FREQ2FBIN(5600, 0),
947 FREQ2FBIN(5745, 0),
948 FREQ2FBIN(5785, 0)
949 },
950 .calPierData5G = {
951 {
952 {0, 0, 0, 0, 0},
953 {0, 0, 0, 0, 0},
954 {0, 0, 0, 0, 0},
955 {0, 0, 0, 0, 0},
956 {0, 0, 0, 0, 0},
957 {0, 0, 0, 0, 0},
958 {0, 0, 0, 0, 0},
959 {0, 0, 0, 0, 0},
960 },
961 {
962 {0, 0, 0, 0, 0},
963 {0, 0, 0, 0, 0},
964 {0, 0, 0, 0, 0},
965 {0, 0, 0, 0, 0},
966 {0, 0, 0, 0, 0},
967 {0, 0, 0, 0, 0},
968 {0, 0, 0, 0, 0},
969 {0, 0, 0, 0, 0},
970 },
971 {
972 {0, 0, 0, 0, 0},
973 {0, 0, 0, 0, 0},
974 {0, 0, 0, 0, 0},
975 {0, 0, 0, 0, 0},
976 {0, 0, 0, 0, 0},
977 {0, 0, 0, 0, 0},
978 {0, 0, 0, 0, 0},
979 {0, 0, 0, 0, 0},
980 },
981
982 },
983 .calTarget_freqbin_5G = {
984 FREQ2FBIN(5180, 0),
985 FREQ2FBIN(5220, 0),
986 FREQ2FBIN(5320, 0),
987 FREQ2FBIN(5400, 0),
988 FREQ2FBIN(5500, 0),
989 FREQ2FBIN(5600, 0),
990 FREQ2FBIN(5745, 0),
991 FREQ2FBIN(5785, 0)
992 },
993 .calTarget_freqbin_5GHT20 = {
994 FREQ2FBIN(5180, 0),
995 FREQ2FBIN(5240, 0),
996 FREQ2FBIN(5320, 0),
997 FREQ2FBIN(5400, 0),
998 FREQ2FBIN(5500, 0),
999 FREQ2FBIN(5700, 0),
1000 FREQ2FBIN(5745, 0),
1001 FREQ2FBIN(5825, 0)
1002 },
1003 .calTarget_freqbin_5GHT40 = {
1004 FREQ2FBIN(5190, 0),
1005 FREQ2FBIN(5230, 0),
1006 FREQ2FBIN(5320, 0),
1007 FREQ2FBIN(5410, 0),
1008 FREQ2FBIN(5510, 0),
1009 FREQ2FBIN(5670, 0),
1010 FREQ2FBIN(5755, 0),
1011 FREQ2FBIN(5825, 0)
1012 },
1013 .calTargetPower5G = {
1014 /* 6-24,36,48,54 */
1015 { {42, 40, 40, 34} },
1016 { {42, 40, 40, 34} },
1017 { {42, 40, 40, 34} },
1018 { {42, 40, 40, 34} },
1019 { {42, 40, 40, 34} },
1020 { {42, 40, 40, 34} },
1021 { {42, 40, 40, 34} },
1022 { {42, 40, 40, 34} },
1023 },
1024 .calTargetPower5GHT20 = {
1025 /*
1026 * 0_8_16,1-3_9-11_17-19,
1027 * 4,5,6,7,12,13,14,15,20,21,22,23
1028 */
1029 { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1030 { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1031 { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1032 { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1033 { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1034 { {40, 40, 40, 40, 32, 28, 40, 40, 32, 28, 40, 40, 32, 20} },
1035 { {38, 38, 38, 38, 32, 28, 38, 38, 32, 28, 38, 38, 32, 26} },
1036 { {36, 36, 36, 36, 32, 28, 36, 36, 32, 28, 36, 36, 32, 26} },
1037 },
1038 .calTargetPower5GHT40 = {
1039 /*
1040 * 0_8_16,1-3_9-11_17-19,
1041 * 4,5,6,7,12,13,14,15,20,21,22,23
1042 */
1043 { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1044 { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1045 { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1046 { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1047 { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1048 { {40, 40, 40, 38, 30, 26, 40, 40, 30, 26, 40, 40, 30, 24} },
1049 { {36, 36, 36, 36, 30, 26, 36, 36, 30, 26, 36, 36, 30, 24} },
1050 { {34, 34, 34, 34, 30, 26, 34, 34, 30, 26, 34, 34, 30, 24} },
1051 },
1052 .ctlIndex_5G = {
1053 0x10, 0x16, 0x18, 0x40, 0x46,
1054 0x48, 0x30, 0x36, 0x38
1055 },
1056 .ctl_freqbin_5G = {
1057 {
1058 /* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1059 /* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1060 /* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1061 /* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1062 /* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
1063 /* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1064 /* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1065 /* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1066 },
1067 {
1068 /* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1069 /* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1070 /* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1071 /* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1072 /* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
1073 /* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1074 /* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1075 /* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1076 },
1077
1078 {
1079 /* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1080 /* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1081 /* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1082 /* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
1083 /* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
1084 /* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
1085 /* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
1086 /* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
1087 },
1088
1089 {
1090 /* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1091 /* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1092 /* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
1093 /* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
1094 /* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1095 /* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1096 /* Data[3].ctlEdges[6].bChannel */ 0xFF,
1097 /* Data[3].ctlEdges[7].bChannel */ 0xFF,
1098 },
1099
1100 {
1101 /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1102 /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1103 /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
1104 /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
1105 /* Data[4].ctlEdges[4].bChannel */ 0xFF,
1106 /* Data[4].ctlEdges[5].bChannel */ 0xFF,
1107 /* Data[4].ctlEdges[6].bChannel */ 0xFF,
1108 /* Data[4].ctlEdges[7].bChannel */ 0xFF,
1109 },
1110
1111 {
1112 /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1113 /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
1114 /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
1115 /* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1116 /* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
1117 /* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1118 /* Data[5].ctlEdges[6].bChannel */ 0xFF,
1119 /* Data[5].ctlEdges[7].bChannel */ 0xFF
1120 },
1121
1122 {
1123 /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1124 /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1125 /* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
1126 /* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
1127 /* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1128 /* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
1129 /* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
1130 /* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
1131 },
1132
1133 {
1134 /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1135 /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1136 /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
1137 /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1138 /* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
1139 /* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1140 /* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1141 /* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1142 },
1143
1144 {
1145 /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1146 /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1147 /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1148 /* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1149 /* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
1150 /* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1151 /* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
1152 /* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
1153 }
1154 },
1155 .ctlPowerData_5G = {
1156 {
1157 {
1158 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1159 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1160 }
1161 },
1162 {
1163 {
1164 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1165 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1166 }
1167 },
1168 {
1169 {
1170 {60, 0}, {60, 1}, {60, 0}, {60, 1},
1171 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1172 }
1173 },
1174 {
1175 {
1176 {60, 0}, {60, 1}, {60, 1}, {60, 0},
1177 {60, 1}, {60, 0}, {60, 0}, {60, 0},
1178 }
1179 },
1180 {
1181 {
1182 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1183 {60, 0}, {60, 0}, {60, 0}, {60, 0},
1184 }
1185 },
1186 {
1187 {
1188 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1189 {60, 1}, {60, 0}, {60, 0}, {60, 0},
1190 }
1191 },
1192 {
1193 {
1194 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1195 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1196 }
1197 },
1198 {
1199 {
1200 {60, 1}, {60, 1}, {60, 0}, {60, 1},
1201 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1202 }
1203 },
1204 {
1205 {
1206 {60, 1}, {60, 0}, {60, 1}, {60, 1},
1207 {60, 1}, {60, 1}, {60, 0}, {60, 1},
1208 }
1209 },
1210 }
1211};
1212
1213
1214static const struct ar9300_eeprom ar9300_h112 = {
1215 .eepromVersion = 2,
1216 .templateVersion = 3,
1217 .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
1218 .custData = {"h112-241-f0000"},
1219 .baseEepHeader = {
1220 .regDmn = { LE16(0), LE16(0x1f) },
1221 .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
1222 .opCapFlags = {
1223 .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
1224 .eepMisc = 0,
1225 },
1226 .rfSilent = 0,
1227 .blueToothOptions = 0,
1228 .deviceCap = 0,
1229 .deviceType = 5, /* takes lower byte in eeprom location */
1230 .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
1231 .params_for_tuning_caps = {0, 0},
1232 .featureEnable = 0x0d,
1233 /*
1234 * bit0 - enable tx temp comp - disabled
1235 * bit1 - enable tx volt comp - disabled
1236 * bit2 - enable fastClock - enabled
1237 * bit3 - enable doubling - enabled
1238 * bit4 - enable internal regulator - disabled
1239 * bit5 - enable pa predistortion - disabled
1240 */
1241 .miscConfiguration = 0, /* bit0 - turn down drivestrength */
1242 .eepromWriteEnableGpio = 6,
1243 .wlanDisableGpio = 0,
1244 .wlanLedGpio = 8,
1245 .rxBandSelectGpio = 0xff,
1246 .txrxgain = 0x10,
1247 .swreg = 0,
1248 },
1249 .modalHeader2G = {
1250 /* ar9300_modal_eep_header 2g */
1251 /* 4 idle,t1,t2,b(4 bits per setting) */
1252 .antCtrlCommon = LE32(0x110),
1253 /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
1254 .antCtrlCommon2 = LE32(0x44444),
1255
1256 /*
1257 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
1258 * rx1, rx12, b (2 bits each)
1259 */
1260 .antCtrlChain = { LE16(0x150), LE16(0x150), LE16(0x150) },
1261
1262 /*
1263 * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
1264 * for ar9280 (0xa20c/b20c 5:0)
1265 */
1266 .xatten1DB = {0, 0, 0},
1267
1268 /*
1269 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
1270 * for ar9280 (0xa20c/b20c 16:12
1271 */
1272 .xatten1Margin = {0, 0, 0},
1273 .tempSlope = 25,
1274 .voltSlope = 0,
1275
1276 /*
1277 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
1278 * channels in usual fbin coding format
1279 */
1280 .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
1281
1282 /*
1283 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
1284 * if the register is per chain
1285 */
1286 .noiseFloorThreshCh = {-1, 0, 0},
1287 .ob = {1, 1, 1},/* 3 chain */
1288 .db_stage2 = {1, 1, 1}, /* 3 chain */
1289 .db_stage3 = {0, 0, 0},
1290 .db_stage4 = {0, 0, 0},
1291 .xpaBiasLvl = 0,
1292 .txFrameToDataStart = 0x0e,
1293 .txFrameToPaOn = 0x0e,
1294 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
1295 .antennaGain = 0,
1296 .switchSettling = 0x2c,
1297 .adcDesiredSize = -30,
1298 .txEndToXpaOff = 0,
1299 .txEndToRxOn = 0x2,
1300 .txFrameToXpaOn = 0xe,
1301 .thresh62 = 28,
1302 .papdRateMaskHt20 = LE32(0x80c080),
1303 .papdRateMaskHt40 = LE32(0x80c080),
1304 .futureModal = {
1305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1306 },
1307 },
1308 .base_ext1 = {
1309 .ant_div_control = 0,
1310 .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
1311 },
1312 .calFreqPier2G = {
1313 FREQ2FBIN(2412, 1),
1314 FREQ2FBIN(2437, 1),
1315 FREQ2FBIN(2472, 1),
1316 },
1317 /* ar9300_cal_data_per_freq_op_loop 2g */
1318 .calPierData2G = {
1319 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1320 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1321 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1322 },
1323 .calTarget_freqbin_Cck = {
1324 FREQ2FBIN(2412, 1),
1325 FREQ2FBIN(2484, 1),
1326 },
1327 .calTarget_freqbin_2G = {
1328 FREQ2FBIN(2412, 1),
1329 FREQ2FBIN(2437, 1),
1330 FREQ2FBIN(2472, 1)
1331 },
1332 .calTarget_freqbin_2GHT20 = {
1333 FREQ2FBIN(2412, 1),
1334 FREQ2FBIN(2437, 1),
1335 FREQ2FBIN(2472, 1)
1336 },
1337 .calTarget_freqbin_2GHT40 = {
1338 FREQ2FBIN(2412, 1),
1339 FREQ2FBIN(2437, 1),
1340 FREQ2FBIN(2472, 1)
1341 },
1342 .calTargetPowerCck = {
1343 /* 1L-5L,5S,11L,11S */
1344 { {34, 34, 34, 34} },
1345 { {34, 34, 34, 34} },
1346 },
1347 .calTargetPower2G = {
1348 /* 6-24,36,48,54 */
1349 { {34, 34, 32, 32} },
1350 { {34, 34, 32, 32} },
1351 { {34, 34, 32, 32} },
1352 },
1353 .calTargetPower2GHT20 = {
1354 { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
1355 { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
1356 { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 28, 28, 28, 24} },
1357 },
1358 .calTargetPower2GHT40 = {
1359 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
1360 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
1361 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 26, 26, 26, 22} },
1362 },
1363 .ctlIndex_2G = {
1364 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
1365 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
1366 },
1367 .ctl_freqbin_2G = {
1368 {
1369 FREQ2FBIN(2412, 1),
1370 FREQ2FBIN(2417, 1),
1371 FREQ2FBIN(2457, 1),
1372 FREQ2FBIN(2462, 1)
1373 },
1374 {
1375 FREQ2FBIN(2412, 1),
1376 FREQ2FBIN(2417, 1),
1377 FREQ2FBIN(2462, 1),
1378 0xFF,
1379 },
1380
1381 {
1382 FREQ2FBIN(2412, 1),
1383 FREQ2FBIN(2417, 1),
1384 FREQ2FBIN(2462, 1),
1385 0xFF,
1386 },
1387 {
1388 FREQ2FBIN(2422, 1),
1389 FREQ2FBIN(2427, 1),
1390 FREQ2FBIN(2447, 1),
1391 FREQ2FBIN(2452, 1)
1392 },
1393
1394 {
1395 /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1396 /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1397 /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1398 /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
1399 },
1400
1401 {
1402 /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1403 /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1404 /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1405 0,
1406 },
1407
1408 {
1409 /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1410 /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1411 FREQ2FBIN(2472, 1),
1412 0,
1413 },
1414
1415 {
1416 /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
1417 /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
1418 /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
1419 /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
1420 },
1421
1422 {
1423 /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1424 /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1425 /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1426 },
1427
1428 {
1429 /* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1430 /* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1431 /* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1432 0
1433 },
1434
1435 {
1436 /* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
1437 /* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
1438 /* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
1439 0
1440 },
1441
1442 {
1443 /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
1444 /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
1445 /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
1446 /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
1447 }
1448 },
1449 .ctlPowerData_2G = {
1450 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1451 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1452 { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
1453
1454 { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
1455 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1456 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1457
1458 { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
1459 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1460 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1461
1462 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
1463 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
1464 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
1465 },
1466 .modalHeader5G = {
1467 /* 4 idle,t1,t2,b (4 bits per setting) */
1468 .antCtrlCommon = LE32(0x220),
1469 /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
1470 .antCtrlCommon2 = LE32(0x44444),
1471 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
1472 .antCtrlChain = {
1473 LE16(0x150), LE16(0x150), LE16(0x150),
1474 },
1475 /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
1476 .xatten1DB = {0, 0, 0},
1477
1478 /*
1479 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
1480 * for merlin (0xa20c/b20c 16:12
1481 */
1482 .xatten1Margin = {0, 0, 0},
1483 .tempSlope = 45,
1484 .voltSlope = 0,
1485 /* spurChans spur channels in usual fbin coding format */
1486 .spurChans = {0, 0, 0, 0, 0},
1487 /* noiseFloorThreshCh Check if the register is per chain */
1488 .noiseFloorThreshCh = {-1, 0, 0},
1489 .ob = {3, 3, 3}, /* 3 chain */
1490 .db_stage2 = {3, 3, 3}, /* 3 chain */
1491 .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
1492 .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
1493 .xpaBiasLvl = 0,
1494 .txFrameToDataStart = 0x0e,
1495 .txFrameToPaOn = 0x0e,
1496 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
1497 .antennaGain = 0,
1498 .switchSettling = 0x2d,
1499 .adcDesiredSize = -30,
1500 .txEndToXpaOff = 0,
1501 .txEndToRxOn = 0x2,
1502 .txFrameToXpaOn = 0xe,
1503 .thresh62 = 28,
1504 .papdRateMaskHt20 = LE32(0x0cf0e0e0),
1505 .papdRateMaskHt40 = LE32(0x6cf0e0e0),
1506 .futureModal = {
1507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1508 },
1509 },
1510 .base_ext2 = {
1511 .tempSlopeLow = 40,
1512 .tempSlopeHigh = 50,
1513 .xatten1DBLow = {0, 0, 0},
1514 .xatten1MarginLow = {0, 0, 0},
1515 .xatten1DBHigh = {0, 0, 0},
1516 .xatten1MarginHigh = {0, 0, 0}
1517 },
1518 .calFreqPier5G = {
1519 FREQ2FBIN(5180, 0),
1520 FREQ2FBIN(5220, 0),
1521 FREQ2FBIN(5320, 0),
1522 FREQ2FBIN(5400, 0),
1523 FREQ2FBIN(5500, 0),
1524 FREQ2FBIN(5600, 0),
1525 FREQ2FBIN(5700, 0),
1526 FREQ2FBIN(5825, 0)
1527 },
1528 .calPierData5G = {
1529 {
1530 {0, 0, 0, 0, 0},
1531 {0, 0, 0, 0, 0},
1532 {0, 0, 0, 0, 0},
1533 {0, 0, 0, 0, 0},
1534 {0, 0, 0, 0, 0},
1535 {0, 0, 0, 0, 0},
1536 {0, 0, 0, 0, 0},
1537 {0, 0, 0, 0, 0},
1538 },
1539 {
1540 {0, 0, 0, 0, 0},
1541 {0, 0, 0, 0, 0},
1542 {0, 0, 0, 0, 0},
1543 {0, 0, 0, 0, 0},
1544 {0, 0, 0, 0, 0},
1545 {0, 0, 0, 0, 0},
1546 {0, 0, 0, 0, 0},
1547 {0, 0, 0, 0, 0},
1548 },
1549 {
1550 {0, 0, 0, 0, 0},
1551 {0, 0, 0, 0, 0},
1552 {0, 0, 0, 0, 0},
1553 {0, 0, 0, 0, 0},
1554 {0, 0, 0, 0, 0},
1555 {0, 0, 0, 0, 0},
1556 {0, 0, 0, 0, 0},
1557 {0, 0, 0, 0, 0},
1558 },
1559
1560 },
1561 .calTarget_freqbin_5G = {
1562 FREQ2FBIN(5180, 0),
1563 FREQ2FBIN(5240, 0),
1564 FREQ2FBIN(5320, 0),
1565 FREQ2FBIN(5400, 0),
1566 FREQ2FBIN(5500, 0),
1567 FREQ2FBIN(5600, 0),
1568 FREQ2FBIN(5700, 0),
1569 FREQ2FBIN(5825, 0)
1570 },
1571 .calTarget_freqbin_5GHT20 = {
1572 FREQ2FBIN(5180, 0),
1573 FREQ2FBIN(5240, 0),
1574 FREQ2FBIN(5320, 0),
1575 FREQ2FBIN(5400, 0),
1576 FREQ2FBIN(5500, 0),
1577 FREQ2FBIN(5700, 0),
1578 FREQ2FBIN(5745, 0),
1579 FREQ2FBIN(5825, 0)
1580 },
1581 .calTarget_freqbin_5GHT40 = {
1582 FREQ2FBIN(5180, 0),
1583 FREQ2FBIN(5240, 0),
1584 FREQ2FBIN(5320, 0),
1585 FREQ2FBIN(5400, 0),
1586 FREQ2FBIN(5500, 0),
1587 FREQ2FBIN(5700, 0),
1588 FREQ2FBIN(5745, 0),
1589 FREQ2FBIN(5825, 0)
1590 },
1591 .calTargetPower5G = {
1592 /* 6-24,36,48,54 */
1593 { {30, 30, 28, 24} },
1594 { {30, 30, 28, 24} },
1595 { {30, 30, 28, 24} },
1596 { {30, 30, 28, 24} },
1597 { {30, 30, 28, 24} },
1598 { {30, 30, 28, 24} },
1599 { {30, 30, 28, 24} },
1600 { {30, 30, 28, 24} },
1601 },
1602 .calTargetPower5GHT20 = {
1603 /*
1604 * 0_8_16,1-3_9-11_17-19,
1605 * 4,5,6,7,12,13,14,15,20,21,22,23
1606 */
1607 { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 20, 20, 20, 16} },
1608 { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 20, 20, 20, 16} },
1609 { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 18, 18, 18, 16} },
1610 { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 18, 18, 18, 16} },
1611 { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 16, 16, 16, 14} },
1612 { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 16, 16, 16, 14} },
1613 { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 14, 14, 14, 12} },
1614 { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 14, 14, 14, 12} },
1615 },
1616 .calTargetPower5GHT40 = {
1617 /*
1618 * 0_8_16,1-3_9-11_17-19,
1619 * 4,5,6,7,12,13,14,15,20,21,22,23
1620 */
1621 { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 18, 18, 18, 14} },
1622 { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 18, 18, 18, 14} },
1623 { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 16, 16, 16, 12} },
1624 { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 16, 16, 16, 12} },
1625 { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 14, 14, 14, 10} },
1626 { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 14, 14, 14, 10} },
1627 { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 12, 12, 12, 8} },
1628 { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 12, 12, 12, 8} },
1629 },
1630 .ctlIndex_5G = {
1631 0x10, 0x16, 0x18, 0x40, 0x46,
1632 0x48, 0x30, 0x36, 0x38
1633 },
1634 .ctl_freqbin_5G = {
1635 {
1636 /* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1637 /* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1638 /* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1639 /* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1640 /* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
1641 /* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1642 /* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1643 /* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1644 },
1645 {
1646 /* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1647 /* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1648 /* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
1649 /* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1650 /* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
1651 /* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1652 /* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1653 /* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1654 },
1655
1656 {
1657 /* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1658 /* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1659 /* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1660 /* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
1661 /* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
1662 /* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
1663 /* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
1664 /* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
1665 },
1666
1667 {
1668 /* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1669 /* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1670 /* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
1671 /* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
1672 /* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1673 /* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1674 /* Data[3].ctlEdges[6].bChannel */ 0xFF,
1675 /* Data[3].ctlEdges[7].bChannel */ 0xFF,
1676 },
1677
1678 {
1679 /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1680 /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1681 /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
1682 /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
1683 /* Data[4].ctlEdges[4].bChannel */ 0xFF,
1684 /* Data[4].ctlEdges[5].bChannel */ 0xFF,
1685 /* Data[4].ctlEdges[6].bChannel */ 0xFF,
1686 /* Data[4].ctlEdges[7].bChannel */ 0xFF,
1687 },
1688
1689 {
1690 /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1691 /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
1692 /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
1693 /* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1694 /* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
1695 /* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1696 /* Data[5].ctlEdges[6].bChannel */ 0xFF,
1697 /* Data[5].ctlEdges[7].bChannel */ 0xFF
1698 },
1699
1700 {
1701 /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1702 /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
1703 /* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
1704 /* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
1705 /* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
1706 /* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
1707 /* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
1708 /* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
1709 },
1710
1711 {
1712 /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
1713 /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
1714 /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
1715 /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
1716 /* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
1717 /* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
1718 /* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
1719 /* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
1720 },
1721
1722 {
1723 /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
1724 /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
1725 /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
1726 /* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
1727 /* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
1728 /* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
1729 /* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
1730 /* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
1731 }
1732 },
1733 .ctlPowerData_5G = {
1734 {
1735 {
1736 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1737 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1738 }
1739 },
1740 {
1741 {
1742 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1743 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1744 }
1745 },
1746 {
1747 {
1748 {60, 0}, {60, 1}, {60, 0}, {60, 1},
1749 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1750 }
1751 },
1752 {
1753 {
1754 {60, 0}, {60, 1}, {60, 1}, {60, 0},
1755 {60, 1}, {60, 0}, {60, 0}, {60, 0},
1756 }
1757 },
1758 {
1759 {
1760 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1761 {60, 0}, {60, 0}, {60, 0}, {60, 0},
1762 }
1763 },
1764 {
1765 {
1766 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1767 {60, 1}, {60, 0}, {60, 0}, {60, 0},
1768 }
1769 },
1770 {
1771 {
1772 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1773 {60, 1}, {60, 1}, {60, 1}, {60, 1},
1774 }
1775 },
1776 {
1777 {
1778 {60, 1}, {60, 1}, {60, 0}, {60, 1},
1779 {60, 1}, {60, 1}, {60, 1}, {60, 0},
1780 }
1781 },
1782 {
1783 {
1784 {60, 1}, {60, 0}, {60, 1}, {60, 1},
1785 {60, 1}, {60, 1}, {60, 0}, {60, 1},
1786 }
1787 },
1788 }
1789};
1790
1791
1792static const struct ar9300_eeprom ar9300_x112 = {
1793 .eepromVersion = 2,
1794 .templateVersion = 5,
1795 .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
1796 .custData = {"x112-041-f0000"},
1797 .baseEepHeader = {
1798 .regDmn = { LE16(0), LE16(0x1f) },
1799 .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
1800 .opCapFlags = {
1801 .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
1802 .eepMisc = 0,
1803 },
1804 .rfSilent = 0,
1805 .blueToothOptions = 0,
1806 .deviceCap = 0,
1807 .deviceType = 5, /* takes lower byte in eeprom location */
1808 .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
1809 .params_for_tuning_caps = {0, 0},
1810 .featureEnable = 0x0d,
1811 /*
1812 * bit0 - enable tx temp comp - disabled
1813 * bit1 - enable tx volt comp - disabled
1814 * bit2 - enable fastclock - enabled
1815 * bit3 - enable doubling - enabled
1816 * bit4 - enable internal regulator - disabled
1817 * bit5 - enable pa predistortion - disabled
1818 */
1819 .miscConfiguration = 0, /* bit0 - turn down drivestrength */
1820 .eepromWriteEnableGpio = 6,
1821 .wlanDisableGpio = 0,
1822 .wlanLedGpio = 8,
1823 .rxBandSelectGpio = 0xff,
1824 .txrxgain = 0x0,
1825 .swreg = 0,
1826 },
1827 .modalHeader2G = {
1828 /* ar9300_modal_eep_header 2g */
1829 /* 4 idle,t1,t2,b(4 bits per setting) */
1830 .antCtrlCommon = LE32(0x110),
1831 /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
1832 .antCtrlCommon2 = LE32(0x22222),
1833
1834 /*
1835 * antCtrlChain[ar9300_max_chains]; 6 idle, t, r,
1836 * rx1, rx12, b (2 bits each)
1837 */
1838 .antCtrlChain = { LE16(0x10), LE16(0x10), LE16(0x10) },
1839
1840 /*
1841 * xatten1DB[AR9300_max_chains]; 3 xatten1_db
1842 * for ar9280 (0xa20c/b20c 5:0)
1843 */
1844 .xatten1DB = {0x1b, 0x1b, 0x1b},
1845
1846 /*
1847 * xatten1Margin[ar9300_max_chains]; 3 xatten1_margin
1848 * for ar9280 (0xa20c/b20c 16:12
1849 */
1850 .xatten1Margin = {0x15, 0x15, 0x15},
1851 .tempSlope = 50,
1852 .voltSlope = 0,
1853
1854 /*
1855 * spurChans[OSPrey_eeprom_modal_sPURS]; spur
1856 * channels in usual fbin coding format
1857 */
1858 .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
1859
1860 /*
1861 * noiseFloorThreshch[ar9300_max_cHAINS]; 3 Check
1862 * if the register is per chain
1863 */
1864 .noiseFloorThreshCh = {-1, 0, 0},
1865 .ob = {1, 1, 1},/* 3 chain */
1866 .db_stage2 = {1, 1, 1}, /* 3 chain */
1867 .db_stage3 = {0, 0, 0},
1868 .db_stage4 = {0, 0, 0},
1869 .xpaBiasLvl = 0,
1870 .txFrameToDataStart = 0x0e,
1871 .txFrameToPaOn = 0x0e,
1872 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
1873 .antennaGain = 0,
1874 .switchSettling = 0x2c,
1875 .adcDesiredSize = -30,
1876 .txEndToXpaOff = 0,
1877 .txEndToRxOn = 0x2,
1878 .txFrameToXpaOn = 0xe,
1879 .thresh62 = 28,
1880 .papdRateMaskHt20 = LE32(0x0c80c080),
1881 .papdRateMaskHt40 = LE32(0x0080c080),
1882 .futureModal = {
1883 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1884 },
1885 },
1886 .base_ext1 = {
1887 .ant_div_control = 0,
1888 .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
1889 },
1890 .calFreqPier2G = {
1891 FREQ2FBIN(2412, 1),
1892 FREQ2FBIN(2437, 1),
1893 FREQ2FBIN(2472, 1),
1894 },
1895 /* ar9300_cal_data_per_freq_op_loop 2g */
1896 .calPierData2G = {
1897 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1898 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1899 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
1900 },
1901 .calTarget_freqbin_Cck = {
1902 FREQ2FBIN(2412, 1),
1903 FREQ2FBIN(2472, 1),
1904 },
1905 .calTarget_freqbin_2G = {
1906 FREQ2FBIN(2412, 1),
1907 FREQ2FBIN(2437, 1),
1908 FREQ2FBIN(2472, 1)
1909 },
1910 .calTarget_freqbin_2GHT20 = {
1911 FREQ2FBIN(2412, 1),
1912 FREQ2FBIN(2437, 1),
1913 FREQ2FBIN(2472, 1)
1914 },
1915 .calTarget_freqbin_2GHT40 = {
1916 FREQ2FBIN(2412, 1),
1917 FREQ2FBIN(2437, 1),
1918 FREQ2FBIN(2472, 1)
1919 },
1920 .calTargetPowerCck = {
1921 /* 1L-5L,5S,11L,11s */
1922 { {38, 38, 38, 38} },
1923 { {38, 38, 38, 38} },
1924 },
1925 .calTargetPower2G = {
1926 /* 6-24,36,48,54 */
1927 { {38, 38, 36, 34} },
1928 { {38, 38, 36, 34} },
1929 { {38, 38, 34, 32} },
1930 },
1931 .calTargetPower2GHT20 = {
1932 { {36, 36, 36, 36, 36, 34, 34, 32, 30, 28, 28, 28, 28, 26} },
1933 { {36, 36, 36, 36, 36, 34, 36, 34, 32, 30, 30, 30, 28, 26} },
1934 { {36, 36, 36, 36, 36, 34, 34, 32, 30, 28, 28, 28, 28, 26} },
1935 },
1936 .calTargetPower2GHT40 = {
1937 { {36, 36, 36, 36, 34, 32, 32, 30, 28, 26, 26, 26, 26, 24} },
1938 { {36, 36, 36, 36, 34, 32, 34, 32, 30, 28, 28, 28, 28, 24} },
1939 { {36, 36, 36, 36, 34, 32, 32, 30, 28, 26, 26, 26, 26, 24} },
1940 },
1941 .ctlIndex_2G = {
1942 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
1943 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
1944 },
1945 .ctl_freqbin_2G = {
1946 {
1947 FREQ2FBIN(2412, 1),
1948 FREQ2FBIN(2417, 1),
1949 FREQ2FBIN(2457, 1),
1950 FREQ2FBIN(2462, 1)
1951 },
1952 {
1953 FREQ2FBIN(2412, 1),
1954 FREQ2FBIN(2417, 1),
1955 FREQ2FBIN(2462, 1),
1956 0xFF,
1957 },
1958
1959 {
1960 FREQ2FBIN(2412, 1),
1961 FREQ2FBIN(2417, 1),
1962 FREQ2FBIN(2462, 1),
1963 0xFF,
1964 },
1965 {
1966 FREQ2FBIN(2422, 1),
1967 FREQ2FBIN(2427, 1),
1968 FREQ2FBIN(2447, 1),
1969 FREQ2FBIN(2452, 1)
1970 },
1971
1972 {
1973 /* Data[4].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
1974 /* Data[4].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
1975 /* Data[4].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
1976 /* Data[4].ctledges[3].bchannel */ FREQ2FBIN(2484, 1),
1977 },
1978
1979 {
1980 /* Data[5].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
1981 /* Data[5].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
1982 /* Data[5].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
1983 0,
1984 },
1985
1986 {
1987 /* Data[6].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
1988 /* Data[6].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
1989 FREQ2FBIN(2472, 1),
1990 0,
1991 },
1992
1993 {
1994 /* Data[7].ctledges[0].bchannel */ FREQ2FBIN(2422, 1),
1995 /* Data[7].ctledges[1].bchannel */ FREQ2FBIN(2427, 1),
1996 /* Data[7].ctledges[2].bchannel */ FREQ2FBIN(2447, 1),
1997 /* Data[7].ctledges[3].bchannel */ FREQ2FBIN(2462, 1),
1998 },
1999
2000 {
2001 /* Data[8].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2002 /* Data[8].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2003 /* Data[8].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2004 },
2005
2006 {
2007 /* Data[9].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2008 /* Data[9].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2009 /* Data[9].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2010 0
2011 },
2012
2013 {
2014 /* Data[10].ctledges[0].bchannel */ FREQ2FBIN(2412, 1),
2015 /* Data[10].ctledges[1].bchannel */ FREQ2FBIN(2417, 1),
2016 /* Data[10].ctledges[2].bchannel */ FREQ2FBIN(2472, 1),
2017 0
2018 },
2019
2020 {
2021 /* Data[11].ctledges[0].bchannel */ FREQ2FBIN(2422, 1),
2022 /* Data[11].ctledges[1].bchannel */ FREQ2FBIN(2427, 1),
2023 /* Data[11].ctledges[2].bchannel */ FREQ2FBIN(2447, 1),
2024 /* Data[11].ctledges[3].bchannel */ FREQ2FBIN(2462, 1),
2025 }
2026 },
2027 .ctlPowerData_2G = {
2028 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2029 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2030 { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
2031
2032 { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
2033 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2034 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2035
2036 { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
2037 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2038 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2039
2040 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2041 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2042 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2043 },
2044 .modalHeader5G = {
2045 /* 4 idle,t1,t2,b (4 bits per setting) */
2046 .antCtrlCommon = LE32(0x110),
2047 /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
2048 .antCtrlCommon2 = LE32(0x22222),
2049 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
2050 .antCtrlChain = {
2051 LE16(0x0), LE16(0x0), LE16(0x0),
2052 },
2053 /* xatten1DB 3 xatten1_db for ar9280 (0xa20c/b20c 5:0) */
2054 .xatten1DB = {0x13, 0x19, 0x17},
2055
2056 /*
2057 * xatten1Margin[ar9300_max_chains]; 3 xatten1_margin
2058 * for merlin (0xa20c/b20c 16:12
2059 */
2060 .xatten1Margin = {0x19, 0x19, 0x19},
2061 .tempSlope = 70,
2062 .voltSlope = 15,
2063 /* spurChans spur channels in usual fbin coding format */
2064 .spurChans = {0, 0, 0, 0, 0},
2065 /* noiseFloorThreshch check if the register is per chain */
2066 .noiseFloorThreshCh = {-1, 0, 0},
2067 .ob = {3, 3, 3}, /* 3 chain */
2068 .db_stage2 = {3, 3, 3}, /* 3 chain */
2069 .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
2070 .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
2071 .xpaBiasLvl = 0,
2072 .txFrameToDataStart = 0x0e,
2073 .txFrameToPaOn = 0x0e,
2074 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
2075 .antennaGain = 0,
2076 .switchSettling = 0x2d,
2077 .adcDesiredSize = -30,
2078 .txEndToXpaOff = 0,
2079 .txEndToRxOn = 0x2,
2080 .txFrameToXpaOn = 0xe,
2081 .thresh62 = 28,
2082 .papdRateMaskHt20 = LE32(0x0cf0e0e0),
2083 .papdRateMaskHt40 = LE32(0x6cf0e0e0),
2084 .futureModal = {
2085 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2086 },
2087 },
2088 .base_ext2 = {
2089 .tempSlopeLow = 72,
2090 .tempSlopeHigh = 105,
2091 .xatten1DBLow = {0x10, 0x14, 0x10},
2092 .xatten1MarginLow = {0x19, 0x19 , 0x19},
2093 .xatten1DBHigh = {0x1d, 0x20, 0x24},
2094 .xatten1MarginHigh = {0x10, 0x10, 0x10}
2095 },
2096 .calFreqPier5G = {
2097 FREQ2FBIN(5180, 0),
2098 FREQ2FBIN(5220, 0),
2099 FREQ2FBIN(5320, 0),
2100 FREQ2FBIN(5400, 0),
2101 FREQ2FBIN(5500, 0),
2102 FREQ2FBIN(5600, 0),
2103 FREQ2FBIN(5700, 0),
2104 FREQ2FBIN(5785, 0)
2105 },
2106 .calPierData5G = {
2107 {
2108 {0, 0, 0, 0, 0},
2109 {0, 0, 0, 0, 0},
2110 {0, 0, 0, 0, 0},
2111 {0, 0, 0, 0, 0},
2112 {0, 0, 0, 0, 0},
2113 {0, 0, 0, 0, 0},
2114 {0, 0, 0, 0, 0},
2115 {0, 0, 0, 0, 0},
2116 },
2117 {
2118 {0, 0, 0, 0, 0},
2119 {0, 0, 0, 0, 0},
2120 {0, 0, 0, 0, 0},
2121 {0, 0, 0, 0, 0},
2122 {0, 0, 0, 0, 0},
2123 {0, 0, 0, 0, 0},
2124 {0, 0, 0, 0, 0},
2125 {0, 0, 0, 0, 0},
2126 },
2127 {
2128 {0, 0, 0, 0, 0},
2129 {0, 0, 0, 0, 0},
2130 {0, 0, 0, 0, 0},
2131 {0, 0, 0, 0, 0},
2132 {0, 0, 0, 0, 0},
2133 {0, 0, 0, 0, 0},
2134 {0, 0, 0, 0, 0},
2135 {0, 0, 0, 0, 0},
2136 },
2137
2138 },
2139 .calTarget_freqbin_5G = {
2140 FREQ2FBIN(5180, 0),
2141 FREQ2FBIN(5220, 0),
2142 FREQ2FBIN(5320, 0),
2143 FREQ2FBIN(5400, 0),
2144 FREQ2FBIN(5500, 0),
2145 FREQ2FBIN(5600, 0),
2146 FREQ2FBIN(5725, 0),
2147 FREQ2FBIN(5825, 0)
2148 },
2149 .calTarget_freqbin_5GHT20 = {
2150 FREQ2FBIN(5180, 0),
2151 FREQ2FBIN(5220, 0),
2152 FREQ2FBIN(5320, 0),
2153 FREQ2FBIN(5400, 0),
2154 FREQ2FBIN(5500, 0),
2155 FREQ2FBIN(5600, 0),
2156 FREQ2FBIN(5725, 0),
2157 FREQ2FBIN(5825, 0)
2158 },
2159 .calTarget_freqbin_5GHT40 = {
2160 FREQ2FBIN(5180, 0),
2161 FREQ2FBIN(5220, 0),
2162 FREQ2FBIN(5320, 0),
2163 FREQ2FBIN(5400, 0),
2164 FREQ2FBIN(5500, 0),
2165 FREQ2FBIN(5600, 0),
2166 FREQ2FBIN(5725, 0),
2167 FREQ2FBIN(5825, 0)
2168 },
2169 .calTargetPower5G = {
2170 /* 6-24,36,48,54 */
2171 { {32, 32, 28, 26} },
2172 { {32, 32, 28, 26} },
2173 { {32, 32, 28, 26} },
2174 { {32, 32, 26, 24} },
2175 { {32, 32, 26, 24} },
2176 { {32, 32, 24, 22} },
2177 { {30, 30, 24, 22} },
2178 { {30, 30, 24, 22} },
2179 },
2180 .calTargetPower5GHT20 = {
2181 /*
2182 * 0_8_16,1-3_9-11_17-19,
2183 * 4,5,6,7,12,13,14,15,20,21,22,23
2184 */
2185 { {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
2186 { {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
2187 { {32, 32, 32, 32, 28, 26, 32, 28, 26, 24, 24, 24, 22, 22} },
2188 { {32, 32, 32, 32, 28, 26, 32, 26, 24, 22, 22, 22, 20, 20} },
2189 { {32, 32, 32, 32, 28, 26, 32, 26, 24, 22, 20, 18, 16, 16} },
2190 { {32, 32, 32, 32, 28, 26, 32, 24, 20, 16, 18, 16, 14, 14} },
2191 { {30, 30, 30, 30, 28, 26, 30, 24, 20, 16, 18, 16, 14, 14} },
2192 { {30, 30, 30, 30, 28, 26, 30, 24, 20, 16, 18, 16, 14, 14} },
2193 },
2194 .calTargetPower5GHT40 = {
2195 /*
2196 * 0_8_16,1-3_9-11_17-19,
2197 * 4,5,6,7,12,13,14,15,20,21,22,23
2198 */
2199 { {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
2200 { {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
2201 { {32, 32, 32, 30, 28, 26, 30, 28, 26, 24, 24, 24, 22, 22} },
2202 { {32, 32, 32, 30, 28, 26, 30, 26, 24, 22, 22, 22, 20, 20} },
2203 { {32, 32, 32, 30, 28, 26, 30, 26, 24, 22, 20, 18, 16, 16} },
2204 { {32, 32, 32, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
2205 { {30, 30, 30, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
2206 { {30, 30, 30, 30, 28, 26, 30, 22, 20, 16, 18, 16, 14, 14} },
2207 },
2208 .ctlIndex_5G = {
2209 0x10, 0x16, 0x18, 0x40, 0x46,
2210 0x48, 0x30, 0x36, 0x38
2211 },
2212 .ctl_freqbin_5G = {
2213 {
2214 /* Data[0].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2215 /* Data[0].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2216 /* Data[0].ctledges[2].bchannel */ FREQ2FBIN(5280, 0),
2217 /* Data[0].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
2218 /* Data[0].ctledges[4].bchannel */ FREQ2FBIN(5600, 0),
2219 /* Data[0].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2220 /* Data[0].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
2221 /* Data[0].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
2222 },
2223 {
2224 /* Data[1].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2225 /* Data[1].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2226 /* Data[1].ctledges[2].bchannel */ FREQ2FBIN(5280, 0),
2227 /* Data[1].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
2228 /* Data[1].ctledges[4].bchannel */ FREQ2FBIN(5520, 0),
2229 /* Data[1].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2230 /* Data[1].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
2231 /* Data[1].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
2232 },
2233
2234 {
2235 /* Data[2].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
2236 /* Data[2].ctledges[1].bchannel */ FREQ2FBIN(5230, 0),
2237 /* Data[2].ctledges[2].bchannel */ FREQ2FBIN(5270, 0),
2238 /* Data[2].ctledges[3].bchannel */ FREQ2FBIN(5310, 0),
2239 /* Data[2].ctledges[4].bchannel */ FREQ2FBIN(5510, 0),
2240 /* Data[2].ctledges[5].bchannel */ FREQ2FBIN(5550, 0),
2241 /* Data[2].ctledges[6].bchannel */ FREQ2FBIN(5670, 0),
2242 /* Data[2].ctledges[7].bchannel */ FREQ2FBIN(5755, 0)
2243 },
2244
2245 {
2246 /* Data[3].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2247 /* Data[3].ctledges[1].bchannel */ FREQ2FBIN(5200, 0),
2248 /* Data[3].ctledges[2].bchannel */ FREQ2FBIN(5260, 0),
2249 /* Data[3].ctledges[3].bchannel */ FREQ2FBIN(5320, 0),
2250 /* Data[3].ctledges[4].bchannel */ FREQ2FBIN(5500, 0),
2251 /* Data[3].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2252 /* Data[3].ctledges[6].bchannel */ 0xFF,
2253 /* Data[3].ctledges[7].bchannel */ 0xFF,
2254 },
2255
2256 {
2257 /* Data[4].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2258 /* Data[4].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2259 /* Data[4].ctledges[2].bchannel */ FREQ2FBIN(5500, 0),
2260 /* Data[4].ctledges[3].bchannel */ FREQ2FBIN(5700, 0),
2261 /* Data[4].ctledges[4].bchannel */ 0xFF,
2262 /* Data[4].ctledges[5].bchannel */ 0xFF,
2263 /* Data[4].ctledges[6].bchannel */ 0xFF,
2264 /* Data[4].ctledges[7].bchannel */ 0xFF,
2265 },
2266
2267 {
2268 /* Data[5].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
2269 /* Data[5].ctledges[1].bchannel */ FREQ2FBIN(5270, 0),
2270 /* Data[5].ctledges[2].bchannel */ FREQ2FBIN(5310, 0),
2271 /* Data[5].ctledges[3].bchannel */ FREQ2FBIN(5510, 0),
2272 /* Data[5].ctledges[4].bchannel */ FREQ2FBIN(5590, 0),
2273 /* Data[5].ctledges[5].bchannel */ FREQ2FBIN(5670, 0),
2274 /* Data[5].ctledges[6].bchannel */ 0xFF,
2275 /* Data[5].ctledges[7].bchannel */ 0xFF
2276 },
2277
2278 {
2279 /* Data[6].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2280 /* Data[6].ctledges[1].bchannel */ FREQ2FBIN(5200, 0),
2281 /* Data[6].ctledges[2].bchannel */ FREQ2FBIN(5220, 0),
2282 /* Data[6].ctledges[3].bchannel */ FREQ2FBIN(5260, 0),
2283 /* Data[6].ctledges[4].bchannel */ FREQ2FBIN(5500, 0),
2284 /* Data[6].ctledges[5].bchannel */ FREQ2FBIN(5600, 0),
2285 /* Data[6].ctledges[6].bchannel */ FREQ2FBIN(5700, 0),
2286 /* Data[6].ctledges[7].bchannel */ FREQ2FBIN(5745, 0)
2287 },
2288
2289 {
2290 /* Data[7].ctledges[0].bchannel */ FREQ2FBIN(5180, 0),
2291 /* Data[7].ctledges[1].bchannel */ FREQ2FBIN(5260, 0),
2292 /* Data[7].ctledges[2].bchannel */ FREQ2FBIN(5320, 0),
2293 /* Data[7].ctledges[3].bchannel */ FREQ2FBIN(5500, 0),
2294 /* Data[7].ctledges[4].bchannel */ FREQ2FBIN(5560, 0),
2295 /* Data[7].ctledges[5].bchannel */ FREQ2FBIN(5700, 0),
2296 /* Data[7].ctledges[6].bchannel */ FREQ2FBIN(5745, 0),
2297 /* Data[7].ctledges[7].bchannel */ FREQ2FBIN(5825, 0)
2298 },
2299
2300 {
2301 /* Data[8].ctledges[0].bchannel */ FREQ2FBIN(5190, 0),
2302 /* Data[8].ctledges[1].bchannel */ FREQ2FBIN(5230, 0),
2303 /* Data[8].ctledges[2].bchannel */ FREQ2FBIN(5270, 0),
2304 /* Data[8].ctledges[3].bchannel */ FREQ2FBIN(5510, 0),
2305 /* Data[8].ctledges[4].bchannel */ FREQ2FBIN(5550, 0),
2306 /* Data[8].ctledges[5].bchannel */ FREQ2FBIN(5670, 0),
2307 /* Data[8].ctledges[6].bchannel */ FREQ2FBIN(5755, 0),
2308 /* Data[8].ctledges[7].bchannel */ FREQ2FBIN(5795, 0)
2309 }
2310 },
2311 .ctlPowerData_5G = {
2312 {
2313 {
2314 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2315 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2316 }
2317 },
2318 {
2319 {
2320 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2321 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2322 }
2323 },
2324 {
2325 {
2326 {60, 0}, {60, 1}, {60, 0}, {60, 1},
2327 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2328 }
2329 },
2330 {
2331 {
2332 {60, 0}, {60, 1}, {60, 1}, {60, 0},
2333 {60, 1}, {60, 0}, {60, 0}, {60, 0},
2334 }
2335 },
2336 {
2337 {
2338 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2339 {60, 0}, {60, 0}, {60, 0}, {60, 0},
2340 }
2341 },
2342 {
2343 {
2344 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2345 {60, 1}, {60, 0}, {60, 0}, {60, 0},
2346 }
2347 },
2348 {
2349 {
2350 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2351 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2352 }
2353 },
2354 {
2355 {
2356 {60, 1}, {60, 1}, {60, 0}, {60, 1},
2357 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2358 }
2359 },
2360 {
2361 {
2362 {60, 1}, {60, 0}, {60, 1}, {60, 1},
2363 {60, 1}, {60, 1}, {60, 0}, {60, 1},
2364 }
2365 },
2366 }
2367};
2368
2369static const struct ar9300_eeprom ar9300_h116 = {
2370 .eepromVersion = 2,
2371 .templateVersion = 4,
2372 .macAddr = {0x00, 0x03, 0x7f, 0x0, 0x0, 0x0},
2373 .custData = {"h116-041-f0000"},
2374 .baseEepHeader = {
2375 .regDmn = { LE16(0), LE16(0x1f) },
2376 .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */
2377 .opCapFlags = {
2378 .opFlags = AR9300_OPFLAGS_11G | AR9300_OPFLAGS_11A,
2379 .eepMisc = 0,
2380 },
2381 .rfSilent = 0,
2382 .blueToothOptions = 0,
2383 .deviceCap = 0,
2384 .deviceType = 5, /* takes lower byte in eeprom location */
2385 .pwrTableOffset = AR9300_PWR_TABLE_OFFSET,
2386 .params_for_tuning_caps = {0, 0},
2387 .featureEnable = 0x0d,
2388 /*
2389 * bit0 - enable tx temp comp - disabled
2390 * bit1 - enable tx volt comp - disabled
2391 * bit2 - enable fastClock - enabled
2392 * bit3 - enable doubling - enabled
2393 * bit4 - enable internal regulator - disabled
2394 * bit5 - enable pa predistortion - disabled
2395 */
2396 .miscConfiguration = 0, /* bit0 - turn down drivestrength */
2397 .eepromWriteEnableGpio = 6,
2398 .wlanDisableGpio = 0,
2399 .wlanLedGpio = 8,
2400 .rxBandSelectGpio = 0xff,
2401 .txrxgain = 0x10,
2402 .swreg = 0,
2403 },
2404 .modalHeader2G = {
2405 /* ar9300_modal_eep_header 2g */
2406 /* 4 idle,t1,t2,b(4 bits per setting) */
2407 .antCtrlCommon = LE32(0x110),
2408 /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */
2409 .antCtrlCommon2 = LE32(0x44444),
2410
2411 /*
2412 * antCtrlChain[AR9300_MAX_CHAINS]; 6 idle, t, r,
2413 * rx1, rx12, b (2 bits each)
2414 */
2415 .antCtrlChain = { LE16(0x10), LE16(0x10), LE16(0x10) },
2416
2417 /*
2418 * xatten1DB[AR9300_MAX_CHAINS]; 3 xatten1_db
2419 * for ar9280 (0xa20c/b20c 5:0)
2420 */
2421 .xatten1DB = {0x1f, 0x1f, 0x1f},
2422
2423 /*
2424 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
2425 * for ar9280 (0xa20c/b20c 16:12
2426 */
2427 .xatten1Margin = {0x12, 0x12, 0x12},
2428 .tempSlope = 25,
2429 .voltSlope = 0,
2430
2431 /*
2432 * spurChans[OSPREY_EEPROM_MODAL_SPURS]; spur
2433 * channels in usual fbin coding format
2434 */
2435 .spurChans = {FREQ2FBIN(2464, 1), 0, 0, 0, 0},
2436
2437 /*
2438 * noiseFloorThreshCh[AR9300_MAX_CHAINS]; 3 Check
2439 * if the register is per chain
2440 */
2441 .noiseFloorThreshCh = {-1, 0, 0},
2442 .ob = {1, 1, 1},/* 3 chain */
2443 .db_stage2 = {1, 1, 1}, /* 3 chain */
2444 .db_stage3 = {0, 0, 0},
2445 .db_stage4 = {0, 0, 0},
2446 .xpaBiasLvl = 0,
2447 .txFrameToDataStart = 0x0e,
2448 .txFrameToPaOn = 0x0e,
2449 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
2450 .antennaGain = 0,
2451 .switchSettling = 0x2c,
2452 .adcDesiredSize = -30,
2453 .txEndToXpaOff = 0,
2454 .txEndToRxOn = 0x2,
2455 .txFrameToXpaOn = 0xe,
2456 .thresh62 = 28,
2457 .papdRateMaskHt20 = LE32(0x0c80C080),
2458 .papdRateMaskHt40 = LE32(0x0080C080),
2459 .futureModal = {
2460 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2461 },
2462 },
2463 .base_ext1 = {
2464 .ant_div_control = 0,
2465 .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
2466 },
2467 .calFreqPier2G = {
2468 FREQ2FBIN(2412, 1),
2469 FREQ2FBIN(2437, 1),
2470 FREQ2FBIN(2472, 1),
2471 },
2472 /* ar9300_cal_data_per_freq_op_loop 2g */
2473 .calPierData2G = {
2474 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
2475 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
2476 { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} },
2477 },
2478 .calTarget_freqbin_Cck = {
2479 FREQ2FBIN(2412, 1),
2480 FREQ2FBIN(2472, 1),
2481 },
2482 .calTarget_freqbin_2G = {
2483 FREQ2FBIN(2412, 1),
2484 FREQ2FBIN(2437, 1),
2485 FREQ2FBIN(2472, 1)
2486 },
2487 .calTarget_freqbin_2GHT20 = {
2488 FREQ2FBIN(2412, 1),
2489 FREQ2FBIN(2437, 1),
2490 FREQ2FBIN(2472, 1)
2491 },
2492 .calTarget_freqbin_2GHT40 = {
2493 FREQ2FBIN(2412, 1),
2494 FREQ2FBIN(2437, 1),
2495 FREQ2FBIN(2472, 1)
2496 },
2497 .calTargetPowerCck = {
2498 /* 1L-5L,5S,11L,11S */
2499 { {34, 34, 34, 34} },
2500 { {34, 34, 34, 34} },
2501 },
2502 .calTargetPower2G = {
2503 /* 6-24,36,48,54 */
2504 { {34, 34, 32, 32} },
2505 { {34, 34, 32, 32} },
2506 { {34, 34, 32, 32} },
2507 },
2508 .calTargetPower2GHT20 = {
2509 { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 0, 0, 0, 0} },
2510 { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 0, 0, 0, 0} },
2511 { {32, 32, 32, 32, 32, 30, 32, 32, 30, 28, 0, 0, 0, 0} },
2512 },
2513 .calTargetPower2GHT40 = {
2514 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
2515 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
2516 { {30, 30, 30, 30, 30, 28, 30, 30, 28, 26, 0, 0, 0, 0} },
2517 },
2518 .ctlIndex_2G = {
2519 0x11, 0x12, 0x15, 0x17, 0x41, 0x42,
2520 0x45, 0x47, 0x31, 0x32, 0x35, 0x37,
2521 },
2522 .ctl_freqbin_2G = {
2523 {
2524 FREQ2FBIN(2412, 1),
2525 FREQ2FBIN(2417, 1),
2526 FREQ2FBIN(2457, 1),
2527 FREQ2FBIN(2462, 1)
2528 },
2529 {
2530 FREQ2FBIN(2412, 1),
2531 FREQ2FBIN(2417, 1),
2532 FREQ2FBIN(2462, 1),
2533 0xFF,
2534 },
2535
2536 {
2537 FREQ2FBIN(2412, 1),
2538 FREQ2FBIN(2417, 1),
2539 FREQ2FBIN(2462, 1),
2540 0xFF,
2541 },
2542 {
2543 FREQ2FBIN(2422, 1),
2544 FREQ2FBIN(2427, 1),
2545 FREQ2FBIN(2447, 1),
2546 FREQ2FBIN(2452, 1)
2547 },
2548
2549 {
2550 /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
2551 /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
2552 /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
2553 /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(2484, 1),
2554 },
2555
2556 {
2557 /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
2558 /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
2559 /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
2560 0,
2561 },
2562
2563 {
2564 /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
2565 /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
2566 FREQ2FBIN(2472, 1),
2567 0,
2568 },
2569
2570 {
2571 /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
2572 /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
2573 /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
2574 /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
2575 },
2576
2577 {
2578 /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
2579 /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
2580 /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
2581 },
2582
2583 {
2584 /* Data[9].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
2585 /* Data[9].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
2586 /* Data[9].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
2587 0
2588 },
2589
2590 {
2591 /* Data[10].ctlEdges[0].bChannel */ FREQ2FBIN(2412, 1),
2592 /* Data[10].ctlEdges[1].bChannel */ FREQ2FBIN(2417, 1),
2593 /* Data[10].ctlEdges[2].bChannel */ FREQ2FBIN(2472, 1),
2594 0
2595 },
2596
2597 {
2598 /* Data[11].ctlEdges[0].bChannel */ FREQ2FBIN(2422, 1),
2599 /* Data[11].ctlEdges[1].bChannel */ FREQ2FBIN(2427, 1),
2600 /* Data[11].ctlEdges[2].bChannel */ FREQ2FBIN(2447, 1),
2601 /* Data[11].ctlEdges[3].bChannel */ FREQ2FBIN(2462, 1),
2602 }
2603 },
2604 .ctlPowerData_2G = {
2605 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2606 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2607 { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } },
2608
2609 { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } },
2610 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2611 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2612
2613 { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } },
2614 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2615 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2616
2617 { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } },
2618 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2619 { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } },
2620 },
2621 .modalHeader5G = {
2622 /* 4 idle,t1,t2,b (4 bits per setting) */
2623 .antCtrlCommon = LE32(0x220),
2624 /* 4 ra1l1, ra2l1, ra1l2,ra2l2,ra12 */
2625 .antCtrlCommon2 = LE32(0x44444),
2626 /* antCtrlChain 6 idle, t,r,rx1,rx12,b (2 bits each) */
2627 .antCtrlChain = {
2628 LE16(0x150), LE16(0x150), LE16(0x150),
2629 },
2630 /* xatten1DB 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */
2631 .xatten1DB = {0x19, 0x19, 0x19},
2632
2633 /*
2634 * xatten1Margin[AR9300_MAX_CHAINS]; 3 xatten1_margin
2635 * for merlin (0xa20c/b20c 16:12
2636 */
2637 .xatten1Margin = {0x14, 0x14, 0x14},
2638 .tempSlope = 70,
2639 .voltSlope = 0,
2640 /* spurChans spur channels in usual fbin coding format */
2641 .spurChans = {0, 0, 0, 0, 0},
2642 /* noiseFloorThreshCh Check if the register is per chain */
2643 .noiseFloorThreshCh = {-1, 0, 0},
2644 .ob = {3, 3, 3}, /* 3 chain */
2645 .db_stage2 = {3, 3, 3}, /* 3 chain */
2646 .db_stage3 = {3, 3, 3}, /* doesn't exist for 2G */
2647 .db_stage4 = {3, 3, 3}, /* don't exist for 2G */
2648 .xpaBiasLvl = 0,
2649 .txFrameToDataStart = 0x0e,
2650 .txFrameToPaOn = 0x0e,
2651 .txClip = 3, /* 4 bits tx_clip, 4 bits dac_scale_cck */
2652 .antennaGain = 0,
2653 .switchSettling = 0x2d,
2654 .adcDesiredSize = -30,
2655 .txEndToXpaOff = 0,
2656 .txEndToRxOn = 0x2,
2657 .txFrameToXpaOn = 0xe,
2658 .thresh62 = 28,
2659 .papdRateMaskHt20 = LE32(0x0cf0e0e0),
2660 .papdRateMaskHt40 = LE32(0x6cf0e0e0),
2661 .futureModal = {
2662 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2663 },
2664 },
2665 .base_ext2 = {
2666 .tempSlopeLow = 35,
2667 .tempSlopeHigh = 50,
2668 .xatten1DBLow = {0, 0, 0},
2669 .xatten1MarginLow = {0, 0, 0},
2670 .xatten1DBHigh = {0, 0, 0},
2671 .xatten1MarginHigh = {0, 0, 0}
2672 },
2673 .calFreqPier5G = {
2674 FREQ2FBIN(5180, 0),
2675 FREQ2FBIN(5220, 0),
2676 FREQ2FBIN(5320, 0),
2677 FREQ2FBIN(5400, 0),
2678 FREQ2FBIN(5500, 0),
2679 FREQ2FBIN(5600, 0),
2680 FREQ2FBIN(5700, 0),
2681 FREQ2FBIN(5785, 0)
2682 },
2683 .calPierData5G = {
2684 {
2685 {0, 0, 0, 0, 0},
2686 {0, 0, 0, 0, 0},
2687 {0, 0, 0, 0, 0},
2688 {0, 0, 0, 0, 0},
2689 {0, 0, 0, 0, 0},
2690 {0, 0, 0, 0, 0},
2691 {0, 0, 0, 0, 0},
2692 {0, 0, 0, 0, 0},
2693 },
2694 {
2695 {0, 0, 0, 0, 0},
2696 {0, 0, 0, 0, 0},
2697 {0, 0, 0, 0, 0},
2698 {0, 0, 0, 0, 0},
2699 {0, 0, 0, 0, 0},
2700 {0, 0, 0, 0, 0},
2701 {0, 0, 0, 0, 0},
2702 {0, 0, 0, 0, 0},
2703 },
2704 {
2705 {0, 0, 0, 0, 0},
2706 {0, 0, 0, 0, 0},
2707 {0, 0, 0, 0, 0},
2708 {0, 0, 0, 0, 0},
2709 {0, 0, 0, 0, 0},
2710 {0, 0, 0, 0, 0},
2711 {0, 0, 0, 0, 0},
2712 {0, 0, 0, 0, 0},
2713 },
2714
2715 },
2716 .calTarget_freqbin_5G = {
2717 FREQ2FBIN(5180, 0),
2718 FREQ2FBIN(5240, 0),
2719 FREQ2FBIN(5320, 0),
2720 FREQ2FBIN(5400, 0),
2721 FREQ2FBIN(5500, 0),
2722 FREQ2FBIN(5600, 0),
2723 FREQ2FBIN(5700, 0),
2724 FREQ2FBIN(5825, 0)
2725 },
2726 .calTarget_freqbin_5GHT20 = {
2727 FREQ2FBIN(5180, 0),
2728 FREQ2FBIN(5240, 0),
2729 FREQ2FBIN(5320, 0),
2730 FREQ2FBIN(5400, 0),
2731 FREQ2FBIN(5500, 0),
2732 FREQ2FBIN(5700, 0),
2733 FREQ2FBIN(5745, 0),
2734 FREQ2FBIN(5825, 0)
2735 },
2736 .calTarget_freqbin_5GHT40 = {
2737 FREQ2FBIN(5180, 0),
2738 FREQ2FBIN(5240, 0),
2739 FREQ2FBIN(5320, 0),
2740 FREQ2FBIN(5400, 0),
2741 FREQ2FBIN(5500, 0),
2742 FREQ2FBIN(5700, 0),
2743 FREQ2FBIN(5745, 0),
2744 FREQ2FBIN(5825, 0)
2745 },
2746 .calTargetPower5G = {
2747 /* 6-24,36,48,54 */
2748 { {30, 30, 28, 24} },
2749 { {30, 30, 28, 24} },
2750 { {30, 30, 28, 24} },
2751 { {30, 30, 28, 24} },
2752 { {30, 30, 28, 24} },
2753 { {30, 30, 28, 24} },
2754 { {30, 30, 28, 24} },
2755 { {30, 30, 28, 24} },
2756 },
2757 .calTargetPower5GHT20 = {
2758 /*
2759 * 0_8_16,1-3_9-11_17-19,
2760 * 4,5,6,7,12,13,14,15,20,21,22,23
2761 */
2762 { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 0, 0, 0, 0} },
2763 { {30, 30, 30, 28, 24, 20, 30, 28, 24, 20, 0, 0, 0, 0} },
2764 { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 0, 0, 0, 0} },
2765 { {30, 30, 30, 26, 22, 18, 30, 26, 22, 18, 0, 0, 0, 0} },
2766 { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 0, 0, 0, 0} },
2767 { {30, 30, 30, 24, 20, 16, 30, 24, 20, 16, 0, 0, 0, 0} },
2768 { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 0, 0, 0, 0} },
2769 { {30, 30, 30, 22, 18, 14, 30, 22, 18, 14, 0, 0, 0, 0} },
2770 },
2771 .calTargetPower5GHT40 = {
2772 /*
2773 * 0_8_16,1-3_9-11_17-19,
2774 * 4,5,6,7,12,13,14,15,20,21,22,23
2775 */
2776 { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 0, 0, 0, 0} },
2777 { {28, 28, 28, 26, 22, 18, 28, 26, 22, 18, 0, 0, 0, 0} },
2778 { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 0, 0, 0, 0} },
2779 { {28, 28, 28, 24, 20, 16, 28, 24, 20, 16, 0, 0, 0, 0} },
2780 { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 0, 0, 0, 0} },
2781 { {28, 28, 28, 22, 18, 14, 28, 22, 18, 14, 0, 0, 0, 0} },
2782 { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 0, 0, 0, 0} },
2783 { {28, 28, 28, 20, 16, 12, 28, 20, 16, 12, 0, 0, 0, 0} },
2784 },
2785 .ctlIndex_5G = {
2786 0x10, 0x16, 0x18, 0x40, 0x46,
2787 0x48, 0x30, 0x36, 0x38
2788 },
2789 .ctl_freqbin_5G = {
2790 {
2791 /* Data[0].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
2792 /* Data[0].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
2793 /* Data[0].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
2794 /* Data[0].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
2795 /* Data[0].ctlEdges[4].bChannel */ FREQ2FBIN(5600, 0),
2796 /* Data[0].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
2797 /* Data[0].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
2798 /* Data[0].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
2799 },
2800 {
2801 /* Data[1].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
2802 /* Data[1].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
2803 /* Data[1].ctlEdges[2].bChannel */ FREQ2FBIN(5280, 0),
2804 /* Data[1].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
2805 /* Data[1].ctlEdges[4].bChannel */ FREQ2FBIN(5520, 0),
2806 /* Data[1].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
2807 /* Data[1].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
2808 /* Data[1].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
2809 },
2810
2811 {
2812 /* Data[2].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
2813 /* Data[2].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
2814 /* Data[2].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
2815 /* Data[2].ctlEdges[3].bChannel */ FREQ2FBIN(5310, 0),
2816 /* Data[2].ctlEdges[4].bChannel */ FREQ2FBIN(5510, 0),
2817 /* Data[2].ctlEdges[5].bChannel */ FREQ2FBIN(5550, 0),
2818 /* Data[2].ctlEdges[6].bChannel */ FREQ2FBIN(5670, 0),
2819 /* Data[2].ctlEdges[7].bChannel */ FREQ2FBIN(5755, 0)
2820 },
2821
2822 {
2823 /* Data[3].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
2824 /* Data[3].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
2825 /* Data[3].ctlEdges[2].bChannel */ FREQ2FBIN(5260, 0),
2826 /* Data[3].ctlEdges[3].bChannel */ FREQ2FBIN(5320, 0),
2827 /* Data[3].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
2828 /* Data[3].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
2829 /* Data[3].ctlEdges[6].bChannel */ 0xFF,
2830 /* Data[3].ctlEdges[7].bChannel */ 0xFF,
2831 },
2832
2833 {
2834 /* Data[4].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
2835 /* Data[4].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
2836 /* Data[4].ctlEdges[2].bChannel */ FREQ2FBIN(5500, 0),
2837 /* Data[4].ctlEdges[3].bChannel */ FREQ2FBIN(5700, 0),
2838 /* Data[4].ctlEdges[4].bChannel */ 0xFF,
2839 /* Data[4].ctlEdges[5].bChannel */ 0xFF,
2840 /* Data[4].ctlEdges[6].bChannel */ 0xFF,
2841 /* Data[4].ctlEdges[7].bChannel */ 0xFF,
2842 },
2843
2844 {
2845 /* Data[5].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
2846 /* Data[5].ctlEdges[1].bChannel */ FREQ2FBIN(5270, 0),
2847 /* Data[5].ctlEdges[2].bChannel */ FREQ2FBIN(5310, 0),
2848 /* Data[5].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
2849 /* Data[5].ctlEdges[4].bChannel */ FREQ2FBIN(5590, 0),
2850 /* Data[5].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
2851 /* Data[5].ctlEdges[6].bChannel */ 0xFF,
2852 /* Data[5].ctlEdges[7].bChannel */ 0xFF
2853 },
2854
2855 {
2856 /* Data[6].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
2857 /* Data[6].ctlEdges[1].bChannel */ FREQ2FBIN(5200, 0),
2858 /* Data[6].ctlEdges[2].bChannel */ FREQ2FBIN(5220, 0),
2859 /* Data[6].ctlEdges[3].bChannel */ FREQ2FBIN(5260, 0),
2860 /* Data[6].ctlEdges[4].bChannel */ FREQ2FBIN(5500, 0),
2861 /* Data[6].ctlEdges[5].bChannel */ FREQ2FBIN(5600, 0),
2862 /* Data[6].ctlEdges[6].bChannel */ FREQ2FBIN(5700, 0),
2863 /* Data[6].ctlEdges[7].bChannel */ FREQ2FBIN(5745, 0)
2864 },
2865
2866 {
2867 /* Data[7].ctlEdges[0].bChannel */ FREQ2FBIN(5180, 0),
2868 /* Data[7].ctlEdges[1].bChannel */ FREQ2FBIN(5260, 0),
2869 /* Data[7].ctlEdges[2].bChannel */ FREQ2FBIN(5320, 0),
2870 /* Data[7].ctlEdges[3].bChannel */ FREQ2FBIN(5500, 0),
2871 /* Data[7].ctlEdges[4].bChannel */ FREQ2FBIN(5560, 0),
2872 /* Data[7].ctlEdges[5].bChannel */ FREQ2FBIN(5700, 0),
2873 /* Data[7].ctlEdges[6].bChannel */ FREQ2FBIN(5745, 0),
2874 /* Data[7].ctlEdges[7].bChannel */ FREQ2FBIN(5825, 0)
2875 },
2876
2877 {
2878 /* Data[8].ctlEdges[0].bChannel */ FREQ2FBIN(5190, 0),
2879 /* Data[8].ctlEdges[1].bChannel */ FREQ2FBIN(5230, 0),
2880 /* Data[8].ctlEdges[2].bChannel */ FREQ2FBIN(5270, 0),
2881 /* Data[8].ctlEdges[3].bChannel */ FREQ2FBIN(5510, 0),
2882 /* Data[8].ctlEdges[4].bChannel */ FREQ2FBIN(5550, 0),
2883 /* Data[8].ctlEdges[5].bChannel */ FREQ2FBIN(5670, 0),
2884 /* Data[8].ctlEdges[6].bChannel */ FREQ2FBIN(5755, 0),
2885 /* Data[8].ctlEdges[7].bChannel */ FREQ2FBIN(5795, 0)
2886 }
2887 },
2888 .ctlPowerData_5G = {
2889 {
2890 {
2891 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2892 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2893 }
2894 },
2895 {
2896 {
2897 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2898 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2899 }
2900 },
2901 {
2902 {
2903 {60, 0}, {60, 1}, {60, 0}, {60, 1},
2904 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2905 }
2906 },
2907 {
2908 {
2909 {60, 0}, {60, 1}, {60, 1}, {60, 0},
2910 {60, 1}, {60, 0}, {60, 0}, {60, 0},
2911 }
2912 },
2913 {
2914 {
2915 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2916 {60, 0}, {60, 0}, {60, 0}, {60, 0},
2917 }
2918 },
2919 {
2920 {
2921 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2922 {60, 1}, {60, 0}, {60, 0}, {60, 0},
2923 }
2924 },
2925 {
2926 {
2927 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2928 {60, 1}, {60, 1}, {60, 1}, {60, 1},
2929 }
2930 },
2931 {
2932 {
2933 {60, 1}, {60, 1}, {60, 0}, {60, 1},
2934 {60, 1}, {60, 1}, {60, 1}, {60, 0},
2935 }
2936 },
2937 {
2938 {
2939 {60, 1}, {60, 0}, {60, 1}, {60, 1},
2940 {60, 1}, {60, 1}, {60, 0}, {60, 1},
2941 }
2942 },
2943 }
2944};
2945
2946
2947static const struct ar9300_eeprom *ar9300_eep_templates[] = {
2948 &ar9300_default,
2949 &ar9300_x112,
2950 &ar9300_h116,
2951 &ar9300_h112,
2952 &ar9300_x113,
2953};
2954
2955static const struct ar9300_eeprom *ar9003_eeprom_struct_find_by_id(int id)
2956{
2957#define N_LOOP (sizeof(ar9300_eep_templates) / sizeof(ar9300_eep_templates[0]))
2958 int it;
2959
2960 for (it = 0; it < N_LOOP; it++)
2961 if (ar9300_eep_templates[it]->templateVersion == id)
2962 return ar9300_eep_templates[it];
2963 return NULL;
2964#undef N_LOOP
2965}
2966
2967
636static u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz) 2968static u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
637{ 2969{
638 if (fbin == AR9300_BCHAN_UNUSED) 2970 if (fbin == AR9300_BCHAN_UNUSED)
@@ -834,6 +3166,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
834{ 3166{
835 struct ath_common *common = ath9k_hw_common(ah); 3167 struct ath_common *common = ath9k_hw_common(ah);
836 u8 *dptr; 3168 u8 *dptr;
3169 const struct ar9300_eeprom *eep = NULL;
837 3170
838 switch (code) { 3171 switch (code) {
839 case _CompressNone: 3172 case _CompressNone:
@@ -851,13 +3184,14 @@ static int ar9300_compress_decision(struct ath_hw *ah,
851 if (reference == 0) { 3184 if (reference == 0) {
852 dptr = mptr; 3185 dptr = mptr;
853 } else { 3186 } else {
854 if (reference != 2) { 3187 eep = ar9003_eeprom_struct_find_by_id(reference);
3188 if (eep == NULL) {
855 ath_print(common, ATH_DBG_EEPROM, 3189 ath_print(common, ATH_DBG_EEPROM,
856 "cant find reference eeprom" 3190 "cant find reference eeprom"
857 "struct %d\n", reference); 3191 "struct %d\n", reference);
858 return -1; 3192 return -1;
859 } 3193 }
860 memcpy(mptr, &ar9300_default, mdata_size); 3194 memcpy(mptr, eep, mdata_size);
861 } 3195 }
862 ath_print(common, ATH_DBG_EEPROM, 3196 ath_print(common, ATH_DBG_EEPROM,
863 "restore eeprom %d: block, reference %d," 3197 "restore eeprom %d: block, reference %d,"