diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192cu')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/phy.c | 71 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.h | 2 |
4 files changed, 36 insertions, 70 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c index 468bf73cc883..68b5c7e92cfb 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | |||
@@ -394,7 +394,7 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw) | |||
394 | if (rtlefuse->eeprom_did == 0x8176) { | 394 | if (rtlefuse->eeprom_did == 0x8176) { |
395 | if ((rtlefuse->eeprom_svid == 0x103C && | 395 | if ((rtlefuse->eeprom_svid == 0x103C && |
396 | rtlefuse->eeprom_smid == 0x1629)) | 396 | rtlefuse->eeprom_smid == 0x1629)) |
397 | rtlhal->oem_id = RT_CID_819x_HP; | 397 | rtlhal->oem_id = RT_CID_819X_HP; |
398 | else | 398 | else |
399 | rtlhal->oem_id = RT_CID_DEFAULT; | 399 | rtlhal->oem_id = RT_CID_DEFAULT; |
400 | } else { | 400 | } else { |
@@ -405,7 +405,7 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw) | |||
405 | rtlhal->oem_id = RT_CID_TOSHIBA; | 405 | rtlhal->oem_id = RT_CID_TOSHIBA; |
406 | break; | 406 | break; |
407 | case EEPROM_CID_QMI: | 407 | case EEPROM_CID_QMI: |
408 | rtlhal->oem_id = RT_CID_819x_QMI; | 408 | rtlhal->oem_id = RT_CID_819X_QMI; |
409 | break; | 409 | break; |
410 | case EEPROM_CID_WHQL: | 410 | case EEPROM_CID_WHQL: |
411 | default: | 411 | default: |
@@ -423,14 +423,14 @@ static void _rtl92cu_hal_customized_behavior(struct ieee80211_hw *hw) | |||
423 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 423 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
424 | 424 | ||
425 | switch (rtlhal->oem_id) { | 425 | switch (rtlhal->oem_id) { |
426 | case RT_CID_819x_HP: | 426 | case RT_CID_819X_HP: |
427 | usb_priv->ledctl.led_opendrain = true; | 427 | usb_priv->ledctl.led_opendrain = true; |
428 | break; | 428 | break; |
429 | case RT_CID_819x_Lenovo: | 429 | case RT_CID_819X_LENOVO: |
430 | case RT_CID_DEFAULT: | 430 | case RT_CID_DEFAULT: |
431 | case RT_CID_TOSHIBA: | 431 | case RT_CID_TOSHIBA: |
432 | case RT_CID_CCX: | 432 | case RT_CID_CCX: |
433 | case RT_CID_819x_Acer: | 433 | case RT_CID_819X_ACER: |
434 | case RT_CID_WHQL: | 434 | case RT_CID_WHQL: |
435 | default: | 435 | default: |
436 | break; | 436 | break; |
@@ -985,6 +985,17 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) | |||
985 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 985 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
986 | int err = 0; | 986 | int err = 0; |
987 | static bool iqk_initialized; | 987 | static bool iqk_initialized; |
988 | unsigned long flags; | ||
989 | |||
990 | /* As this function can take a very long time (up to 350 ms) | ||
991 | * and can be called with irqs disabled, reenable the irqs | ||
992 | * to let the other devices continue being serviced. | ||
993 | * | ||
994 | * It is safe doing so since our own interrupts will only be enabled | ||
995 | * in a subsequent step. | ||
996 | */ | ||
997 | local_save_flags(flags); | ||
998 | local_irq_enable(); | ||
988 | 999 | ||
989 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU; | 1000 | rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU; |
990 | err = _rtl92cu_init_mac(hw); | 1001 | err = _rtl92cu_init_mac(hw); |
@@ -997,7 +1008,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) | |||
997 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | 1008 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, |
998 | "Failed to download FW. Init HW without FW now..\n"); | 1009 | "Failed to download FW. Init HW without FW now..\n"); |
999 | err = 1; | 1010 | err = 1; |
1000 | return err; | 1011 | goto exit; |
1001 | } | 1012 | } |
1002 | rtlhal->last_hmeboxnum = 0; /* h2c */ | 1013 | rtlhal->last_hmeboxnum = 0; /* h2c */ |
1003 | _rtl92cu_phy_param_tab_init(hw); | 1014 | _rtl92cu_phy_param_tab_init(hw); |
@@ -1034,6 +1045,8 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) | |||
1034 | _InitPABias(hw); | 1045 | _InitPABias(hw); |
1035 | _update_mac_setting(hw); | 1046 | _update_mac_setting(hw); |
1036 | rtl92c_dm_init(hw); | 1047 | rtl92c_dm_init(hw); |
1048 | exit: | ||
1049 | local_irq_restore(flags); | ||
1037 | return err; | 1050 | return err; |
1038 | } | 1051 | } |
1039 | 1052 | ||
@@ -1379,11 +1392,13 @@ void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid) | |||
1379 | { | 1392 | { |
1380 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1393 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1381 | struct rtl_hal *rtlhal = rtl_hal(rtlpriv); | 1394 | struct rtl_hal *rtlhal = rtl_hal(rtlpriv); |
1382 | u32 reg_rcr = rtl_read_dword(rtlpriv, REG_RCR); | 1395 | u32 reg_rcr; |
1383 | 1396 | ||
1384 | if (rtlpriv->psc.rfpwr_state != ERFON) | 1397 | if (rtlpriv->psc.rfpwr_state != ERFON) |
1385 | return; | 1398 | return; |
1386 | 1399 | ||
1400 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RCR, (u8 *)(®_rcr)); | ||
1401 | |||
1387 | if (check_bssid) { | 1402 | if (check_bssid) { |
1388 | u8 tmp; | 1403 | u8 tmp; |
1389 | if (IS_NORMAL_CHIP(rtlhal->version)) { | 1404 | if (IS_NORMAL_CHIP(rtlhal->version)) { |
@@ -1795,7 +1810,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
1795 | e_aci); | 1810 | e_aci); |
1796 | break; | 1811 | break; |
1797 | } | 1812 | } |
1798 | if (rtlusb->acm_method != eAcmWay2_SW) | 1813 | if (rtlusb->acm_method != EACMWAY2_SW) |
1799 | rtlpriv->cfg->ops->set_hw_reg(hw, | 1814 | rtlpriv->cfg->ops->set_hw_reg(hw, |
1800 | HW_VAR_ACM_CTRL, &e_aci); | 1815 | HW_VAR_ACM_CTRL, &e_aci); |
1801 | break; | 1816 | break; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c index 0c09240eadcc..9831ff1128ca 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "../wifi.h" | 30 | #include "../wifi.h" |
31 | #include "../pci.h" | 31 | #include "../pci.h" |
32 | #include "../ps.h" | 32 | #include "../ps.h" |
33 | #include "../core.h" | ||
33 | #include "reg.h" | 34 | #include "reg.h" |
34 | #include "def.h" | 35 | #include "def.h" |
35 | #include "phy.h" | 36 | #include "phy.h" |
@@ -188,18 +189,7 @@ bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, | |||
188 | } | 189 | } |
189 | if (configtype == BASEBAND_CONFIG_PHY_REG) { | 190 | if (configtype == BASEBAND_CONFIG_PHY_REG) { |
190 | for (i = 0; i < phy_reg_arraylen; i = i + 2) { | 191 | for (i = 0; i < phy_reg_arraylen; i = i + 2) { |
191 | if (phy_regarray_table[i] == 0xfe) | 192 | rtl_addr_delay(phy_regarray_table[i]); |
192 | mdelay(50); | ||
193 | else if (phy_regarray_table[i] == 0xfd) | ||
194 | mdelay(5); | ||
195 | else if (phy_regarray_table[i] == 0xfc) | ||
196 | mdelay(1); | ||
197 | else if (phy_regarray_table[i] == 0xfb) | ||
198 | udelay(50); | ||
199 | else if (phy_regarray_table[i] == 0xfa) | ||
200 | udelay(5); | ||
201 | else if (phy_regarray_table[i] == 0xf9) | ||
202 | udelay(1); | ||
203 | rtl_set_bbreg(hw, phy_regarray_table[i], MASKDWORD, | 193 | rtl_set_bbreg(hw, phy_regarray_table[i], MASKDWORD, |
204 | phy_regarray_table[i + 1]); | 194 | phy_regarray_table[i + 1]); |
205 | udelay(1); | 195 | udelay(1); |
@@ -236,18 +226,7 @@ bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, | |||
236 | phy_regarray_table_pg = rtlphy->hwparam_tables[PHY_REG_PG].pdata; | 226 | phy_regarray_table_pg = rtlphy->hwparam_tables[PHY_REG_PG].pdata; |
237 | if (configtype == BASEBAND_CONFIG_PHY_REG) { | 227 | if (configtype == BASEBAND_CONFIG_PHY_REG) { |
238 | for (i = 0; i < phy_regarray_pg_len; i = i + 3) { | 228 | for (i = 0; i < phy_regarray_pg_len; i = i + 3) { |
239 | if (phy_regarray_table_pg[i] == 0xfe) | 229 | rtl_addr_delay(phy_regarray_table_pg[i]); |
240 | mdelay(50); | ||
241 | else if (phy_regarray_table_pg[i] == 0xfd) | ||
242 | mdelay(5); | ||
243 | else if (phy_regarray_table_pg[i] == 0xfc) | ||
244 | mdelay(1); | ||
245 | else if (phy_regarray_table_pg[i] == 0xfb) | ||
246 | udelay(50); | ||
247 | else if (phy_regarray_table_pg[i] == 0xfa) | ||
248 | udelay(5); | ||
249 | else if (phy_regarray_table_pg[i] == 0xf9) | ||
250 | udelay(1); | ||
251 | _rtl92c_store_pwrIndex_diffrate_offset(hw, | 230 | _rtl92c_store_pwrIndex_diffrate_offset(hw, |
252 | phy_regarray_table_pg[i], | 231 | phy_regarray_table_pg[i], |
253 | phy_regarray_table_pg[i + 1], | 232 | phy_regarray_table_pg[i + 1], |
@@ -294,46 +273,16 @@ bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | |||
294 | switch (rfpath) { | 273 | switch (rfpath) { |
295 | case RF90_PATH_A: | 274 | case RF90_PATH_A: |
296 | for (i = 0; i < radioa_arraylen; i = i + 2) { | 275 | for (i = 0; i < radioa_arraylen; i = i + 2) { |
297 | if (radioa_array_table[i] == 0xfe) | 276 | rtl_rfreg_delay(hw, rfpath, radioa_array_table[i], |
298 | mdelay(50); | 277 | RFREG_OFFSET_MASK, |
299 | else if (radioa_array_table[i] == 0xfd) | 278 | radioa_array_table[i + 1]); |
300 | mdelay(5); | ||
301 | else if (radioa_array_table[i] == 0xfc) | ||
302 | mdelay(1); | ||
303 | else if (radioa_array_table[i] == 0xfb) | ||
304 | udelay(50); | ||
305 | else if (radioa_array_table[i] == 0xfa) | ||
306 | udelay(5); | ||
307 | else if (radioa_array_table[i] == 0xf9) | ||
308 | udelay(1); | ||
309 | else { | ||
310 | rtl_set_rfreg(hw, rfpath, radioa_array_table[i], | ||
311 | RFREG_OFFSET_MASK, | ||
312 | radioa_array_table[i + 1]); | ||
313 | udelay(1); | ||
314 | } | ||
315 | } | 279 | } |
316 | break; | 280 | break; |
317 | case RF90_PATH_B: | 281 | case RF90_PATH_B: |
318 | for (i = 0; i < radiob_arraylen; i = i + 2) { | 282 | for (i = 0; i < radiob_arraylen; i = i + 2) { |
319 | if (radiob_array_table[i] == 0xfe) { | 283 | rtl_rfreg_delay(hw, rfpath, radiob_array_table[i], |
320 | mdelay(50); | 284 | RFREG_OFFSET_MASK, |
321 | } else if (radiob_array_table[i] == 0xfd) | 285 | radiob_array_table[i + 1]); |
322 | mdelay(5); | ||
323 | else if (radiob_array_table[i] == 0xfc) | ||
324 | mdelay(1); | ||
325 | else if (radiob_array_table[i] == 0xfb) | ||
326 | udelay(50); | ||
327 | else if (radiob_array_table[i] == 0xfa) | ||
328 | udelay(5); | ||
329 | else if (radiob_array_table[i] == 0xf9) | ||
330 | udelay(1); | ||
331 | else { | ||
332 | rtl_set_rfreg(hw, rfpath, radiob_array_table[i], | ||
333 | RFREG_OFFSET_MASK, | ||
334 | radiob_array_table[i + 1]); | ||
335 | udelay(1); | ||
336 | } | ||
337 | } | 286 | } |
338 | break; | 287 | break; |
339 | case RF90_PATH_C: | 288 | case RF90_PATH_C: |
@@ -344,6 +293,8 @@ bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, | |||
344 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 293 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
345 | "switch case not processed\n"); | 294 | "switch case not processed\n"); |
346 | break; | 295 | break; |
296 | default: | ||
297 | break; | ||
347 | } | 298 | } |
348 | return true; | 299 | return true; |
349 | } | 300 | } |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 1bc21ccfa71b..035e0dc3922c 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -495,7 +495,7 @@ static void _rtl_tx_desc_checksum(u8 *txdesc) | |||
495 | 495 | ||
496 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, | 496 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, |
497 | struct ieee80211_hdr *hdr, u8 *pdesc_tx, | 497 | struct ieee80211_hdr *hdr, u8 *pdesc_tx, |
498 | struct ieee80211_tx_info *info, | 498 | u8 *pbd_desc_tx, struct ieee80211_tx_info *info, |
499 | struct ieee80211_sta *sta, | 499 | struct ieee80211_sta *sta, |
500 | struct sk_buff *skb, | 500 | struct sk_buff *skb, |
501 | u8 queue_index, | 501 | u8 queue_index, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h index 725c53accc58..fd8051dcd98a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h | |||
@@ -420,7 +420,7 @@ struct sk_buff *rtl8192c_tx_aggregate_hdl(struct ieee80211_hw *, | |||
420 | struct sk_buff_head *); | 420 | struct sk_buff_head *); |
421 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, | 421 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, |
422 | struct ieee80211_hdr *hdr, u8 *pdesc_tx, | 422 | struct ieee80211_hdr *hdr, u8 *pdesc_tx, |
423 | struct ieee80211_tx_info *info, | 423 | u8 *pbd_desc_tx, struct ieee80211_tx_info *info, |
424 | struct ieee80211_sta *sta, | 424 | struct ieee80211_sta *sta, |
425 | struct sk_buff *skb, | 425 | struct sk_buff *skb, |
426 | u8 queue_index, | 426 | u8 queue_index, |