diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2007-11-28 22:10:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:28 -0500 |
commit | 0c434c5a7f9983c8ee3c8943924db8c5fb1d12bd (patch) | |
tree | 046e297af95e61f269366a1b418a220dca743734 /drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |
parent | 5991b419f04dee78c36d43de6b6ff2d27934d707 (diff) |
iwlwifi: document txpower calculations
Document txpower calculations
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-hw.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 575 |
1 files changed, 562 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h index 78d9854f7506..4a2fa80acff7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |||
@@ -647,7 +647,7 @@ static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr) | |||
647 | 647 | ||
648 | /********************* START TEMPERATURE *************************************/ | 648 | /********************* START TEMPERATURE *************************************/ |
649 | 649 | ||
650 | /* | 650 | /** |
651 | * 4965 temperature calculation. | 651 | * 4965 temperature calculation. |
652 | * | 652 | * |
653 | * The driver must calculate the device temperature before calculating | 653 | * The driver must calculate the device temperature before calculating |
@@ -693,44 +693,593 @@ static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr) | |||
693 | 693 | ||
694 | /********************* START TXPOWER *****************************************/ | 694 | /********************* START TXPOWER *****************************************/ |
695 | 695 | ||
696 | enum { | 696 | /** |
697 | CALIB_CH_GROUP_1 = 0, | 697 | * 4965 txpower calculations rely on information from three sources: |
698 | CALIB_CH_GROUP_2 = 1, | 698 | * |
699 | CALIB_CH_GROUP_3 = 2, | 699 | * 1) EEPROM |
700 | CALIB_CH_GROUP_4 = 3, | 700 | * 2) "initialize" alive notification |
701 | CALIB_CH_GROUP_5 = 4, | 701 | * 3) statistics notifications |
702 | CALIB_CH_GROUP_MAX | 702 | * |
703 | }; | 703 | * EEPROM data consists of: |
704 | * | ||
705 | * 1) Regulatory information (max txpower and channel usage flags) is provided | ||
706 | * separately for each channel that can possibly supported by 4965. | ||
707 | * 40 MHz wide (.11n fat) channels are listed separately from 20 MHz | ||
708 | * (legacy) channels. | ||
709 | * | ||
710 | * See struct iwl4965_eeprom_channel for format, and struct iwl4965_eeprom | ||
711 | * for locations in EEPROM. | ||
712 | * | ||
713 | * 2) Factory txpower calibration information is provided separately for | ||
714 | * sub-bands of contiguous channels. 2.4GHz has just one sub-band, | ||
715 | * but 5 GHz has several sub-bands. | ||
716 | * | ||
717 | * In addition, per-band (2.4 and 5 Ghz) saturation txpowers are provided. | ||
718 | * | ||
719 | * See struct iwl4965_eeprom_calib_info (and the tree of structures | ||
720 | * contained within it) for format, and struct iwl4965_eeprom for | ||
721 | * locations in EEPROM. | ||
722 | * | ||
723 | * "Initialization alive" notification (see struct iwl4965_init_alive_resp) | ||
724 | * consists of: | ||
725 | * | ||
726 | * 1) Temperature calculation parameters. | ||
727 | * | ||
728 | * 2) Power supply voltage measurement. | ||
729 | * | ||
730 | * 3) Tx gain compensation to balance 2 transmitters for MIMO use. | ||
731 | * | ||
732 | * Statistics notifications deliver: | ||
733 | * | ||
734 | * 1) Current values for temperature param R4. | ||
735 | */ | ||
704 | 736 | ||
705 | #define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6) | 737 | /** |
738 | * To calculate a txpower setting for a given desired target txpower, channel, | ||
739 | * modulation bit rate, and transmitter chain (4965 has 2 transmitters to | ||
740 | * support MIMO and transmit diversity), driver must do the following: | ||
741 | * | ||
742 | * 1) Compare desired txpower vs. (EEPROM) regulatory limit for this channel. | ||
743 | * Do not exceed regulatory limit; reduce target txpower if necessary. | ||
744 | * | ||
745 | * If setting up txpowers for MIMO rates (rate indexes 8-15, 24-31), | ||
746 | * 2 transmitters will be used simultaneously; driver must reduce the | ||
747 | * regulatory limit by 3 dB (half-power) for each transmitter, so the | ||
748 | * combined total output of the 2 transmitters is within regulatory limits. | ||
749 | * | ||
750 | * | ||
751 | * 2) Compare target txpower vs. (EEPROM) saturation txpower *reduced by | ||
752 | * backoff for this bit rate*. Do not exceed (saturation - backoff[rate]); | ||
753 | * reduce target txpower if necessary. | ||
754 | * | ||
755 | * Backoff values below are in 1/2 dB units (equivalent to steps in | ||
756 | * txpower gain tables): | ||
757 | * | ||
758 | * OFDM 6 - 36 MBit: 10 steps (5 dB) | ||
759 | * OFDM 48 MBit: 15 steps (7.5 dB) | ||
760 | * OFDM 54 MBit: 17 steps (8.5 dB) | ||
761 | * OFDM 60 MBit: 20 steps (10 dB) | ||
762 | * CCK all rates: 10 steps (5 dB) | ||
763 | * | ||
764 | * Backoff values apply to saturation txpower on a per-transmitter basis; | ||
765 | * when using MIMO (2 transmitters), each transmitter uses the same | ||
766 | * saturation level provided in EEPROM, and the same backoff values; | ||
767 | * no reduction (such as with regulatory txpower limits) is required. | ||
768 | * | ||
769 | * Saturation and Backoff values apply equally to 20 Mhz (legacy) channel | ||
770 | * widths and 40 Mhz (.11n fat) channel widths; there is no separate | ||
771 | * factory measurement for fat channels. | ||
772 | * | ||
773 | * The result of this step is the final target txpower. The rest of | ||
774 | * the steps figure out the proper settings for the device to achieve | ||
775 | * that target txpower. | ||
776 | * | ||
777 | * | ||
778 | * 3) Determine (EEPROM) calibration subband for the target channel, by | ||
779 | * comparing against first and last channels in each subband | ||
780 | * (see struct iwl4965_eeprom_calib_subband_info). | ||
781 | * | ||
782 | * | ||
783 | * 4) Linearly interpolate (EEPROM) factory calibration measurement sets, | ||
784 | * referencing the 2 factory-measured (sample) channels within the subband. | ||
785 | * | ||
786 | * Interpolation is based on difference between target channel's frequency | ||
787 | * and the sample channels' frequencies. Since channel numbers are based | ||
788 | * on frequency (5 MHz between each channel number), this is equivalent | ||
789 | * to interpolating based on channel number differences. | ||
790 | * | ||
791 | * Note that the sample channels may or may not be the channels at the | ||
792 | * edges of the subband. The target channel may be "outside" of the | ||
793 | * span of the sampled channels. | ||
794 | * | ||
795 | * Driver may choose the pair (for 2 Tx chains) of measurements (see | ||
796 | * struct iwl4965_eeprom_calib_ch_info) for which the actual measured | ||
797 | * txpower comes closest to the desired txpower. Usually, though, | ||
798 | * the middle set of measurements is closest to the regulatory limits, | ||
799 | * and is therefore a good choice for all txpower calculations (this | ||
800 | * assumes that high accuracy is needed for maximizing legal txpower, | ||
801 | * while lower txpower configurations do not need as much accuracy). | ||
802 | * | ||
803 | * Driver should interpolate both members of the chosen measurement pair, | ||
804 | * i.e. for both Tx chains (radio transmitters), unless the driver knows | ||
805 | * that only one of the chains will be used (e.g. only one tx antenna | ||
806 | * connected, but this should be unusual). The rate scaling algorithm | ||
807 | * switches antennas to find best performance, so both Tx chains will | ||
808 | * be used (although only one at a time) even for non-MIMO transmissions. | ||
809 | * | ||
810 | * Driver should interpolate factory values for temperature, gain table | ||
811 | * index, and actual power. The power amplifier detector values are | ||
812 | * not used by the driver. | ||
813 | * | ||
814 | * Sanity check: If the target channel happens to be one of the sample | ||
815 | * channels, the results should agree with the sample channel's | ||
816 | * measurements! | ||
817 | * | ||
818 | * | ||
819 | * 5) Find difference between desired txpower and (interpolated) | ||
820 | * factory-measured txpower. Using (interpolated) factory gain table index | ||
821 | * (shown elsewhere) as a starting point, adjust this index lower to | ||
822 | * increase txpower, or higher to decrease txpower, until the target | ||
823 | * txpower is reached. Each step in the gain table is 1/2 dB. | ||
824 | * | ||
825 | * For example, if factory measured txpower is 16 dBm, and target txpower | ||
826 | * is 13 dBm, add 6 steps to the factory gain index to reduce txpower | ||
827 | * by 3 dB. | ||
828 | * | ||
829 | * | ||
830 | * 6) Find difference between current device temperature and (interpolated) | ||
831 | * factory-measured temperature for sub-band. Factory values are in | ||
832 | * degrees Celsius. To calculate current temperature, see comments for | ||
833 | * "4965 temperature calculation". | ||
834 | * | ||
835 | * If current temperature is higher than factory temperature, driver must | ||
836 | * increase gain (lower gain table index), and vice versa. | ||
837 | * | ||
838 | * Temperature affects gain differently for different channels: | ||
839 | * | ||
840 | * 2.4 GHz all channels: 3.5 degrees per half-dB step | ||
841 | * 5 GHz channels 34-43: 4.5 degrees per half-dB step | ||
842 | * 5 GHz channels >= 44: 4.0 degrees per half-dB step | ||
843 | * | ||
844 | * NOTE: Temperature can increase rapidly when transmitting, especially | ||
845 | * with heavy traffic at high txpowers. Driver should update | ||
846 | * temperature calculations often under these conditions to | ||
847 | * maintain strong txpower in the face of rising temperature. | ||
848 | * | ||
849 | * | ||
850 | * 7) Find difference between current power supply voltage indicator | ||
851 | * (from "initialize alive") and factory-measured power supply voltage | ||
852 | * indicator (EEPROM). | ||
853 | * | ||
854 | * If the current voltage is higher (indicator is lower) than factory | ||
855 | * voltage, gain should be reduced (gain table index increased) by: | ||
856 | * | ||
857 | * (eeprom - current) / 7 | ||
858 | * | ||
859 | * If the current voltage is lower (indicator is higher) than factory | ||
860 | * voltage, gain should be increased (gain table index decreased) by: | ||
861 | * | ||
862 | * 2 * (current - eeprom) / 7 | ||
863 | * | ||
864 | * If number of index steps in either direction turns out to be > 2, | ||
865 | * something is wrong ... just use 0. | ||
866 | * | ||
867 | * NOTE: Voltage compensation is independent of band/channel. | ||
868 | * | ||
869 | * NOTE: "Initialize" uCode measures current voltage, which is assumed | ||
870 | * to be constant after this initial measurement. Voltage | ||
871 | * compensation for txpower (number of steps in gain table) | ||
872 | * may be calculated once and used until the next uCode bootload. | ||
873 | * | ||
874 | * | ||
875 | * 8) If setting up txpowers for MIMO rates (rate indexes 8-15, 24-31), | ||
876 | * adjust txpower for each transmitter chain, so txpower is balanced | ||
877 | * between the two chains. There are 5 pairs of tx_atten[group][chain] | ||
878 | * values in "initialize alive", one pair for each of 5 channel ranges: | ||
879 | * | ||
880 | * Group 0: 5 GHz channel 34-43 | ||
881 | * Group 1: 5 GHz channel 44-70 | ||
882 | * Group 2: 5 GHz channel 71-124 | ||
883 | * Group 3: 5 GHz channel 125-200 | ||
884 | * Group 4: 2.4 GHz all channels | ||
885 | * | ||
886 | * Add the tx_atten[group][chain] value to the index for the target chain. | ||
887 | * The values are signed, but are in pairs of 0 and a non-negative number, | ||
888 | * so as to reduce gain (if necessary) of the "hotter" channel. This | ||
889 | * avoids any need to double-check for regulatory compliance after | ||
890 | * this step. | ||
891 | * | ||
892 | * | ||
893 | * 9) If setting up for a CCK rate, lower the gain by adding a CCK compensation | ||
894 | * value to the index: | ||
895 | * | ||
896 | * Hardware rev B: 9 steps (4.5 dB) | ||
897 | * Hardware rev C: 5 steps (2.5 dB) | ||
898 | * | ||
899 | * Hardware rev for 4965 can be determined by reading CSR_HW_REV_WA_REG, | ||
900 | * bits [3:2], 1 = B, 2 = C. | ||
901 | * | ||
902 | * NOTE: This compensation is in addition to any saturation backoff that | ||
903 | * might have been applied in an earlier step. | ||
904 | * | ||
905 | * | ||
906 | * 10) Select the gain table, based on band (2.4 vs 5 GHz). | ||
907 | * | ||
908 | * Limit the adjusted index to stay within the table! | ||
909 | * | ||
910 | * | ||
911 | * 11) Read gain table entries for DSP and radio gain, place into appropriate | ||
912 | * location(s) in command (struct iwl4965_txpowertable_cmd). | ||
913 | */ | ||
706 | 914 | ||
915 | /* Limit range of txpower output target to be between these values */ | ||
707 | #define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */ | 916 | #define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */ |
708 | #define IWL_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */ | 917 | #define IWL_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */ |
709 | 918 | ||
710 | #define MIN_TX_GAIN_INDEX (0) | 919 | /** |
711 | #define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9) | 920 | * When MIMO is used (2 transmitters operating simultaneously), driver should |
921 | * limit each transmitter to deliver a max of 3 dB below the regulatory limit | ||
922 | * for the device. That is, use half power for each transmitter, so total | ||
923 | * txpower is within regulatory limits. | ||
924 | * | ||
925 | * The value "6" represents number of steps in gain table to reduce power 3 dB. | ||
926 | * Each step is 1/2 dB. | ||
927 | */ | ||
928 | #define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6) | ||
929 | |||
930 | /** | ||
931 | * CCK gain compensation. | ||
932 | * | ||
933 | * When calculating txpowers for CCK, after making sure that the target power | ||
934 | * is within regulatory and saturation limits, driver must additionally | ||
935 | * back off gain by adding these values to the gain table index. | ||
936 | * | ||
937 | * Hardware rev for 4965 can be determined by reading CSR_HW_REV_WA_REG, | ||
938 | * bits [3:2], 1 = B, 2 = C. | ||
939 | */ | ||
940 | #define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9) | ||
941 | #define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5) | ||
942 | |||
943 | /* | ||
944 | * 4965 power supply voltage compensation for txpower | ||
945 | */ | ||
946 | #define TX_POWER_IWL_VOLTAGE_CODES_PER_03V (7) | ||
947 | |||
948 | /** | ||
949 | * Gain tables. | ||
950 | * | ||
951 | * The following tables contain pair of values for setting txpower, i.e. | ||
952 | * gain settings for the output of the device's digital signal processor (DSP), | ||
953 | * and for the analog gain structure of the transmitter. | ||
954 | * | ||
955 | * Each entry in the gain tables represents a step of 1/2 dB. Note that these | ||
956 | * are *relative* steps, not indications of absolute output power. Output | ||
957 | * power varies with temperature, voltage, and channel frequency, and also | ||
958 | * requires consideration of average power (to satisfy regulatory constraints), | ||
959 | * and peak power (to avoid distortion of the output signal). | ||
960 | * | ||
961 | * Each entry contains two values: | ||
962 | * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained | ||
963 | * linear value that multiplies the output of the digital signal processor, | ||
964 | * before being sent to the analog radio. | ||
965 | * 2) Radio gain. This sets the analog gain of the radio Tx path. | ||
966 | * It is a coarser setting, and behaves in a logarithmic (dB) fashion. | ||
967 | * | ||
968 | * EEPROM contains factory calibration data for txpower. This maps actual | ||
969 | * measured txpower levels to gain settings in the "well known" tables | ||
970 | * below ("well-known" means here that both factory calibration *and* the | ||
971 | * driver work with the same table). | ||
972 | * | ||
973 | * There are separate tables for 2.4 GHz and 5 GHz bands. The 5 GHz table | ||
974 | * has an extension (into negative indexes), in case the driver needs to | ||
975 | * boost power setting for high device temperatures (higher than would be | ||
976 | * present during factory calibration). A 5 Ghz EEPROM index of "40" | ||
977 | * corresponds to the 49th entry in the table used by the driver. | ||
978 | */ | ||
979 | #define MIN_TX_GAIN_INDEX (0) /* highest gain, lowest idx, 2.4 */ | ||
980 | #define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9) /* highest gain, lowest idx, 5 */ | ||
981 | |||
982 | /** | ||
983 | * 2.4 GHz gain table | ||
984 | * | ||
985 | * Index Dsp gain Radio gain | ||
986 | * 0 110 0x3f (highest gain) | ||
987 | * 1 104 0x3f | ||
988 | * 2 98 0x3f | ||
989 | * 3 110 0x3e | ||
990 | * 4 104 0x3e | ||
991 | * 5 98 0x3e | ||
992 | * 6 110 0x3d | ||
993 | * 7 104 0x3d | ||
994 | * 8 98 0x3d | ||
995 | * 9 110 0x3c | ||
996 | * 10 104 0x3c | ||
997 | * 11 98 0x3c | ||
998 | * 12 110 0x3b | ||
999 | * 13 104 0x3b | ||
1000 | * 14 98 0x3b | ||
1001 | * 15 110 0x3a | ||
1002 | * 16 104 0x3a | ||
1003 | * 17 98 0x3a | ||
1004 | * 18 110 0x39 | ||
1005 | * 19 104 0x39 | ||
1006 | * 20 98 0x39 | ||
1007 | * 21 110 0x38 | ||
1008 | * 22 104 0x38 | ||
1009 | * 23 98 0x38 | ||
1010 | * 24 110 0x37 | ||
1011 | * 25 104 0x37 | ||
1012 | * 26 98 0x37 | ||
1013 | * 27 110 0x36 | ||
1014 | * 28 104 0x36 | ||
1015 | * 29 98 0x36 | ||
1016 | * 30 110 0x35 | ||
1017 | * 31 104 0x35 | ||
1018 | * 32 98 0x35 | ||
1019 | * 33 110 0x34 | ||
1020 | * 34 104 0x34 | ||
1021 | * 35 98 0x34 | ||
1022 | * 36 110 0x33 | ||
1023 | * 37 104 0x33 | ||
1024 | * 38 98 0x33 | ||
1025 | * 39 110 0x32 | ||
1026 | * 40 104 0x32 | ||
1027 | * 41 98 0x32 | ||
1028 | * 42 110 0x31 | ||
1029 | * 43 104 0x31 | ||
1030 | * 44 98 0x31 | ||
1031 | * 45 110 0x30 | ||
1032 | * 46 104 0x30 | ||
1033 | * 47 98 0x30 | ||
1034 | * 48 110 0x6 | ||
1035 | * 49 104 0x6 | ||
1036 | * 50 98 0x6 | ||
1037 | * 51 110 0x5 | ||
1038 | * 52 104 0x5 | ||
1039 | * 53 98 0x5 | ||
1040 | * 54 110 0x4 | ||
1041 | * 55 104 0x4 | ||
1042 | * 56 98 0x4 | ||
1043 | * 57 110 0x3 | ||
1044 | * 58 104 0x3 | ||
1045 | * 59 98 0x3 | ||
1046 | * 60 110 0x2 | ||
1047 | * 61 104 0x2 | ||
1048 | * 62 98 0x2 | ||
1049 | * 63 110 0x1 | ||
1050 | * 64 104 0x1 | ||
1051 | * 65 98 0x1 | ||
1052 | * 66 110 0x0 | ||
1053 | * 67 104 0x0 | ||
1054 | * 68 98 0x0 | ||
1055 | * 69 97 0 | ||
1056 | * 70 96 0 | ||
1057 | * 71 95 0 | ||
1058 | * 72 94 0 | ||
1059 | * 73 93 0 | ||
1060 | * 74 92 0 | ||
1061 | * 75 91 0 | ||
1062 | * 76 90 0 | ||
1063 | * 77 89 0 | ||
1064 | * 78 88 0 | ||
1065 | * 79 87 0 | ||
1066 | * 80 86 0 | ||
1067 | * 81 85 0 | ||
1068 | * 82 84 0 | ||
1069 | * 83 83 0 | ||
1070 | * 84 82 0 | ||
1071 | * 85 81 0 | ||
1072 | * 86 80 0 | ||
1073 | * 87 79 0 | ||
1074 | * 88 78 0 | ||
1075 | * 89 77 0 | ||
1076 | * 90 76 0 | ||
1077 | * 91 75 0 | ||
1078 | * 92 74 0 | ||
1079 | * 93 73 0 | ||
1080 | * 94 72 0 | ||
1081 | * 95 71 0 | ||
1082 | * 96 70 0 | ||
1083 | * 97 69 0 | ||
1084 | * 98 68 0 | ||
1085 | */ | ||
1086 | |||
1087 | /** | ||
1088 | * 5 GHz gain table | ||
1089 | * | ||
1090 | * Index Dsp gain Radio gain | ||
1091 | * -9 123 0x3F (highest gain) | ||
1092 | * -8 117 0x3F | ||
1093 | * -7 110 0x3F | ||
1094 | * -6 104 0x3F | ||
1095 | * -5 98 0x3F | ||
1096 | * -4 110 0x3E | ||
1097 | * -3 104 0x3E | ||
1098 | * -2 98 0x3E | ||
1099 | * -1 110 0x3D | ||
1100 | * 0 104 0x3D | ||
1101 | * 1 98 0x3D | ||
1102 | * 2 110 0x3C | ||
1103 | * 3 104 0x3C | ||
1104 | * 4 98 0x3C | ||
1105 | * 5 110 0x3B | ||
1106 | * 6 104 0x3B | ||
1107 | * 7 98 0x3B | ||
1108 | * 8 110 0x3A | ||
1109 | * 9 104 0x3A | ||
1110 | * 10 98 0x3A | ||
1111 | * 11 110 0x39 | ||
1112 | * 12 104 0x39 | ||
1113 | * 13 98 0x39 | ||
1114 | * 14 110 0x38 | ||
1115 | * 15 104 0x38 | ||
1116 | * 16 98 0x38 | ||
1117 | * 17 110 0x37 | ||
1118 | * 18 104 0x37 | ||
1119 | * 19 98 0x37 | ||
1120 | * 20 110 0x36 | ||
1121 | * 21 104 0x36 | ||
1122 | * 22 98 0x36 | ||
1123 | * 23 110 0x35 | ||
1124 | * 24 104 0x35 | ||
1125 | * 25 98 0x35 | ||
1126 | * 26 110 0x34 | ||
1127 | * 27 104 0x34 | ||
1128 | * 28 98 0x34 | ||
1129 | * 29 110 0x33 | ||
1130 | * 30 104 0x33 | ||
1131 | * 31 98 0x33 | ||
1132 | * 32 110 0x32 | ||
1133 | * 33 104 0x32 | ||
1134 | * 34 98 0x32 | ||
1135 | * 35 110 0x31 | ||
1136 | * 36 104 0x31 | ||
1137 | * 37 98 0x31 | ||
1138 | * 38 110 0x30 | ||
1139 | * 39 104 0x30 | ||
1140 | * 40 98 0x30 | ||
1141 | * 41 110 0x25 | ||
1142 | * 42 104 0x25 | ||
1143 | * 43 98 0x25 | ||
1144 | * 44 110 0x24 | ||
1145 | * 45 104 0x24 | ||
1146 | * 46 98 0x24 | ||
1147 | * 47 110 0x23 | ||
1148 | * 48 104 0x23 | ||
1149 | * 49 98 0x23 | ||
1150 | * 50 110 0x22 | ||
1151 | * 51 104 0x18 | ||
1152 | * 52 98 0x18 | ||
1153 | * 53 110 0x17 | ||
1154 | * 54 104 0x17 | ||
1155 | * 55 98 0x17 | ||
1156 | * 56 110 0x16 | ||
1157 | * 57 104 0x16 | ||
1158 | * 58 98 0x16 | ||
1159 | * 59 110 0x15 | ||
1160 | * 60 104 0x15 | ||
1161 | * 61 98 0x15 | ||
1162 | * 62 110 0x14 | ||
1163 | * 63 104 0x14 | ||
1164 | * 64 98 0x14 | ||
1165 | * 65 110 0x13 | ||
1166 | * 66 104 0x13 | ||
1167 | * 67 98 0x13 | ||
1168 | * 68 110 0x12 | ||
1169 | * 69 104 0x08 | ||
1170 | * 70 98 0x08 | ||
1171 | * 71 110 0x07 | ||
1172 | * 72 104 0x07 | ||
1173 | * 73 98 0x07 | ||
1174 | * 74 110 0x06 | ||
1175 | * 75 104 0x06 | ||
1176 | * 76 98 0x06 | ||
1177 | * 77 110 0x05 | ||
1178 | * 78 104 0x05 | ||
1179 | * 79 98 0x05 | ||
1180 | * 80 110 0x04 | ||
1181 | * 81 104 0x04 | ||
1182 | * 82 98 0x04 | ||
1183 | * 83 110 0x03 | ||
1184 | * 84 104 0x03 | ||
1185 | * 85 98 0x03 | ||
1186 | * 86 110 0x02 | ||
1187 | * 87 104 0x02 | ||
1188 | * 88 98 0x02 | ||
1189 | * 89 110 0x01 | ||
1190 | * 90 104 0x01 | ||
1191 | * 91 98 0x01 | ||
1192 | * 92 110 0x00 | ||
1193 | * 93 104 0x00 | ||
1194 | * 94 98 0x00 | ||
1195 | * 95 93 0x00 | ||
1196 | * 96 88 0x00 | ||
1197 | * 97 83 0x00 | ||
1198 | * 98 78 0x00 | ||
1199 | */ | ||
712 | 1200 | ||
1201 | |||
1202 | /** | ||
1203 | * Sanity checks and default values for EEPROM regulatory levels. | ||
1204 | * If EEPROM values fall outside MIN/MAX range, use default values. | ||
1205 | * | ||
1206 | * Regulatory limits refer to the maximum average txpower allowed by | ||
1207 | * regulatory agencies in the geographies in which the device is meant | ||
1208 | * to be operated. These limits are SKU-specific (i.e. geography-specific), | ||
1209 | * and channel-specific; each channel has an individual regulatory limit | ||
1210 | * listed in the EEPROM. | ||
1211 | * | ||
1212 | * Units are in half-dBm (i.e. "34" means 17 dBm). | ||
1213 | */ | ||
713 | #define IWL_TX_POWER_DEFAULT_REGULATORY_24 (34) | 1214 | #define IWL_TX_POWER_DEFAULT_REGULATORY_24 (34) |
714 | #define IWL_TX_POWER_DEFAULT_REGULATORY_52 (34) | 1215 | #define IWL_TX_POWER_DEFAULT_REGULATORY_52 (34) |
715 | #define IWL_TX_POWER_REGULATORY_MIN (0) | 1216 | #define IWL_TX_POWER_REGULATORY_MIN (0) |
716 | #define IWL_TX_POWER_REGULATORY_MAX (34) | 1217 | #define IWL_TX_POWER_REGULATORY_MAX (34) |
1218 | |||
1219 | /** | ||
1220 | * Sanity checks and default values for EEPROM saturation levels. | ||
1221 | * If EEPROM values fall outside MIN/MAX range, use default values. | ||
1222 | * | ||
1223 | * Saturation is the highest level that the output power amplifier can produce | ||
1224 | * without significant clipping distortion. This is a "peak" power level. | ||
1225 | * Different types of modulation (i.e. various "rates", and OFDM vs. CCK) | ||
1226 | * require differing amounts of backoff, relative to their average power output, | ||
1227 | * in order to avoid clipping distortion. | ||
1228 | * | ||
1229 | * Driver must make sure that it is violating neither the saturation limit, | ||
1230 | * nor the regulatory limit, when calculating Tx power settings for various | ||
1231 | * rates. | ||
1232 | * | ||
1233 | * Units are in half-dBm (i.e. "38" means 19 dBm). | ||
1234 | */ | ||
717 | #define IWL_TX_POWER_DEFAULT_SATURATION_24 (38) | 1235 | #define IWL_TX_POWER_DEFAULT_SATURATION_24 (38) |
718 | #define IWL_TX_POWER_DEFAULT_SATURATION_52 (38) | 1236 | #define IWL_TX_POWER_DEFAULT_SATURATION_52 (38) |
719 | #define IWL_TX_POWER_SATURATION_MIN (20) | 1237 | #define IWL_TX_POWER_SATURATION_MIN (20) |
720 | #define IWL_TX_POWER_SATURATION_MAX (50) | 1238 | #define IWL_TX_POWER_SATURATION_MAX (50) |
721 | 1239 | ||
722 | /* First and last channels of all groups */ | 1240 | /** |
1241 | * Channel groups used for Tx Attenuation calibration (MIMO tx channel balance) | ||
1242 | * and thermal Txpower calibration. | ||
1243 | * | ||
1244 | * When calculating txpower, driver must compensate for current device | ||
1245 | * temperature; higher temperature requires higher gain. Driver must calculate | ||
1246 | * current temperature (see "4965 temperature calculation"), then compare vs. | ||
1247 | * factory calibration temperature in EEPROM; if current temperature is higher | ||
1248 | * than factory temperature, driver must *increase* gain by proportions shown | ||
1249 | * in table below. If current temperature is lower than factory, driver must | ||
1250 | * *decrease* gain. | ||
1251 | * | ||
1252 | * Different frequency ranges require different compensation, as shown below. | ||
1253 | */ | ||
1254 | /* Group 0, 5.2 GHz ch 34-43: 4.5 degrees per 1/2 dB. */ | ||
723 | #define CALIB_IWL_TX_ATTEN_GR1_FCH 34 | 1255 | #define CALIB_IWL_TX_ATTEN_GR1_FCH 34 |
724 | #define CALIB_IWL_TX_ATTEN_GR1_LCH 43 | 1256 | #define CALIB_IWL_TX_ATTEN_GR1_LCH 43 |
1257 | |||
1258 | /* Group 1, 5.3 GHz ch 44-70: 4.0 degrees per 1/2 dB. */ | ||
725 | #define CALIB_IWL_TX_ATTEN_GR2_FCH 44 | 1259 | #define CALIB_IWL_TX_ATTEN_GR2_FCH 44 |
726 | #define CALIB_IWL_TX_ATTEN_GR2_LCH 70 | 1260 | #define CALIB_IWL_TX_ATTEN_GR2_LCH 70 |
1261 | |||
1262 | /* Group 2, 5.5 GHz ch 71-124: 4.0 degrees per 1/2 dB. */ | ||
727 | #define CALIB_IWL_TX_ATTEN_GR3_FCH 71 | 1263 | #define CALIB_IWL_TX_ATTEN_GR3_FCH 71 |
728 | #define CALIB_IWL_TX_ATTEN_GR3_LCH 124 | 1264 | #define CALIB_IWL_TX_ATTEN_GR3_LCH 124 |
1265 | |||
1266 | /* Group 3, 5.7 GHz ch 125-200: 4.0 degrees per 1/2 dB. */ | ||
729 | #define CALIB_IWL_TX_ATTEN_GR4_FCH 125 | 1267 | #define CALIB_IWL_TX_ATTEN_GR4_FCH 125 |
730 | #define CALIB_IWL_TX_ATTEN_GR4_LCH 200 | 1268 | #define CALIB_IWL_TX_ATTEN_GR4_LCH 200 |
1269 | |||
1270 | /* Group 4, 2.4 GHz all channels: 3.5 degrees per 1/2 dB. */ | ||
731 | #define CALIB_IWL_TX_ATTEN_GR5_FCH 1 | 1271 | #define CALIB_IWL_TX_ATTEN_GR5_FCH 1 |
732 | #define CALIB_IWL_TX_ATTEN_GR5_LCH 20 | 1272 | #define CALIB_IWL_TX_ATTEN_GR5_LCH 20 |
733 | 1273 | ||
1274 | enum { | ||
1275 | CALIB_CH_GROUP_1 = 0, | ||
1276 | CALIB_CH_GROUP_2 = 1, | ||
1277 | CALIB_CH_GROUP_3 = 2, | ||
1278 | CALIB_CH_GROUP_4 = 3, | ||
1279 | CALIB_CH_GROUP_5 = 4, | ||
1280 | CALIB_CH_GROUP_MAX | ||
1281 | }; | ||
1282 | |||
734 | /********************* END TXPOWER *****************************************/ | 1283 | /********************* END TXPOWER *****************************************/ |
735 | 1284 | ||
736 | /* Flow Handler Definitions */ | 1285 | /* Flow Handler Definitions */ |