diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/def.h | 135 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 15 |
2 files changed, 94 insertions, 56 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/def.h b/drivers/net/wireless/rtlwifi/rtl8192de/def.h index aff7e19714ff..946304771748 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/def.h +++ b/drivers/net/wireless/rtlwifi/rtl8192de/def.h | |||
@@ -122,59 +122,98 @@ | |||
122 | #define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \ | 122 | #define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \ |
123 | LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12) | 123 | LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12) |
124 | 124 | ||
125 | /* | 125 | enum version_8192d { |
126 | * 92D chip ver: | 126 | VERSION_TEST_CHIP_88C = 0x0000, |
127 | * BIT8: IS 92D | 127 | VERSION_TEST_CHIP_92C = 0x0020, |
128 | * BIT9: single phy | 128 | VERSION_TEST_UMC_CHIP_8723 = 0x0081, |
129 | * BIT10: C-cut | 129 | VERSION_NORMAL_TSMC_CHIP_88C = 0x0008, |
130 | * BIT11: D-cut | 130 | VERSION_NORMAL_TSMC_CHIP_92C = 0x0028, |
131 | */ | 131 | VERSION_NORMAL_TSMC_CHIP_92C_1T2R = 0x0018, |
132 | 132 | VERSION_NORMAL_UMC_CHIP_88C_A_CUT = 0x0088, | |
133 | /* Chip specific */ | 133 | VERSION_NORMAL_UMC_CHIP_92C_A_CUT = 0x00a8, |
134 | #define CHIP_92C BIT(0) | 134 | VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT = 0x0098, |
135 | #define CHIP_92C_1T2R BIT(1) | 135 | VERSION_NORMAL_UMC_CHIP_8723_1T1R_A_CUT = 0x0089, |
136 | #define CHIP_8723 BIT(2) /* RTL8723 With BT feature */ | 136 | VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT = 0x1089, |
137 | #define CHIP_8723_DRV_REV BIT(3) /* RTL8723 Driver Revised */ | 137 | VERSION_NORMAL_UMC_CHIP_88C_B_CUT = 0x1088, |
138 | #define NORMAL_CHIP BIT(4) | 138 | VERSION_NORMAL_UMC_CHIP_92C_B_CUT = 0x10a8, |
139 | #define CHIP_VENDOR_UMC BIT(5) | 139 | VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT = 0x1090, |
140 | #define CHIP_VENDOR_UMC_B_CUT BIT(6) /* Chip version for ECO */ | 140 | VERSION_TEST_CHIP_92D_SINGLEPHY = 0x0022, |
141 | VERSION_TEST_CHIP_92D_DUALPHY = 0x0002, | ||
142 | VERSION_NORMAL_CHIP_92D_SINGLEPHY = 0x002a, | ||
143 | VERSION_NORMAL_CHIP_92D_DUALPHY = 0x000a, | ||
144 | VERSION_NORMAL_CHIP_92D_C_CUT_SINGLEPHY = 0x202a, | ||
145 | VERSION_NORMAL_CHIP_92D_C_CUT_DUALPHY = 0x200a, | ||
146 | VERSION_NORMAL_CHIP_92D_D_CUT_SINGLEPHY = 0x302a, | ||
147 | VERSION_NORMAL_CHIP_92D_D_CUT_DUALPHY = 0x300a, | ||
148 | VERSION_NORMAL_CHIP_92D_E_CUT_SINGLEPHY = 0x402a, | ||
149 | VERSION_NORMAL_CHIP_92D_E_CUT_DUALPHY = 0x400a, | ||
150 | }; | ||
141 | 151 | ||
142 | /* for 92D */ | 152 | /* for 92D */ |
143 | #define CHIP_92D BIT(8) | ||
144 | #define CHIP_92D_SINGLEPHY BIT(9) | 153 | #define CHIP_92D_SINGLEPHY BIT(9) |
145 | #define CHIP_92D_C_CUT BIT(10) | 154 | #define C_CUT_VERSION BIT(13) |
146 | #define CHIP_92D_D_CUT BIT(11) | 155 | #define D_CUT_VERSION ((BIT(12)|BIT(13))) |
156 | #define E_CUT_VERSION BIT(14) | ||
157 | |||
158 | /* Chip specific */ | ||
159 | #define CHIP_BONDING_IDENTIFIER(_value) (((_value)>>22)&0x3) | ||
160 | #define CHIP_BONDING_92C_1T2R 0x1 | ||
161 | #define CHIP_BONDING_88C_USB_MCARD 0x2 | ||
162 | #define CHIP_BONDING_88C_USB_HP 0x1 | ||
163 | |||
164 | /* [15:12] IC version(CUT): A-cut=0, B-cut=1, C-cut=2, D-cut=3 */ | ||
165 | /* [7] Manufacturer: TSMC=0, UMC=1 */ | ||
166 | /* [6:4] RF type: 1T1R=0, 1T2R=1, 2T2R=2 */ | ||
167 | /* [3] Chip type: TEST=0, NORMAL=1 */ | ||
168 | /* [2:0] IC type: 81xxC=0, 8723=1, 92D=2 */ | ||
169 | #define CHIP_8723 BIT(0) | ||
170 | #define CHIP_92D BIT(1) | ||
171 | #define NORMAL_CHIP BIT(3) | ||
172 | #define RF_TYPE_1T1R (~(BIT(4)|BIT(5)|BIT(6))) | ||
173 | #define RF_TYPE_1T2R BIT(4) | ||
174 | #define RF_TYPE_2T2R BIT(5) | ||
175 | #define CHIP_VENDOR_UMC BIT(7) | ||
176 | #define B_CUT_VERSION BIT(12) | ||
177 | |||
178 | /* MASK */ | ||
179 | #define IC_TYPE_MASK (BIT(0)|BIT(1)|BIT(2)) | ||
180 | #define CHIP_TYPE_MASK BIT(3) | ||
181 | #define RF_TYPE_MASK (BIT(4)|BIT(5)|BIT(6)) | ||
182 | #define MANUFACTUER_MASK BIT(7) | ||
183 | #define ROM_VERSION_MASK (BIT(11)|BIT(10)|BIT(9)|BIT(8)) | ||
184 | #define CUT_VERSION_MASK (BIT(15)|BIT(14)|BIT(13)|BIT(12)) | ||
147 | 185 | ||
148 | enum version_8192d { | ||
149 | VERSION_TEST_CHIP_88C = 0x00, | ||
150 | VERSION_TEST_CHIP_92C = 0x01, | ||
151 | VERSION_NORMAL_TSMC_CHIP_88C = 0x10, | ||
152 | VERSION_NORMAL_TSMC_CHIP_92C = 0x11, | ||
153 | VERSION_NORMAL_TSMC_CHIP_92C_1T2R = 0x13, | ||
154 | VERSION_NORMAL_UMC_CHIP_88C_A_CUT = 0x30, | ||
155 | VERSION_NORMAL_UMC_CHIP_92C_A_CUT = 0x31, | ||
156 | VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT = 0x33, | ||
157 | VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT = 0x34, | ||
158 | VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT = 0x3c, | ||
159 | VERSION_NORMAL_UMC_CHIP_88C_B_CUT = 0x70, | ||
160 | VERSION_NORMAL_UMC_CHIP_92C_B_CUT = 0x71, | ||
161 | VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT = 0x73, | ||
162 | VERSION_TEST_CHIP_92D_SINGLEPHY = 0x300, | ||
163 | VERSION_TEST_CHIP_92D_DUALPHY = 0x100, | ||
164 | VERSION_NORMAL_CHIP_92D_SINGLEPHY = 0x310, | ||
165 | VERSION_NORMAL_CHIP_92D_DUALPHY = 0x110, | ||
166 | VERSION_NORMAL_CHIP_92D_C_CUT_SINGLEPHY = 0x710, | ||
167 | VERSION_NORMAL_CHIP_92D_C_CUT_DUALPHY = 0x510, | ||
168 | VERSION_NORMAL_CHIP_92D_D_CUT_SINGLEPHY = 0xB10, | ||
169 | VERSION_NORMAL_CHIP_92D_D_CUT_DUALPHY = 0x910, | ||
170 | }; | ||
171 | 186 | ||
172 | #define IS_92D_SINGLEPHY(version) \ | 187 | /* Get element */ |
173 | ((version & CHIP_92D_SINGLEPHY) ? true : false) | 188 | #define GET_CVID_IC_TYPE(version) ((version) & IC_TYPE_MASK) |
174 | #define IS_92D_C_CUT(version) \ | 189 | #define GET_CVID_CHIP_TYPE(version) ((version) & CHIP_TYPE_MASK) |
175 | ((version & CHIP_92D_C_CUT) ? true : false) | 190 | #define GET_CVID_RF_TYPE(version) ((version) & RF_TYPE_MASK) |
176 | #define IS_92D_D_CUT(version) \ | 191 | #define GET_CVID_MANUFACTUER(version) ((version) & MANUFACTUER_MASK) |
177 | ((version & CHIP_92D_D_CUT) ? true : false) | 192 | #define GET_CVID_ROM_VERSION(version) ((version) & ROM_VERSION_MASK) |
193 | #define GET_CVID_CUT_VERSION(version) ((version) & CUT_VERSION_MASK) | ||
194 | |||
195 | #define IS_1T1R(version) ((GET_CVID_RF_TYPE(version)) ? \ | ||
196 | false : true) | ||
197 | #define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == \ | ||
198 | RF_TYPE_1T2R) ? true : false) | ||
199 | #define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == \ | ||
200 | RF_TYPE_2T2R) ? true : false) | ||
201 | |||
202 | #define IS_92D_SINGLEPHY(version) ((IS_92D(version)) ? \ | ||
203 | (IS_2T2R(version) ? true : false) : false) | ||
204 | #define IS_92D(version) ((GET_CVID_IC_TYPE(version) == \ | ||
205 | CHIP_92D) ? true : false) | ||
206 | #define IS_92D_C_CUT(version) ((IS_92D(version)) ? \ | ||
207 | ((GET_CVID_CUT_VERSION(version) == \ | ||
208 | 0x2000) ? true : false) : false) | ||
209 | #define IS_92D_D_CUT(version) ((IS_92D(version)) ? \ | ||
210 | ((GET_CVID_CUT_VERSION(version) == \ | ||
211 | 0x3000) ? true : false) : false) | ||
212 | #define IS_92D_E_CUT(version) ((IS_92D(version)) ? \ | ||
213 | ((GET_CVID_CUT_VERSION(version) == \ | ||
214 | 0x4000) ? true : false) : false) | ||
215 | #define CHIP_92D_C_CUT BIT(10) | ||
216 | #define CHIP_92D_D_CUT BIT(11) | ||
178 | 217 | ||
179 | enum rf_optype { | 218 | enum rf_optype { |
180 | RF_OP_BY_SW_3WIRE = 0, | 219 | RF_OP_BY_SW_3WIRE = 0, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c index 0073cf106af2..f5bd3a3cd34a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c | |||
@@ -1608,17 +1608,16 @@ static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw, | |||
1608 | tempval[0] = hwinfo[EEPROM_IQK_DELTA] & 0x03; | 1608 | tempval[0] = hwinfo[EEPROM_IQK_DELTA] & 0x03; |
1609 | tempval[1] = (hwinfo[EEPROM_LCK_DELTA] & 0x0C) >> 2; | 1609 | tempval[1] = (hwinfo[EEPROM_LCK_DELTA] & 0x0C) >> 2; |
1610 | rtlefuse->txpwr_fromeprom = true; | 1610 | rtlefuse->txpwr_fromeprom = true; |
1611 | if (IS_92D_D_CUT(rtlpriv->rtlhal.version)) { | 1611 | if (IS_92D_D_CUT(rtlpriv->rtlhal.version) || |
1612 | IS_92D_E_CUT(rtlpriv->rtlhal.version)) { | ||
1612 | rtlefuse->internal_pa_5g[0] = | 1613 | rtlefuse->internal_pa_5g[0] = |
1613 | !((hwinfo[EEPROM_TSSI_A_5G] & | 1614 | !((hwinfo[EEPROM_TSSI_A_5G] & BIT(6)) >> 6); |
1614 | BIT(6)) >> 6); | ||
1615 | rtlefuse->internal_pa_5g[1] = | 1615 | rtlefuse->internal_pa_5g[1] = |
1616 | !((hwinfo[EEPROM_TSSI_B_5G] & | 1616 | !((hwinfo[EEPROM_TSSI_B_5G] & BIT(6)) >> 6); |
1617 | BIT(6)) >> 6); | 1617 | RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, |
1618 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1619 | ("Is D cut,Internal PA0 %d Internal PA1 %d\n", | 1618 | ("Is D cut,Internal PA0 %d Internal PA1 %d\n", |
1620 | rtlefuse->internal_pa_5g[0], | 1619 | rtlefuse->internal_pa_5g[0], |
1621 | rtlefuse->internal_pa_5g[1])) | 1620 | rtlefuse->internal_pa_5g[1])) |
1622 | } | 1621 | } |
1623 | rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6]; | 1622 | rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6]; |
1624 | rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7]; | 1623 | rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7]; |