aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r--drivers/net/wireless/rtlwifi/base.c56
-rw-r--r--drivers/net/wireless/rtlwifi/cam.c81
-rw-r--r--drivers/net/wireless/rtlwifi/core.c120
-rw-r--r--drivers/net/wireless/rtlwifi/debug.h7
-rw-r--r--drivers/net/wireless/rtlwifi/efuse.c31
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c196
-rw-r--r--drivers/net/wireless/rtlwifi/ps.c31
-rw-r--r--drivers/net/wireless/rtlwifi/rc.c2
-rw-r--r--drivers/net/wireless/rtlwifi/regd.c12
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c189
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c69
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c201
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/dm.c24
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/hw.c182
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/led.c16
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/phy.c108
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/rf.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/sw.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/dm.c24
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/hw.c179
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/led.c15
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/mac.c101
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/phy.c121
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/rf.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c36
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/dm.c239
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/fw.c103
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/hw.c182
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/led.c14
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/phy.c419
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/rf.c26
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/sw.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.c8
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/dm.c30
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/fw.c66
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/hw.c155
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/led.c15
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/phy.c200
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/rf.c60
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/sw.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c2
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c37
44 files changed, 1613 insertions, 1784 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 8d6eb0f56c03..fa16b1d708fe 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -211,7 +211,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
211 */ 211 */
212 if (get_rf_type(rtlphy) == RF_1T2R || get_rf_type(rtlphy) == RF_2T2R) { 212 if (get_rf_type(rtlphy) == RF_1T2R || get_rf_type(rtlphy) == RF_2T2R) {
213 213
214 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("1T2R or 2T2R\n")); 214 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "1T2R or 2T2R\n");
215 215
216 ht_cap->mcs.rx_mask[0] = 0xFF; 216 ht_cap->mcs.rx_mask[0] = 0xFF;
217 ht_cap->mcs.rx_mask[1] = 0xFF; 217 ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -220,7 +220,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
220 ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15); 220 ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15);
221 } else if (get_rf_type(rtlphy) == RF_1T1R) { 221 } else if (get_rf_type(rtlphy) == RF_1T1R) {
222 222
223 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("1T1R\n")); 223 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "1T1R\n");
224 224
225 ht_cap->mcs.rx_mask[0] = 0xFF; 225 ht_cap->mcs.rx_mask[0] = 0xFF;
226 ht_cap->mcs.rx_mask[1] = 0x00; 226 ht_cap->mcs.rx_mask[1] = 0x00;
@@ -302,9 +302,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
302 /* <4> set mac->sband to wiphy->sband */ 302 /* <4> set mac->sband to wiphy->sband */
303 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband; 303 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
304 } else { 304 } else {
305 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 305 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
306 ("Err BAND %d\n", 306 rtlhal->current_bandtype);
307 rtlhal->current_bandtype));
308 } 307 }
309 } 308 }
310 /* <5> set hw caps */ 309 /* <5> set hw caps */
@@ -436,13 +435,13 @@ int rtl_init_core(struct ieee80211_hw *hw)
436 * mac80211 hw in _rtl_init_mac80211. 435 * mac80211 hw in _rtl_init_mac80211.
437 */ 436 */
438 if (rtl_regd_init(hw, rtl_reg_notifier)) { 437 if (rtl_regd_init(hw, rtl_reg_notifier)) {
439 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("REGD init failed\n")); 438 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
440 return 1; 439 return 1;
441 } else { 440 } else {
442 /* CRDA regd hint must after init CRDA */ 441 /* CRDA regd hint must after init CRDA */
443 if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) { 442 if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) {
444 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 443 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
445 ("regulatory_hint fail\n")); 444 "regulatory_hint fail\n");
446 } 445 }
447 } 446 }
448 447
@@ -922,17 +921,17 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
922 return false; 921 return false;
923 922
924 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 923 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
925 ("%s ACT_ADDBAREQ From :%pM\n", 924 "%s ACT_ADDBAREQ From :%pM\n",
926 is_tx ? "Tx" : "Rx", hdr->addr2)); 925 is_tx ? "Tx" : "Rx", hdr->addr2);
927 break; 926 break;
928 case ACT_ADDBARSP: 927 case ACT_ADDBARSP:
929 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 928 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
930 ("%s ACT_ADDBARSP From :%pM\n", 929 "%s ACT_ADDBARSP From :%pM\n",
931 is_tx ? "Tx" : "Rx", hdr->addr2)); 930 is_tx ? "Tx" : "Rx", hdr->addr2);
932 break; 931 break;
933 case ACT_DELBA: 932 case ACT_DELBA:
934 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 933 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
935 ("ACT_ADDBADEL From :%pM\n", hdr->addr2)); 934 "ACT_ADDBADEL From :%pM\n", hdr->addr2);
936 break; 935 break;
937 } 936 }
938 break; 937 break;
@@ -975,8 +974,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
975 * 67 : UDP BOOTP server 974 * 67 : UDP BOOTP server
976 */ 975 */
977 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), 976 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV),
978 DBG_DMESG, ("dhcp %s !!\n", 977 DBG_DMESG, "dhcp %s !!\n",
979 (is_tx) ? "Tx" : "Rx")); 978 is_tx ? "Tx" : "Rx");
980 979
981 if (is_tx) { 980 if (is_tx) {
982 rtl_lps_leave(hw); 981 rtl_lps_leave(hw);
@@ -996,7 +995,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
996 return true; 995 return true;
997 } else if (ETH_P_PAE == ether_type) { 996 } else if (ETH_P_PAE == ether_type) {
998 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG, 997 RT_TRACE(rtlpriv, (COMP_SEND | COMP_RECV), DBG_DMESG,
999 ("802.1X %s EAPOL pkt!!\n", (is_tx) ? "Tx" : "Rx")); 998 "802.1X %s EAPOL pkt!!\n", is_tx ? "Tx" : "Rx");
1000 999
1001 if (is_tx) { 1000 if (is_tx) {
1002 rtl_lps_leave(hw); 1001 rtl_lps_leave(hw);
@@ -1036,9 +1035,8 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw,
1036 return -ENXIO; 1035 return -ENXIO;
1037 tid_data = &sta_entry->tids[tid]; 1036 tid_data = &sta_entry->tids[tid];
1038 1037
1039 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, 1038 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "on ra = %pM tid = %d seq:%d\n",
1040 ("on ra = %pM tid = %d seq:%d\n", sta->addr, tid, 1039 sta->addr, tid, tid_data->seq_number);
1041 tid_data->seq_number));
1042 1040
1043 *ssn = tid_data->seq_number; 1041 *ssn = tid_data->seq_number;
1044 tid_data->agg.agg_state = RTL_AGG_START; 1042 tid_data->agg.agg_state = RTL_AGG_START;
@@ -1059,12 +1057,12 @@ int rtl_tx_agg_stop(struct ieee80211_hw *hw,
1059 return -EINVAL; 1057 return -EINVAL;
1060 1058
1061 if (!sta->addr) { 1059 if (!sta->addr) {
1062 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("ra = NULL\n")); 1060 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "ra = NULL\n");
1063 return -EINVAL; 1061 return -EINVAL;
1064 } 1062 }
1065 1063
1066 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, 1064 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "on ra = %pM tid = %d\n",
1067 ("on ra = %pM tid = %d\n", sta->addr, tid)); 1065 sta->addr, tid);
1068 1066
1069 if (unlikely(tid >= MAX_TID_COUNT)) 1067 if (unlikely(tid >= MAX_TID_COUNT))
1070 return -EINVAL; 1068 return -EINVAL;
@@ -1087,12 +1085,12 @@ int rtl_tx_agg_oper(struct ieee80211_hw *hw,
1087 return -EINVAL; 1085 return -EINVAL;
1088 1086
1089 if (!sta->addr) { 1087 if (!sta->addr) {
1090 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("ra = NULL\n")); 1088 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "ra = NULL\n");
1091 return -EINVAL; 1089 return -EINVAL;
1092 } 1090 }
1093 1091
1094 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, 1092 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "on ra = %pM tid = %d\n",
1095 ("on ra = %pM tid = %d\n", sta->addr, tid)); 1093 sta->addr, tid);
1096 1094
1097 if (unlikely(tid >= MAX_TID_COUNT)) 1095 if (unlikely(tid >= MAX_TID_COUNT))
1098 return -EINVAL; 1096 return -EINVAL;
@@ -1474,29 +1472,29 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len)
1474 (memcmp(mac->bssid, ap5_6, 3) == 0) || 1472 (memcmp(mac->bssid, ap5_6, 3) == 0) ||
1475 vendor == PEER_ATH) { 1473 vendor == PEER_ATH) {
1476 vendor = PEER_ATH; 1474 vendor = PEER_ATH;
1477 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>ath find\n")); 1475 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>ath find\n");
1478 } else if ((memcmp(mac->bssid, ap4_4, 3) == 0) || 1476 } else if ((memcmp(mac->bssid, ap4_4, 3) == 0) ||
1479 (memcmp(mac->bssid, ap4_5, 3) == 0) || 1477 (memcmp(mac->bssid, ap4_5, 3) == 0) ||
1480 (memcmp(mac->bssid, ap4_1, 3) == 0) || 1478 (memcmp(mac->bssid, ap4_1, 3) == 0) ||
1481 (memcmp(mac->bssid, ap4_2, 3) == 0) || 1479 (memcmp(mac->bssid, ap4_2, 3) == 0) ||
1482 (memcmp(mac->bssid, ap4_3, 3) == 0) || 1480 (memcmp(mac->bssid, ap4_3, 3) == 0) ||
1483 vendor == PEER_RAL) { 1481 vendor == PEER_RAL) {
1484 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>ral findn\n")); 1482 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>ral find\n");
1485 vendor = PEER_RAL; 1483 vendor = PEER_RAL;
1486 } else if (memcmp(mac->bssid, ap6_1, 3) == 0 || 1484 } else if (memcmp(mac->bssid, ap6_1, 3) == 0 ||
1487 vendor == PEER_CISCO) { 1485 vendor == PEER_CISCO) {
1488 vendor = PEER_CISCO; 1486 vendor = PEER_CISCO;
1489 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>cisco find\n")); 1487 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>cisco find\n");
1490 } else if ((memcmp(mac->bssid, ap3_1, 3) == 0) || 1488 } else if ((memcmp(mac->bssid, ap3_1, 3) == 0) ||
1491 (memcmp(mac->bssid, ap3_2, 3) == 0) || 1489 (memcmp(mac->bssid, ap3_2, 3) == 0) ||
1492 (memcmp(mac->bssid, ap3_3, 3) == 0) || 1490 (memcmp(mac->bssid, ap3_3, 3) == 0) ||
1493 vendor == PEER_BROAD) { 1491 vendor == PEER_BROAD) {
1494 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>broad find\n")); 1492 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>broad find\n");
1495 vendor = PEER_BROAD; 1493 vendor = PEER_BROAD;
1496 } else if (memcmp(mac->bssid, ap7_1, 3) == 0 || 1494 } else if (memcmp(mac->bssid, ap7_1, 3) == 0 ||
1497 vendor == PEER_MARV) { 1495 vendor == PEER_MARV) {
1498 vendor = PEER_MARV; 1496 vendor = PEER_MARV;
1499 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("=>marv find\n")); 1497 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "=>marv find\n");
1500 } 1498 }
1501 1499
1502 mac->vendor = vendor; 1500 mac->vendor = vendor;
diff --git a/drivers/net/wireless/rtlwifi/cam.c b/drivers/net/wireless/rtlwifi/cam.c
index dc36d7461caa..cbf5e3cdb44e 100644
--- a/drivers/net/wireless/rtlwifi/cam.c
+++ b/drivers/net/wireless/rtlwifi/cam.c
@@ -55,10 +55,10 @@ static void rtl_cam_program_entry(struct ieee80211_hw *hw, u32 entry_no,
55 u8 entry_i; 55 u8 entry_i;
56 56
57 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 57 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
58 ("key_cont_128:\n %x:%x:%x:%x:%x:%x\n", 58 "key_cont_128:\n %x:%x:%x:%x:%x:%x\n",
59 key_cont_128[0], key_cont_128[1], 59 key_cont_128[0], key_cont_128[1],
60 key_cont_128[2], key_cont_128[3], 60 key_cont_128[2], key_cont_128[3],
61 key_cont_128[4], key_cont_128[5])); 61 key_cont_128[4], key_cont_128[5]);
62 62
63 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) { 63 for (entry_i = 0; entry_i < CAM_CONTENT_COUNT; entry_i++) {
64 target_command = entry_i + CAM_CONTENT_COUNT * entry_no; 64 target_command = entry_i + CAM_CONTENT_COUNT * entry_no;
@@ -73,14 +73,12 @@ static void rtl_cam_program_entry(struct ieee80211_hw *hw, u32 entry_no,
73 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], 73 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
74 target_command); 74 target_command);
75 75
76 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "WRITE %x: %x\n",
77 rtlpriv->cfg->maps[WCAMI], target_content);
76 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 78 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
77 ("WRITE %x: %x\n", 79 "The Key ID is %d\n", entry_no);
78 rtlpriv->cfg->maps[WCAMI], target_content)); 80 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "WRITE %x: %x\n",
79 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 81 rtlpriv->cfg->maps[RWCAM], target_command);
80 ("The Key ID is %d\n", entry_no));
81 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
82 ("WRITE %x: %x\n",
83 rtlpriv->cfg->maps[RWCAM], target_command));
84 82
85 } else if (entry_i == 1) { 83 } else if (entry_i == 1) {
86 84
@@ -94,10 +92,10 @@ static void rtl_cam_program_entry(struct ieee80211_hw *hw, u32 entry_no,
94 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], 92 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM],
95 target_command); 93 target_command);
96 94
97 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 95 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "WRITE A4: %x\n",
98 ("WRITE A4: %x\n", target_content)); 96 target_content);
99 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 97 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "WRITE A0: %x\n",
100 ("WRITE A0: %x\n", target_command)); 98 target_command);
101 99
102 } else { 100 } else {
103 101
@@ -114,15 +112,15 @@ static void rtl_cam_program_entry(struct ieee80211_hw *hw, u32 entry_no,
114 target_command); 112 target_command);
115 udelay(100); 113 udelay(100);
116 114
117 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 115 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "WRITE A4: %x\n",
118 ("WRITE A4: %x\n", target_content)); 116 target_content);
119 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 117 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "WRITE A0: %x\n",
120 ("WRITE A0: %x\n", target_command)); 118 target_command);
121 } 119 }
122 } 120 }
123 121
124 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 122 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "after set key, usconfig:%x\n",
125 ("after set key, usconfig:%x\n", us_config)); 123 us_config);
126} 124}
127 125
128u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr, 126u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr,
@@ -133,14 +131,13 @@ u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr,
133 struct rtl_priv *rtlpriv = rtl_priv(hw); 131 struct rtl_priv *rtlpriv = rtl_priv(hw);
134 132
135 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 133 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
136 ("EntryNo:%x, ulKeyId=%x, ulEncAlg=%x, " 134 "EntryNo:%x, ulKeyId=%x, ulEncAlg=%x, ulUseDK=%x MacAddr %pM\n",
137 "ulUseDK=%x MacAddr %pM\n", 135 ul_entry_idx, ul_key_id, ul_enc_alg,
138 ul_entry_idx, ul_key_id, ul_enc_alg, 136 ul_default_key, mac_addr);
139 ul_default_key, mac_addr));
140 137
141 if (ul_key_id == TOTAL_CAM_ENTRY) { 138 if (ul_key_id == TOTAL_CAM_ENTRY) {
142 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 139 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
143 ("<=== ulKeyId exceed!\n")); 140 "<=== ulKeyId exceed!\n");
144 return 0; 141 return 0;
145 } 142 }
146 143
@@ -153,7 +150,7 @@ u8 rtl_cam_add_one_entry(struct ieee80211_hw *hw, u8 *mac_addr,
153 rtl_cam_program_entry(hw, ul_entry_idx, mac_addr, 150 rtl_cam_program_entry(hw, ul_entry_idx, mac_addr,
154 (u8 *) key_content, us_config); 151 (u8 *) key_content, us_config);
155 152
156 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("<===\n")); 153 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "<===\n");
157 154
158 return 1; 155 return 1;
159 156
@@ -166,7 +163,7 @@ int rtl_cam_delete_one_entry(struct ieee80211_hw *hw,
166 u32 ul_command; 163 u32 ul_command;
167 struct rtl_priv *rtlpriv = rtl_priv(hw); 164 struct rtl_priv *rtlpriv = rtl_priv(hw);
168 165
169 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("key_idx:%d\n", ul_key_id)); 166 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "key_idx:%d\n", ul_key_id);
170 167
171 ul_command = ul_key_id * CAM_CONTENT_COUNT; 168 ul_command = ul_key_id * CAM_CONTENT_COUNT;
172 ul_command = ul_command | BIT(31) | BIT(16); 169 ul_command = ul_command | BIT(31) | BIT(16);
@@ -175,9 +172,9 @@ int rtl_cam_delete_one_entry(struct ieee80211_hw *hw,
175 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], ul_command); 172 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], ul_command);
176 173
177 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 174 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
178 ("rtl_cam_delete_one_entry(): WRITE A4: %x\n", 0)); 175 "rtl_cam_delete_one_entry(): WRITE A4: %x\n", 0);
179 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 176 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
180 ("rtl_cam_delete_one_entry(): WRITE A0: %x\n", ul_command)); 177 "rtl_cam_delete_one_entry(): WRITE A0: %x\n", ul_command);
181 178
182 return 0; 179 return 0;
183 180
@@ -229,9 +226,9 @@ void rtl_cam_mark_invalid(struct ieee80211_hw *hw, u8 uc_index)
229 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], ul_command); 226 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], ul_command);
230 227
231 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 228 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
232 ("rtl_cam_mark_invalid(): WRITE A4: %x\n", ul_content)); 229 "rtl_cam_mark_invalid(): WRITE A4: %x\n", ul_content);
233 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 230 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
234 ("rtl_cam_mark_invalid(): WRITE A0: %x\n", ul_command)); 231 "rtl_cam_mark_invalid(): WRITE A0: %x\n", ul_command);
235} 232}
236EXPORT_SYMBOL(rtl_cam_mark_invalid); 233EXPORT_SYMBOL(rtl_cam_mark_invalid);
237 234
@@ -279,11 +276,11 @@ void rtl_cam_empty_entry(struct ieee80211_hw *hw, u8 uc_index)
279 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], ul_command); 276 rtl_write_dword(rtlpriv, rtlpriv->cfg->maps[RWCAM], ul_command);
280 277
281 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 278 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
282 ("rtl_cam_empty_entry(): WRITE A4: %x\n", 279 "rtl_cam_empty_entry(): WRITE A4: %x\n",
283 ul_content)); 280 ul_content);
284 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 281 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
285 ("rtl_cam_empty_entry(): WRITE A0: %x\n", 282 "rtl_cam_empty_entry(): WRITE A0: %x\n",
286 ul_command)); 283 ul_command);
287 } 284 }
288 285
289} 286}
@@ -297,8 +294,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
297 u8 i, *addr; 294 u8 i, *addr;
298 295
299 if (NULL == sta_addr) { 296 if (NULL == sta_addr) {
300 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, 297 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, "sta_addr is NULL\n");
301 ("sta_addr is NULL.\n"));
302 return TOTAL_CAM_ENTRY; 298 return TOTAL_CAM_ENTRY;
303 } 299 }
304 /* Does STA already exist? */ 300 /* Does STA already exist? */
@@ -311,8 +307,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
311 for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) { 307 for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
312 if ((bitmap & BIT(0)) == 0) { 308 if ((bitmap & BIT(0)) == 0) {
313 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, 309 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
314 ("-----hwsec_cam_bitmap: 0x%x entry_idx=%d\n", 310 "-----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
315 rtlpriv->sec.hwsec_cam_bitmap, entry_idx)); 311 rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
316 rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx; 312 rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
317 memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx], 313 memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
318 sta_addr, ETH_ALEN); 314 sta_addr, ETH_ALEN);
@@ -331,14 +327,13 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
331 u8 i, *addr; 327 u8 i, *addr;
332 328
333 if (NULL == sta_addr) { 329 if (NULL == sta_addr) {
334 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, 330 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, "sta_addr is NULL\n");
335 ("sta_addr is NULL.\n"));
336 } 331 }
337 332
338 if ((sta_addr[0]|sta_addr[1]|sta_addr[2]|sta_addr[3]|\ 333 if ((sta_addr[0]|sta_addr[1]|sta_addr[2]|sta_addr[3]|\
339 sta_addr[4]|sta_addr[5]) == 0) { 334 sta_addr[4]|sta_addr[5]) == 0) {
340 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, 335 RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
341 ("sta_addr is 00:00:00:00:00:00.\n")); 336 "sta_addr is 00:00:00:00:00:00\n");
342 return; 337 return;
343 } 338 }
344 /* Does STA already exist? */ 339 /* Does STA already exist? */
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 3f0f056fae9c..186c944c1436 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -114,7 +114,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
114 114
115 if (mac->vif) { 115 if (mac->vif) {
116 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 116 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
117 ("vif has been set!! mac->vif = 0x%p\n", mac->vif)); 117 "vif has been set!! mac->vif = 0x%p\n", mac->vif);
118 return -EOPNOTSUPP; 118 return -EOPNOTSUPP;
119 } 119 }
120 120
@@ -125,7 +125,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
125 case NL80211_IFTYPE_STATION: 125 case NL80211_IFTYPE_STATION:
126 if (mac->beacon_enabled == 1) { 126 if (mac->beacon_enabled == 1) {
127 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 127 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
128 ("NL80211_IFTYPE_STATION\n")); 128 "NL80211_IFTYPE_STATION\n");
129 mac->beacon_enabled = 0; 129 mac->beacon_enabled = 0;
130 rtlpriv->cfg->ops->update_interrupt_mask(hw, 0, 130 rtlpriv->cfg->ops->update_interrupt_mask(hw, 0,
131 rtlpriv->cfg->maps 131 rtlpriv->cfg->maps
@@ -134,7 +134,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
134 break; 134 break;
135 case NL80211_IFTYPE_ADHOC: 135 case NL80211_IFTYPE_ADHOC:
136 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 136 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
137 ("NL80211_IFTYPE_ADHOC\n")); 137 "NL80211_IFTYPE_ADHOC\n");
138 138
139 mac->link_state = MAC80211_LINKED; 139 mac->link_state = MAC80211_LINKED;
140 rtlpriv->cfg->ops->set_bcn_reg(hw); 140 rtlpriv->cfg->ops->set_bcn_reg(hw);
@@ -148,7 +148,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
148 break; 148 break;
149 case NL80211_IFTYPE_AP: 149 case NL80211_IFTYPE_AP:
150 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 150 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
151 ("NL80211_IFTYPE_AP\n")); 151 "NL80211_IFTYPE_AP\n");
152 152
153 mac->link_state = MAC80211_LINKED; 153 mac->link_state = MAC80211_LINKED;
154 rtlpriv->cfg->ops->set_bcn_reg(hw); 154 rtlpriv->cfg->ops->set_bcn_reg(hw);
@@ -161,7 +161,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
161 break; 161 break;
162 default: 162 default:
163 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 163 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
164 ("operation mode %d is not support!\n", vif->type)); 164 "operation mode %d is not supported!\n", vif->type);
165 err = -EOPNOTSUPP; 165 err = -EOPNOTSUPP;
166 goto out; 166 goto out;
167 } 167 }
@@ -221,7 +221,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
221 mutex_lock(&rtlpriv->locks.conf_mutex); 221 mutex_lock(&rtlpriv->locks.conf_mutex);
222 if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) { /*BIT(2)*/ 222 if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) { /*BIT(2)*/
223 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 223 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
224 ("IEEE80211_CONF_CHANGE_LISTEN_INTERVAL\n")); 224 "IEEE80211_CONF_CHANGE_LISTEN_INTERVAL\n");
225 } 225 }
226 226
227 /*For IPS */ 227 /*For IPS */
@@ -264,8 +264,8 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
264 264
265 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) { 265 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
266 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 266 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
267 ("IEEE80211_CONF_CHANGE_RETRY_LIMITS %x\n", 267 "IEEE80211_CONF_CHANGE_RETRY_LIMITS %x\n",
268 hw->conf.long_frame_max_tx_count)); 268 hw->conf.long_frame_max_tx_count);
269 mac->retry_long = hw->conf.long_frame_max_tx_count; 269 mac->retry_long = hw->conf.long_frame_max_tx_count;
270 mac->retry_short = hw->conf.long_frame_max_tx_count; 270 mac->retry_short = hw->conf.long_frame_max_tx_count;
271 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, 271 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT,
@@ -320,7 +320,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
320 default: 320 default:
321 mac->bw_40 = false; 321 mac->bw_40 = false;
322 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 322 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
323 ("switch case not processed\n")); 323 "switch case not processed\n");
324 break; 324 break;
325 } 325 }
326 326
@@ -369,12 +369,12 @@ static void rtl_op_configure_filter(struct ieee80211_hw *hw,
369 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_AM] | 369 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_AM] |
370 rtlpriv->cfg->maps[MAC_RCR_AB]; 370 rtlpriv->cfg->maps[MAC_RCR_AB];
371 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 371 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
372 ("Enable receive multicast frame.\n")); 372 "Enable receive multicast frame\n");
373 } else { 373 } else {
374 mac->rx_conf &= ~(rtlpriv->cfg->maps[MAC_RCR_AM] | 374 mac->rx_conf &= ~(rtlpriv->cfg->maps[MAC_RCR_AM] |
375 rtlpriv->cfg->maps[MAC_RCR_AB]); 375 rtlpriv->cfg->maps[MAC_RCR_AB]);
376 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 376 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
377 ("Disable receive multicast frame.\n")); 377 "Disable receive multicast frame\n");
378 } 378 }
379 } 379 }
380 380
@@ -382,11 +382,11 @@ static void rtl_op_configure_filter(struct ieee80211_hw *hw,
382 if (*new_flags & FIF_FCSFAIL) { 382 if (*new_flags & FIF_FCSFAIL) {
383 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_ACRC32]; 383 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_ACRC32];
384 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 384 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
385 ("Enable receive FCS error frame.\n")); 385 "Enable receive FCS error frame\n");
386 } else { 386 } else {
387 mac->rx_conf &= ~rtlpriv->cfg->maps[MAC_RCR_ACRC32]; 387 mac->rx_conf &= ~rtlpriv->cfg->maps[MAC_RCR_ACRC32];
388 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 388 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
389 ("Disable receive FCS error frame.\n")); 389 "Disable receive FCS error frame\n");
390 } 390 }
391 } 391 }
392 392
@@ -409,11 +409,11 @@ static void rtl_op_configure_filter(struct ieee80211_hw *hw,
409 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_ACF]; 409 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_ACF];
410 410
411 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 411 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
412 ("Enable receive control frame.\n")); 412 "Enable receive control frame\n");
413 } else { 413 } else {
414 mac->rx_conf &= ~rtlpriv->cfg->maps[MAC_RCR_ACF]; 414 mac->rx_conf &= ~rtlpriv->cfg->maps[MAC_RCR_ACF];
415 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 415 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
416 ("Disable receive control frame.\n")); 416 "Disable receive control frame\n");
417 } 417 }
418 } 418 }
419 419
@@ -421,11 +421,11 @@ static void rtl_op_configure_filter(struct ieee80211_hw *hw,
421 if (*new_flags & FIF_OTHER_BSS) { 421 if (*new_flags & FIF_OTHER_BSS) {
422 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_AAP]; 422 mac->rx_conf |= rtlpriv->cfg->maps[MAC_RCR_AAP];
423 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 423 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
424 ("Enable receive other BSS's frame.\n")); 424 "Enable receive other BSS's frame\n");
425 } else { 425 } else {
426 mac->rx_conf &= ~rtlpriv->cfg->maps[MAC_RCR_AAP]; 426 mac->rx_conf &= ~rtlpriv->cfg->maps[MAC_RCR_AAP];
427 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 427 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
428 ("Disable receive other BSS's frame.\n")); 428 "Disable receive other BSS's frame\n");
429 } 429 }
430 } 430 }
431} 431}
@@ -456,7 +456,7 @@ static int rtl_op_sta_add(struct ieee80211_hw *hw,
456 sta_entry->wireless_mode = WIRELESS_MODE_G; 456 sta_entry->wireless_mode = WIRELESS_MODE_G;
457 457
458 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 458 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
459 ("Add sta addr is %pM\n", sta->addr)); 459 "Add sta addr is %pM\n", sta->addr);
460 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0); 460 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
461 } 461 }
462 return 0; 462 return 0;
@@ -469,7 +469,7 @@ static int rtl_op_sta_remove(struct ieee80211_hw *hw,
469 struct rtl_sta_info *sta_entry; 469 struct rtl_sta_info *sta_entry;
470 if (sta) { 470 if (sta) {
471 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 471 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
472 ("Remove sta addr is %pM\n", sta->addr)); 472 "Remove sta addr is %pM\n", sta->addr);
473 sta_entry = (struct rtl_sta_info *) sta->drv_priv; 473 sta_entry = (struct rtl_sta_info *) sta->drv_priv;
474 sta_entry->wireless_mode = 0; 474 sta_entry->wireless_mode = 0;
475 sta_entry->ratr_index = 0; 475 sta_entry->ratr_index = 0;
@@ -514,7 +514,7 @@ static int rtl_op_conf_tx(struct ieee80211_hw *hw,
514 514
515 if (queue >= AC_MAX) { 515 if (queue >= AC_MAX) {
516 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 516 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
517 ("queue number %d is incorrect!\n", queue)); 517 "queue number %d is incorrect!\n", queue);
518 return -EINVAL; 518 return -EINVAL;
519 } 519 }
520 520
@@ -547,7 +547,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
547 bss_conf->enable_beacon)) { 547 bss_conf->enable_beacon)) {
548 if (mac->beacon_enabled == 0) { 548 if (mac->beacon_enabled == 0) {
549 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 549 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
550 ("BSS_CHANGED_BEACON_ENABLED\n")); 550 "BSS_CHANGED_BEACON_ENABLED\n");
551 551
552 /*start hw beacon interrupt. */ 552 /*start hw beacon interrupt. */
553 /*rtlpriv->cfg->ops->set_bcn_reg(hw); */ 553 /*rtlpriv->cfg->ops->set_bcn_reg(hw); */
@@ -565,7 +565,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
565 !bss_conf->enable_beacon)) { 565 !bss_conf->enable_beacon)) {
566 if (mac->beacon_enabled == 1) { 566 if (mac->beacon_enabled == 1) {
567 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 567 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
568 ("ADHOC DISABLE BEACON\n")); 568 "ADHOC DISABLE BEACON\n");
569 569
570 mac->beacon_enabled = 0; 570 mac->beacon_enabled = 0;
571 rtlpriv->cfg->ops->update_interrupt_mask(hw, 0, 571 rtlpriv->cfg->ops->update_interrupt_mask(hw, 0,
@@ -575,7 +575,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
575 } 575 }
576 if (changed & BSS_CHANGED_BEACON_INT) { 576 if (changed & BSS_CHANGED_BEACON_INT) {
577 RT_TRACE(rtlpriv, COMP_BEACON, DBG_TRACE, 577 RT_TRACE(rtlpriv, COMP_BEACON, DBG_TRACE,
578 ("BSS_CHANGED_BEACON_INT\n")); 578 "BSS_CHANGED_BEACON_INT\n");
579 mac->beacon_interval = bss_conf->beacon_int; 579 mac->beacon_interval = bss_conf->beacon_int;
580 rtlpriv->cfg->ops->set_bcn_intv(hw); 580 rtlpriv->cfg->ops->set_bcn_intv(hw);
581 } 581 }
@@ -604,7 +604,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
604 if (mac->opmode == NL80211_IFTYPE_STATION && sta) 604 if (mac->opmode == NL80211_IFTYPE_STATION && sta)
605 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0); 605 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
606 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 606 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
607 ("BSS_CHANGED_ASSOC\n")); 607 "BSS_CHANGED_ASSOC\n");
608 } else { 608 } else {
609 if (mac->link_state == MAC80211_LINKED) 609 if (mac->link_state == MAC80211_LINKED)
610 rtl_lps_leave(hw); 610 rtl_lps_leave(hw);
@@ -619,20 +619,20 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
619 mac->vendor = PEER_UNKNOWN; 619 mac->vendor = PEER_UNKNOWN;
620 620
621 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 621 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
622 ("BSS_CHANGED_UN_ASSOC\n")); 622 "BSS_CHANGED_UN_ASSOC\n");
623 } 623 }
624 } 624 }
625 625
626 if (changed & BSS_CHANGED_ERP_CTS_PROT) { 626 if (changed & BSS_CHANGED_ERP_CTS_PROT) {
627 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 627 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
628 ("BSS_CHANGED_ERP_CTS_PROT\n")); 628 "BSS_CHANGED_ERP_CTS_PROT\n");
629 mac->use_cts_protect = bss_conf->use_cts_prot; 629 mac->use_cts_protect = bss_conf->use_cts_prot;
630 } 630 }
631 631
632 if (changed & BSS_CHANGED_ERP_PREAMBLE) { 632 if (changed & BSS_CHANGED_ERP_PREAMBLE) {
633 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, 633 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
634 ("BSS_CHANGED_ERP_PREAMBLE use short preamble:%x\n", 634 "BSS_CHANGED_ERP_PREAMBLE use short preamble:%x\n",
635 bss_conf->use_short_preamble)); 635 bss_conf->use_short_preamble);
636 636
637 mac->short_preamble = bss_conf->use_short_preamble; 637 mac->short_preamble = bss_conf->use_short_preamble;
638 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACK_PREAMBLE, 638 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ACK_PREAMBLE,
@@ -641,7 +641,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
641 641
642 if (changed & BSS_CHANGED_ERP_SLOT) { 642 if (changed & BSS_CHANGED_ERP_SLOT) {
643 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 643 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
644 ("BSS_CHANGED_ERP_SLOT\n")); 644 "BSS_CHANGED_ERP_SLOT\n");
645 645
646 if (bss_conf->use_short_slot) 646 if (bss_conf->use_short_slot)
647 mac->slot_time = RTL_SLOT_TIME_9; 647 mac->slot_time = RTL_SLOT_TIME_9;
@@ -653,8 +653,7 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
653 } 653 }
654 654
655 if (changed & BSS_CHANGED_HT) { 655 if (changed & BSS_CHANGED_HT) {
656 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 656 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, "BSS_CHANGED_HT\n");
657 ("BSS_CHANGED_HT\n"));
658 rcu_read_lock(); 657 rcu_read_lock();
659 sta = get_sta(hw, vif, bss_conf->bssid); 658 sta = get_sta(hw, vif, bss_conf->bssid);
660 if (sta) { 659 if (sta) {
@@ -683,8 +682,8 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
683 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BSSID, 682 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BSSID,
684 (u8 *) bss_conf->bssid); 683 (u8 *) bss_conf->bssid);
685 684
686 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 685 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, "%pM\n",
687 ("%pM\n", bss_conf->bssid)); 686 bss_conf->bssid);
688 687
689 mac->vendor = PEER_UNKNOWN; 688 mac->vendor = PEER_UNKNOWN;
690 memcpy(mac->bssid, bss_conf->bssid, 6); 689 memcpy(mac->bssid, bss_conf->bssid, 6);
@@ -831,30 +830,30 @@ static int rtl_op_ampdu_action(struct ieee80211_hw *hw,
831 switch (action) { 830 switch (action) {
832 case IEEE80211_AMPDU_TX_START: 831 case IEEE80211_AMPDU_TX_START:
833 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 832 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
834 ("IEEE80211_AMPDU_TX_START: TID:%d\n", tid)); 833 "IEEE80211_AMPDU_TX_START: TID:%d\n", tid);
835 return rtl_tx_agg_start(hw, sta, tid, ssn); 834 return rtl_tx_agg_start(hw, sta, tid, ssn);
836 break; 835 break;
837 case IEEE80211_AMPDU_TX_STOP: 836 case IEEE80211_AMPDU_TX_STOP:
838 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 837 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
839 ("IEEE80211_AMPDU_TX_STOP: TID:%d\n", tid)); 838 "IEEE80211_AMPDU_TX_STOP: TID:%d\n", tid);
840 return rtl_tx_agg_stop(hw, sta, tid); 839 return rtl_tx_agg_stop(hw, sta, tid);
841 break; 840 break;
842 case IEEE80211_AMPDU_TX_OPERATIONAL: 841 case IEEE80211_AMPDU_TX_OPERATIONAL:
843 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 842 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
844 ("IEEE80211_AMPDU_TX_OPERATIONAL:TID:%d\n", tid)); 843 "IEEE80211_AMPDU_TX_OPERATIONAL:TID:%d\n", tid);
845 rtl_tx_agg_oper(hw, sta, tid); 844 rtl_tx_agg_oper(hw, sta, tid);
846 break; 845 break;
847 case IEEE80211_AMPDU_RX_START: 846 case IEEE80211_AMPDU_RX_START:
848 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 847 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
849 ("IEEE80211_AMPDU_RX_START:TID:%d\n", tid)); 848 "IEEE80211_AMPDU_RX_START:TID:%d\n", tid);
850 break; 849 break;
851 case IEEE80211_AMPDU_RX_STOP: 850 case IEEE80211_AMPDU_RX_STOP:
852 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE, 851 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_TRACE,
853 ("IEEE80211_AMPDU_RX_STOP:TID:%d\n", tid)); 852 "IEEE80211_AMPDU_RX_STOP:TID:%d\n", tid);
854 break; 853 break;
855 default: 854 default:
856 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 855 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
857 ("IEEE80211_AMPDU_ERR!!!!:\n")); 856 "IEEE80211_AMPDU_ERR!!!!:\n");
858 return -EOPNOTSUPP; 857 return -EOPNOTSUPP;
859 } 858 }
860 return 0; 859 return 0;
@@ -867,7 +866,7 @@ static void rtl_op_sw_scan_start(struct ieee80211_hw *hw)
867 866
868 mac->act_scanning = true; 867 mac->act_scanning = true;
869 868
870 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("\n")); 869 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "\n");
871 870
872 if (mac->link_state == MAC80211_LINKED) { 871 if (mac->link_state == MAC80211_LINKED) {
873 rtl_lps_leave(hw); 872 rtl_lps_leave(hw);
@@ -888,7 +887,7 @@ static void rtl_op_sw_scan_complete(struct ieee80211_hw *hw)
888 struct rtl_priv *rtlpriv = rtl_priv(hw); 887 struct rtl_priv *rtlpriv = rtl_priv(hw);
889 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 888 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
890 889
891 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, ("\n")); 890 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "\n");
892 mac->act_scanning = false; 891 mac->act_scanning = false;
893 /* Dual mac */ 892 /* Dual mac */
894 rtlpriv->rtlhal.load_imrandiqk_setting_for2g = false; 893 rtlpriv->rtlhal.load_imrandiqk_setting_for2g = false;
@@ -921,13 +920,13 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
921 920
922 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { 921 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) {
923 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 922 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
924 ("not open hw encryption\n")); 923 "not open hw encryption\n");
925 return -ENOSPC; /*User disabled HW-crypto */ 924 return -ENOSPC; /*User disabled HW-crypto */
926 } 925 }
927 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 926 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
928 ("%s hardware based encryption for keyidx: %d, mac: %pM\n", 927 "%s hardware based encryption for keyidx: %d, mac: %pM\n",
929 cmd == SET_KEY ? "Using" : "Disabling", key->keyidx, 928 cmd == SET_KEY ? "Using" : "Disabling", key->keyidx,
930 sta ? sta->addr : bcast_addr)); 929 sta ? sta->addr : bcast_addr);
931 rtlpriv->sec.being_setkey = true; 930 rtlpriv->sec.being_setkey = true;
932 rtl_ips_nic_on(hw); 931 rtl_ips_nic_on(hw);
933 mutex_lock(&rtlpriv->locks.conf_mutex); 932 mutex_lock(&rtlpriv->locks.conf_mutex);
@@ -936,24 +935,23 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
936 switch (key->cipher) { 935 switch (key->cipher) {
937 case WLAN_CIPHER_SUITE_WEP40: 936 case WLAN_CIPHER_SUITE_WEP40:
938 key_type = WEP40_ENCRYPTION; 937 key_type = WEP40_ENCRYPTION;
939 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("alg:WEP40\n")); 938 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "alg:WEP40\n");
940 break; 939 break;
941 case WLAN_CIPHER_SUITE_WEP104: 940 case WLAN_CIPHER_SUITE_WEP104:
942 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 941 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "alg:WEP104\n");
943 ("alg:WEP104\n"));
944 key_type = WEP104_ENCRYPTION; 942 key_type = WEP104_ENCRYPTION;
945 break; 943 break;
946 case WLAN_CIPHER_SUITE_TKIP: 944 case WLAN_CIPHER_SUITE_TKIP:
947 key_type = TKIP_ENCRYPTION; 945 key_type = TKIP_ENCRYPTION;
948 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("alg:TKIP\n")); 946 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "alg:TKIP\n");
949 break; 947 break;
950 case WLAN_CIPHER_SUITE_CCMP: 948 case WLAN_CIPHER_SUITE_CCMP:
951 key_type = AESCCMP_ENCRYPTION; 949 key_type = AESCCMP_ENCRYPTION;
952 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("alg:CCMP\n")); 950 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "alg:CCMP\n");
953 break; 951 break;
954 default: 952 default:
955 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 953 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "alg_err:%x!!!!\n",
956 ("alg_err:%x!!!!:\n", key->cipher)); 954 key->cipher);
957 goto out_unlock; 955 goto out_unlock;
958 } 956 }
959 if (key_type == WEP40_ENCRYPTION || 957 if (key_type == WEP40_ENCRYPTION ||
@@ -995,8 +993,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
995 wep_only = true; 993 wep_only = true;
996 rtlpriv->sec.pairwise_enc_algorithm = key_type; 994 rtlpriv->sec.pairwise_enc_algorithm = key_type;
997 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 995 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
998 ("set enable_hw_sec, key_type:%x(OPEN:0 WEP40:1" 996 "set enable_hw_sec, key_type:%x(OPEN:0 WEP40:1 TKIP:2 AES:4 WEP104:5)\n",
999 " TKIP:2 AES:4 WEP104:5)\n", key_type)); 997 key_type);
1000 rtlpriv->cfg->ops->enable_hw_sec(hw); 998 rtlpriv->cfg->ops->enable_hw_sec(hw);
1001 } 999 }
1002 } 1000 }
@@ -1005,7 +1003,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1005 case SET_KEY: 1003 case SET_KEY:
1006 if (wep_only) { 1004 if (wep_only) {
1007 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 1005 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
1008 ("set WEP(group/pairwise) key\n")); 1006 "set WEP(group/pairwise) key\n");
1009 /* Pairwise key with an assigned MAC address. */ 1007 /* Pairwise key with an assigned MAC address. */
1010 rtlpriv->sec.pairwise_enc_algorithm = key_type; 1008 rtlpriv->sec.pairwise_enc_algorithm = key_type;
1011 rtlpriv->sec.group_enc_algorithm = key_type; 1009 rtlpriv->sec.group_enc_algorithm = key_type;
@@ -1016,7 +1014,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1016 memcpy(mac_addr, zero_addr, ETH_ALEN); 1014 memcpy(mac_addr, zero_addr, ETH_ALEN);
1017 } else if (group_key) { /* group key */ 1015 } else if (group_key) { /* group key */
1018 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 1016 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
1019 ("set group key\n")); 1017 "set group key\n");
1020 /* group key */ 1018 /* group key */
1021 rtlpriv->sec.group_enc_algorithm = key_type; 1019 rtlpriv->sec.group_enc_algorithm = key_type;
1022 /*set local buf about group key. */ 1020 /*set local buf about group key. */
@@ -1026,7 +1024,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1026 memcpy(mac_addr, bcast_addr, ETH_ALEN); 1024 memcpy(mac_addr, bcast_addr, ETH_ALEN);
1027 } else { /* pairwise key */ 1025 } else { /* pairwise key */
1028 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 1026 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
1029 ("set pairwise key\n")); 1027 "set pairwise key\n");
1030 if (!sta) { 1028 if (!sta) {
1031 RT_ASSERT(false, ("pairwise key withnot" 1029 RT_ASSERT(false, ("pairwise key withnot"
1032 "mac_addr\n")); 1030 "mac_addr\n"));
@@ -1056,7 +1054,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1056 break; 1054 break;
1057 case DISABLE_KEY: 1055 case DISABLE_KEY:
1058 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 1056 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
1059 ("disable key delete one entry\n")); 1057 "disable key delete one entry\n");
1060 /*set local buf about wep key. */ 1058 /*set local buf about wep key. */
1061 if (mac->opmode == NL80211_IFTYPE_AP) { 1059 if (mac->opmode == NL80211_IFTYPE_AP) {
1062 if (sta) 1060 if (sta)
@@ -1077,7 +1075,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1077 break; 1075 break;
1078 default: 1076 default:
1079 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1077 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1080 ("cmd_err:%x!!!!:\n", cmd)); 1078 "cmd_err:%x!!!!\n", cmd);
1081 } 1079 }
1082out_unlock: 1080out_unlock:
1083 mutex_unlock(&rtlpriv->locks.conf_mutex); 1081 mutex_unlock(&rtlpriv->locks.conf_mutex);
@@ -1106,8 +1104,8 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw)
1106 rtlpriv->rfkill.rfkill_state = radio_state; 1104 rtlpriv->rfkill.rfkill_state = radio_state;
1107 1105
1108 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 1106 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
1109 (KERN_INFO "wireless radio switch turned %s\n", 1107 "wireless radio switch turned %s\n",
1110 radio_state ? "on" : "off")); 1108 radio_state ? "on" : "off");
1111 1109
1112 blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1; 1110 blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1;
1113 wiphy_rfkill_set_hw_state(hw->wiphy, blocked); 1111 wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
diff --git a/drivers/net/wireless/rtlwifi/debug.h b/drivers/net/wireless/rtlwifi/debug.h
index 588986a1e213..8c1396933540 100644
--- a/drivers/net/wireless/rtlwifi/debug.h
+++ b/drivers/net/wireless/rtlwifi/debug.h
@@ -165,14 +165,13 @@ do { \
165 } \ 165 } \
166} while (0) 166} while (0)
167 167
168#define RT_TRACE(rtlpriv, comp, level, fmt) \ 168#define RT_TRACE(rtlpriv, comp, level, fmt, ...) \
169do { \ 169do { \
170 if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \ 170 if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \
171 ((level) <= rtlpriv->dbg.global_debuglevel))) { \ 171 ((level) <= rtlpriv->dbg.global_debuglevel))) { \
172 printk(KERN_DEBUG "%s:%s():<%lx-%x> ", \ 172 printk(KERN_DEBUG "%s:%s():<%lx-%x> " fmt, \
173 KBUILD_MODNAME, __func__, \ 173 KBUILD_MODNAME, __func__, \
174 in_interrupt(), in_atomic()); \ 174 in_interrupt(), in_atomic(), ##__VA_ARGS__); \
175 printk fmt; \
176 } \ 175 } \
177} while (0) 176} while (0)
178 177
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 91fd3639d737..2885131cf1a0 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -162,8 +162,8 @@ void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value)
162 const u32 efuse_len = 162 const u32 efuse_len =
163 rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE]; 163 rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE];
164 164
165 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 165 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, "Addr=%x Data =%x\n",
166 ("Addr=%x Data =%x\n", address, value)); 166 address, value);
167 167
168 if (address < efuse_len) { 168 if (address < efuse_len) {
169 rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL], value); 169 rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL], value);
@@ -252,8 +252,8 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf)
252 252
253 if ((_offset + _size_byte) > rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]) { 253 if ((_offset + _size_byte) > rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]) {
254 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 254 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
255 ("read_efuse(): Invalid offset(%#x) with read " 255 "read_efuse(): Invalid offset(%#x) with read bytes(%#x)!!\n",
256 "bytes(%#x)!!\n", _offset, _size_byte)); 256 _offset, _size_byte);
257 return; 257 return;
258 } 258 }
259 259
@@ -395,9 +395,8 @@ bool efuse_shadow_update_chk(struct ieee80211_hw *hw)
395 result = false; 395 result = false;
396 396
397 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 397 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
398 ("efuse_shadow_update_chk(): totalbytes(%#x), " 398 "efuse_shadow_update_chk(): totalbytes(%#x), hdr_num(%#x), words_need(%#x), efuse_used(%d)\n",
399 "hdr_num(%#x), words_need(%#x), efuse_used(%d)\n", 399 totalbytes, hdr_num, words_need, efuse_used);
400 totalbytes, hdr_num, words_need, efuse_used));
401 400
402 return result; 401 return result;
403} 402}
@@ -434,7 +433,7 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
434 u8 word_en = 0x0F; 433 u8 word_en = 0x0F;
435 u8 first_pg = false; 434 u8 first_pg = false;
436 435
437 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, ("--->\n")); 436 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, "--->\n");
438 437
439 if (!efuse_shadow_update_chk(hw)) { 438 if (!efuse_shadow_update_chk(hw)) {
440 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); 439 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
@@ -443,7 +442,7 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
443 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); 442 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
444 443
445 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 444 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
446 ("<---efuse out of capacity!!\n")); 445 "<---efuse out of capacity!!\n");
447 return false; 446 return false;
448 } 447 }
449 efuse_power_switch(hw, true, true); 448 efuse_power_switch(hw, true, true);
@@ -483,7 +482,7 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
483 if (!efuse_pg_packet_write(hw, (u8) offset, word_en, 482 if (!efuse_pg_packet_write(hw, (u8) offset, word_en,
484 tmpdata)) { 483 tmpdata)) {
485 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 484 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
486 ("PG section(%#x) fail!!\n", offset)); 485 "PG section(%#x) fail!!\n", offset);
487 break; 486 break;
488 } 487 }
489 } 488 }
@@ -497,7 +496,7 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
497 &rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 496 &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
498 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); 497 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
499 498
500 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, ("<---\n")); 499 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, "<---\n");
501 return true; 500 return true;
502} 501}
503 502
@@ -634,8 +633,8 @@ static int efuse_one_byte_write(struct ieee80211_hw *hw, u16 addr, u8 data)
634 struct rtl_priv *rtlpriv = rtl_priv(hw); 633 struct rtl_priv *rtlpriv = rtl_priv(hw);
635 u8 tmpidx = 0; 634 u8 tmpidx = 0;
636 635
637 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 636 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, "Addr = %x Data=%x\n",
638 ("Addr = %x Data=%x\n", addr, data)); 637 addr, data);
639 638
640 rtl_write_byte(rtlpriv, 639 rtl_write_byte(rtlpriv,
641 rtlpriv->cfg->maps[EFUSE_CTRL] + 1, (u8) (addr & 0xff)); 640 rtlpriv->cfg->maps[EFUSE_CTRL] + 1, (u8) (addr & 0xff));
@@ -1006,7 +1005,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
1006 1005
1007 if (efuse_addr >= (EFUSE_MAX_SIZE - EFUSE_OOB_PROTECT_BYTES)) { 1006 if (efuse_addr >= (EFUSE_MAX_SIZE - EFUSE_OOB_PROTECT_BYTES)) {
1008 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 1007 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
1009 ("efuse_addr(%#x) Out of size!!\n", efuse_addr)); 1008 "efuse_addr(%#x) Out of size!!\n", efuse_addr);
1010 } 1009 }
1011 1010
1012 return true; 1011 return true;
@@ -1046,8 +1045,8 @@ static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw,
1046 u8 tmpdata[8]; 1045 u8 tmpdata[8];
1047 1046
1048 memset(tmpdata, 0xff, PGPKT_DATA_SIZE); 1047 memset(tmpdata, 0xff, PGPKT_DATA_SIZE);
1049 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 1048 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, "word_en = %x efuse_addr=%x\n",
1050 ("word_en = %x efuse_addr=%x\n", word_en, efuse_addr)); 1049 word_en, efuse_addr);
1051 1050
1052 if (!(word_en & BIT(0))) { 1051 if (!(word_en & BIT(0))) {
1053 tmpaddr = start_addr; 1052 tmpaddr = start_addr;
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 39e0907a3c4e..b52fef235754 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -170,7 +170,7 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
170 break; 170 break;
171 default: 171 default:
172 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 172 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
173 ("switch case not process\n")); 173 "switch case not processed\n");
174 break; 174 break;
175 } 175 }
176 176
@@ -232,7 +232,7 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw)
232 232
233 if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { 233 if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) {
234 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 234 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
235 ("PCI(Bridge) UNKNOWN.\n")); 235 "PCI(Bridge) UNKNOWN\n");
236 236
237 return; 237 return;
238 } 238 }
@@ -286,7 +286,7 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw)
286 286
287 if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { 287 if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) {
288 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 288 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
289 ("PCI(Bridge) UNKNOWN.\n")); 289 "PCI(Bridge) UNKNOWN\n");
290 return; 290 return;
291 } 291 }
292 292
@@ -303,11 +303,10 @@ static void rtl_pci_enable_aspm(struct ieee80211_hw *hw)
303 u_pcibridge_aspmsetting); 303 u_pcibridge_aspmsetting);
304 304
305 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 305 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
306 ("PlatformEnableASPM():PciBridge busnumber[%x], " 306 "PlatformEnableASPM():PciBridge busnumber[%x], DevNumbe[%x], funcnumber[%x], Write reg[%x] = %x\n",
307 "DevNumbe[%x], funcnumber[%x], Write reg[%x] = %x\n", 307 pcibridge_busnum, pcibridge_devnum, pcibridge_funcnum,
308 pcibridge_busnum, pcibridge_devnum, pcibridge_funcnum, 308 (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10),
309 (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10), 309 u_pcibridge_aspmsetting);
310 u_pcibridge_aspmsetting));
311 310
312 udelay(50); 311 udelay(50);
313 312
@@ -382,9 +381,8 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev,
382 pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg); 381 pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg);
383 pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg; 382 pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg;
384 383
385 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 384 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Link Control Register =%x\n",
386 ("Link Control Register =%x\n", 385 pcipriv->ndis_adapter.linkctrl_reg);
387 pcipriv->ndis_adapter.linkctrl_reg));
388 386
389 pci_read_config_byte(pdev, 0x98, &tmp); 387 pci_read_config_byte(pdev, 0x98, &tmp);
390 tmp |= BIT(4); 388 tmp |= BIT(4);
@@ -551,11 +549,10 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
551 skb_pull(skb, EM_HDR_LEN); 549 skb_pull(skb, EM_HDR_LEN);
552 550
553 RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE, 551 RT_TRACE(rtlpriv, (COMP_INTR | COMP_SEND), DBG_TRACE,
554 ("new ring->idx:%d, " 552 "new ring->idx:%d, free: skb_queue_len:%d, free: seq:%x\n",
555 "free: skb_queue_len:%d, free: seq:%x\n", 553 ring->idx,
556 ring->idx, 554 skb_queue_len(&ring->queue),
557 skb_queue_len(&ring->queue), 555 *(u16 *) (skb->data + 22));
558 *(u16 *) (skb->data + 22)));
559 556
560 if (prio == TXCMD_QUEUE) { 557 if (prio == TXCMD_QUEUE) {
561 dev_kfree_skb(skb); 558 dev_kfree_skb(skb);
@@ -593,11 +590,9 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
593 == 2) { 590 == 2) {
594 591
595 RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, 592 RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
596 ("more desc left, wake" 593 "more desc left, wake skb_queue@%d, ring->idx = %d, skb_queue_len = 0x%d\n",
597 "skb_queue@%d,ring->idx = %d," 594 prio, ring->idx,
598 "skb_queue_len = 0x%d\n", 595 skb_queue_len(&ring->queue));
599 prio, ring->idx,
600 skb_queue_len(&ring->queue)));
601 596
602 ieee80211_wake_queue(hw, 597 ieee80211_wake_queue(hw,
603 skb_get_queue_mapping 598 skb_get_queue_mapping
@@ -709,9 +704,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
709 704
710 new_skb = dev_alloc_skb(rtlpci->rxbuffersize); 705 new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
711 if (unlikely(!new_skb)) { 706 if (unlikely(!new_skb)) {
712 RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), 707 RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV), DBG_DMESG,
713 DBG_DMESG, 708 "can't alloc skb for rx\n");
714 ("can't alloc skb for rx\n"));
715 goto done; 709 goto done;
716 } 710 }
717 711
@@ -796,38 +790,37 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
796 /*<1> beacon related */ 790 /*<1> beacon related */
797 if (inta & rtlpriv->cfg->maps[RTL_IMR_TBDOK]) { 791 if (inta & rtlpriv->cfg->maps[RTL_IMR_TBDOK]) {
798 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 792 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
799 ("beacon ok interrupt!\n")); 793 "beacon ok interrupt!\n");
800 } 794 }
801 795
802 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TBDER])) { 796 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TBDER])) {
803 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 797 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
804 ("beacon err interrupt!\n")); 798 "beacon err interrupt!\n");
805 } 799 }
806 800
807 if (inta & rtlpriv->cfg->maps[RTL_IMR_BDOK]) { 801 if (inta & rtlpriv->cfg->maps[RTL_IMR_BDOK]) {
808 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 802 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, "beacon interrupt!\n");
809 ("beacon interrupt!\n"));
810 } 803 }
811 804
812 if (inta & rtlpriv->cfg->maps[RTL_IMR_BcnInt]) { 805 if (inta & rtlpriv->cfg->maps[RTL_IMR_BcnInt]) {
813 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 806 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
814 ("prepare beacon for interrupt!\n")); 807 "prepare beacon for interrupt!\n");
815 tasklet_schedule(&rtlpriv->works.irq_prepare_bcn_tasklet); 808 tasklet_schedule(&rtlpriv->works.irq_prepare_bcn_tasklet);
816 } 809 }
817 810
818 /*<3> Tx related */ 811 /*<3> Tx related */
819 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TXFOVW])) 812 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_TXFOVW]))
820 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("IMR_TXFOVW!\n")); 813 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, "IMR_TXFOVW!\n");
821 814
822 if (inta & rtlpriv->cfg->maps[RTL_IMR_MGNTDOK]) { 815 if (inta & rtlpriv->cfg->maps[RTL_IMR_MGNTDOK]) {
823 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 816 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
824 ("Manage ok interrupt!\n")); 817 "Manage ok interrupt!\n");
825 _rtl_pci_tx_isr(hw, MGNT_QUEUE); 818 _rtl_pci_tx_isr(hw, MGNT_QUEUE);
826 } 819 }
827 820
828 if (inta & rtlpriv->cfg->maps[RTL_IMR_HIGHDOK]) { 821 if (inta & rtlpriv->cfg->maps[RTL_IMR_HIGHDOK]) {
829 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 822 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
830 ("HIGH_QUEUE ok interrupt!\n")); 823 "HIGH_QUEUE ok interrupt!\n");
831 _rtl_pci_tx_isr(hw, HIGH_QUEUE); 824 _rtl_pci_tx_isr(hw, HIGH_QUEUE);
832 } 825 }
833 826
@@ -835,7 +828,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
835 rtlpriv->link_info.num_tx_inperiod++; 828 rtlpriv->link_info.num_tx_inperiod++;
836 829
837 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 830 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
838 ("BK Tx OK interrupt!\n")); 831 "BK Tx OK interrupt!\n");
839 _rtl_pci_tx_isr(hw, BK_QUEUE); 832 _rtl_pci_tx_isr(hw, BK_QUEUE);
840 } 833 }
841 834
@@ -843,7 +836,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
843 rtlpriv->link_info.num_tx_inperiod++; 836 rtlpriv->link_info.num_tx_inperiod++;
844 837
845 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 838 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
846 ("BE TX OK interrupt!\n")); 839 "BE TX OK interrupt!\n");
847 _rtl_pci_tx_isr(hw, BE_QUEUE); 840 _rtl_pci_tx_isr(hw, BE_QUEUE);
848 } 841 }
849 842
@@ -851,7 +844,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
851 rtlpriv->link_info.num_tx_inperiod++; 844 rtlpriv->link_info.num_tx_inperiod++;
852 845
853 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 846 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
854 ("VI TX OK interrupt!\n")); 847 "VI TX OK interrupt!\n");
855 _rtl_pci_tx_isr(hw, VI_QUEUE); 848 _rtl_pci_tx_isr(hw, VI_QUEUE);
856 } 849 }
857 850
@@ -859,7 +852,7 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
859 rtlpriv->link_info.num_tx_inperiod++; 852 rtlpriv->link_info.num_tx_inperiod++;
860 853
861 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 854 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
862 ("Vo TX OK interrupt!\n")); 855 "Vo TX OK interrupt!\n");
863 _rtl_pci_tx_isr(hw, VO_QUEUE); 856 _rtl_pci_tx_isr(hw, VO_QUEUE);
864 } 857 }
865 858
@@ -868,25 +861,25 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)
868 rtlpriv->link_info.num_tx_inperiod++; 861 rtlpriv->link_info.num_tx_inperiod++;
869 862
870 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, 863 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE,
871 ("CMD TX OK interrupt!\n")); 864 "CMD TX OK interrupt!\n");
872 _rtl_pci_tx_isr(hw, TXCMD_QUEUE); 865 _rtl_pci_tx_isr(hw, TXCMD_QUEUE);
873 } 866 }
874 } 867 }
875 868
876 /*<2> Rx related */ 869 /*<2> Rx related */
877 if (inta & rtlpriv->cfg->maps[RTL_IMR_ROK]) { 870 if (inta & rtlpriv->cfg->maps[RTL_IMR_ROK]) {
878 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, ("Rx ok interrupt!\n")); 871 RT_TRACE(rtlpriv, COMP_INTR, DBG_TRACE, "Rx ok interrupt!\n");
879 _rtl_pci_rx_interrupt(hw); 872 _rtl_pci_rx_interrupt(hw);
880 } 873 }
881 874
882 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RDU])) { 875 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RDU])) {
883 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 876 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
884 ("rx descriptor unavailable!\n")); 877 "rx descriptor unavailable!\n");
885 _rtl_pci_rx_interrupt(hw); 878 _rtl_pci_rx_interrupt(hw);
886 } 879 }
887 880
888 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RXFOVW])) { 881 if (unlikely(inta & rtlpriv->cfg->maps[RTL_IMR_RXFOVW])) {
889 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("rx overflow !\n")); 882 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, "rx overflow !\n");
890 _rtl_pci_rx_interrupt(hw); 883 _rtl_pci_rx_interrupt(hw);
891 } 884 }
892 885
@@ -1028,7 +1021,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1028 1021
1029 if (!ring || (unsigned long)ring & 0xFF) { 1022 if (!ring || (unsigned long)ring & 0xFF) {
1030 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1023 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1031 ("Cannot allocate TX ring (prio = %d)\n", prio)); 1024 "Cannot allocate TX ring (prio = %d)\n", prio);
1032 return -ENOMEM; 1025 return -ENOMEM;
1033 } 1026 }
1034 1027
@@ -1039,8 +1032,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
1039 rtlpci->tx_ring[prio].entries = entries; 1032 rtlpci->tx_ring[prio].entries = entries;
1040 skb_queue_head_init(&rtlpci->tx_ring[prio].queue); 1033 skb_queue_head_init(&rtlpci->tx_ring[prio].queue);
1041 1034
1042 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1035 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "queue:%d, ring_addr:%p\n",
1043 ("queue:%d, ring_addr:%p\n", prio, ring)); 1036 prio, ring);
1044 1037
1045 for (i = 0; i < entries; i++) { 1038 for (i = 0; i < entries; i++) {
1046 nextdescaddress = (u32) dma + 1039 nextdescaddress = (u32) dma +
@@ -1078,7 +1071,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
1078 if (!rtlpci->rx_ring[rx_queue_idx].desc || 1071 if (!rtlpci->rx_ring[rx_queue_idx].desc ||
1079 (unsigned long)rtlpci->rx_ring[rx_queue_idx].desc & 0xFF) { 1072 (unsigned long)rtlpci->rx_ring[rx_queue_idx].desc & 0xFF) {
1080 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1073 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1081 ("Cannot allocate RX ring\n")); 1074 "Cannot allocate RX ring\n");
1082 return -ENOMEM; 1075 return -ENOMEM;
1083 } 1076 }
1084 1077
@@ -1355,7 +1348,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
1355 u8 temp_one = 1; 1348 u8 temp_one = 1;
1356 1349
1357 if (ieee80211_is_auth(fc)) { 1350 if (ieee80211_is_auth(fc)) {
1358 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n")); 1351 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "MAC80211_LINKING\n");
1359 rtl_ips_nic_on(hw); 1352 rtl_ips_nic_on(hw);
1360 } 1353 }
1361 1354
@@ -1388,10 +1381,9 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
1388 1381
1389 if ((own == 1) && (hw_queue != BEACON_QUEUE)) { 1382 if ((own == 1) && (hw_queue != BEACON_QUEUE)) {
1390 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1383 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1391 ("No more TX desc@%d, ring->idx = %d," 1384 "No more TX desc@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%d\n",
1392 "idx = %d, skb_queue_len = 0x%d\n", 1385 hw_queue, ring->idx, idx,
1393 hw_queue, ring->idx, idx, 1386 skb_queue_len(&ring->queue));
1394 skb_queue_len(&ring->queue)));
1395 1387
1396 spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); 1388 spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
1397 return skb->len; 1389 return skb->len;
@@ -1426,11 +1418,9 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
1426 hw_queue != BEACON_QUEUE) { 1418 hw_queue != BEACON_QUEUE) {
1427 1419
1428 RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, 1420 RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
1429 ("less desc left, stop skb_queue@%d, " 1421 "less desc left, stop skb_queue@%d, ring->idx = %d, idx = %d, skb_queue_len = 0x%d\n",
1430 "ring->idx = %d," 1422 hw_queue, ring->idx, idx,
1431 "idx = %d, skb_queue_len = 0x%d\n", 1423 skb_queue_len(&ring->queue));
1432 hw_queue, ring->idx, idx,
1433 skb_queue_len(&ring->queue)));
1434 1424
1435 ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); 1425 ieee80211_stop_queue(hw, skb_get_queue_mapping(skb));
1436 } 1426 }
@@ -1497,7 +1487,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
1497 err = _rtl_pci_init_trx_ring(hw); 1487 err = _rtl_pci_init_trx_ring(hw);
1498 if (err) { 1488 if (err) {
1499 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1489 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1500 ("tx ring initialization failed")); 1490 "tx ring initialization failed\n");
1501 return err; 1491 return err;
1502 } 1492 }
1503 1493
@@ -1519,12 +1509,12 @@ static int rtl_pci_start(struct ieee80211_hw *hw)
1519 err = rtlpriv->cfg->ops->hw_init(hw); 1509 err = rtlpriv->cfg->ops->hw_init(hw);
1520 if (err) { 1510 if (err) {
1521 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1511 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1522 ("Failed to config hardware!\n")); 1512 "Failed to config hardware!\n");
1523 return err; 1513 return err;
1524 } 1514 }
1525 1515
1526 rtlpriv->cfg->ops->enable_interrupt(hw); 1516 rtlpriv->cfg->ops->enable_interrupt(hw);
1527 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("enable_interrupt OK\n")); 1517 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "enable_interrupt OK\n");
1528 1518
1529 rtl_init_rx_config(hw); 1519 rtl_init_rx_config(hw);
1530 1520
@@ -1535,7 +1525,7 @@ static int rtl_pci_start(struct ieee80211_hw *hw)
1535 1525
1536 rtlpci->up_first_time = false; 1526 rtlpci->up_first_time = false;
1537 1527
1538 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("OK\n")); 1528 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "OK\n");
1539 return 0; 1529 return 0;
1540} 1530}
1541 1531
@@ -1622,20 +1612,20 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1622 switch (revisionid) { 1612 switch (revisionid) {
1623 case RTL_PCI_REVISION_ID_8192PCIE: 1613 case RTL_PCI_REVISION_ID_8192PCIE:
1624 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1614 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1625 ("8192 PCI-E is found - " 1615 "8192 PCI-E is found - vid/did=%x/%x\n",
1626 "vid/did=%x/%x\n", venderid, deviceid)); 1616 venderid, deviceid);
1627 rtlhal->hw_type = HARDWARE_TYPE_RTL8192E; 1617 rtlhal->hw_type = HARDWARE_TYPE_RTL8192E;
1628 break; 1618 break;
1629 case RTL_PCI_REVISION_ID_8192SE: 1619 case RTL_PCI_REVISION_ID_8192SE:
1630 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1620 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1631 ("8192SE is found - " 1621 "8192SE is found - vid/did=%x/%x\n",
1632 "vid/did=%x/%x\n", venderid, deviceid)); 1622 venderid, deviceid);
1633 rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; 1623 rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE;
1634 break; 1624 break;
1635 default: 1625 default:
1636 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1626 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1637 ("Err: Unknown device - " 1627 "Err: Unknown device - vid/did=%x/%x\n",
1638 "vid/did=%x/%x\n", venderid, deviceid)); 1628 venderid, deviceid);
1639 rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE; 1629 rtlhal->hw_type = HARDWARE_TYPE_RTL8192SE;
1640 break; 1630 break;
1641 1631
@@ -1646,18 +1636,18 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1646 deviceid == RTL_PCI_8188CE_DID) { 1636 deviceid == RTL_PCI_8188CE_DID) {
1647 rtlhal->hw_type = HARDWARE_TYPE_RTL8192CE; 1637 rtlhal->hw_type = HARDWARE_TYPE_RTL8192CE;
1648 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1638 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1649 ("8192C PCI-E is found - " 1639 "8192C PCI-E is found - vid/did=%x/%x\n",
1650 "vid/did=%x/%x\n", venderid, deviceid)); 1640 venderid, deviceid);
1651 } else if (deviceid == RTL_PCI_8192DE_DID || 1641 } else if (deviceid == RTL_PCI_8192DE_DID ||
1652 deviceid == RTL_PCI_8192DE_DID2) { 1642 deviceid == RTL_PCI_8192DE_DID2) {
1653 rtlhal->hw_type = HARDWARE_TYPE_RTL8192DE; 1643 rtlhal->hw_type = HARDWARE_TYPE_RTL8192DE;
1654 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1644 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1655 ("8192D PCI-E is found - " 1645 "8192D PCI-E is found - vid/did=%x/%x\n",
1656 "vid/did=%x/%x\n", venderid, deviceid)); 1646 venderid, deviceid);
1657 } else { 1647 } else {
1658 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1648 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1659 ("Err: Unknown device -" 1649 "Err: Unknown device - vid/did=%x/%x\n",
1660 " vid/did=%x/%x\n", venderid, deviceid)); 1650 venderid, deviceid);
1661 1651
1662 rtlhal->hw_type = RTL_DEFAULT_HARDWARE_TYPE; 1652 rtlhal->hw_type = RTL_DEFAULT_HARDWARE_TYPE;
1663 } 1653 }
@@ -1665,19 +1655,18 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1665 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) { 1655 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) {
1666 if (revisionid == 0 || revisionid == 1) { 1656 if (revisionid == 0 || revisionid == 1) {
1667 if (revisionid == 0) { 1657 if (revisionid == 0) {
1668 RT_TRACE(rtlpriv, COMP_INIT, 1658 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1669 DBG_LOUD, ("Find 92DE MAC0.\n")); 1659 "Find 92DE MAC0\n");
1670 rtlhal->interfaceindex = 0; 1660 rtlhal->interfaceindex = 0;
1671 } else if (revisionid == 1) { 1661 } else if (revisionid == 1) {
1672 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1662 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1673 ("Find 92DE MAC1.\n")); 1663 "Find 92DE MAC1\n");
1674 rtlhal->interfaceindex = 1; 1664 rtlhal->interfaceindex = 1;
1675 } 1665 }
1676 } else { 1666 } else {
1677 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1667 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1678 ("Unknown device - " 1668 "Unknown device - VendorID/DeviceID=%x/%x, Revision=%x\n",
1679 "VendorID/DeviceID=%x/%x, Revision=%x\n", 1669 venderid, deviceid, revisionid);
1680 venderid, deviceid, revisionid));
1681 rtlhal->interfaceindex = 0; 1670 rtlhal->interfaceindex = 0;
1682 } 1671 }
1683 } 1672 }
@@ -1693,8 +1682,8 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1693 if (bridge_pdev->vendor == pcibridge_vendors[tmp]) { 1682 if (bridge_pdev->vendor == pcibridge_vendors[tmp]) {
1694 pcipriv->ndis_adapter.pcibridge_vendor = tmp; 1683 pcipriv->ndis_adapter.pcibridge_vendor = tmp;
1695 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1684 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1696 ("Pci Bridge Vendor is found index:" 1685 "Pci Bridge Vendor is found index: %d\n",
1697 " %d\n", tmp)); 1686 tmp);
1698 break; 1687 break;
1699 } 1688 }
1700 } 1689 }
@@ -1723,23 +1712,21 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1723 } 1712 }
1724 1713
1725 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1714 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1726 ("pcidev busnumber:devnumber:funcnumber:" 1715 "pcidev busnumber:devnumber:funcnumber:vendor:link_ctl %d:%d:%d:%x:%x\n",
1727 "vendor:link_ctl %d:%d:%d:%x:%x\n", 1716 pcipriv->ndis_adapter.busnumber,
1728 pcipriv->ndis_adapter.busnumber, 1717 pcipriv->ndis_adapter.devnumber,
1729 pcipriv->ndis_adapter.devnumber, 1718 pcipriv->ndis_adapter.funcnumber,
1730 pcipriv->ndis_adapter.funcnumber, 1719 pdev->vendor, pcipriv->ndis_adapter.linkctrl_reg);
1731 pdev->vendor, pcipriv->ndis_adapter.linkctrl_reg));
1732 1720
1733 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1721 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1734 ("pci_bridge busnumber:devnumber:funcnumber:vendor:" 1722 "pci_bridge busnumber:devnumber:funcnumber:vendor:pcie_cap:link_ctl_reg:amd %d:%d:%d:%x:%x:%x:%x\n",
1735 "pcie_cap:link_ctl_reg:amd %d:%d:%d:%x:%x:%x:%x\n", 1723 pcipriv->ndis_adapter.pcibridge_busnum,
1736 pcipriv->ndis_adapter.pcibridge_busnum, 1724 pcipriv->ndis_adapter.pcibridge_devnum,
1737 pcipriv->ndis_adapter.pcibridge_devnum, 1725 pcipriv->ndis_adapter.pcibridge_funcnum,
1738 pcipriv->ndis_adapter.pcibridge_funcnum, 1726 pcibridge_vendors[pcipriv->ndis_adapter.pcibridge_vendor],
1739 pcibridge_vendors[pcipriv->ndis_adapter.pcibridge_vendor], 1727 pcipriv->ndis_adapter.pcibridge_pciehdr_offset,
1740 pcipriv->ndis_adapter.pcibridge_pciehdr_offset, 1728 pcipriv->ndis_adapter.pcibridge_linkctrlreg,
1741 pcipriv->ndis_adapter.pcibridge_linkctrlreg, 1729 pcipriv->ndis_adapter.amd_l1_patch);
1742 pcipriv->ndis_adapter.amd_l1_patch));
1743 1730
1744 rtl_pci_parse_configuration(pdev, hw); 1731 rtl_pci_parse_configuration(pdev, hw);
1745 1732
@@ -1828,10 +1815,9 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1828 } 1815 }
1829 1816
1830 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1817 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1831 ("mem mapped space: start: 0x%08lx len:%08lx " 1818 "mem mapped space: start: 0x%08lx len:%08lx flags:%08lx, after map:0x%08lx\n",
1832 "flags:%08lx, after map:0x%08lx\n", 1819 pmem_start, pmem_len, pmem_flags,
1833 pmem_start, pmem_len, pmem_flags, 1820 rtlpriv->io.pci_mem_start);
1834 rtlpriv->io.pci_mem_start));
1835 1821
1836 /* Disable Clk Request */ 1822 /* Disable Clk Request */
1837 pci_write_config_byte(pdev, 0x81, 0); 1823 pci_write_config_byte(pdev, 0x81, 0);
@@ -1851,8 +1837,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1851 rtlpriv->cfg->ops->read_eeprom_info(hw); 1837 rtlpriv->cfg->ops->read_eeprom_info(hw);
1852 1838
1853 if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 1839 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
1854 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1840 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
1855 ("Can't init_sw_vars.\n"));
1856 goto fail3; 1841 goto fail3;
1857 } 1842 }
1858 1843
@@ -1865,22 +1850,21 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1865 err = rtl_init_core(hw); 1850 err = rtl_init_core(hw);
1866 if (err) { 1851 if (err) {
1867 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1852 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1868 ("Can't allocate sw for mac80211.\n")); 1853 "Can't allocate sw for mac80211\n");
1869 goto fail3; 1854 goto fail3;
1870 } 1855 }
1871 1856
1872 /* Init PCI sw */ 1857 /* Init PCI sw */
1873 err = !rtl_pci_init(hw, pdev); 1858 err = !rtl_pci_init(hw, pdev);
1874 if (err) { 1859 if (err) {
1875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1860 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
1876 ("Failed to init PCI.\n"));
1877 goto fail3; 1861 goto fail3;
1878 } 1862 }
1879 1863
1880 err = ieee80211_register_hw(hw); 1864 err = ieee80211_register_hw(hw);
1881 if (err) { 1865 if (err) {
1882 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1866 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1883 ("Can't register mac80211 hw.\n")); 1867 "Can't register mac80211 hw\n");
1884 goto fail3; 1868 goto fail3;
1885 } else { 1869 } else {
1886 rtlpriv->mac80211.mac80211_registered = 1; 1870 rtlpriv->mac80211.mac80211_registered = 1;
@@ -1889,7 +1873,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1889 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); 1873 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
1890 if (err) { 1874 if (err) {
1891 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1892 ("failed to create sysfs device attributes\n")); 1876 "failed to create sysfs device attributes\n");
1893 goto fail3; 1877 goto fail3;
1894 } 1878 }
1895 1879
@@ -1901,8 +1885,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1901 IRQF_SHARED, KBUILD_MODNAME, hw); 1885 IRQF_SHARED, KBUILD_MODNAME, hw);
1902 if (err) { 1886 if (err) {
1903 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1887 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1904 ("%s: failed to register IRQ handler\n", 1888 "%s: failed to register IRQ handler\n",
1905 wiphy_name(hw->wiphy))); 1889 wiphy_name(hw->wiphy));
1906 goto fail3; 1890 goto fail3;
1907 } else { 1891 } else {
1908 rtlpci->irq_alloc = 1; 1892 rtlpci->irq_alloc = 1;
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c
index 130fdd99d573..a36dc3d5e04f 100644
--- a/drivers/net/wireless/rtlwifi/ps.c
+++ b/drivers/net/wireless/rtlwifi/ps.c
@@ -44,7 +44,7 @@ bool rtl_ps_enable_nic(struct ieee80211_hw *hw)
44 44
45 if (is_hal_stop(rtlhal)) 45 if (is_hal_stop(rtlhal))
46 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 46 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
47 ("Driver is already down!\n")); 47 "Driver is already down!\n");
48 48
49 /*<2> Enable Adapter */ 49 /*<2> Enable Adapter */
50 rtlpriv->cfg->ops->hw_init(hw); 50 rtlpriv->cfg->ops->hw_init(hw);
@@ -120,7 +120,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
120 120
121 default: 121 default:
122 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 122 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
123 ("switch case not process\n")); 123 "switch case not processed\n");
124 break; 124 break;
125 } 125 }
126 126
@@ -176,7 +176,7 @@ void rtl_ips_nic_off_wq_callback(void *data)
176 176
177 if (mac->opmode != NL80211_IFTYPE_STATION) { 177 if (mac->opmode != NL80211_IFTYPE_STATION) {
178 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 178 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
179 ("not station return\n")); 179 "not station return\n");
180 return; 180 return;
181 } 181 }
182 182
@@ -207,7 +207,7 @@ void rtl_ips_nic_off_wq_callback(void *data)
207 (mac->link_state == MAC80211_NOLINK) && 207 (mac->link_state == MAC80211_NOLINK) &&
208 !mac->act_scanning) { 208 !mac->act_scanning) {
209 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 209 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
210 ("IPSEnter(): Turn off RF.\n")); 210 "IPSEnter(): Turn off RF\n");
211 211
212 ppsc->inactive_pwrstate = ERFOFF; 212 ppsc->inactive_pwrstate = ERFOFF;
213 ppsc->in_powersavemode = true; 213 ppsc->in_powersavemode = true;
@@ -280,8 +280,7 @@ static bool rtl_get_fwlps_doze(struct ieee80211_hw *hw)
280 280
281 if (ps_timediff < 2000) { 281 if (ps_timediff < 2000) {
282 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 282 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
283 ("Delay enter Fw LPS for DHCP, ARP," 283 "Delay enter Fw LPS for DHCP, ARP, or EAPOL exchanging state\n");
284 " or EAPOL exchanging state.\n"));
285 return false; 284 return false;
286 } 285 }
287 286
@@ -328,8 +327,8 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
328 bool fw_current_inps; 327 bool fw_current_inps;
329 if (ppsc->dot11_psmode == EACTIVE) { 328 if (ppsc->dot11_psmode == EACTIVE) {
330 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 329 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
331 ("FW LPS leave ps_mode:%x\n", 330 "FW LPS leave ps_mode:%x\n",
332 FW_PS_ACTIVE_MODE)); 331 FW_PS_ACTIVE_MODE);
333 332
334 rpwm_val = 0x0C; /* RF on */ 333 rpwm_val = 0x0C; /* RF on */
335 fw_pwrmode = FW_PS_ACTIVE_MODE; 334 fw_pwrmode = FW_PS_ACTIVE_MODE;
@@ -347,8 +346,8 @@ static void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode)
347 } else { 346 } else {
348 if (rtl_get_fwlps_doze(hw)) { 347 if (rtl_get_fwlps_doze(hw)) {
349 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 348 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
350 ("FW LPS enter ps_mode:%x\n", 349 "FW LPS enter ps_mode:%x\n",
351 ppsc->fwctrl_psmode)); 350 ppsc->fwctrl_psmode);
352 351
353 rpwm_val = 0x02; /* RF off */ 352 rpwm_val = 0x02; /* RF off */
354 fw_current_inps = true; 353 fw_current_inps = true;
@@ -402,7 +401,7 @@ void rtl_lps_enter(struct ieee80211_hw *hw)
402 if (mac->cnt_after_linked >= 2) { 401 if (mac->cnt_after_linked >= 2) {
403 if (ppsc->dot11_psmode == EACTIVE) { 402 if (ppsc->dot11_psmode == EACTIVE) {
404 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 403 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
405 ("Enter 802.11 power save mode...\n")); 404 "Enter 802.11 power save mode...\n");
406 405
407 rtl_lps_set_psmode(hw, EAUTOPS); 406 rtl_lps_set_psmode(hw, EAUTOPS);
408 } 407 }
@@ -434,7 +433,7 @@ void rtl_lps_leave(struct ieee80211_hw *hw)
434 } 433 }
435 434
436 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 435 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
437 ("Busy Traffic,Leave 802.11 power save..\n")); 436 "Busy Traffic,Leave 802.11 power save..\n");
438 437
439 rtl_lps_set_psmode(hw, EACTIVE); 438 rtl_lps_set_psmode(hw, EACTIVE);
440 } 439 }
@@ -518,8 +517,8 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len)
518 queue_delayed_work(rtlpriv->works.rtl_wq, 517 queue_delayed_work(rtlpriv->works.rtl_wq,
519 &rtlpriv->works.ps_work, MSECS(5)); 518 &rtlpriv->works.ps_work, MSECS(5));
520 } else { 519 } else {
521 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, ("u_bufferd: %x, " 520 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
522 "m_buffered: %x\n", u_buffed, m_buffed)); 521 "u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed);
523 } 522 }
524} 523}
525 524
@@ -607,8 +606,8 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw)
607 * sleep = dtim_period, that meaons, we should 606 * sleep = dtim_period, that meaons, we should
608 * awake before every dtim */ 607 * awake before every dtim */
609 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 608 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
610 ("dtim_counter:%x will sleep :%d" 609 "dtim_counter:%x will sleep :%d beacon_intv\n",
611 " beacon_intv\n", rtlpriv->psc.dtim_counter, sleep_intv)); 610 rtlpriv->psc.dtim_counter, sleep_intv);
612 611
613 /* we tested that 40ms is enough for sw & hw sw delay */ 612 /* we tested that 40ms is enough for sw & hw sw delay */
614 queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.ps_rfon_wq, 613 queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.ps_rfon_wq,
diff --git a/drivers/net/wireless/rtlwifi/rc.c b/drivers/net/wireless/rtlwifi/rc.c
index 539df66dce0a..4f560d6a386c 100644
--- a/drivers/net/wireless/rtlwifi/rc.c
+++ b/drivers/net/wireless/rtlwifi/rc.c
@@ -251,7 +251,7 @@ static void *rtl_rate_alloc_sta(void *ppriv,
251 rate_priv = kzalloc(sizeof(struct rtl_rate_priv), gfp); 251 rate_priv = kzalloc(sizeof(struct rtl_rate_priv), gfp);
252 if (!rate_priv) { 252 if (!rate_priv) {
253 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 253 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
254 ("Unable to allocate private rc structure\n")); 254 "Unable to allocate private rc structure\n");
255 return NULL; 255 return NULL;
256 } 256 }
257 257
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c
index 9fedb1f70919..c263df217604 100644
--- a/drivers/net/wireless/rtlwifi/regd.c
+++ b/drivers/net/wireless/rtlwifi/regd.c
@@ -398,13 +398,11 @@ int rtl_regd_init(struct ieee80211_hw *hw,
398 rtlpriv->regd.country_code = rtlpriv->efuse.channel_plan; 398 rtlpriv->regd.country_code = rtlpriv->efuse.channel_plan;
399 399
400 RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE, 400 RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE,
401 (KERN_DEBUG "rtl: EEPROM regdomain: 0x%0x\n", 401 "rtl: EEPROM regdomain: 0x%0x\n", rtlpriv->regd.country_code);
402 rtlpriv->regd.country_code));
403 402
404 if (rtlpriv->regd.country_code >= COUNTRY_CODE_MAX) { 403 if (rtlpriv->regd.country_code >= COUNTRY_CODE_MAX) {
405 RT_TRACE(rtlpriv, COMP_REGD, DBG_DMESG, 404 RT_TRACE(rtlpriv, COMP_REGD, DBG_DMESG,
406 (KERN_DEBUG "rtl: EEPROM indicates invalid contry code" 405 "rtl: EEPROM indicates invalid contry code, world wide 13 should be used\n");
407 "world wide 13 should be used\n"));
408 406
409 rtlpriv->regd.country_code = COUNTRY_CODE_WORLD_WIDE_13; 407 rtlpriv->regd.country_code = COUNTRY_CODE_WORLD_WIDE_13;
410 } 408 }
@@ -420,8 +418,8 @@ int rtl_regd_init(struct ieee80211_hw *hw,
420 } 418 }
421 419
422 RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE, 420 RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE,
423 (KERN_DEBUG "rtl: Country alpha2 being used: %c%c\n", 421 "rtl: Country alpha2 being used: %c%c\n",
424 rtlpriv->regd.alpha2[0], rtlpriv->regd.alpha2[1])); 422 rtlpriv->regd.alpha2[0], rtlpriv->regd.alpha2[1]);
425 423
426 _rtl_regd_init_wiphy(&rtlpriv->regd, wiphy, reg_notifier); 424 _rtl_regd_init_wiphy(&rtlpriv->regd, wiphy, reg_notifier);
427 425
@@ -433,7 +431,7 @@ int rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
433 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); 431 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
434 struct rtl_priv *rtlpriv = rtl_priv(hw); 432 struct rtl_priv *rtlpriv = rtl_priv(hw);
435 433
436 RT_TRACE(rtlpriv, COMP_REGD, DBG_LOUD, ("\n")); 434 RT_TRACE(rtlpriv, COMP_REGD, DBG_LOUD, "\n");
437 435
438 return _rtl_reg_notifier_apply(wiphy, request, &rtlpriv->regd); 436 return _rtl_reg_notifier_apply(wiphy, request, &rtlpriv->regd);
439} 437}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index 72a98cab6f69..bf94cbfb4e3f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -246,16 +246,15 @@ static void rtl92c_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
246 rtl_set_bbreg(hw, RCCK0_FALSEALARMREPORT, 0x0000c000, 2); 246 rtl_set_bbreg(hw, RCCK0_FALSEALARMREPORT, 0x0000c000, 2);
247 247
248 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 248 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
249 ("cnt_parity_fail = %d, cnt_rate_illegal = %d, " 249 "cnt_parity_fail = %d, cnt_rate_illegal = %d, cnt_crc8_fail = %d, cnt_mcs_fail = %d\n",
250 "cnt_crc8_fail = %d, cnt_mcs_fail = %d\n", 250 falsealm_cnt->cnt_parity_fail,
251 falsealm_cnt->cnt_parity_fail, 251 falsealm_cnt->cnt_rate_illegal,
252 falsealm_cnt->cnt_rate_illegal, 252 falsealm_cnt->cnt_crc8_fail, falsealm_cnt->cnt_mcs_fail);
253 falsealm_cnt->cnt_crc8_fail, falsealm_cnt->cnt_mcs_fail));
254 253
255 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 254 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
256 ("cnt_ofdm_fail = %x, cnt_cck_fail = %x, cnt_all = %x\n", 255 "cnt_ofdm_fail = %x, cnt_cck_fail = %x, cnt_all = %x\n",
257 falsealm_cnt->cnt_ofdm_fail, 256 falsealm_cnt->cnt_ofdm_fail,
258 falsealm_cnt->cnt_cck_fail, falsealm_cnt->cnt_all)); 257 falsealm_cnt->cnt_cck_fail, falsealm_cnt->cnt_all);
259} 258}
260 259
261static void rtl92c_dm_ctrl_initgain_by_fa(struct ieee80211_hw *hw) 260static void rtl92c_dm_ctrl_initgain_by_fa(struct ieee80211_hw *hw)
@@ -313,8 +312,8 @@ static void rtl92c_dm_ctrl_initgain_by_rssi(struct ieee80211_hw *hw)
313 dm_digtable.backoff_val; 312 dm_digtable.backoff_val;
314 313
315 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 314 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
316 ("rssi_val_min = %x backoff_val %x\n", 315 "rssi_val_min = %x backoff_val %x\n",
317 dm_digtable.rssi_val_min, dm_digtable.backoff_val)); 316 dm_digtable.rssi_val_min, dm_digtable.backoff_val);
318 317
319 rtl92c_dm_write_dig(hw); 318 rtl92c_dm_write_dig(hw);
320} 319}
@@ -364,10 +363,9 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw)
364 } 363 }
365 364
366 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 365 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
367 ("curmultista_connectstate = " 366 "curmultista_connectstate = %x dig_ext_port_stage %x\n",
368 "%x dig_ext_port_stage %x\n", 367 dm_digtable.curmultista_connectstate,
369 dm_digtable.curmultista_connectstate, 368 dm_digtable.dig_ext_port_stage);
370 dm_digtable.dig_ext_port_stage));
371} 369}
372 370
373static void rtl92c_dm_initial_gain_sta(struct ieee80211_hw *hw) 371static void rtl92c_dm_initial_gain_sta(struct ieee80211_hw *hw)
@@ -375,10 +373,9 @@ static void rtl92c_dm_initial_gain_sta(struct ieee80211_hw *hw)
375 struct rtl_priv *rtlpriv = rtl_priv(hw); 373 struct rtl_priv *rtlpriv = rtl_priv(hw);
376 374
377 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 375 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE,
378 ("presta_connectstate = %x," 376 "presta_connectstate = %x, cursta_connectctate = %x\n",
379 " cursta_connectctate = %x\n", 377 dm_digtable.presta_connectstate,
380 dm_digtable.presta_connectstate, 378 dm_digtable.cursta_connectctate);
381 dm_digtable.cursta_connectctate));
382 379
383 if (dm_digtable.presta_connectstate == dm_digtable.cursta_connectctate 380 if (dm_digtable.presta_connectstate == dm_digtable.cursta_connectctate
384 || dm_digtable.cursta_connectctate == DIG_STA_BEFORE_CONNECT 381 || dm_digtable.cursta_connectctate == DIG_STA_BEFORE_CONNECT
@@ -464,11 +461,11 @@ static void rtl92c_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
464 dm_digtable.pre_cck_pd_state = dm_digtable.cur_cck_pd_state; 461 dm_digtable.pre_cck_pd_state = dm_digtable.cur_cck_pd_state;
465 } 462 }
466 463
467 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 464 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, "CCKPDStage=%x\n",
468 ("CCKPDStage=%x\n", dm_digtable.cur_cck_pd_state)); 465 dm_digtable.cur_cck_pd_state);
469 466
470 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, 467 RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, "is92C=%x\n",
471 ("is92C=%x\n", IS_92C_SERIAL(rtlhal->version))); 468 IS_92C_SERIAL(rtlhal->version));
472} 469}
473 470
474static void rtl92c_dm_ctrl_initgain_by_twoport(struct ieee80211_hw *hw) 471static void rtl92c_dm_ctrl_initgain_by_twoport(struct ieee80211_hw *hw)
@@ -519,10 +516,9 @@ void rtl92c_dm_write_dig(struct ieee80211_hw *hw)
519 struct rtl_priv *rtlpriv = rtl_priv(hw); 516 struct rtl_priv *rtlpriv = rtl_priv(hw);
520 517
521 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 518 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
522 ("cur_igvalue = 0x%x, " 519 "cur_igvalue = 0x%x, pre_igvalue = 0x%x, backoff_val = %d\n",
523 "pre_igvalue = 0x%x, backoff_val = %d\n", 520 dm_digtable.cur_igvalue, dm_digtable.pre_igvalue,
524 dm_digtable.cur_igvalue, dm_digtable.pre_igvalue, 521 dm_digtable.backoff_val);
525 dm_digtable.backoff_val));
526 522
527 if (dm_digtable.pre_igvalue != dm_digtable.cur_igvalue) { 523 if (dm_digtable.pre_igvalue != dm_digtable.cur_igvalue) {
528 rtl_set_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f, 524 rtl_set_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f,
@@ -676,15 +672,14 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
676 672
677 rtlpriv->dm.txpower_trackinginit = true; 673 rtlpriv->dm.txpower_trackinginit = true;
678 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 674 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
679 ("rtl92c_dm_txpower_tracking_callback_thermalmeter\n")); 675 "rtl92c_dm_txpower_tracking_callback_thermalmeter\n");
680 676
681 thermalvalue = (u8) rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0x1f); 677 thermalvalue = (u8) rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0x1f);
682 678
683 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 679 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
684 ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x " 680 "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x\n",
685 "eeprom_thermalmeter 0x%x\n", 681 thermalvalue, rtlpriv->dm.thermalvalue,
686 thermalvalue, rtlpriv->dm.thermalvalue, 682 rtlefuse->eeprom_thermalmeter);
687 rtlefuse->eeprom_thermalmeter));
688 683
689 rtl92c_phy_ap_calibrate(hw, (thermalvalue - 684 rtl92c_phy_ap_calibrate(hw, (thermalvalue -
690 rtlefuse->eeprom_thermalmeter)); 685 rtlefuse->eeprom_thermalmeter));
@@ -702,10 +697,9 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
702 ofdm_index_old[0] = (u8) i; 697 ofdm_index_old[0] = (u8) i;
703 698
704 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 699 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
705 ("Initial pathA ele_d reg0x%x = 0x%lx, " 700 "Initial pathA ele_d reg0x%x = 0x%lx, ofdm_index=0x%x\n",
706 "ofdm_index=0x%x\n",
707 ROFDM0_XATXIQIMBALANCE, 701 ROFDM0_XATXIQIMBALANCE,
708 ele_d, ofdm_index_old[0])); 702 ele_d, ofdm_index_old[0]);
709 break; 703 break;
710 } 704 }
711 } 705 }
@@ -719,11 +713,10 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
719 MASKOFDM_D)) { 713 MASKOFDM_D)) {
720 714
721 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 715 RT_TRACE(rtlpriv, COMP_POWER_TRACKING,
722 DBG_LOUD, 716 DBG_LOUD,
723 ("Initial pathB ele_d reg0x%x = " 717 "Initial pathB ele_d reg0x%x = 0x%lx, ofdm_index=0x%x\n",
724 "0x%lx, ofdm_index=0x%x\n", 718 ROFDM0_XBTXIQIMBALANCE, ele_d,
725 ROFDM0_XBTXIQIMBALANCE, ele_d, 719 ofdm_index_old[1]);
726 ofdm_index_old[1]));
727 break; 720 break;
728 } 721 }
729 } 722 }
@@ -741,11 +734,10 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
741 734
742 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 735 RT_TRACE(rtlpriv, COMP_POWER_TRACKING,
743 DBG_LOUD, 736 DBG_LOUD,
744 ("Initial reg0x%x = 0x%lx, " 737 "Initial reg0x%x = 0x%lx, cck_index=0x%x, ch 14 %d\n",
745 "cck_index=0x%x, ch 14 %d\n", 738 RCCK0_TXFILTER2, temp_cck,
746 RCCK0_TXFILTER2, temp_cck, 739 cck_index_old,
747 cck_index_old, 740 rtlpriv->dm.cck_inch14);
748 rtlpriv->dm.cck_inch14));
749 break; 741 break;
750 } 742 }
751 } else { 743 } else {
@@ -757,11 +749,10 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
757 749
758 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 750 RT_TRACE(rtlpriv, COMP_POWER_TRACKING,
759 DBG_LOUD, 751 DBG_LOUD,
760 ("Initial reg0x%x = 0x%lx, " 752 "Initial reg0x%x = 0x%lx, cck_index=0x%x, ch14 %d\n",
761 "cck_index=0x%x, ch14 %d\n", 753 RCCK0_TXFILTER2, temp_cck,
762 RCCK0_TXFILTER2, temp_cck, 754 cck_index_old,
763 cck_index_old, 755 rtlpriv->dm.cck_inch14);
764 rtlpriv->dm.cck_inch14));
765 break; 756 break;
766 } 757 }
767 } 758 }
@@ -790,12 +781,10 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
790 (rtlpriv->dm.thermalvalue_iqk - thermalvalue); 781 (rtlpriv->dm.thermalvalue_iqk - thermalvalue);
791 782
792 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 783 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
793 ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x " 784 "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x delta 0x%x delta_lck 0x%x delta_iqk 0x%x\n",
794 "eeprom_thermalmeter 0x%x delta 0x%x "
795 "delta_lck 0x%x delta_iqk 0x%x\n",
796 thermalvalue, rtlpriv->dm.thermalvalue, 785 thermalvalue, rtlpriv->dm.thermalvalue,
797 rtlefuse->eeprom_thermalmeter, delta, delta_lck, 786 rtlefuse->eeprom_thermalmeter, delta, delta_lck,
798 delta_iqk)); 787 delta_iqk);
799 788
800 if (delta_lck > 1) { 789 if (delta_lck > 1) {
801 rtlpriv->dm.thermalvalue_lck = thermalvalue; 790 rtlpriv->dm.thermalvalue_lck = thermalvalue;
@@ -815,18 +804,15 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
815 804
816 if (is2t) { 805 if (is2t) {
817 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 806 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
818 ("temp OFDM_A_index=0x%x, " 807 "temp OFDM_A_index=0x%x, OFDM_B_index=0x%x, cck_index=0x%x\n",
819 "OFDM_B_index=0x%x," 808 rtlpriv->dm.ofdm_index[0],
820 "cck_index=0x%x\n", 809 rtlpriv->dm.ofdm_index[1],
821 rtlpriv->dm.ofdm_index[0], 810 rtlpriv->dm.cck_index);
822 rtlpriv->dm.ofdm_index[1],
823 rtlpriv->dm.cck_index));
824 } else { 811 } else {
825 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 812 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
826 ("temp OFDM_A_index=0x%x," 813 "temp OFDM_A_index=0x%x, cck_index=0x%x\n",
827 "cck_index=0x%x\n", 814 rtlpriv->dm.ofdm_index[0],
828 rtlpriv->dm.ofdm_index[0], 815 rtlpriv->dm.cck_index);
829 rtlpriv->dm.cck_index));
830 } 816 }
831 817
832 if (thermalvalue > rtlefuse->eeprom_thermalmeter) { 818 if (thermalvalue > rtlefuse->eeprom_thermalmeter) {
@@ -918,16 +904,13 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
918 904
919 if (is2t) { 905 if (is2t) {
920 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 906 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
921 ("new OFDM_A_index=0x%x, " 907 "new OFDM_A_index=0x%x, OFDM_B_index=0x%x, cck_index=0x%x\n",
922 "OFDM_B_index=0x%x," 908 ofdm_index[0], ofdm_index[1],
923 "cck_index=0x%x\n", 909 cck_index);
924 ofdm_index[0], ofdm_index[1],
925 cck_index));
926 } else { 910 } else {
927 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 911 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
928 ("new OFDM_A_index=0x%x," 912 "new OFDM_A_index=0x%x, cck_index=0x%x\n",
929 "cck_index=0x%x\n", 913 ofdm_index[0], cck_index);
930 ofdm_index[0], cck_index));
931 } 914 }
932 } 915 }
933 916
@@ -1085,7 +1068,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
1085 rtlpriv->dm.thermalvalue = thermalvalue; 1068 rtlpriv->dm.thermalvalue = thermalvalue;
1086 } 1069 }
1087 1070
1088 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, ("<===\n")); 1071 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "<===\n");
1089 1072
1090} 1073}
1091 1074
@@ -1098,8 +1081,8 @@ static void rtl92c_dm_initialize_txpower_tracking_thermalmeter(
1098 rtlpriv->dm.txpower_trackinginit = false; 1081 rtlpriv->dm.txpower_trackinginit = false;
1099 1082
1100 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1083 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1101 ("pMgntInfo->txpower_tracking = %d\n", 1084 "pMgntInfo->txpower_tracking = %d\n",
1102 rtlpriv->dm.txpower_tracking)); 1085 rtlpriv->dm.txpower_tracking);
1103} 1086}
1104 1087
1105static void rtl92c_dm_initialize_txpower_tracking(struct ieee80211_hw *hw) 1088static void rtl92c_dm_initialize_txpower_tracking(struct ieee80211_hw *hw)
@@ -1125,12 +1108,12 @@ static void rtl92c_dm_check_txpower_tracking_thermal_meter(
1125 rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER, RFREG_OFFSET_MASK, 1108 rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER, RFREG_OFFSET_MASK,
1126 0x60); 1109 0x60);
1127 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1110 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1128 ("Trigger 92S Thermal Meter!!\n")); 1111 "Trigger 92S Thermal Meter!!\n");
1129 tm_trigger = 1; 1112 tm_trigger = 1;
1130 return; 1113 return;
1131 } else { 1114 } else {
1132 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1115 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1133 ("Schedule TxPowerTracking direct call!!\n")); 1116 "Schedule TxPowerTracking direct call!!\n");
1134 rtl92c_dm_txpower_tracking_directcall(hw); 1117 rtl92c_dm_txpower_tracking_directcall(hw);
1135 tm_trigger = 0; 1118 tm_trigger = 0;
1136 } 1119 }
@@ -1169,13 +1152,13 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
1169 1152
1170 if (is_hal_stop(rtlhal)) { 1153 if (is_hal_stop(rtlhal)) {
1171 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 1154 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
1172 ("<---- driver is going to unload\n")); 1155 "<---- driver is going to unload\n");
1173 return; 1156 return;
1174 } 1157 }
1175 1158
1176 if (!rtlpriv->dm.useramask) { 1159 if (!rtlpriv->dm.useramask) {
1177 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 1160 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
1178 ("<---- driver does not control rate adaptive mask\n")); 1161 "<---- driver does not control rate adaptive mask\n");
1179 return; 1162 return;
1180 } 1163 }
1181 1164
@@ -1210,14 +1193,13 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
1210 p_ra->ratr_state = DM_RATR_STA_LOW; 1193 p_ra->ratr_state = DM_RATR_STA_LOW;
1211 1194
1212 if (p_ra->pre_ratr_state != p_ra->ratr_state) { 1195 if (p_ra->pre_ratr_state != p_ra->ratr_state) {
1196 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, "RSSI = %ld\n",
1197 rtlpriv->dm.undecorated_smoothed_pwdb);
1213 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 1198 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
1214 ("RSSI = %ld\n", 1199 "RSSI_LEVEL = %d\n", p_ra->ratr_state);
1215 rtlpriv->dm.undecorated_smoothed_pwdb));
1216 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 1200 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
1217 ("RSSI_LEVEL = %d\n", p_ra->ratr_state)); 1201 "PreState = %d, CurState = %d\n",
1218 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 1202 p_ra->pre_ratr_state, p_ra->ratr_state);
1219 ("PreState = %d, CurState = %d\n",
1220 p_ra->pre_ratr_state, p_ra->ratr_state));
1221 1203
1222 rcu_read_lock(); 1204 rcu_read_lock();
1223 sta = ieee80211_find_sta(mac->vif, mac->bssid); 1205 sta = ieee80211_find_sta(mac->vif, mac->bssid);
@@ -1316,8 +1298,7 @@ static void rtl92c_dm_dynamic_bb_powersaving(struct ieee80211_hw *hw)
1316 if (((mac->link_state == MAC80211_NOLINK)) && 1298 if (((mac->link_state == MAC80211_NOLINK)) &&
1317 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) { 1299 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) {
1318 dm_pstable.rssi_val_min = 0; 1300 dm_pstable.rssi_val_min = 0;
1319 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD, 1301 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD, "Not connected to any\n");
1320 ("Not connected to any\n"));
1321 } 1302 }
1322 1303
1323 if (mac->link_state == MAC80211_LINKED) { 1304 if (mac->link_state == MAC80211_LINKED) {
@@ -1325,22 +1306,22 @@ static void rtl92c_dm_dynamic_bb_powersaving(struct ieee80211_hw *hw)
1325 dm_pstable.rssi_val_min = 1306 dm_pstable.rssi_val_min =
1326 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 1307 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
1327 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD, 1308 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD,
1328 ("AP Client PWDB = 0x%lx\n", 1309 "AP Client PWDB = 0x%lx\n",
1329 dm_pstable.rssi_val_min)); 1310 dm_pstable.rssi_val_min);
1330 } else { 1311 } else {
1331 dm_pstable.rssi_val_min = 1312 dm_pstable.rssi_val_min =
1332 rtlpriv->dm.undecorated_smoothed_pwdb; 1313 rtlpriv->dm.undecorated_smoothed_pwdb;
1333 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD, 1314 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD,
1334 ("STA Default Port PWDB = 0x%lx\n", 1315 "STA Default Port PWDB = 0x%lx\n",
1335 dm_pstable.rssi_val_min)); 1316 dm_pstable.rssi_val_min);
1336 } 1317 }
1337 } else { 1318 } else {
1338 dm_pstable.rssi_val_min = 1319 dm_pstable.rssi_val_min =
1339 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 1320 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
1340 1321
1341 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD, 1322 RT_TRACE(rtlpriv, DBG_LOUD, DBG_LOUD,
1342 ("AP Ext Port PWDB = 0x%lx\n", 1323 "AP Ext Port PWDB = 0x%lx\n",
1343 dm_pstable.rssi_val_min)); 1324 dm_pstable.rssi_val_min);
1344 } 1325 }
1345 1326
1346 if (IS_92C_SERIAL(rtlhal->version)) 1327 if (IS_92C_SERIAL(rtlhal->version))
@@ -1381,7 +1362,7 @@ void rtl92c_dm_dynamic_txpower(struct ieee80211_hw *hw)
1381 if ((mac->link_state < MAC80211_LINKED) && 1362 if ((mac->link_state < MAC80211_LINKED) &&
1382 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) { 1363 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) {
1383 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 1364 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
1384 ("Not connected to any\n")); 1365 "Not connected to any\n");
1385 1366
1386 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 1367 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
1387 1368
@@ -1394,28 +1375,28 @@ void rtl92c_dm_dynamic_txpower(struct ieee80211_hw *hw)
1394 undecorated_smoothed_pwdb = 1375 undecorated_smoothed_pwdb =
1395 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 1376 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
1396 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1377 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1397 ("AP Client PWDB = 0x%lx\n", 1378 "AP Client PWDB = 0x%lx\n",
1398 undecorated_smoothed_pwdb)); 1379 undecorated_smoothed_pwdb);
1399 } else { 1380 } else {
1400 undecorated_smoothed_pwdb = 1381 undecorated_smoothed_pwdb =
1401 rtlpriv->dm.undecorated_smoothed_pwdb; 1382 rtlpriv->dm.undecorated_smoothed_pwdb;
1402 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1383 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1403 ("STA Default Port PWDB = 0x%lx\n", 1384 "STA Default Port PWDB = 0x%lx\n",
1404 undecorated_smoothed_pwdb)); 1385 undecorated_smoothed_pwdb);
1405 } 1386 }
1406 } else { 1387 } else {
1407 undecorated_smoothed_pwdb = 1388 undecorated_smoothed_pwdb =
1408 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 1389 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
1409 1390
1410 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1391 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1411 ("AP Ext Port PWDB = 0x%lx\n", 1392 "AP Ext Port PWDB = 0x%lx\n",
1412 undecorated_smoothed_pwdb)); 1393 undecorated_smoothed_pwdb);
1413 } 1394 }
1414 1395
1415 if (undecorated_smoothed_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) { 1396 if (undecorated_smoothed_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) {
1416 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 1397 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1;
1417 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1398 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1418 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n")); 1399 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n");
1419 } else if ((undecorated_smoothed_pwdb < 1400 } else if ((undecorated_smoothed_pwdb <
1420 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) && 1401 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) &&
1421 (undecorated_smoothed_pwdb >= 1402 (undecorated_smoothed_pwdb >=
@@ -1423,18 +1404,18 @@ void rtl92c_dm_dynamic_txpower(struct ieee80211_hw *hw)
1423 1404
1424 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 1405 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1;
1425 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1406 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1426 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n")); 1407 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n");
1427 } else if (undecorated_smoothed_pwdb < 1408 } else if (undecorated_smoothed_pwdb <
1428 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) { 1409 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) {
1429 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 1410 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
1430 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1411 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1431 ("TXHIGHPWRLEVEL_NORMAL\n")); 1412 "TXHIGHPWRLEVEL_NORMAL\n");
1432 } 1413 }
1433 1414
1434 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) { 1415 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) {
1435 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1416 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1436 ("PHY_SetTxPowerLevel8192S() Channel = %d\n", 1417 "PHY_SetTxPowerLevel8192S() Channel = %d\n",
1437 rtlphy->current_channel)); 1418 rtlphy->current_channel);
1438 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel); 1419 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel);
1439 } 1420 }
1440 1421
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index 5401b32733d3..12c025bf53b2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -172,7 +172,7 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
172 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 172 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
173 u8 *bufferPtr = (u8 *) buffer; 173 u8 *bufferPtr = (u8 *) buffer;
174 174
175 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, ("FW size is %d bytes,\n", size)); 175 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "FW size is %d bytes\n", size);
176 176
177 if (IS_CHIP_VER_B(version)) { 177 if (IS_CHIP_VER_B(version)) {
178 u32 pageNums, remainSize; 178 u32 pageNums, remainSize;
@@ -186,7 +186,7 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
186 186
187 if (pageNums > 4) { 187 if (pageNums > 4) {
188 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 188 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
189 ("Page numbers should not greater then 4\n")); 189 "Page numbers should not greater then 4\n");
190 } 190 }
191 191
192 for (page = 0; page < pageNums; page++) { 192 for (page = 0; page < pageNums; page++) {
@@ -219,13 +219,12 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
219 219
220 if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) { 220 if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
221 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 221 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
222 ("chksum report faill ! REG_MCUFWDL:0x%08x .\n", 222 "chksum report faill ! REG_MCUFWDL:0x%08x\n", value32);
223 value32));
224 return -EIO; 223 return -EIO;
225 } 224 }
226 225
227 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, 226 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
228 ("Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32)); 227 "Checksum report OK ! REG_MCUFWDL:0x%08x\n", value32);
229 228
230 value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL); 229 value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
231 value32 |= MCUFWDL_RDY; 230 value32 |= MCUFWDL_RDY;
@@ -238,9 +237,8 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
238 value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL); 237 value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
239 if (value32 & WINTINI_RDY) { 238 if (value32 & WINTINI_RDY) {
240 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, 239 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
241 ("Polling FW ready success!!" 240 "Polling FW ready success!! REG_MCUFWDL:0x%08x\n",
242 " REG_MCUFWDL:0x%08x .\n", 241 value32);
243 value32));
244 return 0; 242 return 0;
245 } 243 }
246 244
@@ -249,7 +247,7 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
249 } while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT); 247 } while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
250 248
251 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 249 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
252 ("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32)); 250 "Polling FW ready fail!! REG_MCUFWDL:0x%08x\n", value32);
253 return -EIO; 251 return -EIO;
254} 252}
255 253
@@ -272,10 +270,10 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
272 270
273 if (IS_FW_HEADER_EXIST(pfwheader)) { 271 if (IS_FW_HEADER_EXIST(pfwheader)) {
274 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 272 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
275 ("Firmware Version(%d), Signature(%#x),Size(%d)\n", 273 "Firmware Version(%d), Signature(%#x),Size(%d)\n",
276 le16_to_cpu(pfwheader->version), 274 le16_to_cpu(pfwheader->version),
277 le16_to_cpu(pfwheader->signature), 275 le16_to_cpu(pfwheader->signature),
278 (uint)sizeof(struct rtl92c_firmware_header))); 276 (uint)sizeof(struct rtl92c_firmware_header));
279 277
280 pfwdata = pfwdata + sizeof(struct rtl92c_firmware_header); 278 pfwdata = pfwdata + sizeof(struct rtl92c_firmware_header);
281 fwsize = fwsize - sizeof(struct rtl92c_firmware_header); 279 fwsize = fwsize - sizeof(struct rtl92c_firmware_header);
@@ -287,10 +285,10 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
287 285
288 if (_rtl92c_fw_free_to_go(hw)) { 286 if (_rtl92c_fw_free_to_go(hw)) {
289 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 287 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
290 ("Firmware is not ready to run!\n")); 288 "Firmware is not ready to run!\n");
291 } else { 289 } else {
292 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, 290 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
293 ("Firmware is ready to run!\n")); 291 "Firmware is ready to run!\n");
294 } 292 }
295 293
296 return 0; 294 return 0;
@@ -328,22 +326,22 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
328 unsigned long flag; 326 unsigned long flag;
329 u8 idx; 327 u8 idx;
330 328
331 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("come in\n")); 329 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "come in\n");
332 330
333 while (true) { 331 while (true) {
334 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); 332 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
335 if (rtlhal->h2c_setinprogress) { 333 if (rtlhal->h2c_setinprogress) {
336 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 334 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
337 ("H2C set in progress! Wait to set.." 335 "H2C set in progress! Wait to set..element_id(%d)\n",
338 "element_id(%d).\n", element_id)); 336 element_id);
339 337
340 while (rtlhal->h2c_setinprogress) { 338 while (rtlhal->h2c_setinprogress) {
341 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, 339 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock,
342 flag); 340 flag);
343 h2c_waitcounter++; 341 h2c_waitcounter++;
344 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 342 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
345 ("Wait 100 us (%d times)...\n", 343 "Wait 100 us (%d times)...\n",
346 h2c_waitcounter)); 344 h2c_waitcounter);
347 udelay(100); 345 udelay(100);
348 346
349 if (h2c_waitcounter > 1000) 347 if (h2c_waitcounter > 1000)
@@ -363,8 +361,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
363 wait_writeh2c_limmit--; 361 wait_writeh2c_limmit--;
364 if (wait_writeh2c_limmit == 0) { 362 if (wait_writeh2c_limmit == 0) {
365 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 363 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
366 ("Write H2C fail because no trigger " 364 "Write H2C fail because no trigger for FW INT!\n");
367 "for FW INT!\n"));
368 break; 365 break;
369 } 366 }
370 367
@@ -388,7 +385,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
388 break; 385 break;
389 default: 386 default:
390 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 387 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
391 ("switch case not process\n")); 388 "switch case not processed\n");
392 break; 389 break;
393 } 390 }
394 391
@@ -398,8 +395,8 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
398 wait_h2c_limmit--; 395 wait_h2c_limmit--;
399 if (wait_h2c_limmit == 0) { 396 if (wait_h2c_limmit == 0) {
400 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 397 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
401 ("Wating too long for FW read " 398 "Waiting too long for FW read clear HMEBox(%d)!\n",
402 "clear HMEBox(%d)!\n", boxnum)); 399 boxnum);
403 break; 400 break;
404 } 401 }
405 402
@@ -408,14 +405,14 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
408 isfw_read = _rtl92c_check_fw_read_last_h2c(hw, boxnum); 405 isfw_read = _rtl92c_check_fw_read_last_h2c(hw, boxnum);
409 u1b_tmp = rtl_read_byte(rtlpriv, 0x1BF); 406 u1b_tmp = rtl_read_byte(rtlpriv, 0x1BF);
410 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 407 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
411 ("Wating for FW read clear HMEBox(%d)!!! " 408 "Waiting for FW read clear HMEBox(%d)!!! 0x1BF = %2x\n",
412 "0x1BF = %2x\n", boxnum, u1b_tmp)); 409 boxnum, u1b_tmp);
413 } 410 }
414 411
415 if (!isfw_read) { 412 if (!isfw_read) {
416 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 413 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
417 ("Write H2C register BOX[%d] fail!!!!! " 414 "Write H2C register BOX[%d] fail!!!!! Fw do not read\n",
418 "Fw do not read.\n", boxnum)); 415 boxnum);
419 break; 416 break;
420 } 417 }
421 418
@@ -423,8 +420,8 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
423 memset(boxextcontent, 0, sizeof(boxextcontent)); 420 memset(boxextcontent, 0, sizeof(boxextcontent));
424 boxcontent[0] = element_id; 421 boxcontent[0] = element_id;
425 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 422 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
426 ("Write element_id box_reg(%4x) = %2x\n", 423 "Write element_id box_reg(%4x) = %2x\n",
427 box_reg, element_id)); 424 box_reg, element_id);
428 425
429 switch (cmd_len) { 426 switch (cmd_len) {
430 case 1: 427 case 1:
@@ -493,7 +490,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
493 break; 490 break;
494 default: 491 default:
495 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 492 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
496 ("switch case not process\n")); 493 "switch case not processed\n");
497 break; 494 break;
498 } 495 }
499 496
@@ -504,15 +501,15 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
504 rtlhal->last_hmeboxnum = 0; 501 rtlhal->last_hmeboxnum = 0;
505 502
506 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 503 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
507 ("pHalData->last_hmeboxnum = %d\n", 504 "pHalData->last_hmeboxnum = %d\n",
508 rtlhal->last_hmeboxnum)); 505 rtlhal->last_hmeboxnum);
509 } 506 }
510 507
511 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); 508 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
512 rtlhal->h2c_setinprogress = false; 509 rtlhal->h2c_setinprogress = false;
513 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); 510 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
514 511
515 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("go out\n")); 512 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "go out\n");
516} 513}
517 514
518void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, 515void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
@@ -562,7 +559,7 @@ void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode)
562 u8 u1_h2c_set_pwrmode[3] = {0}; 559 u8 u1_h2c_set_pwrmode[3] = {0};
563 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 560 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
564 561
565 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("FW LPS mode = %d\n", mode)); 562 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "FW LPS mode = %d\n", mode);
566 563
567 SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, mode); 564 SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, mode);
568 SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode, 1); 565 SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode, 1);
@@ -798,14 +795,14 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool dl_finished)
798 795
799 if (dlok) { 796 if (dlok) {
800 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 797 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
801 ("Set RSVD page location to Fw.\n")); 798 "Set RSVD page location to Fw\n");
802 RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG, 799 RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
803 "H2C_RSVDPAGE", u1RsvdPageLoc, 3); 800 "H2C_RSVDPAGE", u1RsvdPageLoc, 3);
804 rtl92c_fill_h2c_cmd(hw, H2C_RSVDPAGE, 801 rtl92c_fill_h2c_cmd(hw, H2C_RSVDPAGE,
805 sizeof(u1RsvdPageLoc), u1RsvdPageLoc); 802 sizeof(u1RsvdPageLoc), u1RsvdPageLoc);
806 } else 803 } else
807 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 804 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
808 ("Set RSVD page location to Fw FAIL!!!!!!.\n")); 805 "Set RSVD page location to Fw FAIL!!!!!!\n");
809} 806}
810EXPORT_SYMBOL(rtl92c_set_fw_rsvdpagepkt); 807EXPORT_SYMBOL(rtl92c_set_fw_rsvdpagepkt);
811 808
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
index 1f07558debf2..8ab93a69f334 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
@@ -42,16 +42,15 @@ u32 rtl92c_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
42 struct rtl_priv *rtlpriv = rtl_priv(hw); 42 struct rtl_priv *rtlpriv = rtl_priv(hw);
43 u32 returnvalue, originalvalue, bitshift; 43 u32 returnvalue, originalvalue, bitshift;
44 44
45 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 45 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n",
46 "bitmask(%#x)\n", regaddr, 46 regaddr, bitmask);
47 bitmask));
48 originalvalue = rtl_read_dword(rtlpriv, regaddr); 47 originalvalue = rtl_read_dword(rtlpriv, regaddr);
49 bitshift = _rtl92c_phy_calculate_bit_shift(bitmask); 48 bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
50 returnvalue = (originalvalue & bitmask) >> bitshift; 49 returnvalue = (originalvalue & bitmask) >> bitshift;
51 50
52 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("BBR MASK=0x%x " 51 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
53 "Addr[0x%x]=0x%x\n", bitmask, 52 "BBR MASK=0x%x Addr[0x%x]=0x%x\n",
54 regaddr, originalvalue)); 53 bitmask, regaddr, originalvalue);
55 54
56 return returnvalue; 55 return returnvalue;
57 56
@@ -64,9 +63,9 @@ void rtl92c_phy_set_bb_reg(struct ieee80211_hw *hw,
64 struct rtl_priv *rtlpriv = rtl_priv(hw); 63 struct rtl_priv *rtlpriv = rtl_priv(hw);
65 u32 originalvalue, bitshift; 64 u32 originalvalue, bitshift;
66 65
67 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 66 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
68 " data(%#x)\n", regaddr, bitmask, 67 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
69 data)); 68 regaddr, bitmask, data);
70 69
71 if (bitmask != MASKDWORD) { 70 if (bitmask != MASKDWORD) {
72 originalvalue = rtl_read_dword(rtlpriv, regaddr); 71 originalvalue = rtl_read_dword(rtlpriv, regaddr);
@@ -76,9 +75,9 @@ void rtl92c_phy_set_bb_reg(struct ieee80211_hw *hw,
76 75
77 rtl_write_dword(rtlpriv, regaddr, data); 76 rtl_write_dword(rtlpriv, regaddr, data);
78 77
79 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 78 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
80 " data(%#x)\n", regaddr, bitmask, 79 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
81 data)); 80 regaddr, bitmask, data);
82 81
83} 82}
84EXPORT_SYMBOL(rtl92c_phy_set_bb_reg); 83EXPORT_SYMBOL(rtl92c_phy_set_bb_reg);
@@ -114,7 +113,7 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
114 offset &= 0x3f; 113 offset &= 0x3f;
115 newoffset = offset; 114 newoffset = offset;
116 if (RT_CANNOT_IO(hw)) { 115 if (RT_CANNOT_IO(hw)) {
117 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("return all one\n")); 116 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
118 return 0xFFFFFFFF; 117 return 0xFFFFFFFF;
119 } 118 }
120 tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD); 119 tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -144,9 +143,8 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
144 else 143 else
145 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback, 144 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback,
146 BLSSIREADBACKDATA); 145 BLSSIREADBACKDATA);
147 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFR-%d Addr[0x%x]=0x%x\n", 146 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFR-%d Addr[0x%x]=0x%x\n",
148 rfpath, pphyreg->rflssi_readback, 147 rfpath, pphyreg->rflssi_readback, retvalue);
149 retvalue));
150 return retvalue; 148 return retvalue;
151} 149}
152EXPORT_SYMBOL(_rtl92c_phy_rf_serial_read); 150EXPORT_SYMBOL(_rtl92c_phy_rf_serial_read);
@@ -162,16 +160,15 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
162 struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath]; 160 struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
163 161
164 if (RT_CANNOT_IO(hw)) { 162 if (RT_CANNOT_IO(hw)) {
165 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("stop\n")); 163 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
166 return; 164 return;
167 } 165 }
168 offset &= 0x3f; 166 offset &= 0x3f;
169 newoffset = offset; 167 newoffset = offset;
170 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff; 168 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff;
171 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr); 169 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr);
172 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFW-%d Addr[0x%x]=0x%x\n", 170 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFW-%d Addr[0x%x]=0x%x\n",
173 rfpath, pphyreg->rf3wire_offset, 171 rfpath, pphyreg->rf3wire_offset, data_and_addr);
174 data_and_addr));
175} 172}
176EXPORT_SYMBOL(_rtl92c_phy_rf_serial_write); 173EXPORT_SYMBOL(_rtl92c_phy_rf_serial_write);
177 174
@@ -216,16 +213,16 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
216 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 213 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
217 bool rtstatus; 214 bool rtstatus;
218 215
219 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("==>\n")); 216 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "==>\n");
220 rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw, 217 rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw,
221 BASEBAND_CONFIG_PHY_REG); 218 BASEBAND_CONFIG_PHY_REG);
222 if (rtstatus != true) { 219 if (rtstatus != true) {
223 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Write BB Reg Fail!!")); 220 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
224 return false; 221 return false;
225 } 222 }
226 if (rtlphy->rf_type == RF_1T2R) { 223 if (rtlphy->rf_type == RF_1T2R) {
227 _rtl92c_phy_bb_config_1t(hw); 224 _rtl92c_phy_bb_config_1t(hw);
228 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Config to 1T!!\n")); 225 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Config to 1T!!\n");
229 } 226 }
230 if (rtlefuse->autoload_failflag == false) { 227 if (rtlefuse->autoload_failflag == false) {
231 rtlphy->pwrgroup_cnt = 0; 228 rtlphy->pwrgroup_cnt = 0;
@@ -233,13 +230,13 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
233 BASEBAND_CONFIG_PHY_REG); 230 BASEBAND_CONFIG_PHY_REG);
234 } 231 }
235 if (rtstatus != true) { 232 if (rtstatus != true) {
236 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("BB_PG Reg Fail!!")); 233 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
237 return false; 234 return false;
238 } 235 }
239 rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw, 236 rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw,
240 BASEBAND_CONFIG_AGC_TAB); 237 BASEBAND_CONFIG_AGC_TAB);
241 if (rtstatus != true) { 238 if (rtstatus != true) {
242 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("AGC Table Fail\n")); 239 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
243 return false; 240 return false;
244 } 241 }
245 rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw, 242 rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw,
@@ -260,114 +257,114 @@ void _rtl92c_store_pwrIndex_diffrate_offset(struct ieee80211_hw *hw,
260 if (regaddr == RTXAGC_A_RATE18_06) { 257 if (regaddr == RTXAGC_A_RATE18_06) {
261 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][0] = data; 258 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][0] = data;
262 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 259 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
263 ("MCSTxPowerLevelOriginalOffset[%d][0] = 0x%x\n", 260 "MCSTxPowerLevelOriginalOffset[%d][0] = 0x%x\n",
264 rtlphy->pwrgroup_cnt, 261 rtlphy->pwrgroup_cnt,
265 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][0])); 262 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][0]);
266 } 263 }
267 if (regaddr == RTXAGC_A_RATE54_24) { 264 if (regaddr == RTXAGC_A_RATE54_24) {
268 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][1] = data; 265 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][1] = data;
269 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 266 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
270 ("MCSTxPowerLevelOriginalOffset[%d][1] = 0x%x\n", 267 "MCSTxPowerLevelOriginalOffset[%d][1] = 0x%x\n",
271 rtlphy->pwrgroup_cnt, 268 rtlphy->pwrgroup_cnt,
272 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][1])); 269 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][1]);
273 } 270 }
274 if (regaddr == RTXAGC_A_CCK1_MCS32) { 271 if (regaddr == RTXAGC_A_CCK1_MCS32) {
275 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][6] = data; 272 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][6] = data;
276 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 273 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
277 ("MCSTxPowerLevelOriginalOffset[%d][6] = 0x%x\n", 274 "MCSTxPowerLevelOriginalOffset[%d][6] = 0x%x\n",
278 rtlphy->pwrgroup_cnt, 275 rtlphy->pwrgroup_cnt,
279 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][6])); 276 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][6]);
280 } 277 }
281 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0xffffff00) { 278 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0xffffff00) {
282 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][7] = data; 279 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][7] = data;
283 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 280 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
284 ("MCSTxPowerLevelOriginalOffset[%d][7] = 0x%x\n", 281 "MCSTxPowerLevelOriginalOffset[%d][7] = 0x%x\n",
285 rtlphy->pwrgroup_cnt, 282 rtlphy->pwrgroup_cnt,
286 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][7])); 283 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][7]);
287 } 284 }
288 if (regaddr == RTXAGC_A_MCS03_MCS00) { 285 if (regaddr == RTXAGC_A_MCS03_MCS00) {
289 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][2] = data; 286 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][2] = data;
290 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 287 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
291 ("MCSTxPowerLevelOriginalOffset[%d][2] = 0x%x\n", 288 "MCSTxPowerLevelOriginalOffset[%d][2] = 0x%x\n",
292 rtlphy->pwrgroup_cnt, 289 rtlphy->pwrgroup_cnt,
293 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][2])); 290 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][2]);
294 } 291 }
295 if (regaddr == RTXAGC_A_MCS07_MCS04) { 292 if (regaddr == RTXAGC_A_MCS07_MCS04) {
296 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][3] = data; 293 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][3] = data;
297 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 294 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
298 ("MCSTxPowerLevelOriginalOffset[%d][3] = 0x%x\n", 295 "MCSTxPowerLevelOriginalOffset[%d][3] = 0x%x\n",
299 rtlphy->pwrgroup_cnt, 296 rtlphy->pwrgroup_cnt,
300 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][3])); 297 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][3]);
301 } 298 }
302 if (regaddr == RTXAGC_A_MCS11_MCS08) { 299 if (regaddr == RTXAGC_A_MCS11_MCS08) {
303 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][4] = data; 300 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][4] = data;
304 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 301 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
305 ("MCSTxPowerLevelOriginalOffset[%d][4] = 0x%x\n", 302 "MCSTxPowerLevelOriginalOffset[%d][4] = 0x%x\n",
306 rtlphy->pwrgroup_cnt, 303 rtlphy->pwrgroup_cnt,
307 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][4])); 304 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][4]);
308 } 305 }
309 if (regaddr == RTXAGC_A_MCS15_MCS12) { 306 if (regaddr == RTXAGC_A_MCS15_MCS12) {
310 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][5] = data; 307 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][5] = data;
311 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 308 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
312 ("MCSTxPowerLevelOriginalOffset[%d][5] = 0x%x\n", 309 "MCSTxPowerLevelOriginalOffset[%d][5] = 0x%x\n",
313 rtlphy->pwrgroup_cnt, 310 rtlphy->pwrgroup_cnt,
314 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][5])); 311 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][5]);
315 } 312 }
316 if (regaddr == RTXAGC_B_RATE18_06) { 313 if (regaddr == RTXAGC_B_RATE18_06) {
317 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][8] = data; 314 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][8] = data;
318 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 315 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
319 ("MCSTxPowerLevelOriginalOffset[%d][8] = 0x%x\n", 316 "MCSTxPowerLevelOriginalOffset[%d][8] = 0x%x\n",
320 rtlphy->pwrgroup_cnt, 317 rtlphy->pwrgroup_cnt,
321 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][8])); 318 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][8]);
322 } 319 }
323 if (regaddr == RTXAGC_B_RATE54_24) { 320 if (regaddr == RTXAGC_B_RATE54_24) {
324 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][9] = data; 321 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][9] = data;
325 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 322 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
326 ("MCSTxPowerLevelOriginalOffset[%d][9] = 0x%x\n", 323 "MCSTxPowerLevelOriginalOffset[%d][9] = 0x%x\n",
327 rtlphy->pwrgroup_cnt, 324 rtlphy->pwrgroup_cnt,
328 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][9])); 325 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][9]);
329 } 326 }
330 if (regaddr == RTXAGC_B_CCK1_55_MCS32) { 327 if (regaddr == RTXAGC_B_CCK1_55_MCS32) {
331 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][14] = data; 328 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][14] = data;
332 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 329 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
333 ("MCSTxPowerLevelOriginalOffset[%d][14] = 0x%x\n", 330 "MCSTxPowerLevelOriginalOffset[%d][14] = 0x%x\n",
334 rtlphy->pwrgroup_cnt, 331 rtlphy->pwrgroup_cnt,
335 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][14])); 332 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][14]);
336 } 333 }
337 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0x000000ff) { 334 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0x000000ff) {
338 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][15] = data; 335 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][15] = data;
339 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 336 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
340 ("MCSTxPowerLevelOriginalOffset[%d][15] = 0x%x\n", 337 "MCSTxPowerLevelOriginalOffset[%d][15] = 0x%x\n",
341 rtlphy->pwrgroup_cnt, 338 rtlphy->pwrgroup_cnt,
342 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][15])); 339 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][15]);
343 } 340 }
344 if (regaddr == RTXAGC_B_MCS03_MCS00) { 341 if (regaddr == RTXAGC_B_MCS03_MCS00) {
345 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][10] = data; 342 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][10] = data;
346 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 343 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
347 ("MCSTxPowerLevelOriginalOffset[%d][10] = 0x%x\n", 344 "MCSTxPowerLevelOriginalOffset[%d][10] = 0x%x\n",
348 rtlphy->pwrgroup_cnt, 345 rtlphy->pwrgroup_cnt,
349 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][10])); 346 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][10]);
350 } 347 }
351 if (regaddr == RTXAGC_B_MCS07_MCS04) { 348 if (regaddr == RTXAGC_B_MCS07_MCS04) {
352 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][11] = data; 349 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][11] = data;
353 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 350 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
354 ("MCSTxPowerLevelOriginalOffset[%d][11] = 0x%x\n", 351 "MCSTxPowerLevelOriginalOffset[%d][11] = 0x%x\n",
355 rtlphy->pwrgroup_cnt, 352 rtlphy->pwrgroup_cnt,
356 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][11])); 353 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][11]);
357 } 354 }
358 if (regaddr == RTXAGC_B_MCS11_MCS08) { 355 if (regaddr == RTXAGC_B_MCS11_MCS08) {
359 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][12] = data; 356 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][12] = data;
360 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 357 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
361 ("MCSTxPowerLevelOriginalOffset[%d][12] = 0x%x\n", 358 "MCSTxPowerLevelOriginalOffset[%d][12] = 0x%x\n",
362 rtlphy->pwrgroup_cnt, 359 rtlphy->pwrgroup_cnt,
363 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][12])); 360 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][12]);
364 } 361 }
365 if (regaddr == RTXAGC_B_MCS15_MCS12) { 362 if (regaddr == RTXAGC_B_MCS15_MCS12) {
366 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][13] = data; 363 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][13] = data;
367 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 364 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
368 ("MCSTxPowerLevelOriginalOffset[%d][13] = 0x%x\n", 365 "MCSTxPowerLevelOriginalOffset[%d][13] = 0x%x\n",
369 rtlphy->pwrgroup_cnt, 366 rtlphy->pwrgroup_cnt,
370 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][13])); 367 rtlphy->MCS_TXPWR[rtlphy->pwrgroup_cnt][13]);
371 368
372 rtlphy->pwrgroup_cnt++; 369 rtlphy->pwrgroup_cnt++;
373 } 370 }
@@ -389,12 +386,11 @@ void rtl92c_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
389 (u8) rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, MASKBYTE0); 386 (u8) rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, MASKBYTE0);
390 387
391 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 388 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
392 ("Default initial gain (c50=0x%x, " 389 "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x\n",
393 "c58=0x%x, c60=0x%x, c68=0x%x\n", 390 rtlphy->default_initialgain[0],
394 rtlphy->default_initialgain[0], 391 rtlphy->default_initialgain[1],
395 rtlphy->default_initialgain[1], 392 rtlphy->default_initialgain[2],
396 rtlphy->default_initialgain[2], 393 rtlphy->default_initialgain[3]);
397 rtlphy->default_initialgain[3]));
398 394
399 rtlphy->framesync = (u8) rtl_get_bbreg(hw, 395 rtlphy->framesync = (u8) rtl_get_bbreg(hw,
400 ROFDM0_RXDETECTOR3, MASKBYTE0); 396 ROFDM0_RXDETECTOR3, MASKBYTE0);
@@ -402,8 +398,8 @@ void rtl92c_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
402 ROFDM0_RXDETECTOR2, MASKDWORD); 398 ROFDM0_RXDETECTOR2, MASKDWORD);
403 399
404 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 400 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
405 ("Default framesync (0x%x) = 0x%x\n", 401 "Default framesync (0x%x) = 0x%x\n",
406 ROFDM0_RXDETECTOR3, rtlphy->framesync)); 402 ROFDM0_RXDETECTOR3, rtlphy->framesync);
407} 403}
408 404
409void _rtl92c_phy_init_bb_rf_register_definition(struct ieee80211_hw *hw) 405void _rtl92c_phy_init_bb_rf_register_definition(struct ieee80211_hw *hw)
@@ -615,8 +611,8 @@ bool rtl92c_phy_update_txpower_dbm(struct ieee80211_hw *hw, long power_indbm)
615 else 611 else
616 ofdmtxpwridx = 0; 612 ofdmtxpwridx = 0;
617 RT_TRACE(rtlpriv, COMP_TXAGC, DBG_TRACE, 613 RT_TRACE(rtlpriv, COMP_TXAGC, DBG_TRACE,
618 ("%lx dBm, ccktxpwridx = %d, ofdmtxpwridx = %d\n", 614 "%lx dBm, ccktxpwridx = %d, ofdmtxpwridx = %d\n",
619 power_indbm, ccktxpwridx, ofdmtxpwridx)); 615 power_indbm, ccktxpwridx, ofdmtxpwridx);
620 for (idx = 0; idx < 14; idx++) { 616 for (idx = 0; idx < 14; idx++) {
621 for (rf_path = 0; rf_path < 2; rf_path++) { 617 for (rf_path = 0; rf_path < 2; rf_path++) {
622 rtlefuse->txpwrlevel_cck[rf_path][idx] = ccktxpwridx; 618 rtlefuse->txpwrlevel_cck[rf_path][idx] = ccktxpwridx;
@@ -710,7 +706,7 @@ void rtl92c_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
710 break; 706 break;
711 default: 707 default:
712 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 708 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
713 ("Unknown Scan Backup operation.\n")); 709 "Unknown Scan Backup operation\n");
714 break; 710 break;
715 } 711 }
716 } 712 }
@@ -732,7 +728,7 @@ void rtl92c_phy_set_bw_mode(struct ieee80211_hw *hw,
732 rtlpriv->cfg->ops->phy_set_bw_mode_callback(hw); 728 rtlpriv->cfg->ops->phy_set_bw_mode_callback(hw);
733 } else { 729 } else {
734 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 730 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
735 ("FALSE driver sleep or unload\n")); 731 "FALSE driver sleep or unload\n");
736 rtlphy->set_bwmode_inprogress = false; 732 rtlphy->set_bwmode_inprogress = false;
737 rtlphy->current_chan_bw = tmp_bw; 733 rtlphy->current_chan_bw = tmp_bw;
738 } 734 }
@@ -747,7 +743,7 @@ void rtl92c_phy_sw_chnl_callback(struct ieee80211_hw *hw)
747 u32 delay; 743 u32 delay;
748 744
749 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 745 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE,
750 ("switch to channel%d\n", rtlphy->current_channel)); 746 "switch to channel%d\n", rtlphy->current_channel);
751 if (is_hal_stop(rtlhal)) 747 if (is_hal_stop(rtlhal))
752 return; 748 return;
753 do { 749 do {
@@ -765,7 +761,7 @@ void rtl92c_phy_sw_chnl_callback(struct ieee80211_hw *hw)
765 } 761 }
766 break; 762 break;
767 } while (true); 763 } while (true);
768 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 764 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
769} 765}
770EXPORT_SYMBOL(rtl92c_phy_sw_chnl_callback); 766EXPORT_SYMBOL(rtl92c_phy_sw_chnl_callback);
771 767
@@ -787,12 +783,11 @@ u8 rtl92c_phy_sw_chnl(struct ieee80211_hw *hw)
787 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { 783 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) {
788 rtl92c_phy_sw_chnl_callback(hw); 784 rtl92c_phy_sw_chnl_callback(hw);
789 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 785 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
790 ("sw_chnl_inprogress false schdule workitem\n")); 786 "sw_chnl_inprogress false schdule workitem\n");
791 rtlphy->sw_chnl_inprogress = false; 787 rtlphy->sw_chnl_inprogress = false;
792 } else { 788 } else {
793 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 789 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
794 ("sw_chnl_inprogress false driver sleep or" 790 "sw_chnl_inprogress false driver sleep or unload\n");
795 " unload\n"));
796 rtlphy->sw_chnl_inprogress = false; 791 rtlphy->sw_chnl_inprogress = false;
797 } 792 }
798 return 1; 793 return 1;
@@ -916,7 +911,7 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
916 break; 911 break;
917 default: 912 default:
918 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 913 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
919 ("switch case not process\n")); 914 "switch case not processed\n");
920 break; 915 break;
921 } 916 }
922 917
@@ -1920,23 +1915,23 @@ bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
1920 bool postprocessing = false; 1915 bool postprocessing = false;
1921 1916
1922 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 1917 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
1923 ("-->IO Cmd(%#x), set_io_inprogress(%d)\n", 1918 "-->IO Cmd(%#x), set_io_inprogress(%d)\n",
1924 iotype, rtlphy->set_io_inprogress)); 1919 iotype, rtlphy->set_io_inprogress);
1925 do { 1920 do {
1926 switch (iotype) { 1921 switch (iotype) {
1927 case IO_CMD_RESUME_DM_BY_SCAN: 1922 case IO_CMD_RESUME_DM_BY_SCAN:
1928 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 1923 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
1929 ("[IO CMD] Resume DM after scan.\n")); 1924 "[IO CMD] Resume DM after scan\n");
1930 postprocessing = true; 1925 postprocessing = true;
1931 break; 1926 break;
1932 case IO_CMD_PAUSE_DM_BY_SCAN: 1927 case IO_CMD_PAUSE_DM_BY_SCAN:
1933 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 1928 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
1934 ("[IO CMD] Pause DM before scan.\n")); 1929 "[IO CMD] Pause DM before scan\n");
1935 postprocessing = true; 1930 postprocessing = true;
1936 break; 1931 break;
1937 default: 1932 default:
1938 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1933 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1939 ("switch case not process\n")); 1934 "switch case not processed\n");
1940 break; 1935 break;
1941 } 1936 }
1942 } while (false); 1937 } while (false);
@@ -1947,7 +1942,7 @@ bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
1947 return false; 1942 return false;
1948 } 1943 }
1949 rtl92c_phy_set_io(hw); 1944 rtl92c_phy_set_io(hw);
1950 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, ("<--IO Type(%#x)\n", iotype)); 1945 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, "<--IO Type(%#x)\n", iotype);
1951 return true; 1946 return true;
1952} 1947}
1953EXPORT_SYMBOL(rtl92c_phy_set_io_cmd); 1948EXPORT_SYMBOL(rtl92c_phy_set_io_cmd);
@@ -1958,8 +1953,8 @@ void rtl92c_phy_set_io(struct ieee80211_hw *hw)
1958 struct rtl_phy *rtlphy = &(rtlpriv->phy); 1953 struct rtl_phy *rtlphy = &(rtlpriv->phy);
1959 1954
1960 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 1955 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
1961 ("--->Cmd(%#x), set_io_inprogress(%d)\n", 1956 "--->Cmd(%#x), set_io_inprogress(%d)\n",
1962 rtlphy->current_io_type, rtlphy->set_io_inprogress)); 1957 rtlphy->current_io_type, rtlphy->set_io_inprogress);
1963 switch (rtlphy->current_io_type) { 1958 switch (rtlphy->current_io_type) {
1964 case IO_CMD_RESUME_DM_BY_SCAN: 1959 case IO_CMD_RESUME_DM_BY_SCAN:
1965 dm_digtable.cur_igvalue = rtlphy->initgain_backup.xaagccore1; 1960 dm_digtable.cur_igvalue = rtlphy->initgain_backup.xaagccore1;
@@ -1973,12 +1968,12 @@ void rtl92c_phy_set_io(struct ieee80211_hw *hw)
1973 break; 1968 break;
1974 default: 1969 default:
1975 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1970 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1976 ("switch case not process\n")); 1971 "switch case not processed\n");
1977 break; 1972 break;
1978 } 1973 }
1979 rtlphy->set_io_inprogress = false; 1974 rtlphy->set_io_inprogress = false;
1980 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 1975 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, "<---(%#x)\n",
1981 ("<---(%#x)\n", rtlphy->current_io_type)); 1976 rtlphy->current_io_type);
1982} 1977}
1983EXPORT_SYMBOL(rtl92c_phy_set_io); 1978EXPORT_SYMBOL(rtl92c_phy_set_io);
1984 1979
@@ -2018,7 +2013,7 @@ void _rtl92c_phy_set_rf_sleep(struct ieee80211_hw *hw)
2018 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); 2013 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3);
2019 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00); 2014 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00);
2020 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 2015 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
2021 ("Switch RF timeout !!!.\n")); 2016 "Switch RF timeout !!!\n");
2022 return; 2017 return;
2023 } 2018 }
2024 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2); 2019 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c b/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
index 2df33e53e15a..6730e683aba3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
@@ -54,7 +54,7 @@ void rtl92ce_dm_dynamic_txpower(struct ieee80211_hw *hw)
54 if ((mac->link_state < MAC80211_LINKED) && 54 if ((mac->link_state < MAC80211_LINKED) &&
55 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) { 55 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) {
56 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 56 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
57 ("Not connected to any\n")); 57 "Not connected to any\n");
58 58
59 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 59 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
60 60
@@ -67,28 +67,28 @@ void rtl92ce_dm_dynamic_txpower(struct ieee80211_hw *hw)
67 undecorated_smoothed_pwdb = 67 undecorated_smoothed_pwdb =
68 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 68 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
69 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 69 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
70 ("AP Client PWDB = 0x%lx\n", 70 "AP Client PWDB = 0x%lx\n",
71 undecorated_smoothed_pwdb)); 71 undecorated_smoothed_pwdb);
72 } else { 72 } else {
73 undecorated_smoothed_pwdb = 73 undecorated_smoothed_pwdb =
74 rtlpriv->dm.undecorated_smoothed_pwdb; 74 rtlpriv->dm.undecorated_smoothed_pwdb;
75 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 75 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
76 ("STA Default Port PWDB = 0x%lx\n", 76 "STA Default Port PWDB = 0x%lx\n",
77 undecorated_smoothed_pwdb)); 77 undecorated_smoothed_pwdb);
78 } 78 }
79 } else { 79 } else {
80 undecorated_smoothed_pwdb = 80 undecorated_smoothed_pwdb =
81 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 81 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
82 82
83 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 83 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
84 ("AP Ext Port PWDB = 0x%lx\n", 84 "AP Ext Port PWDB = 0x%lx\n",
85 undecorated_smoothed_pwdb)); 85 undecorated_smoothed_pwdb);
86 } 86 }
87 87
88 if (undecorated_smoothed_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) { 88 if (undecorated_smoothed_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) {
89 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 89 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1;
90 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 90 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
91 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n")); 91 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n");
92 } else if ((undecorated_smoothed_pwdb < 92 } else if ((undecorated_smoothed_pwdb <
93 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) && 93 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) &&
94 (undecorated_smoothed_pwdb >= 94 (undecorated_smoothed_pwdb >=
@@ -96,18 +96,18 @@ void rtl92ce_dm_dynamic_txpower(struct ieee80211_hw *hw)
96 96
97 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 97 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1;
98 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 98 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
99 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n")); 99 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n");
100 } else if (undecorated_smoothed_pwdb < 100 } else if (undecorated_smoothed_pwdb <
101 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) { 101 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) {
102 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 102 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
103 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 103 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
104 ("TXHIGHPWRLEVEL_NORMAL\n")); 104 "TXHIGHPWRLEVEL_NORMAL\n");
105 } 105 }
106 106
107 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) { 107 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) {
108 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 108 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
109 ("PHY_SetTxPowerLevel8192S() Channel = %d\n", 109 "PHY_SetTxPowerLevel8192S() Channel = %d\n",
110 rtlphy->current_channel)); 110 rtlphy->current_channel);
111 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel); 111 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel);
112 } 112 }
113 113
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 2156378de1e8..4aa228fe96e9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -141,7 +141,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
141 } 141 }
142 default: 142 default:
143 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 143 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
144 ("switch case not process\n")); 144 "switch case not processed\n");
145 break; 145 break;
146 } 146 }
147} 147}
@@ -207,7 +207,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
207 u8 e_aci; 207 u8 e_aci;
208 208
209 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 209 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
210 ("HW_VAR_SLOT_TIME %x\n", val[0])); 210 "HW_VAR_SLOT_TIME %x\n", val[0]);
211 211
212 rtl_write_byte(rtlpriv, REG_SLOT, val[0]); 212 rtl_write_byte(rtlpriv, REG_SLOT, val[0]);
213 213
@@ -246,8 +246,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
246 *val = min_spacing_to_set; 246 *val = min_spacing_to_set;
247 247
248 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 248 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
249 ("Set HW_VAR_AMPDU_MIN_SPACE: %#x\n", 249 "Set HW_VAR_AMPDU_MIN_SPACE: %#x\n",
250 mac->min_space_cfg)); 250 mac->min_space_cfg);
251 251
252 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, 252 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE,
253 mac->min_space_cfg); 253 mac->min_space_cfg);
@@ -261,8 +261,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
261 mac->min_space_cfg |= (density_to_set << 3); 261 mac->min_space_cfg |= (density_to_set << 3);
262 262
263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
264 ("Set HW_VAR_SHORTGI_DENSITY: %#x\n", 264 "Set HW_VAR_SHORTGI_DENSITY: %#x\n",
265 mac->min_space_cfg)); 265 mac->min_space_cfg);
266 266
267 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, 267 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE,
268 mac->min_space_cfg); 268 mac->min_space_cfg);
@@ -310,8 +310,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
310 } 310 }
311 311
312 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 312 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
313 ("Set HW_VAR_AMPDU_FACTOR: %#x\n", 313 "Set HW_VAR_AMPDU_FACTOR: %#x\n",
314 factor_toset)); 314 factor_toset);
315 } 315 }
316 break; 316 break;
317 } 317 }
@@ -348,8 +348,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
348 break; 348 break;
349 default: 349 default:
350 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 350 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
351 ("HW_VAR_ACM_CTRL acm set " 351 "HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
352 "failed: eACI is %d\n", acm)); 352 acm);
353 break; 353 break;
354 } 354 }
355 } else { 355 } else {
@@ -365,14 +365,14 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
365 break; 365 break;
366 default: 366 default:
367 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 367 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
368 ("switch case not process\n")); 368 "switch case not processed\n");
369 break; 369 break;
370 } 370 }
371 } 371 }
372 372
373 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE, 373 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE,
374 ("SetHwReg8190pci(): [HW_VAR_ACM_CTRL] " 374 "SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n",
375 "Write 0x%X\n", acm_ctrl)); 375 acm_ctrl);
376 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl); 376 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl);
377 break; 377 break;
378 } 378 }
@@ -507,8 +507,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
507 507
508 } 508 }
509 default: 509 default:
510 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("switch case " 510 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
511 "not process\n")); 511 "switch case not processed\n");
512 break; 512 break;
513 } 513 }
514} 514}
@@ -530,8 +530,8 @@ static bool _rtl92ce_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
530 530
531 if (count > POLLING_LLT_THRESHOLD) { 531 if (count > POLLING_LLT_THRESHOLD) {
532 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 532 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
533 ("Failed to polling write LLT done at " 533 "Failed to polling write LLT done at address %d!\n",
534 "address %d!\n", address)); 534 address);
535 status = false; 535 status = false;
536 break; 536 break;
537 } 537 }
@@ -669,18 +669,15 @@ static bool _rtl92ce_init_mac(struct ieee80211_hw *hw)
669 udelay(2); 669 udelay(2);
670 670
671 retry = 0; 671 retry = 0;
672 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("reg0xec:%x:%x\n", 672 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "reg0xec:%x:%x\n",
673 rtl_read_dword(rtlpriv, 0xEC), 673 rtl_read_dword(rtlpriv, 0xEC), bytetmp);
674 bytetmp));
675 674
676 while ((bytetmp & BIT(0)) && retry < 1000) { 675 while ((bytetmp & BIT(0)) && retry < 1000) {
677 retry++; 676 retry++;
678 udelay(50); 677 udelay(50);
679 bytetmp = rtl_read_byte(rtlpriv, REG_APS_FSMCO + 1); 678 bytetmp = rtl_read_byte(rtlpriv, REG_APS_FSMCO + 1);
680 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("reg0xec:%x:%x\n", 679 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "reg0xec:%x:%x\n",
681 rtl_read_dword(rtlpriv, 680 rtl_read_dword(rtlpriv, 0xEC), bytetmp);
682 0xEC),
683 bytetmp));
684 udelay(50); 681 udelay(50);
685 } 682 }
686 683
@@ -864,13 +861,13 @@ void rtl92ce_enable_hw_security_config(struct ieee80211_hw *hw)
864 u8 sec_reg_value; 861 u8 sec_reg_value;
865 862
866 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 863 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
867 ("PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n", 864 "PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n",
868 rtlpriv->sec.pairwise_enc_algorithm, 865 rtlpriv->sec.pairwise_enc_algorithm,
869 rtlpriv->sec.group_enc_algorithm)); 866 rtlpriv->sec.group_enc_algorithm);
870 867
871 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { 868 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) {
872 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("not open " 869 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
873 "hw encryption\n")); 870 "not open hw encryption\n");
874 return; 871 return;
875 } 872 }
876 873
@@ -886,7 +883,7 @@ void rtl92ce_enable_hw_security_config(struct ieee80211_hw *hw)
886 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02); 883 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02);
887 884
888 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 885 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
889 ("The SECR-value %x\n", sec_reg_value)); 886 "The SECR-value %x\n", sec_reg_value);
890 887
891 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); 888 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value);
892 889
@@ -910,7 +907,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
910 rtlpriv->intf_ops->disable_aspm(hw); 907 rtlpriv->intf_ops->disable_aspm(hw);
911 rtstatus = _rtl92ce_init_mac(hw); 908 rtstatus = _rtl92ce_init_mac(hw);
912 if (rtstatus != true) { 909 if (rtstatus != true) {
913 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Init MAC failed\n")); 910 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
914 err = 1; 911 err = 1;
915 return err; 912 return err;
916 } 913 }
@@ -918,8 +915,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
918 err = rtl92c_download_fw(hw); 915 err = rtl92c_download_fw(hw);
919 if (err) { 916 if (err) {
920 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 917 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
921 ("Failed to download FW. Init HW " 918 "Failed to download FW. Init HW without FW now..\n");
922 "without FW now..\n"));
923 err = 1; 919 err = 1;
924 rtlhal->fw_ready = false; 920 rtlhal->fw_ready = false;
925 return err; 921 return err;
@@ -968,12 +964,12 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
968 tmp_u1b = efuse_read_1byte(hw, 0x1FA); 964 tmp_u1b = efuse_read_1byte(hw, 0x1FA);
969 if (!(tmp_u1b & BIT(0))) { 965 if (!(tmp_u1b & BIT(0))) {
970 rtl_set_rfreg(hw, RF90_PATH_A, 0x15, 0x0F, 0x05); 966 rtl_set_rfreg(hw, RF90_PATH_A, 0x15, 0x0F, 0x05);
971 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("PA BIAS path A\n")); 967 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "PA BIAS path A\n");
972 } 968 }
973 969
974 if (!(tmp_u1b & BIT(1)) && is92c) { 970 if (!(tmp_u1b & BIT(1)) && is92c) {
975 rtl_set_rfreg(hw, RF90_PATH_B, 0x15, 0x0F, 0x05); 971 rtl_set_rfreg(hw, RF90_PATH_B, 0x15, 0x0F, 0x05);
976 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("PA BIAS path B\n")); 972 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "PA BIAS path B\n");
977 } 973 }
978 974
979 if (!(tmp_u1b & BIT(4))) { 975 if (!(tmp_u1b & BIT(4))) {
@@ -982,7 +978,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
982 rtl_write_byte(rtlpriv, 0x16, tmp_u1b | 0x80); 978 rtl_write_byte(rtlpriv, 0x16, tmp_u1b | 0x80);
983 udelay(10); 979 udelay(10);
984 rtl_write_byte(rtlpriv, 0x16, tmp_u1b | 0x90); 980 rtl_write_byte(rtlpriv, 0x16, tmp_u1b | 0x90);
985 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("under 1.5V\n")); 981 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "under 1.5V\n");
986 } 982 }
987 rtl92c_dm_init(hw); 983 rtl92c_dm_init(hw);
988 rtlpci->being_init_adapter = false; 984 rtlpci->being_init_adapter = false;
@@ -1008,23 +1004,23 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
1008 switch (version) { 1004 switch (version) {
1009 case VERSION_B_CHIP_92C: 1005 case VERSION_B_CHIP_92C:
1010 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1006 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1011 ("Chip Version ID: VERSION_B_CHIP_92C.\n")); 1007 "Chip Version ID: VERSION_B_CHIP_92C\n");
1012 break; 1008 break;
1013 case VERSION_B_CHIP_88C: 1009 case VERSION_B_CHIP_88C:
1014 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1010 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1015 ("Chip Version ID: VERSION_B_CHIP_88C.\n")); 1011 "Chip Version ID: VERSION_B_CHIP_88C\n");
1016 break; 1012 break;
1017 case VERSION_A_CHIP_92C: 1013 case VERSION_A_CHIP_92C:
1018 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1014 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1019 ("Chip Version ID: VERSION_A_CHIP_92C.\n")); 1015 "Chip Version ID: VERSION_A_CHIP_92C\n");
1020 break; 1016 break;
1021 case VERSION_A_CHIP_88C: 1017 case VERSION_A_CHIP_88C:
1022 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1018 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1023 ("Chip Version ID: VERSION_A_CHIP_88C.\n")); 1019 "Chip Version ID: VERSION_A_CHIP_88C\n");
1024 break; 1020 break;
1025 default: 1021 default:
1026 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1022 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1027 ("Chip Version ID: Unknown. Bug?\n")); 1023 "Chip Version ID: Unknown. Bug?\n");
1028 break; 1024 break;
1029 } 1025 }
1030 1026
@@ -1041,13 +1037,12 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
1041 default: 1037 default:
1042 rtlphy->rf_type = RF_1T1R; 1038 rtlphy->rf_type = RF_1T1R;
1043 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1039 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1044 ("ERROR RF_Type is set!!")); 1040 "ERROR RF_Type is set!!\n");
1045 break; 1041 break;
1046 } 1042 }
1047 1043
1048 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1044 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Chip RF Type: %s\n",
1049 ("Chip RF Type: %s\n", (rtlphy->rf_type == RF_2T2R) ? 1045 rtlphy->rf_type == RF_2T2R ? "RF_2T2R" : "RF_1T1R");
1050 "RF_2T2R" : "RF_1T1R"));
1051 1046
1052 return version; 1047 return version;
1053} 1048}
@@ -1069,8 +1064,8 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw *hw,
1069 _rtl92ce_disable_bcn_sub_func(hw); 1064 _rtl92ce_disable_bcn_sub_func(hw);
1070 } else { 1065 } else {
1071 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1066 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1072 ("Set HW_VAR_MEDIA_STATUS: " 1067 "Set HW_VAR_MEDIA_STATUS: No such media status(%x)\n",
1073 "No such media status(%x).\n", type)); 1068 type);
1074 } 1069 }
1075 1070
1076 switch (type) { 1071 switch (type) {
@@ -1078,27 +1073,27 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw *hw,
1078 bt_msr |= MSR_NOLINK; 1073 bt_msr |= MSR_NOLINK;
1079 ledaction = LED_CTL_LINK; 1074 ledaction = LED_CTL_LINK;
1080 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1075 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1081 ("Set Network type to NO LINK!\n")); 1076 "Set Network type to NO LINK!\n");
1082 break; 1077 break;
1083 case NL80211_IFTYPE_ADHOC: 1078 case NL80211_IFTYPE_ADHOC:
1084 bt_msr |= MSR_ADHOC; 1079 bt_msr |= MSR_ADHOC;
1085 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1080 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1086 ("Set Network type to Ad Hoc!\n")); 1081 "Set Network type to Ad Hoc!\n");
1087 break; 1082 break;
1088 case NL80211_IFTYPE_STATION: 1083 case NL80211_IFTYPE_STATION:
1089 bt_msr |= MSR_INFRA; 1084 bt_msr |= MSR_INFRA;
1090 ledaction = LED_CTL_LINK; 1085 ledaction = LED_CTL_LINK;
1091 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1086 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1092 ("Set Network type to STA!\n")); 1087 "Set Network type to STA!\n");
1093 break; 1088 break;
1094 case NL80211_IFTYPE_AP: 1089 case NL80211_IFTYPE_AP:
1095 bt_msr |= MSR_AP; 1090 bt_msr |= MSR_AP;
1096 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1091 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1097 ("Set Network type to AP!\n")); 1092 "Set Network type to AP!\n");
1098 break; 1093 break;
1099 default: 1094 default:
1100 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1095 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1101 ("Network type %d not support!\n", type)); 1096 "Network type %d not supported!\n", type);
1102 return 1; 1097 return 1;
1103 break; 1098 break;
1104 1099
@@ -1300,7 +1295,7 @@ void rtl92ce_set_beacon_interval(struct ieee80211_hw *hw)
1300 u16 bcn_interval = mac->beacon_interval; 1295 u16 bcn_interval = mac->beacon_interval;
1301 1296
1302 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 1297 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG,
1303 ("beacon_interval:%d\n", bcn_interval)); 1298 "beacon_interval:%d\n", bcn_interval);
1304 rtl92ce_disable_interrupt(hw); 1299 rtl92ce_disable_interrupt(hw);
1305 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval); 1300 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval);
1306 rtl92ce_enable_interrupt(hw); 1301 rtl92ce_enable_interrupt(hw);
@@ -1312,8 +1307,8 @@ void rtl92ce_update_interrupt_mask(struct ieee80211_hw *hw,
1312 struct rtl_priv *rtlpriv = rtl_priv(hw); 1307 struct rtl_priv *rtlpriv = rtl_priv(hw);
1313 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1308 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
1314 1309
1315 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1310 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, "add_msr:%x, rm_msr:%x\n",
1316 ("add_msr:%x, rm_msr:%x\n", add_msr, rm_msr)); 1311 add_msr, rm_msr);
1317 1312
1318 if (add_msr) 1313 if (add_msr)
1319 rtlpci->irq_mask[0] |= add_msr; 1314 rtlpci->irq_mask[0] |= add_msr;
@@ -1567,7 +1562,7 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
1567 HWSET_MAX_SIZE); 1562 HWSET_MAX_SIZE);
1568 } else if (rtlefuse->epromtype == EEPROM_93C46) { 1563 } else if (rtlefuse->epromtype == EEPROM_93C46) {
1569 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1564 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1570 ("RTL819X Not boot from eeprom, check it !!")); 1565 "RTL819X Not boot from eeprom, check it !!");
1571 } 1566 }
1572 1567
1573 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, "MAP", 1568 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, "MAP",
@@ -1576,10 +1571,10 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
1576 eeprom_id = *((u16 *)&hwinfo[0]); 1571 eeprom_id = *((u16 *)&hwinfo[0]);
1577 if (eeprom_id != RTL8190_EEPROM_ID) { 1572 if (eeprom_id != RTL8190_EEPROM_ID) {
1578 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1573 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1579 ("EEPROM ID(%#x) is invalid!!\n", eeprom_id)); 1574 "EEPROM ID(%#x) is invalid!!\n", eeprom_id);
1580 rtlefuse->autoload_failflag = true; 1575 rtlefuse->autoload_failflag = true;
1581 } else { 1576 } else {
1582 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1577 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1583 rtlefuse->autoload_failflag = false; 1578 rtlefuse->autoload_failflag = false;
1584 } 1579 }
1585 1580
@@ -1591,8 +1586,7 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
1591 *((u16 *) (&rtlefuse->dev_addr[i])) = usvalue; 1586 *((u16 *) (&rtlefuse->dev_addr[i])) = usvalue;
1592 } 1587 }
1593 1588
1594 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1589 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "%pM\n", rtlefuse->dev_addr);
1595 ("%pM\n", rtlefuse->dev_addr));
1596 1590
1597 _rtl92ce_read_txpower_info_from_hwpg(hw, 1591 _rtl92ce_read_txpower_info_from_hwpg(hw,
1598 rtlefuse->autoload_failflag, 1592 rtlefuse->autoload_failflag,
@@ -1608,7 +1602,7 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
1608 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 1602 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID];
1609 1603
1610 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1604 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1611 ("EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid)); 1605 "EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid);
1612 1606
1613 /* set channel paln to world wide 13 */ 1607 /* set channel paln to world wide 13 */
1614 rtlefuse->channel_plan = COUNTRY_CODE_WORLD_WIDE_13; 1608 rtlefuse->channel_plan = COUNTRY_CODE_WORLD_WIDE_13;
@@ -1662,7 +1656,7 @@ static void _rtl92ce_hal_customized_behavior(struct ieee80211_hw *hw)
1662 break; 1656 break;
1663 } 1657 }
1664 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1658 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1665 ("RT Customized ID: 0x%02X\n", rtlhal->oem_id)); 1659 "RT Customized ID: 0x%02X\n", rtlhal->oem_id);
1666} 1660}
1667 1661
1668void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw) 1662void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
@@ -1679,22 +1673,22 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
1679 else 1673 else
1680 rtlpriv->dm.rfpath_rxenable[0] = 1674 rtlpriv->dm.rfpath_rxenable[0] =
1681 rtlpriv->dm.rfpath_rxenable[1] = true; 1675 rtlpriv->dm.rfpath_rxenable[1] = true;
1682 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("VersionID = 0x%4x\n", 1676 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "VersionID = 0x%4x\n",
1683 rtlhal->version)); 1677 rtlhal->version);
1684 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR); 1678 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR);
1685 if (tmp_u1b & BIT(4)) { 1679 if (tmp_u1b & BIT(4)) {
1686 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EEPROM\n")); 1680 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EEPROM\n");
1687 rtlefuse->epromtype = EEPROM_93C46; 1681 rtlefuse->epromtype = EEPROM_93C46;
1688 } else { 1682 } else {
1689 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EFUSE\n")); 1683 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EFUSE\n");
1690 rtlefuse->epromtype = EEPROM_BOOT_EFUSE; 1684 rtlefuse->epromtype = EEPROM_BOOT_EFUSE;
1691 } 1685 }
1692 if (tmp_u1b & BIT(5)) { 1686 if (tmp_u1b & BIT(5)) {
1693 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1687 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1694 rtlefuse->autoload_failflag = false; 1688 rtlefuse->autoload_failflag = false;
1695 _rtl92ce_read_adapter_info(hw); 1689 _rtl92ce_read_adapter_info(hw);
1696 } else { 1690 } else {
1697 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Autoload ERR!!\n")); 1691 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
1698 } 1692 }
1699 _rtl92ce_hal_customized_behavior(hw); 1693 _rtl92ce_hal_customized_behavior(hw);
1700} 1694}
@@ -1790,8 +1784,8 @@ static void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw,
1790 1784
1791 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value); 1785 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value);
1792 1786
1793 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 1787 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
1794 ("%x\n", rtl_read_dword(rtlpriv, REG_ARFR0))); 1788 rtl_read_dword(rtlpriv, REG_ARFR0));
1795} 1789}
1796 1790
1797static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, 1791static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw,
@@ -1919,16 +1913,15 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw,
1919 break; 1913 break;
1920 } 1914 }
1921 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 1915 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG,
1922 ("ratr_bitmap :%x\n", ratr_bitmap)); 1916 "ratr_bitmap :%x\n", ratr_bitmap);
1923 *(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) | 1917 *(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) |
1924 (ratr_index << 28)); 1918 (ratr_index << 28));
1925 rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; 1919 rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80;
1926 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("Rate_index:%x, " 1920 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG,
1927 "ratr_val:%x, %x:%x:%x:%x:%x\n", 1921 "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n",
1928 ratr_index, ratr_bitmap, 1922 ratr_index, ratr_bitmap,
1929 rate_mask[0], rate_mask[1], 1923 rate_mask[0], rate_mask[1], rate_mask[2], rate_mask[3],
1930 rate_mask[2], rate_mask[3], 1924 rate_mask[4]);
1931 rate_mask[4]));
1932 rtl92c_fill_h2c_cmd(hw, H2C_RA_MASK, 5, rate_mask); 1925 rtl92c_fill_h2c_cmd(hw, H2C_RA_MASK, 5, rate_mask);
1933 1926
1934 if (macid != 0) 1927 if (macid != 0)
@@ -1994,7 +1987,7 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
1994 1987
1995 if ((ppsc->hwradiooff) && (e_rfpowerstate_toset == ERFON)) { 1988 if ((ppsc->hwradiooff) && (e_rfpowerstate_toset == ERFON)) {
1996 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 1989 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
1997 ("GPIOChangeRF - HW Radio ON, RF ON\n")); 1990 "GPIOChangeRF - HW Radio ON, RF ON\n");
1998 1991
1999 e_rfpowerstate_toset = ERFON; 1992 e_rfpowerstate_toset = ERFON;
2000 ppsc->hwradiooff = false; 1993 ppsc->hwradiooff = false;
@@ -2002,7 +1995,7 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
2002 } else if ((ppsc->hwradiooff == false) 1995 } else if ((ppsc->hwradiooff == false)
2003 && (e_rfpowerstate_toset == ERFOFF)) { 1996 && (e_rfpowerstate_toset == ERFOFF)) {
2004 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 1997 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
2005 ("GPIOChangeRF - HW Radio OFF, RF OFF\n")); 1998 "GPIOChangeRF - HW Radio OFF, RF OFF\n");
2006 1999
2007 e_rfpowerstate_toset = ERFOFF; 2000 e_rfpowerstate_toset = ERFOFF;
2008 ppsc->hwradiooff = true; 2001 ppsc->hwradiooff = true;
@@ -2053,7 +2046,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2053 u8 cam_offset = 0; 2046 u8 cam_offset = 0;
2054 u8 clear_number = 5; 2047 u8 clear_number = 5;
2055 2048
2056 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("clear_all\n")); 2049 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "clear_all\n");
2057 2050
2058 for (idx = 0; idx < clear_number; idx++) { 2051 for (idx = 0; idx < clear_number; idx++) {
2059 rtl_cam_mark_invalid(hw, cam_offset + idx); 2052 rtl_cam_mark_invalid(hw, cam_offset + idx);
@@ -2081,8 +2074,8 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2081 enc_algo = CAM_AES; 2074 enc_algo = CAM_AES;
2082 break; 2075 break;
2083 default: 2076 default:
2084 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("switch case " 2077 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
2085 "not process\n")); 2078 "switch case not processed\n");
2086 enc_algo = CAM_TKIP; 2079 enc_algo = CAM_TKIP;
2087 break; 2080 break;
2088 } 2081 }
@@ -2100,9 +2093,8 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2100 p_macaddr); 2093 p_macaddr);
2101 if (entry_id >= TOTAL_CAM_ENTRY) { 2094 if (entry_id >= TOTAL_CAM_ENTRY) {
2102 RT_TRACE(rtlpriv, COMP_SEC, 2095 RT_TRACE(rtlpriv, COMP_SEC,
2103 DBG_EMERG, 2096 DBG_EMERG,
2104 ("Can not find free hw" 2097 "Can not find free hw security cam entry\n");
2105 " security cam entry\n"));
2106 return; 2098 return;
2107 } 2099 }
2108 } else { 2100 } else {
@@ -2116,22 +2108,22 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2116 2108
2117 if (rtlpriv->sec.key_len[key_index] == 0) { 2109 if (rtlpriv->sec.key_len[key_index] == 0) {
2118 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2110 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2119 ("delete one entry, entry_id is %d\n", 2111 "delete one entry, entry_id is %d\n",
2120 entry_id)); 2112 entry_id);
2121 if (mac->opmode == NL80211_IFTYPE_AP) 2113 if (mac->opmode == NL80211_IFTYPE_AP)
2122 rtl_cam_del_entry(hw, p_macaddr); 2114 rtl_cam_del_entry(hw, p_macaddr);
2123 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); 2115 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id);
2124 } else { 2116 } else {
2125 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2117 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2126 ("The insert KEY length is %d\n", 2118 "The insert KEY length is %d\n",
2127 rtlpriv->sec.key_len[PAIRWISE_KEYIDX])); 2119 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]);
2128 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2120 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2129 ("The insert KEY is %x %x\n", 2121 "The insert KEY is %x %x\n",
2130 rtlpriv->sec.key_buf[0][0], 2122 rtlpriv->sec.key_buf[0][0],
2131 rtlpriv->sec.key_buf[0][1])); 2123 rtlpriv->sec.key_buf[0][1]);
2132 2124
2133 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2125 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2134 ("add one entry\n")); 2126 "add one entry\n");
2135 if (is_pairwise) { 2127 if (is_pairwise) {
2136 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD, 2128 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD,
2137 "Pairwise Key content", 2129 "Pairwise Key content",
@@ -2140,7 +2132,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2140 key_len[PAIRWISE_KEYIDX]); 2132 key_len[PAIRWISE_KEYIDX]);
2141 2133
2142 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2134 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2143 ("set Pairwiase key\n")); 2135 "set Pairwise key\n");
2144 2136
2145 rtl_cam_add_one_entry(hw, macaddr, key_index, 2137 rtl_cam_add_one_entry(hw, macaddr, key_index,
2146 entry_id, enc_algo, 2138 entry_id, enc_algo,
@@ -2149,7 +2141,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
2149 key_buf[key_index]); 2141 key_buf[key_index]);
2150 } else { 2142 } else {
2151 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2143 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2152 ("set group key\n")); 2144 "set group key\n");
2153 2145
2154 if (mac->opmode == NL80211_IFTYPE_ADHOC) { 2146 if (mac->opmode == NL80211_IFTYPE_ADHOC) {
2155 rtl_cam_add_one_entry(hw, 2147 rtl_cam_add_one_entry(hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
index 28a1a707d09c..09758f48d3e6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/led.c
@@ -45,8 +45,8 @@ void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
45 u8 ledcfg; 45 u8 ledcfg;
46 struct rtl_priv *rtlpriv = rtl_priv(hw); 46 struct rtl_priv *rtlpriv = rtl_priv(hw);
47 47
48 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 48 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
49 ("LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin)); 49 REG_LEDCFG2, pled->ledpin);
50 50
51 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); 51 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2);
52 52
@@ -62,7 +62,7 @@ void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
62 break; 62 break;
63 default: 63 default:
64 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 64 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
65 ("switch case not process\n")); 65 "switch case not processed\n");
66 break; 66 break;
67 } 67 }
68 pled->ledon = true; 68 pled->ledon = true;
@@ -74,8 +74,8 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
74 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); 74 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
75 u8 ledcfg; 75 u8 ledcfg;
76 76
77 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 77 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
78 ("LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin)); 78 REG_LEDCFG2, pled->ledpin);
79 79
80 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); 80 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2);
81 81
@@ -97,7 +97,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
97 break; 97 break;
98 default: 98 default:
99 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 99 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
100 ("switch case not process\n")); 100 "switch case not processed\n");
101 break; 101 break;
102 } 102 }
103 pled->ledon = false; 103 pled->ledon = false;
@@ -145,7 +145,7 @@ void rtl92ce_led_control(struct ieee80211_hw *hw,
145 ledaction == LED_CTL_POWER_ON)) { 145 ledaction == LED_CTL_POWER_ON)) {
146 return; 146 return;
147 } 147 }
148 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, ("ledaction %d.\n", 148 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "ledaction %d\n",
149 ledaction)); 149 ledaction);
150 _rtl92ce_sw_led_control(hw, ledaction); 150 _rtl92ce_sw_led_control(hw, ledaction);
151} 151}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
index ce9eea94bb53..03ee82e05f2f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
@@ -47,9 +47,9 @@ u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw,
47 u32 original_value, readback_value, bitshift; 47 u32 original_value, readback_value, bitshift;
48 struct rtl_phy *rtlphy = &(rtlpriv->phy); 48 struct rtl_phy *rtlphy = &(rtlpriv->phy);
49 49
50 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 50 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
51 "rfpath(%#x), bitmask(%#x)\n", 51 "regaddr(%#x), rfpath(%#x), bitmask(%#x)\n",
52 regaddr, rfpath, bitmask)); 52 regaddr, rfpath, bitmask);
53 53
54 spin_lock(&rtlpriv->locks.rf_lock); 54 spin_lock(&rtlpriv->locks.rf_lock);
55 55
@@ -67,9 +67,8 @@ u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw,
67 spin_unlock(&rtlpriv->locks.rf_lock); 67 spin_unlock(&rtlpriv->locks.rf_lock);
68 68
69 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 69 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
70 ("regaddr(%#x), rfpath(%#x), " 70 "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
71 "bitmask(%#x), original_value(%#x)\n", 71 regaddr, rfpath, bitmask, original_value);
72 regaddr, rfpath, bitmask, original_value));
73 72
74 return readback_value; 73 return readback_value;
75} 74}
@@ -121,8 +120,8 @@ void rtl92ce_phy_set_rf_reg(struct ieee80211_hw *hw,
121 u32 original_value, bitshift; 120 u32 original_value, bitshift;
122 121
123 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 122 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
124 ("regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n", 123 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
125 regaddr, bitmask, data, rfpath)); 124 regaddr, bitmask, data, rfpath);
126 125
127 spin_lock(&rtlpriv->locks.rf_lock); 126 spin_lock(&rtlpriv->locks.rf_lock);
128 127
@@ -153,10 +152,9 @@ void rtl92ce_phy_set_rf_reg(struct ieee80211_hw *hw,
153 152
154 spin_unlock(&rtlpriv->locks.rf_lock); 153 spin_unlock(&rtlpriv->locks.rf_lock);
155 154
156 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 155 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
157 "bitmask(%#x), data(%#x), " 156 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
158 "rfpath(%#x)\n", regaddr, 157 regaddr, bitmask, data, rfpath);
159 bitmask, data, rfpath));
160} 158}
161 159
162static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) 160static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw)
@@ -166,11 +164,10 @@ static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw)
166 u32 arraylength; 164 u32 arraylength;
167 u32 *ptrarray; 165 u32 *ptrarray;
168 166
169 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Read Rtl819XMACPHY_Array\n")); 167 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Read Rtl819XMACPHY_Array\n");
170 arraylength = MAC_2T_ARRAYLENGTH; 168 arraylength = MAC_2T_ARRAYLENGTH;
171 ptrarray = RTL8192CEMAC_2T_ARRAY; 169 ptrarray = RTL8192CEMAC_2T_ARRAY;
172 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 170 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Img:RTL8192CEMAC_2T_ARRAY\n");
173 ("Img:RTL8192CEMAC_2T_ARRAY\n"));
174 for (i = 0; i < arraylength; i = i + 2) 171 for (i = 0; i < arraylength; i = i + 2)
175 rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]); 172 rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]);
176 return true; 173 return true;
@@ -215,10 +212,9 @@ bool _rtl92ce_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
215 phy_regarray_table[i + 1]); 212 phy_regarray_table[i + 1]);
216 udelay(1); 213 udelay(1);
217 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 214 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
218 ("The phy_regarray_table[0] is %x" 215 "The phy_regarray_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
219 " Rtl819XPHY_REGArray[1] is %x\n", 216 phy_regarray_table[i],
220 phy_regarray_table[i], 217 phy_regarray_table[i + 1]);
221 phy_regarray_table[i + 1]));
222 } 218 }
223 } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { 219 } else if (configtype == BASEBAND_CONFIG_AGC_TAB) {
224 for (i = 0; i < agctab_arraylen; i = i + 2) { 220 for (i = 0; i < agctab_arraylen; i = i + 2) {
@@ -226,10 +222,9 @@ bool _rtl92ce_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
226 agctab_array_table[i + 1]); 222 agctab_array_table[i + 1]);
227 udelay(1); 223 udelay(1);
228 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 224 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
229 ("The agctab_array_table[0] is " 225 "The agctab_array_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
230 "%x Rtl819XPHY_REGArray[1] is %x\n", 226 agctab_array_table[i],
231 agctab_array_table[i], 227 agctab_array_table[i + 1]);
232 agctab_array_table[i + 1]));
233 } 228 }
234 } 229 }
235 return true; 230 return true;
@@ -269,7 +264,7 @@ bool _rtl92ce_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
269 } else { 264 } else {
270 265
271 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 266 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
272 ("configtype != BaseBand_Config_PHY_REG\n")); 267 "configtype != BaseBand_Config_PHY_REG\n");
273 } 268 }
274 return true; 269 return true;
275} 270}
@@ -291,20 +286,20 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
291 radiob_arraylen = RADIOB_2TARRAYLENGTH; 286 radiob_arraylen = RADIOB_2TARRAYLENGTH;
292 radiob_array_table = RTL8192CE_RADIOB_2TARRAY; 287 radiob_array_table = RTL8192CE_RADIOB_2TARRAY;
293 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 288 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
294 ("Radio_A:RTL8192CERADIOA_2TARRAY\n")); 289 "Radio_A:RTL8192CERADIOA_2TARRAY\n");
295 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 290 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
296 ("Radio_B:RTL8192CE_RADIOB_2TARRAY\n")); 291 "Radio_B:RTL8192CE_RADIOB_2TARRAY\n");
297 } else { 292 } else {
298 radioa_arraylen = RADIOA_1TARRAYLENGTH; 293 radioa_arraylen = RADIOA_1TARRAYLENGTH;
299 radioa_array_table = RTL8192CE_RADIOA_1TARRAY; 294 radioa_array_table = RTL8192CE_RADIOA_1TARRAY;
300 radiob_arraylen = RADIOB_1TARRAYLENGTH; 295 radiob_arraylen = RADIOB_1TARRAYLENGTH;
301 radiob_array_table = RTL8192CE_RADIOB_1TARRAY; 296 radiob_array_table = RTL8192CE_RADIOB_1TARRAY;
302 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 297 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
303 ("Radio_A:RTL8192CE_RADIOA_1TARRAY\n")); 298 "Radio_A:RTL8192CE_RADIOA_1TARRAY\n");
304 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 299 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
305 ("Radio_B:RTL8192CE_RADIOB_1TARRAY\n")); 300 "Radio_B:RTL8192CE_RADIOB_1TARRAY\n");
306 } 301 }
307 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Radio No %x\n", rfpath)); 302 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Radio No %x\n", rfpath);
308 switch (rfpath) { 303 switch (rfpath) {
309 case RF90_PATH_A: 304 case RF90_PATH_A:
310 for (i = 0; i < radioa_arraylen; i = i + 2) { 305 for (i = 0; i < radioa_arraylen; i = i + 2) {
@@ -352,11 +347,11 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
352 break; 347 break;
353 case RF90_PATH_C: 348 case RF90_PATH_C:
354 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 349 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
355 ("switch case not process\n")); 350 "switch case not processed\n");
356 break; 351 break;
357 case RF90_PATH_D: 352 case RF90_PATH_D:
358 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 353 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
359 ("switch case not process\n")); 354 "switch case not processed\n");
360 break; 355 break;
361 } 356 }
362 return true; 357 return true;
@@ -371,10 +366,9 @@ void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
371 u8 reg_bw_opmode; 366 u8 reg_bw_opmode;
372 u8 reg_prsr_rsc; 367 u8 reg_prsr_rsc;
373 368
374 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 369 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "Switch to %s bandwidth\n",
375 ("Switch to %s bandwidth\n", 370 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
376 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 371 "20MHz" : "40MHz");
377 "20MHz" : "40MHz"));
378 372
379 if (is_hal_stop(rtlhal)) { 373 if (is_hal_stop(rtlhal)) {
380 rtlphy->set_bwmode_inprogress = false; 374 rtlphy->set_bwmode_inprogress = false;
@@ -398,7 +392,7 @@ void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
398 break; 392 break;
399 default: 393 default:
400 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 394 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
401 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 395 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
402 break; 396 break;
403 } 397 }
404 398
@@ -423,12 +417,12 @@ void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
423 break; 417 break;
424 default: 418 default:
425 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 419 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
426 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 420 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
427 break; 421 break;
428 } 422 }
429 rtl92ce_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); 423 rtl92ce_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
430 rtlphy->set_bwmode_inprogress = false; 424 rtlphy->set_bwmode_inprogress = false;
431 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 425 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
432} 426}
433 427
434void _rtl92ce_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t) 428void _rtl92ce_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
@@ -499,7 +493,7 @@ static void _rtl92ce_phy_set_rf_sleep(struct ieee80211_hw *hw)
499 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); 493 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3);
500 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00); 494 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00);
501 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 495 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
502 ("Switch RF timeout !!!.\n")); 496 "Switch RF timeout !!!\n");
503 return; 497 return;
504 } 498 }
505 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2); 499 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2);
@@ -526,7 +520,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
526 do { 520 do {
527 InitializeCount++; 521 InitializeCount++;
528 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 522 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
529 ("IPS Set eRf nic enable\n")); 523 "IPS Set eRf nic enable\n");
530 rtstatus = rtl_ps_enable_nic(hw); 524 rtstatus = rtl_ps_enable_nic(hw);
531 } while ((rtstatus != true) 525 } while ((rtstatus != true)
532 && (InitializeCount < 10)); 526 && (InitializeCount < 10));
@@ -534,10 +528,10 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
534 RT_RF_OFF_LEVL_HALT_NIC); 528 RT_RF_OFF_LEVL_HALT_NIC);
535 } else { 529 } else {
536 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 530 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
537 ("Set ERFON sleeped:%d ms\n", 531 "Set ERFON sleeped:%d ms\n",
538 jiffies_to_msecs(jiffies - 532 jiffies_to_msecs(jiffies -
539 ppsc-> 533 ppsc->
540 last_sleep_jiffies))); 534 last_sleep_jiffies));
541 ppsc->last_awake_jiffies = jiffies; 535 ppsc->last_awake_jiffies = jiffies;
542 rtl92ce_phy_set_rf_on(hw); 536 rtl92ce_phy_set_rf_on(hw);
543 } 537 }
@@ -553,7 +547,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
553 case ERFOFF:{ 547 case ERFOFF:{
554 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) { 548 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) {
555 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 549 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
556 ("IPS Set eRf nic disable\n")); 550 "IPS Set eRf nic disable\n");
557 rtl_ps_disable_nic(hw); 551 rtl_ps_disable_nic(hw);
558 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC); 552 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC);
559 } else { 553 } else {
@@ -578,35 +572,33 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
578 continue; 572 continue;
579 } else { 573 } else {
580 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 574 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
581 ("eRf Off/Sleep: %d times " 575 "eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
582 "TcbBusyQueue[%d] =%d before " 576 i + 1, queue_id,
583 "doze!\n", (i + 1), queue_id, 577 skb_queue_len(&ring->queue));
584 skb_queue_len(&ring->queue)));
585 578
586 udelay(10); 579 udelay(10);
587 i++; 580 i++;
588 } 581 }
589 if (i >= MAX_DOZE_WAITING_TIMES_9x) { 582 if (i >= MAX_DOZE_WAITING_TIMES_9x) {
590 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 583 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
591 ("\n ERFSLEEP: %d times " 584 "ERFSLEEP: %d times TcbBusyQueue[%d] = %d !\n",
592 "TcbBusyQueue[%d] = %d !\n", 585 MAX_DOZE_WAITING_TIMES_9x,
593 MAX_DOZE_WAITING_TIMES_9x, 586 queue_id,
594 queue_id, 587 skb_queue_len(&ring->queue));
595 skb_queue_len(&ring->queue)));
596 break; 588 break;
597 } 589 }
598 } 590 }
599 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 591 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
600 ("Set ERFSLEEP awaked:%d ms\n", 592 "Set ERFSLEEP awaked:%d ms\n",
601 jiffies_to_msecs(jiffies - 593 jiffies_to_msecs(jiffies -
602 ppsc->last_awake_jiffies))); 594 ppsc->last_awake_jiffies));
603 ppsc->last_sleep_jiffies = jiffies; 595 ppsc->last_sleep_jiffies = jiffies;
604 _rtl92ce_phy_set_rf_sleep(hw); 596 _rtl92ce_phy_set_rf_sleep(hw);
605 break; 597 break;
606 } 598 }
607 default: 599 default:
608 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 600 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
609 ("switch case not process\n")); 601 "switch case not processed\n");
610 bresult = false; 602 bresult = false;
611 break; 603 break;
612 } 604 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c b/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c
index d3b01e6023ba..3ba1a4feeb3f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/rf.c
@@ -56,7 +56,7 @@ void rtl92ce_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
56 break; 56 break;
57 default: 57 default:
58 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 58 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
59 ("unknown bandwidth: %#X\n", bandwidth)); 59 "unknown bandwidth: %#X\n", bandwidth);
60 break; 60 break;
61 } 61 }
62} 62}
@@ -512,12 +512,12 @@ static bool _rtl92ce_phy_rf6052_config_parafile(struct ieee80211_hw *hw)
512 512
513 if (rtstatus != true) { 513 if (rtstatus != true) {
514 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 514 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
515 ("Radio[%d] Fail!!", rfpath)); 515 "Radio[%d] Fail!!\n", rfpath);
516 return false; 516 return false;
517 } 517 }
518 518
519 } 519 }
520 520
521 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("<---\n")); 521 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "<---\n");
522 return rtstatus; 522 return rtstatus;
523} 523}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index 89ef6982ce50..d2a3576fdaa5 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -159,7 +159,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
159 rtlpriv->rtlhal.pfirmware = vzalloc(0x4000); 159 rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
160 if (!rtlpriv->rtlhal.pfirmware) { 160 if (!rtlpriv->rtlhal.pfirmware) {
161 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 161 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
162 ("Can't alloc buffer for fw.\n")); 162 "Can't alloc buffer for fw\n");
163 return 1; 163 return 1;
164 } 164 }
165 165
@@ -174,12 +174,12 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
174 err = request_firmware(&firmware, fw_name, rtlpriv->io.dev); 174 err = request_firmware(&firmware, fw_name, rtlpriv->io.dev);
175 if (err) { 175 if (err) {
176 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 176 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
177 ("Failed to request firmware!\n")); 177 "Failed to request firmware!\n");
178 return 1; 178 return 1;
179 } 179 }
180 if (firmware->size > 0x4000) { 180 if (firmware->size > 0x4000) {
181 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 181 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
182 ("Firmware is too big!\n")); 182 "Firmware is too big!\n");
183 release_firmware(firmware); 183 release_firmware(firmware);
184 return 1; 184 return 1;
185 } 185 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 378bc5673464..9f6fac450a48 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -725,7 +725,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
725 if (ieee80211_is_data_qos(fc)) { 725 if (ieee80211_is_data_qos(fc)) {
726 if (mac->rdg_en) { 726 if (mac->rdg_en) {
727 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 727 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
728 ("Enable RDG function.\n")); 728 "Enable RDG function\n");
729 SET_TX_DESC_RDG_ENABLE(pdesc, 1); 729 SET_TX_DESC_RDG_ENABLE(pdesc, 1);
730 SET_TX_DESC_HTC(pdesc, 1); 730 SET_TX_DESC_HTC(pdesc, 1);
731 } 731 }
@@ -763,7 +763,7 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
763 SET_TX_DESC_BMC(pdesc, 1); 763 SET_TX_DESC_BMC(pdesc, 1);
764 } 764 }
765 765
766 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, ("\n")); 766 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
767} 767}
768 768
769void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, 769void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/dm.c b/drivers/net/wireless/rtlwifi/rtl8192cu/dm.c
index f311baee668d..c0016f3194e5 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/dm.c
@@ -52,7 +52,7 @@ void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw)
52 if ((mac->link_state < MAC80211_LINKED) && 52 if ((mac->link_state < MAC80211_LINKED) &&
53 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) { 53 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) {
54 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 54 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
55 ("Not connected to any\n")); 55 "Not connected to any\n");
56 56
57 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 57 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
58 58
@@ -65,28 +65,28 @@ void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw)
65 undecorated_smoothed_pwdb = 65 undecorated_smoothed_pwdb =
66 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 66 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
67 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 67 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
68 ("AP Client PWDB = 0x%lx\n", 68 "AP Client PWDB = 0x%lx\n",
69 undecorated_smoothed_pwdb)); 69 undecorated_smoothed_pwdb);
70 } else { 70 } else {
71 undecorated_smoothed_pwdb = 71 undecorated_smoothed_pwdb =
72 rtlpriv->dm.undecorated_smoothed_pwdb; 72 rtlpriv->dm.undecorated_smoothed_pwdb;
73 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 73 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
74 ("STA Default Port PWDB = 0x%lx\n", 74 "STA Default Port PWDB = 0x%lx\n",
75 undecorated_smoothed_pwdb)); 75 undecorated_smoothed_pwdb);
76 } 76 }
77 } else { 77 } else {
78 undecorated_smoothed_pwdb = 78 undecorated_smoothed_pwdb =
79 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 79 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
80 80
81 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 81 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
82 ("AP Ext Port PWDB = 0x%lx\n", 82 "AP Ext Port PWDB = 0x%lx\n",
83 undecorated_smoothed_pwdb)); 83 undecorated_smoothed_pwdb);
84 } 84 }
85 85
86 if (undecorated_smoothed_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) { 86 if (undecorated_smoothed_pwdb >= TX_POWER_NEAR_FIELD_THRESH_LVL2) {
87 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 87 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1;
88 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 88 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
89 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n")); 89 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n");
90 } else if ((undecorated_smoothed_pwdb < 90 } else if ((undecorated_smoothed_pwdb <
91 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) && 91 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) &&
92 (undecorated_smoothed_pwdb >= 92 (undecorated_smoothed_pwdb >=
@@ -94,18 +94,18 @@ void rtl92cu_dm_dynamic_txpower(struct ieee80211_hw *hw)
94 94
95 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1; 95 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_LEVEL1;
96 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 96 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
97 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n")); 97 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n");
98 } else if (undecorated_smoothed_pwdb < 98 } else if (undecorated_smoothed_pwdb <
99 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) { 99 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) {
100 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 100 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
101 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 101 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
102 ("TXHIGHPWRLEVEL_NORMAL\n")); 102 "TXHIGHPWRLEVEL_NORMAL\n");
103 } 103 }
104 104
105 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) { 105 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) {
106 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 106 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
107 ("PHY_SetTxPowerLevel8192S() Channel = %d\n", 107 "PHY_SetTxPowerLevel8192S() Channel = %d\n",
108 rtlphy->current_channel)); 108 rtlphy->current_channel);
109 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel); 109 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel);
110 } 110 }
111 111
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 778c0e6e836b..80bd17d85935 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -494,17 +494,17 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw)
494 HWSET_MAX_SIZE); 494 HWSET_MAX_SIZE);
495 } else if (rtlefuse->epromtype == EEPROM_93C46) { 495 } else if (rtlefuse->epromtype == EEPROM_93C46) {
496 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 496 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
497 ("RTL819X Not boot from eeprom, check it !!")); 497 "RTL819X Not boot from eeprom, check it !!\n");
498 } 498 }
499 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_LOUD, "MAP", 499 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_LOUD, "MAP",
500 hwinfo, HWSET_MAX_SIZE); 500 hwinfo, HWSET_MAX_SIZE);
501 eeprom_id = le16_to_cpu(*((__le16 *)&hwinfo[0])); 501 eeprom_id = le16_to_cpu(*((__le16 *)&hwinfo[0]));
502 if (eeprom_id != RTL8190_EEPROM_ID) { 502 if (eeprom_id != RTL8190_EEPROM_ID) {
503 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 503 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
504 ("EEPROM ID(%#x) is invalid!!\n", eeprom_id)); 504 "EEPROM ID(%#x) is invalid!!\n", eeprom_id);
505 rtlefuse->autoload_failflag = true; 505 rtlefuse->autoload_failflag = true;
506 } else { 506 } else {
507 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 507 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
508 rtlefuse->autoload_failflag = false; 508 rtlefuse->autoload_failflag = false;
509 } 509 }
510 if (rtlefuse->autoload_failflag) 510 if (rtlefuse->autoload_failflag)
@@ -518,16 +518,15 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw)
518 rtlefuse->autoload_failflag, hwinfo); 518 rtlefuse->autoload_failflag, hwinfo);
519 rtlefuse->eeprom_vid = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VID]); 519 rtlefuse->eeprom_vid = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VID]);
520 rtlefuse->eeprom_did = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_DID]); 520 rtlefuse->eeprom_did = le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_DID]);
521 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 521 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, " VID = 0x%02x PID = 0x%02x\n",
522 (" VID = 0x%02x PID = 0x%02x\n", 522 rtlefuse->eeprom_vid, rtlefuse->eeprom_did);
523 rtlefuse->eeprom_vid, rtlefuse->eeprom_did));
524 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 523 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN];
525 rtlefuse->eeprom_version = 524 rtlefuse->eeprom_version =
526 le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VERSION]); 525 le16_to_cpu(*(__le16 *)&hwinfo[EEPROM_VERSION]);
527 rtlefuse->txpwr_fromeprom = true; 526 rtlefuse->txpwr_fromeprom = true;
528 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 527 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID];
529 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 528 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x\n",
530 ("EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid)); 529 rtlefuse->eeprom_oemid);
531 if (rtlhal->oem_id == RT_CID_DEFAULT) { 530 if (rtlhal->oem_id == RT_CID_DEFAULT) {
532 switch (rtlefuse->eeprom_oemid) { 531 switch (rtlefuse->eeprom_oemid) {
533 case EEPROM_CID_DEFAULT: 532 case EEPROM_CID_DEFAULT:
@@ -579,8 +578,8 @@ static void _rtl92cu_hal_customized_behavior(struct ieee80211_hw *hw)
579 default: 578 default:
580 break; 579 break;
581 } 580 }
582 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 581 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "RT Customized ID: 0x%02X\n",
583 ("RT Customized ID: 0x%02X\n", rtlhal->oem_id)); 582 rtlhal->oem_id);
584} 583}
585 584
586void rtl92cu_read_eeprom_info(struct ieee80211_hw *hw) 585void rtl92cu_read_eeprom_info(struct ieee80211_hw *hw)
@@ -596,11 +595,11 @@ void rtl92cu_read_eeprom_info(struct ieee80211_hw *hw)
596 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR); 595 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR);
597 rtlefuse->epromtype = (tmp_u1b & BOOT_FROM_EEPROM) ? 596 rtlefuse->epromtype = (tmp_u1b & BOOT_FROM_EEPROM) ?
598 EEPROM_93C46 : EEPROM_BOOT_EFUSE; 597 EEPROM_93C46 : EEPROM_BOOT_EFUSE;
599 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from %s\n", 598 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from %s\n",
600 (tmp_u1b & BOOT_FROM_EEPROM) ? "EERROM" : "EFUSE")); 599 tmp_u1b & BOOT_FROM_EEPROM ? "EERROM" : "EFUSE");
601 rtlefuse->autoload_failflag = (tmp_u1b & EEPROM_EN) ? false : true; 600 rtlefuse->autoload_failflag = (tmp_u1b & EEPROM_EN) ? false : true;
602 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload %s\n", 601 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload %s\n",
603 (tmp_u1b & EEPROM_EN) ? "OK!!" : "ERR!!")); 602 tmp_u1b & EEPROM_EN ? "OK!!" : "ERR!!");
604 _rtl92cu_read_adapter_info(hw); 603 _rtl92cu_read_adapter_info(hw);
605 _rtl92cu_hal_customized_behavior(hw); 604 _rtl92cu_hal_customized_behavior(hw);
606 return; 605 return;
@@ -618,13 +617,12 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
618 do { 617 do {
619 if (rtl_read_byte(rtlpriv, REG_APS_FSMCO) & PFM_ALDN) { 618 if (rtl_read_byte(rtlpriv, REG_APS_FSMCO) & PFM_ALDN) {
620 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 619 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
621 ("Autoload Done!\n")); 620 "Autoload Done!\n");
622 break; 621 break;
623 } 622 }
624 if (pollingCount++ > 100) { 623 if (pollingCount++ > 100) {
625 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 624 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
626 ("Failed to polling REG_APS_FSMCO[PFM_ALDN]" 625 "Failed to polling REG_APS_FSMCO[PFM_ALDN] done!\n");
627 " done!\n"));
628 return -ENODEV; 626 return -ENODEV;
629 } 627 }
630 } while (true); 628 } while (true);
@@ -639,8 +637,8 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
639 value8 |= LDV12_EN; 637 value8 |= LDV12_EN;
640 rtl_write_byte(rtlpriv, REG_LDOV12D_CTRL, value8); 638 rtl_write_byte(rtlpriv, REG_LDOV12D_CTRL, value8);
641 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 639 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
642 (" power-on :REG_LDOV12D_CTRL Reg0x21:0x%02x.\n", 640 " power-on :REG_LDOV12D_CTRL Reg0x21:0x%02x\n",
643 value8)); 641 value8);
644 udelay(100); 642 udelay(100);
645 value8 = rtl_read_byte(rtlpriv, REG_SYS_ISO_CTRL); 643 value8 = rtl_read_byte(rtlpriv, REG_SYS_ISO_CTRL);
646 value8 &= ~ISO_MD2PP; 644 value8 &= ~ISO_MD2PP;
@@ -658,8 +656,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
658 } 656 }
659 if (pollingCount++ > 100) { 657 if (pollingCount++ > 100) {
660 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 658 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
661 ("Failed to polling REG_APS_FSMCO[APFM_ONMAC]" 659 "Failed to polling REG_APS_FSMCO[APFM_ONMAC] done!\n");
662 " done!\n"));
663 return -ENODEV; 660 return -ENODEV;
664 } 661 }
665 } while (true); 662 } while (true);
@@ -877,8 +874,8 @@ static void _rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
877 hiQ = QUEUE_HIGH; 874 hiQ = QUEUE_HIGH;
878 } 875 }
879 _rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ); 876 _rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
880 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 877 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
881 ("Tx queue select :0x%02x..\n", queue_sel)); 878 queue_sel);
882} 879}
883 880
884static void _rtl92cu_init_chipN_queue_priority(struct ieee80211_hw *hw, 881static void _rtl92cu_init_chipN_queue_priority(struct ieee80211_hw *hw,
@@ -937,8 +934,8 @@ static void _rtl92cu_init_chipT_queue_priority(struct ieee80211_hw *hw,
937 break; 934 break;
938 } 935 }
939 rtl_write_byte(rtlpriv, (REG_TRXDMA_CTRL+1), hq_sele); 936 rtl_write_byte(rtlpriv, (REG_TRXDMA_CTRL+1), hq_sele);
940 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 937 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
941 ("Tx queue select :0x%02x..\n", hq_sele)); 938 hq_sele);
942} 939}
943 940
944static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw, 941static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw,
@@ -998,7 +995,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
998 995
999 if (err) { 996 if (err) {
1000 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 997 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1001 ("Failed to init power on!\n")); 998 "Failed to init power on!\n");
1002 return err; 999 return err;
1003 } 1000 }
1004 if (!wmm_enable) { 1001 if (!wmm_enable) {
@@ -1010,7 +1007,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
1010 } 1007 }
1011 if (false == rtl92c_init_llt_table(hw, boundary)) { 1008 if (false == rtl92c_init_llt_table(hw, boundary)) {
1012 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1009 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1013 ("Failed to init LLT Table!\n")); 1010 "Failed to init LLT Table!\n");
1014 return -EINVAL; 1011 return -EINVAL;
1015 } 1012 }
1016 _rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums, 1013 _rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums,
@@ -1043,12 +1040,12 @@ void rtl92cu_enable_hw_security_config(struct ieee80211_hw *hw)
1043 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); 1040 struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
1044 1041
1045 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1042 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1046 ("PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n", 1043 "PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n",
1047 rtlpriv->sec.pairwise_enc_algorithm, 1044 rtlpriv->sec.pairwise_enc_algorithm,
1048 rtlpriv->sec.group_enc_algorithm)); 1045 rtlpriv->sec.group_enc_algorithm);
1049 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { 1046 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) {
1050 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 1047 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
1051 ("not open sw encryption\n")); 1048 "not open sw encryption\n");
1052 return; 1049 return;
1053 } 1050 }
1054 sec_reg_value = SCR_TxEncEnable | SCR_RxDecEnable; 1051 sec_reg_value = SCR_TxEncEnable | SCR_RxDecEnable;
@@ -1059,8 +1056,8 @@ void rtl92cu_enable_hw_security_config(struct ieee80211_hw *hw)
1059 if (IS_NORMAL_CHIP(rtlhal->version)) 1056 if (IS_NORMAL_CHIP(rtlhal->version))
1060 sec_reg_value |= (SCR_RXBCUSEDK | SCR_TXBCUSEDK); 1057 sec_reg_value |= (SCR_RXBCUSEDK | SCR_TXBCUSEDK);
1061 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02); 1058 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02);
1062 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 1059 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "The SECR-value %x\n",
1063 ("The SECR-value %x\n", sec_reg_value)); 1060 sec_reg_value);
1064 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); 1061 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value);
1065} 1062}
1066 1063
@@ -1163,13 +1160,13 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
1163 rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU; 1160 rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU;
1164 err = _rtl92cu_init_mac(hw); 1161 err = _rtl92cu_init_mac(hw);
1165 if (err) { 1162 if (err) {
1166 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("init mac failed!\n")); 1163 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "init mac failed!\n");
1167 return err; 1164 return err;
1168 } 1165 }
1169 err = rtl92c_download_fw(hw); 1166 err = rtl92c_download_fw(hw);
1170 if (err) { 1167 if (err) {
1171 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1168 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1172 ("Failed to download FW. Init HW without FW now..\n")); 1169 "Failed to download FW. Init HW without FW now..\n");
1173 err = 1; 1170 err = 1;
1174 rtlhal->fw_ready = false; 1171 rtlhal->fw_ready = false;
1175 return err; 1172 return err;
@@ -1280,8 +1277,7 @@ static void _ResetDigitalProcedure1(struct ieee80211_hw *hw, bool bWithoutHWSM)
1280 } 1277 }
1281 if (retry_cnts >= 100) { 1278 if (retry_cnts >= 100) {
1282 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1279 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1283 ("#####=> 8051 reset failed!.." 1280 "#####=> 8051 reset failed!.........................\n");
1284 ".......................\n"););
1285 /* if 8051 reset fail, reset MAC. */ 1281 /* if 8051 reset fail, reset MAC. */
1286 rtl_write_byte(rtlpriv, 1282 rtl_write_byte(rtlpriv,
1287 REG_SYS_FUNC_EN + 1, 1283 REG_SYS_FUNC_EN + 1,
@@ -1495,35 +1491,36 @@ static int _rtl92cu_set_media_status(struct ieee80211_hw *hw,
1495 _rtl92cu_resume_tx_beacon(hw); 1491 _rtl92cu_resume_tx_beacon(hw);
1496 _rtl92cu_disable_bcn_sub_func(hw); 1492 _rtl92cu_disable_bcn_sub_func(hw);
1497 } else { 1493 } else {
1498 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, ("Set HW_VAR_MEDIA_" 1494 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1499 "STATUS:No such media status(%x).\n", type)); 1495 "Set HW_VAR_MEDIA_STATUS:No such media status(%x)\n",
1496 type);
1500 } 1497 }
1501 switch (type) { 1498 switch (type) {
1502 case NL80211_IFTYPE_UNSPECIFIED: 1499 case NL80211_IFTYPE_UNSPECIFIED:
1503 bt_msr |= MSR_NOLINK; 1500 bt_msr |= MSR_NOLINK;
1504 ledaction = LED_CTL_LINK; 1501 ledaction = LED_CTL_LINK;
1505 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1502 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1506 ("Set Network type to NO LINK!\n")); 1503 "Set Network type to NO LINK!\n");
1507 break; 1504 break;
1508 case NL80211_IFTYPE_ADHOC: 1505 case NL80211_IFTYPE_ADHOC:
1509 bt_msr |= MSR_ADHOC; 1506 bt_msr |= MSR_ADHOC;
1510 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1507 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1511 ("Set Network type to Ad Hoc!\n")); 1508 "Set Network type to Ad Hoc!\n");
1512 break; 1509 break;
1513 case NL80211_IFTYPE_STATION: 1510 case NL80211_IFTYPE_STATION:
1514 bt_msr |= MSR_INFRA; 1511 bt_msr |= MSR_INFRA;
1515 ledaction = LED_CTL_LINK; 1512 ledaction = LED_CTL_LINK;
1516 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1513 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1517 ("Set Network type to STA!\n")); 1514 "Set Network type to STA!\n");
1518 break; 1515 break;
1519 case NL80211_IFTYPE_AP: 1516 case NL80211_IFTYPE_AP:
1520 bt_msr |= MSR_AP; 1517 bt_msr |= MSR_AP;
1521 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1518 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1522 ("Set Network type to AP!\n")); 1519 "Set Network type to AP!\n");
1523 break; 1520 break;
1524 default: 1521 default:
1525 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1522 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1526 ("Network type %d not support!\n", type)); 1523 "Network type %d not supported!\n", type);
1527 goto error_out; 1524 goto error_out;
1528 } 1525 }
1529 rtl_write_byte(rtlpriv, (MSR), bt_msr); 1526 rtl_write_byte(rtlpriv, (MSR), bt_msr);
@@ -1684,8 +1681,8 @@ void rtl92cu_set_beacon_related_registers(struct ieee80211_hw *hw)
1684 value32 |= TSFRST; 1681 value32 |= TSFRST;
1685 rtl_write_dword(rtlpriv, REG_TCR, value32); 1682 rtl_write_dword(rtlpriv, REG_TCR, value32);
1686 RT_TRACE(rtlpriv, COMP_INIT|COMP_BEACON, DBG_LOUD, 1683 RT_TRACE(rtlpriv, COMP_INIT|COMP_BEACON, DBG_LOUD,
1687 ("SetBeaconRelatedRegisters8192CUsb(): Set TCR(%x)\n", 1684 "SetBeaconRelatedRegisters8192CUsb(): Set TCR(%x)\n",
1688 value32)); 1685 value32);
1689 /* TODO: Modify later (Find the right parameters) 1686 /* TODO: Modify later (Find the right parameters)
1690 * NOTE: Fix test chip's bug (about contention windows's randomness) */ 1687 * NOTE: Fix test chip's bug (about contention windows's randomness) */
1691 if ((mac->opmode == NL80211_IFTYPE_ADHOC) || 1688 if ((mac->opmode == NL80211_IFTYPE_ADHOC) ||
@@ -1702,8 +1699,8 @@ void rtl92cu_set_beacon_interval(struct ieee80211_hw *hw)
1702 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 1699 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
1703 u16 bcn_interval = mac->beacon_interval; 1700 u16 bcn_interval = mac->beacon_interval;
1704 1701
1705 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 1702 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, "beacon_interval:%d\n",
1706 ("beacon_interval:%d\n", bcn_interval)); 1703 bcn_interval);
1707 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval); 1704 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval);
1708} 1705}
1709 1706
@@ -1767,7 +1764,7 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1767 break; 1764 break;
1768 default: 1765 default:
1769 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1766 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1770 ("switch case not process\n")); 1767 "switch case not processed\n");
1771 break; 1768 break;
1772 } 1769 }
1773} 1770}
@@ -1827,8 +1824,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1827 rtl_write_byte(rtlpriv, REG_MAC_SPEC_SIFS + 1, val[0]); 1824 rtl_write_byte(rtlpriv, REG_MAC_SPEC_SIFS + 1, val[0]);
1828 rtl_write_byte(rtlpriv, REG_R2T_SIFS+1, val[0]); 1825 rtl_write_byte(rtlpriv, REG_R2T_SIFS+1, val[0]);
1829 rtl_write_byte(rtlpriv, REG_T2T_SIFS+1, val[0]); 1826 rtl_write_byte(rtlpriv, REG_T2T_SIFS+1, val[0]);
1830 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 1827 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, "HW_VAR_SIFS\n");
1831 ("HW_VAR_SIFS\n"));
1832 break; 1828 break;
1833 } 1829 }
1834 case HW_VAR_SLOT_TIME:{ 1830 case HW_VAR_SLOT_TIME:{
@@ -1837,7 +1833,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1837 1833
1838 rtl_write_byte(rtlpriv, REG_SLOT, val[0]); 1834 rtl_write_byte(rtlpriv, REG_SLOT, val[0]);
1839 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 1835 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
1840 ("HW_VAR_SLOT_TIME %x\n", val[0])); 1836 "HW_VAR_SLOT_TIME %x\n", val[0]);
1841 if (QOS_MODE) { 1837 if (QOS_MODE) {
1842 for (e_aci = 0; e_aci < AC_MAX; e_aci++) 1838 for (e_aci = 0; e_aci < AC_MAX; e_aci++)
1843 rtlpriv->cfg->ops->set_hw_reg(hw, 1839 rtlpriv->cfg->ops->set_hw_reg(hw,
@@ -1901,8 +1897,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1901 min_spacing_to_set); 1897 min_spacing_to_set);
1902 *val = min_spacing_to_set; 1898 *val = min_spacing_to_set;
1903 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 1899 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
1904 ("Set HW_VAR_AMPDU_MIN_SPACE: %#x\n", 1900 "Set HW_VAR_AMPDU_MIN_SPACE: %#x\n",
1905 mac->min_space_cfg)); 1901 mac->min_space_cfg);
1906 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, 1902 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE,
1907 mac->min_space_cfg); 1903 mac->min_space_cfg);
1908 } 1904 }
@@ -1916,8 +1912,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1916 mac->min_space_cfg &= 0x07; 1912 mac->min_space_cfg &= 0x07;
1917 mac->min_space_cfg |= (density_to_set << 3); 1913 mac->min_space_cfg |= (density_to_set << 3);
1918 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 1914 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
1919 ("Set HW_VAR_SHORTGI_DENSITY: %#x\n", 1915 "Set HW_VAR_SHORTGI_DENSITY: %#x\n",
1920 mac->min_space_cfg)); 1916 mac->min_space_cfg);
1921 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, 1917 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE,
1922 mac->min_space_cfg); 1918 mac->min_space_cfg);
1923 break; 1919 break;
@@ -1950,8 +1946,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1950 p_regtoset[index]); 1946 p_regtoset[index]);
1951 } 1947 }
1952 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 1948 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
1953 ("Set HW_VAR_AMPDU_FACTOR: %#x\n", 1949 "Set HW_VAR_AMPDU_FACTOR: %#x\n",
1954 factor_toset)); 1950 factor_toset);
1955 } 1951 }
1956 break; 1952 break;
1957 } 1953 }
@@ -1969,8 +1965,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
1969 AC_PARAM_ECW_MAX_OFFSET); 1965 AC_PARAM_ECW_MAX_OFFSET);
1970 u4b_ac_param |= (u32) tx_op << AC_PARAM_TXOP_OFFSET; 1966 u4b_ac_param |= (u32) tx_op << AC_PARAM_TXOP_OFFSET;
1971 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 1967 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
1972 ("queue:%x, ac_param:%x\n", e_aci, 1968 "queue:%x, ac_param:%x\n",
1973 u4b_ac_param)); 1969 e_aci, u4b_ac_param);
1974 switch (e_aci) { 1970 switch (e_aci) {
1975 case AC1_BK: 1971 case AC1_BK:
1976 rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 1972 rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM,
@@ -2020,8 +2016,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
2020 break; 2016 break;
2021 default: 2017 default:
2022 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 2018 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
2023 ("HW_VAR_ACM_CTRL acm set " 2019 "HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
2024 "failed: eACI is %d\n", acm)); 2020 acm);
2025 break; 2021 break;
2026 } 2022 }
2027 } else { 2023 } else {
@@ -2037,13 +2033,13 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
2037 break; 2033 break;
2038 default: 2034 default:
2039 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 2035 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
2040 ("switch case not process\n")); 2036 "switch case not processed\n");
2041 break; 2037 break;
2042 } 2038 }
2043 } 2039 }
2044 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE, 2040 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE,
2045 ("SetHwReg8190pci(): [HW_VAR_ACM_CTRL] " 2041 "SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n",
2046 "Write 0x%X\n", acm_ctrl)); 2042 acm_ctrl);
2047 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl); 2043 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl);
2048 break; 2044 break;
2049 } 2045 }
@@ -2051,7 +2047,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
2051 rtl_write_dword(rtlpriv, REG_RCR, ((u32 *) (val))[0]); 2047 rtl_write_dword(rtlpriv, REG_RCR, ((u32 *) (val))[0]);
2052 mac->rx_conf = ((u32 *) (val))[0]; 2048 mac->rx_conf = ((u32 *) (val))[0];
2053 RT_TRACE(rtlpriv, COMP_RECV, DBG_DMESG, 2049 RT_TRACE(rtlpriv, COMP_RECV, DBG_DMESG,
2054 ("### Set RCR(0x%08x) ###\n", mac->rx_conf)); 2050 "### Set RCR(0x%08x) ###\n", mac->rx_conf);
2055 break; 2051 break;
2056 } 2052 }
2057 case HW_VAR_RETRY_LIMIT:{ 2053 case HW_VAR_RETRY_LIMIT:{
@@ -2060,8 +2056,9 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
2060 rtl_write_word(rtlpriv, REG_RL, 2056 rtl_write_word(rtlpriv, REG_RL,
2061 retry_limit << RETRY_LIMIT_SHORT_SHIFT | 2057 retry_limit << RETRY_LIMIT_SHORT_SHIFT |
2062 retry_limit << RETRY_LIMIT_LONG_SHIFT); 2058 retry_limit << RETRY_LIMIT_LONG_SHIFT);
2063 RT_TRACE(rtlpriv, COMP_MLME, DBG_DMESG, ("Set HW_VAR_R" 2059 RT_TRACE(rtlpriv, COMP_MLME, DBG_DMESG,
2064 "ETRY_LIMIT(0x%08x)\n", retry_limit)); 2060 "Set HW_VAR_RETRY_LIMIT(0x%08x)\n",
2061 retry_limit);
2065 break; 2062 break;
2066 } 2063 }
2067 case HW_VAR_DUAL_TSF_RST: 2064 case HW_VAR_DUAL_TSF_RST:
@@ -2165,8 +2162,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
2165 rtl_write_word(rtlpriv, REG_RXFLTMAP2, *(u16 *)val); 2162 rtl_write_word(rtlpriv, REG_RXFLTMAP2, *(u16 *)val);
2166 break; 2163 break;
2167 default: 2164 default:
2168 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("switch case " 2165 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
2169 "not process\n")); 2166 "switch case not processed\n");
2170 break; 2167 break;
2171 } 2168 }
2172} 2169}
@@ -2239,8 +2236,8 @@ void rtl92cu_update_hal_rate_table(struct ieee80211_hw *hw,
2239 (shortgi_rate << 4) | (shortgi_rate); 2236 (shortgi_rate << 4) | (shortgi_rate);
2240 } 2237 }
2241 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value); 2238 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value);
2242 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("%x\n", rtl_read_dword(rtlpriv, 2239 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
2243 REG_ARFR0))); 2240 rtl_read_dword(rtlpriv, REG_ARFR0));
2244} 2241}
2245 2242
2246void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level) 2243void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
@@ -2344,17 +2341,16 @@ void rtl92cu_update_hal_rate_mask(struct ieee80211_hw *hw, u8 rssi_level)
2344 ratr_bitmap &= 0x0f0ff0ff; 2341 ratr_bitmap &= 0x0f0ff0ff;
2345 break; 2342 break;
2346 } 2343 }
2347 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("ratr_bitmap :%x\n", 2344 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "ratr_bitmap :%x\n",
2348 ratr_bitmap)); 2345 ratr_bitmap);
2349 *(u32 *)&rate_mask = ((ratr_bitmap & 0x0fffffff) | 2346 *(u32 *)&rate_mask = ((ratr_bitmap & 0x0fffffff) |
2350 ratr_index << 28); 2347 ratr_index << 28);
2351 rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; 2348 rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80;
2352 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, ("Rate_index:%x, " 2349 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG,
2353 "ratr_val:%x, %x:%x:%x:%x:%x\n", 2350 "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n",
2354 ratr_index, ratr_bitmap, 2351 ratr_index, ratr_bitmap,
2355 rate_mask[0], rate_mask[1], 2352 rate_mask[0], rate_mask[1], rate_mask[2], rate_mask[3],
2356 rate_mask[2], rate_mask[3], 2353 rate_mask[4]);
2357 rate_mask[4]));
2358 rtl92c_fill_h2c_cmd(hw, H2C_RA_MASK, 5, rate_mask); 2354 rtl92c_fill_h2c_cmd(hw, H2C_RA_MASK, 5, rate_mask);
2359} 2355}
2360 2356
@@ -2404,7 +2400,7 @@ bool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid)
2404 e_rfpowerstate_toset = (u1tmp & BIT(7)) ? 2400 e_rfpowerstate_toset = (u1tmp & BIT(7)) ?
2405 ERFOFF : ERFON; 2401 ERFOFF : ERFON;
2406 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 2402 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
2407 ("pwrdown, 0x5c(BIT7)=%02x\n", u1tmp)); 2403 "pwrdown, 0x5c(BIT7)=%02x\n", u1tmp);
2408 } else { 2404 } else {
2409 rtl_write_byte(rtlpriv, REG_MAC_PINMUX_CFG, 2405 rtl_write_byte(rtlpriv, REG_MAC_PINMUX_CFG,
2410 rtl_read_byte(rtlpriv, 2406 rtl_read_byte(rtlpriv,
@@ -2413,27 +2409,26 @@ bool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid)
2413 e_rfpowerstate_toset = (u1tmp & BIT(3)) ? 2409 e_rfpowerstate_toset = (u1tmp & BIT(3)) ?
2414 ERFON : ERFOFF; 2410 ERFON : ERFOFF;
2415 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 2411 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
2416 ("GPIO_IN=%02x\n", u1tmp)); 2412 "GPIO_IN=%02x\n", u1tmp);
2417 } 2413 }
2418 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("N-SS RF =%x\n", 2414 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "N-SS RF =%x\n",
2419 e_rfpowerstate_toset)); 2415 e_rfpowerstate_toset);
2420 } 2416 }
2421 if ((ppsc->hwradiooff) && (e_rfpowerstate_toset == ERFON)) { 2417 if ((ppsc->hwradiooff) && (e_rfpowerstate_toset == ERFON)) {
2422 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("GPIOChangeRF - HW " 2418 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
2423 "Radio ON, RF ON\n")); 2419 "GPIOChangeRF - HW Radio ON, RF ON\n");
2424 ppsc->hwradiooff = false; 2420 ppsc->hwradiooff = false;
2425 actuallyset = true; 2421 actuallyset = true;
2426 } else if ((!ppsc->hwradiooff) && (e_rfpowerstate_toset == 2422 } else if ((!ppsc->hwradiooff) && (e_rfpowerstate_toset ==
2427 ERFOFF)) { 2423 ERFOFF)) {
2428 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("GPIOChangeRF - HW" 2424 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
2429 " Radio OFF\n")); 2425 "GPIOChangeRF - HW Radio OFF\n");
2430 ppsc->hwradiooff = true; 2426 ppsc->hwradiooff = true;
2431 actuallyset = true; 2427 actuallyset = true;
2432 } else { 2428 } else {
2433 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD , 2429 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
2434 ("pHalData->bHwRadioOff and eRfPowerStateToSet do not" 2430 "pHalData->bHwRadioOff and eRfPowerStateToSet do not match: pHalData->bHwRadioOff %x, eRfPowerStateToSet %x\n",
2435 " match: pHalData->bHwRadioOff %x, eRfPowerStateToSet " 2431 ppsc->hwradiooff, e_rfpowerstate_toset);
2436 "%x\n", ppsc->hwradiooff, e_rfpowerstate_toset));
2437 } 2432 }
2438 if (actuallyset) { 2433 if (actuallyset) {
2439 ppsc->hwradiooff = true; 2434 ppsc->hwradiooff = true;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/led.c b/drivers/net/wireless/rtlwifi/rtl8192cu/led.c
index 2ff9d8314e7b..65fd04424623 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/led.c
@@ -47,8 +47,8 @@ void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
47 u8 ledcfg; 47 u8 ledcfg;
48 struct rtl_priv *rtlpriv = rtl_priv(hw); 48 struct rtl_priv *rtlpriv = rtl_priv(hw);
49 49
50 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 50 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
51 ("LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin)); 51 REG_LEDCFG2, pled->ledpin);
52 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); 52 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2);
53 switch (pled->ledpin) { 53 switch (pled->ledpin) {
54 case LED_PIN_GPIO0: 54 case LED_PIN_GPIO0:
@@ -62,7 +62,7 @@ void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
62 break; 62 break;
63 default: 63 default:
64 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 64 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
65 ("switch case not process\n")); 65 "switch case not processed\n");
66 break; 66 break;
67 } 67 }
68 pled->ledon = true; 68 pled->ledon = true;
@@ -74,8 +74,8 @@ void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
74 struct rtl_usb_priv *usbpriv = rtl_usbpriv(hw); 74 struct rtl_usb_priv *usbpriv = rtl_usbpriv(hw);
75 u8 ledcfg; 75 u8 ledcfg;
76 76
77 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 77 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
78 ("LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin)); 78 REG_LEDCFG2, pled->ledpin);
79 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); 79 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2);
80 switch (pled->ledpin) { 80 switch (pled->ledpin) {
81 case LED_PIN_GPIO0: 81 case LED_PIN_GPIO0:
@@ -95,7 +95,7 @@ void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
95 break; 95 break;
96 default: 96 default:
97 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 97 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
98 ("switch case not process\n")); 98 "switch case not processed\n");
99 break; 99 break;
100 } 100 }
101 pled->ledon = false; 101 pled->ledon = false;
@@ -136,7 +136,6 @@ void rtl92cu_led_control(struct ieee80211_hw *hw,
136 ledaction == LED_CTL_POWER_ON)) { 136 ledaction == LED_CTL_POWER_ON)) {
137 return; 137 return;
138 } 138 }
139 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, ("ledaction %d,\n", 139 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "ledaction %d\n", ledaction);
140 ledaction));
141 _rtl92cu_sw_led_control(hw, ledaction); 140 _rtl92cu_sw_led_control(hw, ledaction);
142} 141}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
index 487ee908d7c5..9f09844d7d50 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
@@ -88,67 +88,59 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw)
88 switch (rtlhal->version) { 88 switch (rtlhal->version) {
89 case VERSION_NORMAL_TSMC_CHIP_92C_1T2R: 89 case VERSION_NORMAL_TSMC_CHIP_92C_1T2R:
90 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 90 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
91 ("Chip Version ID: VERSION_B_CHIP_92C.\n")); 91 "Chip Version ID: VERSION_B_CHIP_92C\n");
92 break; 92 break;
93 case VERSION_NORMAL_TSMC_CHIP_92C: 93 case VERSION_NORMAL_TSMC_CHIP_92C:
94 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 94 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
95 ("Chip Version ID: VERSION_NORMAL_TSMC_CHIP_92C.\n")); 95 "Chip Version ID: VERSION_NORMAL_TSMC_CHIP_92C\n");
96 break; 96 break;
97 case VERSION_NORMAL_TSMC_CHIP_88C: 97 case VERSION_NORMAL_TSMC_CHIP_88C:
98 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 98 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
99 ("Chip Version ID: VERSION_NORMAL_TSMC_CHIP_88C.\n")); 99 "Chip Version ID: VERSION_NORMAL_TSMC_CHIP_88C\n");
100 break; 100 break;
101 case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT: 101 case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT:
102 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 102 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
103 ("Chip Version ID: VERSION_NORMAL_UMC_CHIP_i" 103 "Chip Version ID: VERSION_NORMAL_UMC_CHIP_i92C_1T2R_A_CUT\n");
104 "92C_1T2R_A_CUT.\n"));
105 break; 104 break;
106 case VERSION_NORMAL_UMC_CHIP_92C_A_CUT: 105 case VERSION_NORMAL_UMC_CHIP_92C_A_CUT:
107 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 106 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
108 ("Chip Version ID: VERSION_NORMAL_UMC_CHIP_" 107 "Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_A_CUT\n");
109 "92C_A_CUT.\n"));
110 break; 108 break;
111 case VERSION_NORMAL_UMC_CHIP_88C_A_CUT: 109 case VERSION_NORMAL_UMC_CHIP_88C_A_CUT:
112 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 110 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
113 ("Chip Version ID: VERSION_NORMAL_UMC_CHIP" 111 "Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_A_CUT\n");
114 "_88C_A_CUT.\n"));
115 break; 112 break;
116 case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT: 113 case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT:
117 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 114 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
118 ("Chip Version ID: VERSION_NORMAL_UMC_CHIP" 115 "Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT\n");
119 "_92C_1T2R_B_CUT.\n"));
120 break; 116 break;
121 case VERSION_NORMAL_UMC_CHIP_92C_B_CUT: 117 case VERSION_NORMAL_UMC_CHIP_92C_B_CUT:
122 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 118 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
123 ("Chip Version ID: VERSION_NORMAL_UMC_CHIP" 119 "Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_B_CUT\n");
124 "_92C_B_CUT.\n"));
125 break; 120 break;
126 case VERSION_NORMAL_UMC_CHIP_88C_B_CUT: 121 case VERSION_NORMAL_UMC_CHIP_88C_B_CUT:
127 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 122 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
128 ("Chip Version ID: VERSION_NORMAL_UMC_CHIP" 123 "Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT\n");
129 "_88C_B_CUT.\n"));
130 break; 124 break;
131 case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT: 125 case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT:
132 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 126 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
133 ("Chip Version ID: VERSION_NORMA_UMC_CHIP" 127 "Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT\n");
134 "_8723_1T1R_A_CUT.\n"));
135 break; 128 break;
136 case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT: 129 case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT:
137 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 130 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
138 ("Chip Version ID: VERSION_NORMA_UMC_CHIP" 131 "Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT\n");
139 "_8723_1T1R_B_CUT.\n"));
140 break; 132 break;
141 case VERSION_TEST_CHIP_92C: 133 case VERSION_TEST_CHIP_92C:
142 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 134 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
143 ("Chip Version ID: VERSION_TEST_CHIP_92C.\n")); 135 "Chip Version ID: VERSION_TEST_CHIP_92C\n");
144 break; 136 break;
145 case VERSION_TEST_CHIP_88C: 137 case VERSION_TEST_CHIP_88C:
146 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 138 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
147 ("Chip Version ID: VERSION_TEST_CHIP_88C.\n")); 139 "Chip Version ID: VERSION_TEST_CHIP_88C\n");
148 break; 140 break;
149 default: 141 default:
150 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 142 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
151 ("Chip Version ID: ???????????????.\n")); 143 "Chip Version ID: ???????????????\n");
152 break; 144 break;
153 } 145 }
154 if (IS_92C_SERIAL(rtlhal->version)) 146 if (IS_92C_SERIAL(rtlhal->version))
@@ -157,15 +149,15 @@ void rtl92c_read_chip_version(struct ieee80211_hw *hw)
157 else 149 else
158 rtlphy->rf_type = RF_1T1R; 150 rtlphy->rf_type = RF_1T1R;
159 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 151 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
160 ("Chip RF Type: %s\n", (rtlphy->rf_type == RF_2T2R) ? 152 "Chip RF Type: %s\n",
161 "RF_2T2R" : "RF_1T1R")); 153 rtlphy->rf_type == RF_2T2R ? "RF_2T2R" : "RF_1T1R");
162 if (get_rf_type(rtlphy) == RF_1T1R) 154 if (get_rf_type(rtlphy) == RF_1T1R)
163 rtlpriv->dm.rfpath_rxenable[0] = true; 155 rtlpriv->dm.rfpath_rxenable[0] = true;
164 else 156 else
165 rtlpriv->dm.rfpath_rxenable[0] = 157 rtlpriv->dm.rfpath_rxenable[0] =
166 rtlpriv->dm.rfpath_rxenable[1] = true; 158 rtlpriv->dm.rfpath_rxenable[1] = true;
167 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("VersionID = 0x%4x\n", 159 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "VersionID = 0x%4x\n",
168 rtlhal->version)); 160 rtlhal->version);
169} 161}
170 162
171/** 163/**
@@ -192,9 +184,8 @@ bool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
192 break; 184 break;
193 if (count > POLLING_LLT_THRESHOLD) { 185 if (count > POLLING_LLT_THRESHOLD) {
194 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 186 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
195 ("Failed to polling write LLT done at" 187 "Failed to polling write LLT done at address %d! _LLT_OP_VALUE(%x)\n",
196 " address %d! _LLT_OP_VALUE(%x)\n", 188 address, _LLT_OP_VALUE(value));
197 address, _LLT_OP_VALUE(value)));
198 status = false; 189 status = false;
199 break; 190 break;
200 } 191 }
@@ -272,7 +263,7 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
272 u8 cam_offset = 0; 263 u8 cam_offset = 0;
273 u8 clear_number = 5; 264 u8 clear_number = 5;
274 265
275 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("clear_all\n")); 266 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "clear_all\n");
276 for (idx = 0; idx < clear_number; idx++) { 267 for (idx = 0; idx < clear_number; idx++) {
277 rtl_cam_mark_invalid(hw, cam_offset + idx); 268 rtl_cam_mark_invalid(hw, cam_offset + idx);
278 rtl_cam_empty_entry(hw, cam_offset + idx); 269 rtl_cam_empty_entry(hw, cam_offset + idx);
@@ -298,7 +289,7 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
298 break; 289 break;
299 default: 290 default:
300 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 291 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
301 ("iillegal switch case\n")); 292 "illegal switch case\n");
302 enc_algo = CAM_TKIP; 293 enc_algo = CAM_TKIP;
303 break; 294 break;
304 } 295 }
@@ -317,18 +308,18 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
317 } 308 }
318 if (rtlpriv->sec.key_len[key_index] == 0) { 309 if (rtlpriv->sec.key_len[key_index] == 0) {
319 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 310 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
320 ("delete one entry\n")); 311 "delete one entry\n");
321 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); 312 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id);
322 } else { 313 } else {
323 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 314 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
324 ("The insert KEY length is %d\n", 315 "The insert KEY length is %d\n",
325 rtlpriv->sec.key_len[PAIRWISE_KEYIDX])); 316 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]);
326 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 317 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
327 ("The insert KEY is %x %x\n", 318 "The insert KEY is %x %x\n",
328 rtlpriv->sec.key_buf[0][0], 319 rtlpriv->sec.key_buf[0][0],
329 rtlpriv->sec.key_buf[0][1])); 320 rtlpriv->sec.key_buf[0][1]);
330 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 321 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
331 ("add one entry\n")); 322 "add one entry\n");
332 if (is_pairwise) { 323 if (is_pairwise) {
333 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD, 324 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD,
334 "Pairwise Key content", 325 "Pairwise Key content",
@@ -336,7 +327,7 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
336 rtlpriv->sec. 327 rtlpriv->sec.
337 key_len[PAIRWISE_KEYIDX]); 328 key_len[PAIRWISE_KEYIDX]);
338 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 329 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
339 ("set Pairwiase key\n")); 330 "set Pairwise key\n");
340 331
341 rtl_cam_add_one_entry(hw, macaddr, key_index, 332 rtl_cam_add_one_entry(hw, macaddr, key_index,
342 entry_id, enc_algo, 333 entry_id, enc_algo,
@@ -345,7 +336,7 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
345 key_buf[key_index]); 336 key_buf[key_index]);
346 } else { 337 } else {
347 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 338 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
348 ("set group key\n")); 339 "set group key\n");
349 if (mac->opmode == NL80211_IFTYPE_ADHOC) { 340 if (mac->opmode == NL80211_IFTYPE_ADHOC) {
350 rtl_cam_add_one_entry(hw, 341 rtl_cam_add_one_entry(hw,
351 rtlefuse->dev_addr, 342 rtlefuse->dev_addr,
@@ -421,8 +412,8 @@ void rtl92c_set_qos(struct ieee80211_hw *hw, int aci)
421 AC_PARAM_ECW_MAX_OFFSET; 412 AC_PARAM_ECW_MAX_OFFSET;
422 u4b_ac_param |= (u32) le16_to_cpu(mac->ac[aci].tx_op) << 413 u4b_ac_param |= (u32) le16_to_cpu(mac->ac[aci].tx_op) <<
423 AC_PARAM_TXOP_OFFSET; 414 AC_PARAM_TXOP_OFFSET;
424 RT_TRACE(rtlpriv, COMP_QOS, DBG_LOUD, 415 RT_TRACE(rtlpriv, COMP_QOS, DBG_LOUD, "queue:%x, ac_param:%x\n",
425 ("queue:%x, ac_param:%x\n", aci, u4b_ac_param)); 416 aci, u4b_ac_param);
426 switch (aci) { 417 switch (aci) {
427 case AC1_BK: 418 case AC1_BK:
428 rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, u4b_ac_param); 419 rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, u4b_ac_param);
@@ -453,14 +444,14 @@ void rtl92c_set_mac_addr(struct ieee80211_hw *hw, const u8 *addr)
453 for (i = 0 ; i < ETH_ALEN ; i++) 444 for (i = 0 ; i < ETH_ALEN ; i++)
454 rtl_write_byte(rtlpriv, (REG_MACID + i), *(addr+i)); 445 rtl_write_byte(rtlpriv, (REG_MACID + i), *(addr+i));
455 446
456 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, ("MAC Address: %02X-%02X-%02X-" 447 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
457 "%02X-%02X-%02X\n", 448 "MAC Address: %02X-%02X-%02X-%02X-%02X-%02X\n",
458 rtl_read_byte(rtlpriv, REG_MACID), 449 rtl_read_byte(rtlpriv, REG_MACID),
459 rtl_read_byte(rtlpriv, REG_MACID+1), 450 rtl_read_byte(rtlpriv, REG_MACID+1),
460 rtl_read_byte(rtlpriv, REG_MACID+2), 451 rtl_read_byte(rtlpriv, REG_MACID+2),
461 rtl_read_byte(rtlpriv, REG_MACID+3), 452 rtl_read_byte(rtlpriv, REG_MACID+3),
462 rtl_read_byte(rtlpriv, REG_MACID+4), 453 rtl_read_byte(rtlpriv, REG_MACID+4),
463 rtl_read_byte(rtlpriv, REG_MACID+5))); 454 rtl_read_byte(rtlpriv, REG_MACID+5));
464} 455}
465 456
466void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size) 457void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size)
@@ -478,26 +469,26 @@ int rtl92c_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type)
478 case NL80211_IFTYPE_UNSPECIFIED: 469 case NL80211_IFTYPE_UNSPECIFIED:
479 value = NT_NO_LINK; 470 value = NT_NO_LINK;
480 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 471 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
481 ("Set Network type to NO LINK!\n")); 472 "Set Network type to NO LINK!\n");
482 break; 473 break;
483 case NL80211_IFTYPE_ADHOC: 474 case NL80211_IFTYPE_ADHOC:
484 value = NT_LINK_AD_HOC; 475 value = NT_LINK_AD_HOC;
485 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 476 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
486 ("Set Network type to Ad Hoc!\n")); 477 "Set Network type to Ad Hoc!\n");
487 break; 478 break;
488 case NL80211_IFTYPE_STATION: 479 case NL80211_IFTYPE_STATION:
489 value = NT_LINK_AP; 480 value = NT_LINK_AP;
490 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 481 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
491 ("Set Network type to STA!\n")); 482 "Set Network type to STA!\n");
492 break; 483 break;
493 case NL80211_IFTYPE_AP: 484 case NL80211_IFTYPE_AP:
494 value = NT_AS_AP; 485 value = NT_AS_AP;
495 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 486 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
496 ("Set Network type to AP!\n")); 487 "Set Network type to AP!\n");
497 break; 488 break;
498 default: 489 default:
499 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 490 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
500 ("Network type %d not support!\n", type)); 491 "Network type %d not supported!\n", type);
501 return -EOPNOTSUPP; 492 return -EOPNOTSUPP;
502 } 493 }
503 rtl_write_byte(rtlpriv, (REG_CR + 2), value); 494 rtl_write_byte(rtlpriv, (REG_CR + 2), value);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
index df491d38eccc..e7ea2bae2105 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
@@ -44,9 +44,9 @@ u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
44 u32 original_value, readback_value, bitshift; 44 u32 original_value, readback_value, bitshift;
45 struct rtl_phy *rtlphy = &(rtlpriv->phy); 45 struct rtl_phy *rtlphy = &(rtlpriv->phy);
46 46
47 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 47 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
48 "rfpath(%#x), bitmask(%#x)\n", 48 "regaddr(%#x), rfpath(%#x), bitmask(%#x)\n",
49 regaddr, rfpath, bitmask)); 49 regaddr, rfpath, bitmask);
50 if (rtlphy->rf_mode != RF_OP_BY_FW) { 50 if (rtlphy->rf_mode != RF_OP_BY_FW) {
51 original_value = _rtl92c_phy_rf_serial_read(hw, 51 original_value = _rtl92c_phy_rf_serial_read(hw,
52 rfpath, regaddr); 52 rfpath, regaddr);
@@ -57,9 +57,8 @@ u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
57 bitshift = _rtl92c_phy_calculate_bit_shift(bitmask); 57 bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
58 readback_value = (original_value & bitmask) >> bitshift; 58 readback_value = (original_value & bitmask) >> bitshift;
59 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 59 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
60 ("regaddr(%#x), rfpath(%#x), " 60 "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
61 "bitmask(%#x), original_value(%#x)\n", 61 regaddr, rfpath, bitmask, original_value);
62 regaddr, rfpath, bitmask, original_value));
63 return readback_value; 62 return readback_value;
64} 63}
65 64
@@ -72,8 +71,8 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
72 u32 original_value, bitshift; 71 u32 original_value, bitshift;
73 72
74 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 73 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
75 ("regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n", 74 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
76 regaddr, bitmask, data, rfpath)); 75 regaddr, bitmask, data, rfpath);
77 if (rtlphy->rf_mode != RF_OP_BY_FW) { 76 if (rtlphy->rf_mode != RF_OP_BY_FW) {
78 if (bitmask != RFREG_OFFSET_MASK) { 77 if (bitmask != RFREG_OFFSET_MASK) {
79 original_value = _rtl92c_phy_rf_serial_read(hw, 78 original_value = _rtl92c_phy_rf_serial_read(hw,
@@ -97,9 +96,9 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
97 } 96 }
98 _rtl92c_phy_fw_rf_serial_write(hw, rfpath, regaddr, data); 97 _rtl92c_phy_fw_rf_serial_write(hw, rfpath, regaddr, data);
99 } 98 }
100 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 99 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
101 "bitmask(%#x), data(%#x), rfpath(%#x)\n", 100 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
102 regaddr, bitmask, data, rfpath)); 101 regaddr, bitmask, data, rfpath);
103} 102}
104 103
105bool rtl92cu_phy_mac_config(struct ieee80211_hw *hw) 104bool rtl92cu_phy_mac_config(struct ieee80211_hw *hw)
@@ -152,11 +151,10 @@ bool _rtl92cu_phy_config_mac_with_headerfile(struct ieee80211_hw *hw)
152 u32 arraylength; 151 u32 arraylength;
153 u32 *ptrarray; 152 u32 *ptrarray;
154 153
155 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Read Rtl819XMACPHY_Array\n")); 154 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Read Rtl819XMACPHY_Array\n");
156 arraylength = rtlphy->hwparam_tables[MAC_REG].length ; 155 arraylength = rtlphy->hwparam_tables[MAC_REG].length ;
157 ptrarray = rtlphy->hwparam_tables[MAC_REG].pdata; 156 ptrarray = rtlphy->hwparam_tables[MAC_REG].pdata;
158 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 157 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Img:RTL8192CEMAC_2T_ARRAY\n");
159 ("Img:RTL8192CEMAC_2T_ARRAY\n"));
160 for (i = 0; i < arraylength; i = i + 2) 158 for (i = 0; i < arraylength; i = i + 2)
161 rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]); 159 rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]);
162 return true; 160 return true;
@@ -202,10 +200,9 @@ bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
202 phy_regarray_table[i + 1]); 200 phy_regarray_table[i + 1]);
203 udelay(1); 201 udelay(1);
204 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 202 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
205 ("The phy_regarray_table[0] is %x" 203 "The phy_regarray_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
206 " Rtl819XPHY_REGArray[1] is %x\n", 204 phy_regarray_table[i],
207 phy_regarray_table[i], 205 phy_regarray_table[i + 1]);
208 phy_regarray_table[i + 1]));
209 } 206 }
210 } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { 207 } else if (configtype == BASEBAND_CONFIG_AGC_TAB) {
211 for (i = 0; i < agctab_arraylen; i = i + 2) { 208 for (i = 0; i < agctab_arraylen; i = i + 2) {
@@ -213,10 +210,9 @@ bool _rtl92cu_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
213 agctab_array_table[i + 1]); 210 agctab_array_table[i + 1]);
214 udelay(1); 211 udelay(1);
215 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 212 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
216 ("The agctab_array_table[0] is " 213 "The agctab_array_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
217 "%x Rtl819XPHY_REGArray[1] is %x\n", 214 agctab_array_table[i],
218 agctab_array_table[i], 215 agctab_array_table[i + 1]);
219 agctab_array_table[i + 1]));
220 } 216 }
221 } 217 }
222 return true; 218 return true;
@@ -255,7 +251,7 @@ bool _rtl92cu_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
255 } 251 }
256 } else { 252 } else {
257 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 253 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
258 ("configtype != BaseBand_Config_PHY_REG\n")); 254 "configtype != BaseBand_Config_PHY_REG\n");
259 } 255 }
260 return true; 256 return true;
261} 257}
@@ -277,20 +273,20 @@ bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
277 radiob_arraylen = rtlphy->hwparam_tables[RADIOB_2T].length; 273 radiob_arraylen = rtlphy->hwparam_tables[RADIOB_2T].length;
278 radiob_array_table = rtlphy->hwparam_tables[RADIOB_2T].pdata; 274 radiob_array_table = rtlphy->hwparam_tables[RADIOB_2T].pdata;
279 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 275 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
280 ("Radio_A:RTL8192CERADIOA_2TARRAY\n")); 276 "Radio_A:RTL8192CERADIOA_2TARRAY\n");
281 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 277 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
282 ("Radio_B:RTL8192CE_RADIOB_2TARRAY\n")); 278 "Radio_B:RTL8192CE_RADIOB_2TARRAY\n");
283 } else { 279 } else {
284 radioa_arraylen = rtlphy->hwparam_tables[RADIOA_1T].length; 280 radioa_arraylen = rtlphy->hwparam_tables[RADIOA_1T].length;
285 radioa_array_table = rtlphy->hwparam_tables[RADIOA_1T].pdata; 281 radioa_array_table = rtlphy->hwparam_tables[RADIOA_1T].pdata;
286 radiob_arraylen = rtlphy->hwparam_tables[RADIOB_1T].length; 282 radiob_arraylen = rtlphy->hwparam_tables[RADIOB_1T].length;
287 radiob_array_table = rtlphy->hwparam_tables[RADIOB_1T].pdata; 283 radiob_array_table = rtlphy->hwparam_tables[RADIOB_1T].pdata;
288 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 284 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
289 ("Radio_A:RTL8192CE_RADIOA_1TARRAY\n")); 285 "Radio_A:RTL8192CE_RADIOA_1TARRAY\n");
290 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 286 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
291 ("Radio_B:RTL8192CE_RADIOB_1TARRAY\n")); 287 "Radio_B:RTL8192CE_RADIOB_1TARRAY\n");
292 } 288 }
293 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Radio No %x\n", rfpath)); 289 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Radio No %x\n", rfpath);
294 switch (rfpath) { 290 switch (rfpath) {
295 case RF90_PATH_A: 291 case RF90_PATH_A:
296 for (i = 0; i < radioa_arraylen; i = i + 2) { 292 for (i = 0; i < radioa_arraylen; i = i + 2) {
@@ -338,11 +334,11 @@ bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
338 break; 334 break;
339 case RF90_PATH_C: 335 case RF90_PATH_C:
340 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 336 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
341 ("switch case not process\n")); 337 "switch case not processed\n");
342 break; 338 break;
343 case RF90_PATH_D: 339 case RF90_PATH_D:
344 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 340 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
345 ("switch case not process\n")); 341 "switch case not processed\n");
346 break; 342 break;
347 } 343 }
348 return true; 344 return true;
@@ -357,10 +353,9 @@ void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
357 u8 reg_bw_opmode; 353 u8 reg_bw_opmode;
358 u8 reg_prsr_rsc; 354 u8 reg_prsr_rsc;
359 355
360 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 356 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "Switch to %s bandwidth\n",
361 ("Switch to %s bandwidth\n", 357 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
362 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 358 "20MHz" : "40MHz");
363 "20MHz" : "40MHz"));
364 if (is_hal_stop(rtlhal)) { 359 if (is_hal_stop(rtlhal)) {
365 rtlphy->set_bwmode_inprogress = false; 360 rtlphy->set_bwmode_inprogress = false;
366 return; 361 return;
@@ -381,7 +376,7 @@ void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
381 break; 376 break;
382 default: 377 default:
383 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 378 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
384 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 379 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
385 break; 380 break;
386 } 381 }
387 switch (rtlphy->current_chan_bw) { 382 switch (rtlphy->current_chan_bw) {
@@ -403,12 +398,12 @@ void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
403 break; 398 break;
404 default: 399 default:
405 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 400 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
406 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 401 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
407 break; 402 break;
408 } 403 }
409 rtl92cu_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); 404 rtl92cu_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
410 rtlphy->set_bwmode_inprogress = false; 405 rtlphy->set_bwmode_inprogress = false;
411 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 406 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
412} 407}
413 408
414void rtl92cu_bb_block_on(struct ieee80211_hw *hw) 409void rtl92cu_bb_block_on(struct ieee80211_hw *hw)
@@ -480,7 +475,7 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
480 do { 475 do {
481 InitializeCount++; 476 InitializeCount++;
482 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 477 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
483 ("IPS Set eRf nic enable\n")); 478 "IPS Set eRf nic enable\n");
484 rtstatus = rtl_ps_enable_nic(hw); 479 rtstatus = rtl_ps_enable_nic(hw);
485 } while ((rtstatus != true) 480 } while ((rtstatus != true)
486 && (InitializeCount < 10)); 481 && (InitializeCount < 10));
@@ -488,10 +483,9 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
488 RT_RF_OFF_LEVL_HALT_NIC); 483 RT_RF_OFF_LEVL_HALT_NIC);
489 } else { 484 } else {
490 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 485 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
491 ("Set ERFON sleeped:%d ms\n", 486 "Set ERFON sleeped:%d ms\n",
492 jiffies_to_msecs(jiffies - 487 jiffies_to_msecs(jiffies -
493 ppsc-> 488 ppsc->last_sleep_jiffies));
494 last_sleep_jiffies)));
495 ppsc->last_awake_jiffies = jiffies; 489 ppsc->last_awake_jiffies = jiffies;
496 rtl92ce_phy_set_rf_on(hw); 490 rtl92ce_phy_set_rf_on(hw);
497 } 491 }
@@ -513,27 +507,25 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
513 continue; 507 continue;
514 } else { 508 } else {
515 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 509 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
516 ("eRf Off/Sleep: %d times " 510 "eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
517 "TcbBusyQueue[%d] " 511 i + 1,
518 "=%d before doze!\n", (i + 1), 512 queue_id,
519 queue_id, 513 skb_queue_len(&ring->queue));
520 skb_queue_len(&ring->queue)));
521 udelay(10); 514 udelay(10);
522 i++; 515 i++;
523 } 516 }
524 if (i >= MAX_DOZE_WAITING_TIMES_9x) { 517 if (i >= MAX_DOZE_WAITING_TIMES_9x) {
525 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 518 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
526 ("\nERFOFF: %d times " 519 "ERFOFF: %d times TcbBusyQueue[%d] = %d !\n",
527 "TcbBusyQueue[%d] = %d !\n", 520 MAX_DOZE_WAITING_TIMES_9x,
528 MAX_DOZE_WAITING_TIMES_9x, 521 queue_id,
529 queue_id, 522 skb_queue_len(&ring->queue));
530 skb_queue_len(&ring->queue)));
531 break; 523 break;
532 } 524 }
533 } 525 }
534 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) { 526 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) {
535 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 527 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
536 ("IPS Set eRf nic disable\n")); 528 "IPS Set eRf nic disable\n");
537 rtl_ps_disable_nic(hw); 529 rtl_ps_disable_nic(hw);
538 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC); 530 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC);
539 } else { 531 } else {
@@ -557,33 +549,30 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
557 continue; 549 continue;
558 } else { 550 } else {
559 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 551 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
560 ("eRf Off/Sleep: %d times " 552 "eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
561 "TcbBusyQueue[%d] =%d before " 553 i + 1, queue_id,
562 "doze!\n", (i + 1), queue_id, 554 skb_queue_len(&ring->queue));
563 skb_queue_len(&ring->queue)));
564 udelay(10); 555 udelay(10);
565 i++; 556 i++;
566 } 557 }
567 if (i >= MAX_DOZE_WAITING_TIMES_9x) { 558 if (i >= MAX_DOZE_WAITING_TIMES_9x) {
568 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 559 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
569 ("\n ERFSLEEP: %d times " 560 "ERFSLEEP: %d times TcbBusyQueue[%d] = %d !\n",
570 "TcbBusyQueue[%d] = %d !\n", 561 MAX_DOZE_WAITING_TIMES_9x,
571 MAX_DOZE_WAITING_TIMES_9x, 562 queue_id,
572 queue_id, 563 skb_queue_len(&ring->queue));
573 skb_queue_len(&ring->queue)));
574 break; 564 break;
575 } 565 }
576 } 566 }
577 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 567 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
578 ("Set ERFSLEEP awaked:%d ms\n", 568 "Set ERFSLEEP awaked:%d ms\n",
579 jiffies_to_msecs(jiffies - 569 jiffies_to_msecs(jiffies - ppsc->last_awake_jiffies));
580 ppsc->last_awake_jiffies)));
581 ppsc->last_sleep_jiffies = jiffies; 570 ppsc->last_sleep_jiffies = jiffies;
582 _rtl92c_phy_set_rf_sleep(hw); 571 _rtl92c_phy_set_rf_sleep(hw);
583 break; 572 break;
584 default: 573 default:
585 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 574 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
586 ("switch case not process\n")); 575 "switch case not processed\n");
587 bresult = false; 576 bresult = false;
588 break; 577 break;
589 } 578 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
index 1e851aae58db..7b48ee9acb15 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
@@ -56,7 +56,7 @@ void rtl92cu_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
56 break; 56 break;
57 default: 57 default:
58 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 58 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
59 ("unknown bandwidth: %#X\n", bandwidth)); 59 "unknown bandwidth: %#X\n", bandwidth);
60 break; 60 break;
61 } 61 }
62} 62}
@@ -482,11 +482,11 @@ static bool _rtl92c_phy_rf6052_config_parafile(struct ieee80211_hw *hw)
482 } 482 }
483 if (rtstatus != true) { 483 if (rtstatus != true) {
484 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 484 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
485 ("Radio[%d] Fail!!", rfpath)); 485 "Radio[%d] Fail!!", rfpath);
486 goto phy_rf_cfg_fail; 486 goto phy_rf_cfg_fail;
487 } 487 }
488 } 488 }
489 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("<---\n")); 489 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "<---\n");
490 return rtstatus; 490 return rtstatus;
491phy_rf_cfg_fail: 491phy_rf_cfg_fail:
492 return rtstatus; 492 return rtstatus;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 6d2ca773bbc7..dee7aab4faa6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -65,7 +65,7 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
65 rtlpriv->rtlhal.pfirmware = vmalloc(0x4000); 65 rtlpriv->rtlhal.pfirmware = vmalloc(0x4000);
66 if (!rtlpriv->rtlhal.pfirmware) { 66 if (!rtlpriv->rtlhal.pfirmware) {
67 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 67 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
68 ("Can't alloc buffer for fw.\n")); 68 "Can't alloc buffer for fw\n");
69 return 1; 69 return 1;
70 } 70 }
71 /* request fw */ 71 /* request fw */
@@ -73,12 +73,12 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
73 rtlpriv->io.dev); 73 rtlpriv->io.dev);
74 if (err) { 74 if (err) {
75 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 75 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
76 ("Failed to request firmware!\n")); 76 "Failed to request firmware!\n");
77 return 1; 77 return 1;
78 } 78 }
79 if (firmware->size > 0x4000) { 79 if (firmware->size > 0x4000) {
80 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 80 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
81 ("Firmware is too big!\n")); 81 "Firmware is too big!\n");
82 release_firmware(firmware); 82 release_firmware(firmware);
83 return 1; 83 return 1;
84 } 84 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 128cfcd09fa9..b875af75b893 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -108,7 +108,7 @@ static void _TwoOutEpMapping(struct ieee80211_hw *hw, bool bIsChipB,
108 108
109 if (bwificfg) { /* for WMM */ 109 if (bwificfg) { /* for WMM */
110 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 110 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
111 ("USB Chip-B & WMM Setting.....\n")); 111 "USB Chip-B & WMM Setting.....\n");
112 ep_map->ep_mapping[RTL_TXQ_BE] = 2; 112 ep_map->ep_mapping[RTL_TXQ_BE] = 2;
113 ep_map->ep_mapping[RTL_TXQ_BK] = 3; 113 ep_map->ep_mapping[RTL_TXQ_BK] = 3;
114 ep_map->ep_mapping[RTL_TXQ_VI] = 3; 114 ep_map->ep_mapping[RTL_TXQ_VI] = 3;
@@ -118,7 +118,7 @@ static void _TwoOutEpMapping(struct ieee80211_hw *hw, bool bIsChipB,
118 ep_map->ep_mapping[RTL_TXQ_HI] = 2; 118 ep_map->ep_mapping[RTL_TXQ_HI] = 2;
119 } else { /* typical setting */ 119 } else { /* typical setting */
120 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 120 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
121 ("USB typical Setting.....\n")); 121 "USB typical Setting.....\n");
122 ep_map->ep_mapping[RTL_TXQ_BE] = 3; 122 ep_map->ep_mapping[RTL_TXQ_BE] = 3;
123 ep_map->ep_mapping[RTL_TXQ_BK] = 3; 123 ep_map->ep_mapping[RTL_TXQ_BK] = 3;
124 ep_map->ep_mapping[RTL_TXQ_VI] = 2; 124 ep_map->ep_mapping[RTL_TXQ_VI] = 2;
@@ -135,7 +135,7 @@ static void _ThreeOutEpMapping(struct ieee80211_hw *hw, bool bwificfg,
135 struct rtl_priv *rtlpriv = rtl_priv(hw); 135 struct rtl_priv *rtlpriv = rtl_priv(hw);
136 if (bwificfg) { /* for WMM */ 136 if (bwificfg) { /* for WMM */
137 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 137 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
138 ("USB 3EP Setting for WMM.....\n")); 138 "USB 3EP Setting for WMM.....\n");
139 ep_map->ep_mapping[RTL_TXQ_BE] = 5; 139 ep_map->ep_mapping[RTL_TXQ_BE] = 5;
140 ep_map->ep_mapping[RTL_TXQ_BK] = 3; 140 ep_map->ep_mapping[RTL_TXQ_BK] = 3;
141 ep_map->ep_mapping[RTL_TXQ_VI] = 3; 141 ep_map->ep_mapping[RTL_TXQ_VI] = 3;
@@ -145,7 +145,7 @@ static void _ThreeOutEpMapping(struct ieee80211_hw *hw, bool bwificfg,
145 ep_map->ep_mapping[RTL_TXQ_HI] = 2; 145 ep_map->ep_mapping[RTL_TXQ_HI] = 2;
146 } else { /* typical setting */ 146 } else { /* typical setting */
147 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 147 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
148 ("USB 3EP Setting for typical.....\n")); 148 "USB 3EP Setting for typical.....\n");
149 ep_map->ep_mapping[RTL_TXQ_BE] = 5; 149 ep_map->ep_mapping[RTL_TXQ_BE] = 5;
150 ep_map->ep_mapping[RTL_TXQ_BK] = 5; 150 ep_map->ep_mapping[RTL_TXQ_BK] = 5;
151 ep_map->ep_mapping[RTL_TXQ_VI] = 3; 151 ep_map->ep_mapping[RTL_TXQ_VI] = 3;
@@ -270,23 +270,23 @@ static enum rtl_desc_qsel _rtl8192cu_mq_to_descq(struct ieee80211_hw *hw,
270 case 0: /* VO */ 270 case 0: /* VO */
271 qsel = QSLT_VO; 271 qsel = QSLT_VO;
272 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, 272 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG,
273 ("VO queue, set qsel = 0x%x\n", QSLT_VO)); 273 "VO queue, set qsel = 0x%x\n", QSLT_VO);
274 break; 274 break;
275 case 1: /* VI */ 275 case 1: /* VI */
276 qsel = QSLT_VI; 276 qsel = QSLT_VI;
277 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, 277 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG,
278 ("VI queue, set qsel = 0x%x\n", QSLT_VI)); 278 "VI queue, set qsel = 0x%x\n", QSLT_VI);
279 break; 279 break;
280 case 3: /* BK */ 280 case 3: /* BK */
281 qsel = QSLT_BK; 281 qsel = QSLT_BK;
282 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, 282 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG,
283 ("BK queue, set qsel = 0x%x\n", QSLT_BK)); 283 "BK queue, set qsel = 0x%x\n", QSLT_BK);
284 break; 284 break;
285 case 2: /* BE */ 285 case 2: /* BE */
286 default: 286 default:
287 qsel = QSLT_BE; 287 qsel = QSLT_BE;
288 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG, 288 RT_TRACE(rtlpriv, COMP_USB, DBG_DMESG,
289 ("BE queue, set qsel = 0x%x\n", QSLT_BE)); 289 "BE queue, set qsel = 0x%x\n", QSLT_BE);
290 break; 290 break;
291 } 291 }
292out: 292out:
@@ -422,17 +422,17 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb)
422 bv = ieee80211_is_probe_resp(fc); 422 bv = ieee80211_is_probe_resp(fc);
423 if (bv) 423 if (bv)
424 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 424 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
425 ("Got probe response frame.\n")); 425 "Got probe response frame\n");
426 if (ieee80211_is_beacon(fc)) 426 if (ieee80211_is_beacon(fc))
427 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 427 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Got beacon frame\n");
428 ("Got beacon frame.\n"));
429 if (ieee80211_is_data(fc)) 428 if (ieee80211_is_data(fc))
430 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Got data frame.\n")); 429 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Got data frame\n");
431 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 430 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
432 ("Fram: fc = 0x%X addr1 = 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:" 431 "Fram: fc = 0x%X addr1 = 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\n",
433 "0x%02X\n", fc, (u32)hdr->addr1[0], (u32)hdr->addr1[1], 432 fc,
434 (u32)hdr->addr1[2], (u32)hdr->addr1[3], (u32)hdr->addr1[4], 433 (u32)hdr->addr1[0], (u32)hdr->addr1[1],
435 (u32)hdr->addr1[5])); 434 (u32)hdr->addr1[2], (u32)hdr->addr1[3],
435 (u32)hdr->addr1[4], (u32)hdr->addr1[5]);
436 memcpy(IEEE80211_SKB_RXCB(skb), rx_status, sizeof(*rx_status)); 436 memcpy(IEEE80211_SKB_RXCB(skb), rx_status, sizeof(*rx_status));
437 ieee80211_rx_irqsafe(hw, skb); 437 ieee80211_rx_irqsafe(hw, skb);
438} 438}
@@ -594,7 +594,7 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
594 if (ieee80211_is_data_qos(fc)) { 594 if (ieee80211_is_data_qos(fc)) {
595 if (mac->rdg_en) { 595 if (mac->rdg_en) {
596 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 596 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
597 ("Enable RDG function.\n")); 597 "Enable RDG function\n");
598 SET_TX_DESC_RDG_ENABLE(txdesc, 1); 598 SET_TX_DESC_RDG_ENABLE(txdesc, 1);
599 SET_TX_DESC_HTC(txdesc, 1); 599 SET_TX_DESC_HTC(txdesc, 1);
600 } 600 }
@@ -620,7 +620,7 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
620 SET_TX_DESC_BMC(txdesc, 1); 620 SET_TX_DESC_BMC(txdesc, 1);
621 _rtl_fill_usb_tx_desc(txdesc); 621 _rtl_fill_usb_tx_desc(txdesc);
622 _rtl_tx_desc_checksum(txdesc); 622 _rtl_tx_desc_checksum(txdesc);
623 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, (" %s ==>\n", __func__)); 623 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, " %s ==>\n", __func__);
624} 624}
625 625
626void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc, 626void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
index 3cd0736fe8e1..32537c4faf95 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
@@ -246,23 +246,21 @@ static void rtl92d_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
246 rtl_set_bbreg(hw, RCCK0_FALSEALARMREPORT, 0x0000c000, 2); 246 rtl_set_bbreg(hw, RCCK0_FALSEALARMREPORT, 0x0000c000, 2);
247 rtl92d_release_cckandrw_pagea_ctl(hw, &flag); 247 rtl92d_release_cckandrw_pagea_ctl(hw, &flag);
248 } 248 }
249 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("Cnt_Fast_Fsync_fail = %x, " 249 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
250 "Cnt_SB_Search_fail = %x\n", 250 "Cnt_Fast_Fsync_fail = %x, Cnt_SB_Search_fail = %x\n",
251 falsealm_cnt->cnt_fast_fsync_fail, 251 falsealm_cnt->cnt_fast_fsync_fail,
252 falsealm_cnt->cnt_sb_search_fail)); 252 falsealm_cnt->cnt_sb_search_fail);
253 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("Cnt_Parity_Fail = %x, " 253 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
254 "Cnt_Rate_Illegal = %x, Cnt_Crc8_fail = %x, " 254 "Cnt_Parity_Fail = %x, Cnt_Rate_Illegal = %x, Cnt_Crc8_fail = %x, Cnt_Mcs_fail = %x\n",
255 "Cnt_Mcs_fail = %x\n",
256 falsealm_cnt->cnt_parity_fail, 255 falsealm_cnt->cnt_parity_fail,
257 falsealm_cnt->cnt_rate_illegal, 256 falsealm_cnt->cnt_rate_illegal,
258 falsealm_cnt->cnt_crc8_fail, 257 falsealm_cnt->cnt_crc8_fail,
259 falsealm_cnt->cnt_mcs_fail)); 258 falsealm_cnt->cnt_mcs_fail);
260 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 259 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
261 ("Cnt_Ofdm_fail = %x, " "Cnt_Cck_fail = %x, " 260 "Cnt_Ofdm_fail = %x, Cnt_Cck_fail = %x, Cnt_all = %x\n",
262 "Cnt_all = %x\n",
263 falsealm_cnt->cnt_ofdm_fail, 261 falsealm_cnt->cnt_ofdm_fail,
264 falsealm_cnt->cnt_cck_fail, 262 falsealm_cnt->cnt_cck_fail,
265 falsealm_cnt->cnt_all)); 263 falsealm_cnt->cnt_all);
266} 264}
267 265
268static void rtl92d_dm_find_minimum_rssi(struct ieee80211_hw *hw) 266static void rtl92d_dm_find_minimum_rssi(struct ieee80211_hw *hw)
@@ -275,7 +273,7 @@ static void rtl92d_dm_find_minimum_rssi(struct ieee80211_hw *hw)
275 (rtlpriv->dm.UNDEC_SM_PWDB == 0)) { 273 (rtlpriv->dm.UNDEC_SM_PWDB == 0)) {
276 de_digtable.min_undecorated_pwdb_for_dm = 0; 274 de_digtable.min_undecorated_pwdb_for_dm = 0;
277 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, 275 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
278 ("Not connected to any\n")); 276 "Not connected to any\n");
279 } 277 }
280 if (mac->link_state >= MAC80211_LINKED) { 278 if (mac->link_state >= MAC80211_LINKED) {
281 if (mac->opmode == NL80211_IFTYPE_AP || 279 if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -283,25 +281,25 @@ static void rtl92d_dm_find_minimum_rssi(struct ieee80211_hw *hw)
283 de_digtable.min_undecorated_pwdb_for_dm = 281 de_digtable.min_undecorated_pwdb_for_dm =
284 rtlpriv->dm.UNDEC_SM_PWDB; 282 rtlpriv->dm.UNDEC_SM_PWDB;
285 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, 283 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
286 ("AP Client PWDB = 0x%lx\n", 284 "AP Client PWDB = 0x%lx\n",
287 rtlpriv->dm.UNDEC_SM_PWDB)); 285 rtlpriv->dm.UNDEC_SM_PWDB);
288 } else { 286 } else {
289 de_digtable.min_undecorated_pwdb_for_dm = 287 de_digtable.min_undecorated_pwdb_for_dm =
290 rtlpriv->dm.undecorated_smoothed_pwdb; 288 rtlpriv->dm.undecorated_smoothed_pwdb;
291 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, 289 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
292 ("STA Default Port PWDB = 0x%x\n", 290 "STA Default Port PWDB = 0x%x\n",
293 de_digtable.min_undecorated_pwdb_for_dm)); 291 de_digtable.min_undecorated_pwdb_for_dm);
294 } 292 }
295 } else { 293 } else {
296 de_digtable.min_undecorated_pwdb_for_dm = 294 de_digtable.min_undecorated_pwdb_for_dm =
297 rtlpriv->dm.UNDEC_SM_PWDB; 295 rtlpriv->dm.UNDEC_SM_PWDB;
298 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, 296 RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
299 ("AP Ext Port or disconnet PWDB = 0x%x\n", 297 "AP Ext Port or disconnet PWDB = 0x%x\n",
300 de_digtable.min_undecorated_pwdb_for_dm)); 298 de_digtable.min_undecorated_pwdb_for_dm);
301 } 299 }
302 300
303 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("MinUndecoratedPWDBForDM =%d\n", 301 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "MinUndecoratedPWDBForDM =%d\n",
304 de_digtable.min_undecorated_pwdb_for_dm)); 302 de_digtable.min_undecorated_pwdb_for_dm);
305} 303}
306 304
307static void rtl92d_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw) 305static void rtl92d_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
@@ -340,14 +338,14 @@ static void rtl92d_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
340 } 338 }
341 de_digtable.pre_cck_pd_state = de_digtable.cur_cck_pd_state; 339 de_digtable.pre_cck_pd_state = de_digtable.cur_cck_pd_state;
342 } 340 }
343 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("CurSTAConnectState=%s\n", 341 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "CurSTAConnectState=%s\n",
344 (de_digtable.cursta_connectctate == DIG_STA_CONNECT ? 342 de_digtable.cursta_connectctate == DIG_STA_CONNECT ?
345 "DIG_STA_CONNECT " : "DIG_STA_DISCONNECT"))); 343 "DIG_STA_CONNECT " : "DIG_STA_DISCONNECT");
346 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("CCKPDStage=%s\n", 344 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "CCKPDStage=%s\n",
347 (de_digtable.cur_cck_pd_state == CCK_PD_STAGE_LOWRSSI ? 345 de_digtable.cur_cck_pd_state == CCK_PD_STAGE_LOWRSSI ?
348 "Low RSSI " : "High RSSI "))); 346 "Low RSSI " : "High RSSI ");
349 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("is92d single phy =%x\n", 347 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "is92d single phy =%x\n",
350 IS_92D_SINGLEPHY(rtlpriv->rtlhal.version))); 348 IS_92D_SINGLEPHY(rtlpriv->rtlhal.version));
351 349
352} 350}
353 351
@@ -355,12 +353,12 @@ void rtl92d_dm_write_dig(struct ieee80211_hw *hw)
355{ 353{
356 struct rtl_priv *rtlpriv = rtl_priv(hw); 354 struct rtl_priv *rtlpriv = rtl_priv(hw);
357 355
358 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("cur_igvalue = 0x%x, " 356 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
359 "pre_igvalue = 0x%x, backoff_val = %d\n", 357 "cur_igvalue = 0x%x, pre_igvalue = 0x%x, backoff_val = %d\n",
360 de_digtable.cur_igvalue, de_digtable.pre_igvalue, 358 de_digtable.cur_igvalue, de_digtable.pre_igvalue,
361 de_digtable.backoff_val)); 359 de_digtable.backoff_val);
362 if (de_digtable.dig_enable_flag == false) { 360 if (de_digtable.dig_enable_flag == false) {
363 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("DIG is disabled\n")); 361 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "DIG is disabled\n");
364 de_digtable.pre_igvalue = 0x17; 362 de_digtable.pre_igvalue = 0x17;
365 return; 363 return;
366 } 364 }
@@ -377,22 +375,21 @@ static void rtl92d_early_mode_enabled(struct rtl_priv *rtlpriv)
377{ 375{
378 if ((rtlpriv->mac80211.link_state >= MAC80211_LINKED) && 376 if ((rtlpriv->mac80211.link_state >= MAC80211_LINKED) &&
379 (rtlpriv->mac80211.vendor == PEER_CISCO)) { 377 (rtlpriv->mac80211.vendor == PEER_CISCO)) {
380 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 378 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "IOT_PEER = CISCO\n");
381 ("IOT_PEER = CISCO\n"));
382 if (de_digtable.last_min_undecorated_pwdb_for_dm >= 50 379 if (de_digtable.last_min_undecorated_pwdb_for_dm >= 50
383 && de_digtable.min_undecorated_pwdb_for_dm < 50) { 380 && de_digtable.min_undecorated_pwdb_for_dm < 50) {
384 rtl_write_byte(rtlpriv, REG_EARLY_MODE_CONTROL, 0x00); 381 rtl_write_byte(rtlpriv, REG_EARLY_MODE_CONTROL, 0x00);
385 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 382 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
386 ("Early Mode Off\n")); 383 "Early Mode Off\n");
387 } else if (de_digtable.last_min_undecorated_pwdb_for_dm <= 55 && 384 } else if (de_digtable.last_min_undecorated_pwdb_for_dm <= 55 &&
388 de_digtable.min_undecorated_pwdb_for_dm > 55) { 385 de_digtable.min_undecorated_pwdb_for_dm > 55) {
389 rtl_write_byte(rtlpriv, REG_EARLY_MODE_CONTROL, 0x0f); 386 rtl_write_byte(rtlpriv, REG_EARLY_MODE_CONTROL, 0x0f);
390 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 387 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
391 ("Early Mode On\n")); 388 "Early Mode On\n");
392 } 389 }
393 } else if (!(rtl_read_byte(rtlpriv, REG_EARLY_MODE_CONTROL) & 0xf)) { 390 } else if (!(rtl_read_byte(rtlpriv, REG_EARLY_MODE_CONTROL) & 0xf)) {
394 rtl_write_byte(rtlpriv, REG_EARLY_MODE_CONTROL, 0x0f); 391 rtl_write_byte(rtlpriv, REG_EARLY_MODE_CONTROL, 0x0f);
395 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("Early Mode On\n")); 392 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "Early Mode On\n");
396 } 393 }
397} 394}
398 395
@@ -402,7 +399,7 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw)
402 u8 value_igi = de_digtable.cur_igvalue; 399 u8 value_igi = de_digtable.cur_igvalue;
403 struct false_alarm_statistics *falsealm_cnt = &(rtlpriv->falsealm_cnt); 400 struct false_alarm_statistics *falsealm_cnt = &(rtlpriv->falsealm_cnt);
404 401
405 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("==>\n")); 402 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "==>\n");
406 if (rtlpriv->rtlhal.earlymode_enable) { 403 if (rtlpriv->rtlhal.earlymode_enable) {
407 rtl92d_early_mode_enabled(rtlpriv); 404 rtl92d_early_mode_enabled(rtlpriv);
408 de_digtable.last_min_undecorated_pwdb_for_dm = 405 de_digtable.last_min_undecorated_pwdb_for_dm =
@@ -421,7 +418,7 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw)
421 /* Not STA mode return tmp */ 418 /* Not STA mode return tmp */
422 if (rtlpriv->mac80211.opmode != NL80211_IFTYPE_STATION) 419 if (rtlpriv->mac80211.opmode != NL80211_IFTYPE_STATION)
423 return; 420 return;
424 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("progress\n")); 421 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "progress\n");
425 /* Decide the current status and if modify initial gain or not */ 422 /* Decide the current status and if modify initial gain or not */
426 if (rtlpriv->mac80211.link_state >= MAC80211_LINKED) 423 if (rtlpriv->mac80211.link_state >= MAC80211_LINKED)
427 de_digtable.cursta_connectctate = DIG_STA_CONNECT; 424 de_digtable.cursta_connectctate = DIG_STA_CONNECT;
@@ -438,16 +435,16 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw)
438 else if (falsealm_cnt->cnt_all >= DM_DIG_FA_TH2) 435 else if (falsealm_cnt->cnt_all >= DM_DIG_FA_TH2)
439 value_igi += 2; 436 value_igi += 2;
440 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 437 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
441 ("dm_DIG() Before: large_fa_hit=%d, forbidden_igi=%x\n", 438 "dm_DIG() Before: large_fa_hit=%d, forbidden_igi=%x\n",
442 de_digtable.large_fa_hit, de_digtable.forbidden_igi)); 439 de_digtable.large_fa_hit, de_digtable.forbidden_igi);
443 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 440 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
444 ("dm_DIG() Before: Recover_cnt=%d, rx_gain_range_min=%x\n", 441 "dm_DIG() Before: Recover_cnt=%d, rx_gain_range_min=%x\n",
445 de_digtable.recover_cnt, de_digtable.rx_gain_range_min)); 442 de_digtable.recover_cnt, de_digtable.rx_gain_range_min);
446 443
447 /* deal with abnorally large false alarm */ 444 /* deal with abnorally large false alarm */
448 if (falsealm_cnt->cnt_all > 10000) { 445 if (falsealm_cnt->cnt_all > 10000) {
449 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 446 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
450 ("dm_DIG(): Abnornally false alarm case.\n")); 447 "dm_DIG(): Abnormally false alarm case\n");
451 448
452 de_digtable.large_fa_hit++; 449 de_digtable.large_fa_hit++;
453 if (de_digtable.forbidden_igi < de_digtable.cur_igvalue) { 450 if (de_digtable.forbidden_igi < de_digtable.cur_igvalue) {
@@ -486,11 +483,11 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw)
486 } 483 }
487 } 484 }
488 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 485 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
489 ("dm_DIG() After: large_fa_hit=%d, forbidden_igi=%x\n", 486 "dm_DIG() After: large_fa_hit=%d, forbidden_igi=%x\n",
490 de_digtable.large_fa_hit, de_digtable.forbidden_igi)); 487 de_digtable.large_fa_hit, de_digtable.forbidden_igi);
491 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, 488 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
492 ("dm_DIG() After: recover_cnt=%d, rx_gain_range_min=%x\n", 489 "dm_DIG() After: recover_cnt=%d, rx_gain_range_min=%x\n",
493 de_digtable.recover_cnt, de_digtable.rx_gain_range_min)); 490 de_digtable.recover_cnt, de_digtable.rx_gain_range_min);
494 491
495 if (value_igi > DM_DIG_MAX) 492 if (value_igi > DM_DIG_MAX)
496 value_igi = DM_DIG_MAX; 493 value_igi = DM_DIG_MAX;
@@ -500,7 +497,7 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw)
500 rtl92d_dm_write_dig(hw); 497 rtl92d_dm_write_dig(hw);
501 if (rtlpriv->rtlhal.current_bandtype != BAND_ON_5G) 498 if (rtlpriv->rtlhal.current_bandtype != BAND_ON_5G)
502 rtl92d_dm_cck_packet_detection_thresh(hw); 499 rtl92d_dm_cck_packet_detection_thresh(hw);
503 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, ("<<==\n")); 500 RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "<<==\n");
504} 501}
505 502
506static void rtl92d_dm_init_dynamic_txpower(struct ieee80211_hw *hw) 503static void rtl92d_dm_init_dynamic_txpower(struct ieee80211_hw *hw)
@@ -528,7 +525,7 @@ static void rtl92d_dm_dynamic_txpower(struct ieee80211_hw *hw)
528 if ((mac->link_state < MAC80211_LINKED) && 525 if ((mac->link_state < MAC80211_LINKED) &&
529 (rtlpriv->dm.UNDEC_SM_PWDB == 0)) { 526 (rtlpriv->dm.UNDEC_SM_PWDB == 0)) {
530 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 527 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
531 ("Not connected to any\n")); 528 "Not connected to any\n");
532 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL; 529 rtlpriv->dm.dynamic_txhighpower_lvl = TXHIGHPWRLEVEL_NORMAL;
533 rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL; 530 rtlpriv->dm.last_dtp_lvl = TXHIGHPWRLEVEL_NORMAL;
534 return; 531 return;
@@ -538,40 +535,40 @@ static void rtl92d_dm_dynamic_txpower(struct ieee80211_hw *hw)
538 undecorated_smoothed_pwdb = 535 undecorated_smoothed_pwdb =
539 rtlpriv->dm.UNDEC_SM_PWDB; 536 rtlpriv->dm.UNDEC_SM_PWDB;
540 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 537 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
541 ("IBSS Client PWDB = 0x%lx\n", 538 "IBSS Client PWDB = 0x%lx\n",
542 undecorated_smoothed_pwdb)); 539 undecorated_smoothed_pwdb);
543 } else { 540 } else {
544 undecorated_smoothed_pwdb = 541 undecorated_smoothed_pwdb =
545 rtlpriv->dm.undecorated_smoothed_pwdb; 542 rtlpriv->dm.undecorated_smoothed_pwdb;
546 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 543 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
547 ("STA Default Port PWDB = 0x%lx\n", 544 "STA Default Port PWDB = 0x%lx\n",
548 undecorated_smoothed_pwdb)); 545 undecorated_smoothed_pwdb);
549 } 546 }
550 } else { 547 } else {
551 undecorated_smoothed_pwdb = 548 undecorated_smoothed_pwdb =
552 rtlpriv->dm.UNDEC_SM_PWDB; 549 rtlpriv->dm.UNDEC_SM_PWDB;
553 550
554 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 551 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
555 ("AP Ext Port PWDB = 0x%lx\n", 552 "AP Ext Port PWDB = 0x%lx\n",
556 undecorated_smoothed_pwdb)); 553 undecorated_smoothed_pwdb);
557 } 554 }
558 if (rtlhal->current_bandtype == BAND_ON_5G) { 555 if (rtlhal->current_bandtype == BAND_ON_5G) {
559 if (undecorated_smoothed_pwdb >= 0x33) { 556 if (undecorated_smoothed_pwdb >= 0x33) {
560 rtlpriv->dm.dynamic_txhighpower_lvl = 557 rtlpriv->dm.dynamic_txhighpower_lvl =
561 TXHIGHPWRLEVEL_LEVEL2; 558 TXHIGHPWRLEVEL_LEVEL2;
562 RT_TRACE(rtlpriv, COMP_HIPWR, DBG_LOUD, 559 RT_TRACE(rtlpriv, COMP_HIPWR, DBG_LOUD,
563 ("5G:TxHighPwrLevel_Level2 (TxPwr=0x0)\n")); 560 "5G:TxHighPwrLevel_Level2 (TxPwr=0x0)\n");
564 } else if ((undecorated_smoothed_pwdb < 0x33) 561 } else if ((undecorated_smoothed_pwdb < 0x33)
565 && (undecorated_smoothed_pwdb >= 0x2b)) { 562 && (undecorated_smoothed_pwdb >= 0x2b)) {
566 rtlpriv->dm.dynamic_txhighpower_lvl = 563 rtlpriv->dm.dynamic_txhighpower_lvl =
567 TXHIGHPWRLEVEL_LEVEL1; 564 TXHIGHPWRLEVEL_LEVEL1;
568 RT_TRACE(rtlpriv, COMP_HIPWR, DBG_LOUD, 565 RT_TRACE(rtlpriv, COMP_HIPWR, DBG_LOUD,
569 ("5G:TxHighPwrLevel_Level1 (TxPwr=0x10)\n")); 566 "5G:TxHighPwrLevel_Level1 (TxPwr=0x10)\n");
570 } else if (undecorated_smoothed_pwdb < 0x2b) { 567 } else if (undecorated_smoothed_pwdb < 0x2b) {
571 rtlpriv->dm.dynamic_txhighpower_lvl = 568 rtlpriv->dm.dynamic_txhighpower_lvl =
572 TXHIGHPWRLEVEL_NORMAL; 569 TXHIGHPWRLEVEL_NORMAL;
573 RT_TRACE(rtlpriv, COMP_HIPWR, DBG_LOUD, 570 RT_TRACE(rtlpriv, COMP_HIPWR, DBG_LOUD,
574 ("5G:TxHighPwrLevel_Normal\n")); 571 "5G:TxHighPwrLevel_Normal\n");
575 } 572 }
576 } else { 573 } else {
577 if (undecorated_smoothed_pwdb >= 574 if (undecorated_smoothed_pwdb >=
@@ -579,7 +576,7 @@ static void rtl92d_dm_dynamic_txpower(struct ieee80211_hw *hw)
579 rtlpriv->dm.dynamic_txhighpower_lvl = 576 rtlpriv->dm.dynamic_txhighpower_lvl =
580 TXHIGHPWRLEVEL_LEVEL2; 577 TXHIGHPWRLEVEL_LEVEL2;
581 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 578 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
582 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n")); 579 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x0)\n");
583 } else 580 } else
584 if ((undecorated_smoothed_pwdb < 581 if ((undecorated_smoothed_pwdb <
585 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3)) 582 (TX_POWER_NEAR_FIELD_THRESH_LVL2 - 3))
@@ -589,19 +586,19 @@ static void rtl92d_dm_dynamic_txpower(struct ieee80211_hw *hw)
589 rtlpriv->dm.dynamic_txhighpower_lvl = 586 rtlpriv->dm.dynamic_txhighpower_lvl =
590 TXHIGHPWRLEVEL_LEVEL1; 587 TXHIGHPWRLEVEL_LEVEL1;
591 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 588 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
592 ("TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n")); 589 "TXHIGHPWRLEVEL_LEVEL1 (TxPwr=0x10)\n");
593 } else if (undecorated_smoothed_pwdb < 590 } else if (undecorated_smoothed_pwdb <
594 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) { 591 (TX_POWER_NEAR_FIELD_THRESH_LVL1 - 5)) {
595 rtlpriv->dm.dynamic_txhighpower_lvl = 592 rtlpriv->dm.dynamic_txhighpower_lvl =
596 TXHIGHPWRLEVEL_NORMAL; 593 TXHIGHPWRLEVEL_NORMAL;
597 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 594 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
598 ("TXHIGHPWRLEVEL_NORMAL\n")); 595 "TXHIGHPWRLEVEL_NORMAL\n");
599 } 596 }
600 } 597 }
601 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) { 598 if ((rtlpriv->dm.dynamic_txhighpower_lvl != rtlpriv->dm.last_dtp_lvl)) {
602 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 599 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
603 ("PHY_SetTxPowerLevel8192S() Channel = %d\n", 600 "PHY_SetTxPowerLevel8192S() Channel = %d\n",
604 rtlphy->current_channel)); 601 rtlphy->current_channel);
605 rtl92d_phy_set_txpower_level(hw, rtlphy->current_channel); 602 rtl92d_phy_set_txpower_level(hw, rtlphy->current_channel);
606 } 603 }
607 rtlpriv->dm.last_dtp_lvl = rtlpriv->dm.dynamic_txhighpower_lvl; 604 rtlpriv->dm.last_dtp_lvl = rtlpriv->dm.dynamic_txhighpower_lvl;
@@ -717,7 +714,7 @@ static void rtl92d_dm_rxgain_tracking_thermalmeter(struct ieee80211_hw *hw)
717 u4tmp = (index_mapping[(rtlpriv->efuse.eeprom_thermalmeter - 714 u4tmp = (index_mapping[(rtlpriv->efuse.eeprom_thermalmeter -
718 rtlpriv->dm.thermalvalue_rxgain)]) << 12; 715 rtlpriv->dm.thermalvalue_rxgain)]) << 12;
719 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 716 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
720 ("===> Rx Gain %x\n", u4tmp)); 717 "===> Rx Gain %x\n", u4tmp);
721 for (i = RF90_PATH_A; i < rtlpriv->phy.num_total_rfpath; i++) 718 for (i = RF90_PATH_A; i < rtlpriv->phy.num_total_rfpath; i++)
722 rtl_set_rfreg(hw, i, 0x3C, BRFREGOFFSETMASK, 719 rtl_set_rfreg(hw, i, 0x3C, BRFREGOFFSETMASK,
723 (rtlpriv->phy.reg_rf3c[i] & (~(0xF000))) | u4tmp); 720 (rtlpriv->phy.reg_rf3c[i] & (~(0xF000))) | u4tmp);
@@ -741,27 +738,22 @@ static void rtl92d_bandtype_2_4G(struct ieee80211_hw *hw, long *temp_cckg,
741 if (!memcmp((void *)&temp_cck, 738 if (!memcmp((void *)&temp_cck,
742 (void *)&cckswing_table_ch14[i][2], 4)) { 739 (void *)&cckswing_table_ch14[i][2], 4)) {
743 *cck_index_old = (u8) i; 740 *cck_index_old = (u8) i;
744 RT_TRACE(rtlpriv, 741 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
745 COMP_POWER_TRACKING, 742 "Initial reg0x%x = 0x%lx, cck_index=0x%x, ch 14 %d\n",
746 DBG_LOUD, 743 RCCK0_TXFILTER2, temp_cck,
747 ("Initial reg0x%x = 0x%lx, " 744 *cck_index_old,
748 "cck_index=0x%x, ch 14 %d\n", 745 rtlpriv->dm.cck_inch14);
749 RCCK0_TXFILTER2,
750 temp_cck, *cck_index_old,
751 rtlpriv->dm.cck_inch14));
752 break; 746 break;
753 } 747 }
754 } else { 748 } else {
755 if (!memcmp((void *) &temp_cck, 749 if (!memcmp((void *) &temp_cck,
756 &cckswing_table_ch1ch13[i][2], 4)) { 750 &cckswing_table_ch1ch13[i][2], 4)) {
757 *cck_index_old = (u8) i; 751 *cck_index_old = (u8) i;
758 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 752 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
759 DBG_LOUD, 753 "Initial reg0x%x = 0x%lx, cck_index = 0x%x, ch14 %d\n",
760 ("Initial reg0x%x = 0x%lx, " 754 RCCK0_TXFILTER2, temp_cck,
761 "cck_index = 0x%x, ch14 %d\n", 755 *cck_index_old,
762 RCCK0_TXFILTER2, 756 rtlpriv->dm.cck_inch14);
763 temp_cck, *cck_index_old,
764 rtlpriv->dm.cck_inch14));
765 break; 757 break;
766 } 758 }
767 } 759 }
@@ -884,12 +876,12 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
884 }; 876 };
885 877
886 rtlpriv->dm.txpower_trackinginit = true; 878 rtlpriv->dm.txpower_trackinginit = true;
887 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, ("\n")); 879 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "\n");
888 thermalvalue = (u8) rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0xf800); 880 thermalvalue = (u8) rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0xf800);
889 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 881 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
890 ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x " 882 "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x\n",
891 "eeprom_thermalmeter 0x%x\n", thermalvalue, 883 thermalvalue,
892 rtlpriv->dm.thermalvalue, rtlefuse->eeprom_thermalmeter)); 884 rtlpriv->dm.thermalvalue, rtlefuse->eeprom_thermalmeter);
893 rtl92d_phy_ap_calibrate(hw, (thermalvalue - 885 rtl92d_phy_ap_calibrate(hw, (thermalvalue -
894 rtlefuse->eeprom_thermalmeter)); 886 rtlefuse->eeprom_thermalmeter));
895 if (is2t) 887 if (is2t)
@@ -904,10 +896,9 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
904 ofdm_index_old[0] = (u8) i; 896 ofdm_index_old[0] = (u8) i;
905 897
906 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 898 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
907 ("Initial pathA ele_d reg0x%x = 0x%lx," 899 "Initial pathA ele_d reg0x%x = 0x%lx, ofdm_index=0x%x\n",
908 " ofdm_index=0x%x\n",
909 ROFDM0_XATxIQIMBALANCE, 900 ROFDM0_XATxIQIMBALANCE,
910 ele_d, ofdm_index_old[0])); 901 ele_d, ofdm_index_old[0]);
911 break; 902 break;
912 } 903 }
913 } 904 }
@@ -920,11 +911,9 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
920 ofdm_index_old[1] = (u8) i; 911 ofdm_index_old[1] = (u8) i;
921 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, 912 RT_TRACE(rtlpriv, COMP_POWER_TRACKING,
922 DBG_LOUD, 913 DBG_LOUD,
923 ("Initial pathB ele_d reg " 914 "Initial pathB ele_d reg 0x%x = 0x%lx, ofdm_index = 0x%x\n",
924 "0x%x = 0x%lx, ofdm_index "
925 "= 0x%x\n",
926 ROFDM0_XBTxIQIMBALANCE, ele_d, 915 ROFDM0_XBTxIQIMBALANCE, ele_d,
927 ofdm_index_old[1])); 916 ofdm_index_old[1]);
928 break; 917 break;
929 } 918 }
930 } 919 }
@@ -952,7 +941,7 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
952 rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i]; 941 rtlpriv->dm.ofdm_index[i] = ofdm_index_old[i];
953 rtlpriv->dm.cck_index = cck_index_old; 942 rtlpriv->dm.cck_index = cck_index_old;
954 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 943 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
955 ("reload ofdm index for band switch\n")); 944 "reload ofdm index for band switch\n");
956 } 945 }
957 rtlpriv->dm.thermalvalue_avg 946 rtlpriv->dm.thermalvalue_avg
958 [rtlpriv->dm.thermalvalue_avg_index] = thermalvalue; 947 [rtlpriv->dm.thermalvalue_avg_index] = thermalvalue;
@@ -995,12 +984,10 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
995 (thermalvalue - rtlpriv->dm.thermalvalue_rxgain) : 984 (thermalvalue - rtlpriv->dm.thermalvalue_rxgain) :
996 (rtlpriv->dm.thermalvalue_rxgain - thermalvalue); 985 (rtlpriv->dm.thermalvalue_rxgain - thermalvalue);
997 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 986 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
998 ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x" 987 "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermalmeter 0x%x delta 0x%x delta_lck 0x%x delta_iqk 0x%x\n",
999 " eeprom_thermalmeter 0x%x delta 0x%x " 988 thermalvalue, rtlpriv->dm.thermalvalue,
1000 "delta_lck 0x%x delta_iqk 0x%x\n", 989 rtlefuse->eeprom_thermalmeter, delta, delta_lck,
1001 thermalvalue, rtlpriv->dm.thermalvalue, 990 delta_iqk);
1002 rtlefuse->eeprom_thermalmeter, delta, delta_lck,
1003 delta_iqk));
1004 if ((delta_lck > rtlefuse->delta_lck) && 991 if ((delta_lck > rtlefuse->delta_lck) &&
1005 (rtlefuse->delta_lck != 0)) { 992 (rtlefuse->delta_lck != 0)) {
1006 rtlpriv->dm.thermalvalue_lck = thermalvalue; 993 rtlpriv->dm.thermalvalue_lck = thermalvalue;
@@ -1036,17 +1023,15 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
1036 } 1023 }
1037 if (is2t) { 1024 if (is2t) {
1038 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1025 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1039 ("temp OFDM_A_index=0x%x, OFDM_B_index" 1026 "temp OFDM_A_index=0x%x, OFDM_B_index = 0x%x,cck_index=0x%x\n",
1040 " = 0x%x,cck_index=0x%x\n", 1027 rtlpriv->dm.ofdm_index[0],
1041 rtlpriv->dm.ofdm_index[0], 1028 rtlpriv->dm.ofdm_index[1],
1042 rtlpriv->dm.ofdm_index[1], 1029 rtlpriv->dm.cck_index);
1043 rtlpriv->dm.cck_index));
1044 } else { 1030 } else {
1045 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1031 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1046 ("temp OFDM_A_index=0x%x,cck_index = " 1032 "temp OFDM_A_index=0x%x,cck_index = 0x%x\n",
1047 "0x%x\n", 1033 rtlpriv->dm.ofdm_index[0],
1048 rtlpriv->dm.ofdm_index[0], 1034 rtlpriv->dm.cck_index);
1049 rtlpriv->dm.cck_index));
1050 } 1035 }
1051 for (i = 0; i < rf; i++) { 1036 for (i = 0; i < rf; i++) {
1052 if (ofdm_index[i] > OFDM_TABLE_SIZE_92D - 1) 1037 if (ofdm_index[i] > OFDM_TABLE_SIZE_92D - 1)
@@ -1070,15 +1055,13 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
1070 } 1055 }
1071 if (is2t) { 1056 if (is2t) {
1072 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1057 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1073 ("new OFDM_A_index=0x%x, OFDM_B_index " 1058 "new OFDM_A_index=0x%x, OFDM_B_index = 0x%x, cck_index=0x%x\n",
1074 "= 0x%x, cck_index=0x%x\n",
1075 ofdm_index[0], ofdm_index[1], 1059 ofdm_index[0], ofdm_index[1],
1076 cck_index)); 1060 cck_index);
1077 } else { 1061 } else {
1078 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1062 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1079 ("new OFDM_A_index=0x%x,cck_index = " 1063 "new OFDM_A_index=0x%x,cck_index = 0x%x\n",
1080 "0x%x\n", 1064 ofdm_index[0], cck_index);
1081 ofdm_index[0], cck_index));
1082 } 1065 }
1083 ele_d = (ofdmswing_table[(u8) ofdm_index[0]] & 1066 ele_d = (ofdmswing_table[(u8) ofdm_index[0]] &
1084 0xFFC00000) >> 22; 1067 0xFFC00000) >> 22;
@@ -1124,12 +1107,10 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
1124 } 1107 }
1125 1108
1126 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1109 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1127 ("TxPwrTracking for interface %d path A: X =" 1110 "TxPwrTracking for interface %d path A: X = 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = 0x%lx ele_D = 0x%lx 0xe94 = 0x%lx 0xe9c = 0x%lx\n",
1128 " 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = " 1111 rtlhal->interfaceindex,
1129 "0x%lx ele_D = 0x%lx 0xe94 = 0x%lx 0xe9c = "
1130 "0x%lx\n", rtlhal->interfaceindex,
1131 val_x, val_y, ele_a, ele_c, ele_d, 1112 val_x, val_y, ele_a, ele_c, ele_d,
1132 val_x, val_y)); 1113 val_x, val_y);
1133 1114
1134 if (rtlhal->current_bandtype == BAND_ON_2_4G) { 1115 if (rtlhal->current_bandtype == BAND_ON_2_4G) {
1135 /* Adjust CCK according to IQK result */ 1116 /* Adjust CCK according to IQK result */
@@ -1232,20 +1213,16 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
1232 BIT(28), 0x00); 1213 BIT(28), 0x00);
1233 } 1214 }
1234 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1215 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1235 ("TxPwrTracking path B: X = 0x%lx, " 1216 "TxPwrTracking path B: X = 0x%lx, Y = 0x%lx ele_A = 0x%lx ele_C = 0x%lx ele_D = 0x%lx 0xeb4 = 0x%lx 0xebc = 0x%lx\n",
1236 "Y = 0x%lx ele_A = 0x%lx ele_C = 0x" 1217 val_x, val_y, ele_a, ele_c,
1237 "%lx ele_D = 0x%lx 0xeb4 = 0x%lx " 1218 ele_d, val_x, val_y);
1238 "0xebc = 0x%lx\n",
1239 val_x, val_y, ele_a, ele_c,
1240 ele_d, val_x, val_y));
1241 } 1219 }
1242 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1220 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1243 ("TxPwrTracking 0xc80 = 0x%x, 0xc94 = " 1221 "TxPwrTracking 0xc80 = 0x%x, 0xc94 = 0x%x RF 0x24 = 0x%x\n",
1244 "0x%x RF 0x24 = 0x%x\n",
1245 rtl_get_bbreg(hw, 0xc80, BMASKDWORD), 1222 rtl_get_bbreg(hw, 0xc80, BMASKDWORD),
1246 rtl_get_bbreg(hw, 0xc94, BMASKDWORD), 1223 rtl_get_bbreg(hw, 0xc94, BMASKDWORD),
1247 rtl_get_rfreg(hw, RF90_PATH_A, 0x24, 1224 rtl_get_rfreg(hw, RF90_PATH_A, 0x24,
1248 BRFREGOFFSETMASK))); 1225 BRFREGOFFSETMASK));
1249 } 1226 }
1250 if ((delta_iqk > rtlefuse->delta_iqk) && 1227 if ((delta_iqk > rtlefuse->delta_iqk) &&
1251 (rtlefuse->delta_iqk != 0)) { 1228 (rtlefuse->delta_iqk != 0)) {
@@ -1262,7 +1239,7 @@ static void rtl92d_dm_txpower_tracking_callback_thermalmeter(
1262 rtlpriv->dm.thermalvalue = thermalvalue; 1239 rtlpriv->dm.thermalvalue = thermalvalue;
1263 } 1240 }
1264 1241
1265 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, ("<===\n")); 1242 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "<===\n");
1266} 1243}
1267 1244
1268static void rtl92d_dm_initialize_txpower_tracking(struct ieee80211_hw *hw) 1245static void rtl92d_dm_initialize_txpower_tracking(struct ieee80211_hw *hw)
@@ -1273,8 +1250,8 @@ static void rtl92d_dm_initialize_txpower_tracking(struct ieee80211_hw *hw)
1273 rtlpriv->dm.txpower_trackinginit = false; 1250 rtlpriv->dm.txpower_trackinginit = false;
1274 rtlpriv->dm.txpower_track_control = true; 1251 rtlpriv->dm.txpower_track_control = true;
1275 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1252 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1276 ("pMgntInfo->txpower_tracking = %d\n", 1253 "pMgntInfo->txpower_tracking = %d\n",
1277 rtlpriv->dm.txpower_tracking)); 1254 rtlpriv->dm.txpower_tracking);
1278} 1255}
1279 1256
1280void rtl92d_dm_check_txpower_tracking_thermal_meter(struct ieee80211_hw *hw) 1257void rtl92d_dm_check_txpower_tracking_thermal_meter(struct ieee80211_hw *hw)
@@ -1289,12 +1266,12 @@ void rtl92d_dm_check_txpower_tracking_thermal_meter(struct ieee80211_hw *hw)
1289 rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER, BIT(17) | 1266 rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER, BIT(17) |
1290 BIT(16), 0x03); 1267 BIT(16), 0x03);
1291 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1268 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1292 ("Trigger 92S Thermal Meter!!\n")); 1269 "Trigger 92S Thermal Meter!!\n");
1293 tm_trigger = 1; 1270 tm_trigger = 1;
1294 return; 1271 return;
1295 } else { 1272 } else {
1296 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 1273 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
1297 ("Schedule TxPowerTracking direct call!!\n")); 1274 "Schedule TxPowerTracking direct call!!\n");
1298 rtl92d_dm_txpower_tracking_callback_thermalmeter(hw); 1275 rtl92d_dm_txpower_tracking_callback_thermalmeter(hw);
1299 tm_trigger = 0; 1276 tm_trigger = 0;
1300 } 1277 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/rtlwifi/rtl8192de/fw.c
index db6972ffe503..b84f10d60c0d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/fw.c
@@ -124,14 +124,14 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
124 u32 pagenums, remainSize; 124 u32 pagenums, remainSize;
125 u32 page, offset; 125 u32 page, offset;
126 126
127 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, ("FW size is %d bytes,\n", size)); 127 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "FW size is %d bytes,\n", size);
128 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE) 128 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192DE)
129 _rtl92d_fill_dummy(bufferPtr, &size); 129 _rtl92d_fill_dummy(bufferPtr, &size);
130 pagenums = size / FW_8192D_PAGE_SIZE; 130 pagenums = size / FW_8192D_PAGE_SIZE;
131 remainSize = size % FW_8192D_PAGE_SIZE; 131 remainSize = size % FW_8192D_PAGE_SIZE;
132 if (pagenums > 8) { 132 if (pagenums > 8) {
133 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 133 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
134 ("Page numbers should not greater then 8\n")); 134 "Page numbers should not greater then 8\n");
135 } 135 }
136 for (page = 0; page < pagenums; page++) { 136 for (page = 0; page < pagenums; page++) {
137 offset = page * FW_8192D_PAGE_SIZE; 137 offset = page * FW_8192D_PAGE_SIZE;
@@ -158,12 +158,12 @@ static int _rtl92d_fw_free_to_go(struct ieee80211_hw *hw)
158 (!(value32 & FWDL_ChkSum_rpt))); 158 (!(value32 & FWDL_ChkSum_rpt)));
159 if (counter >= FW_8192D_POLLING_TIMEOUT_COUNT) { 159 if (counter >= FW_8192D_POLLING_TIMEOUT_COUNT) {
160 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 160 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
161 ("chksum report faill ! REG_MCUFWDL:0x%08x .\n", 161 "chksum report faill ! REG_MCUFWDL:0x%08x\n",
162 value32)); 162 value32);
163 return -EIO; 163 return -EIO;
164 } 164 }
165 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, 165 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
166 ("Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32)); 166 "Checksum report OK ! REG_MCUFWDL:0x%08x\n", value32);
167 value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL); 167 value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
168 value32 |= MCUFWDL_RDY; 168 value32 |= MCUFWDL_RDY;
169 rtl_write_dword(rtlpriv, REG_MCUFWDL, value32); 169 rtl_write_dword(rtlpriv, REG_MCUFWDL, value32);
@@ -188,7 +188,7 @@ void rtl92d_firmware_selfreset(struct ieee80211_hw *hw)
188 } 188 }
189 RT_ASSERT((delay > 0), ("8051 reset failed!\n")); 189 RT_ASSERT((delay > 0), ("8051 reset failed!\n"));
190 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 190 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
191 ("=====> 8051 reset success (%d) .\n", delay)); 191 "=====> 8051 reset success (%d)\n", delay);
192} 192}
193 193
194static int _rtl92d_fw_init(struct ieee80211_hw *hw) 194static int _rtl92d_fw_init(struct ieee80211_hw *hw)
@@ -197,7 +197,7 @@ static int _rtl92d_fw_init(struct ieee80211_hw *hw)
197 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 197 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
198 u32 counter; 198 u32 counter;
199 199
200 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, ("FW already have download\n")); 200 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, "FW already have download\n");
201 /* polling for FW ready */ 201 /* polling for FW ready */
202 counter = 0; 202 counter = 0;
203 do { 203 do {
@@ -205,10 +205,9 @@ static int _rtl92d_fw_init(struct ieee80211_hw *hw)
205 if (rtl_read_byte(rtlpriv, FW_MAC0_READY) & 205 if (rtl_read_byte(rtlpriv, FW_MAC0_READY) &
206 MAC0_READY) { 206 MAC0_READY) {
207 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 207 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
208 ("Polling FW ready success!! " 208 "Polling FW ready success!! REG_MCUFWDL: 0x%x\n",
209 "REG_MCUFWDL: 0x%x .\n",
210 rtl_read_byte(rtlpriv, 209 rtl_read_byte(rtlpriv,
211 FW_MAC0_READY))); 210 FW_MAC0_READY));
212 return 0; 211 return 0;
213 } 212 }
214 udelay(5); 213 udelay(5);
@@ -216,10 +215,9 @@ static int _rtl92d_fw_init(struct ieee80211_hw *hw)
216 if (rtl_read_byte(rtlpriv, FW_MAC1_READY) & 215 if (rtl_read_byte(rtlpriv, FW_MAC1_READY) &
217 MAC1_READY) { 216 MAC1_READY) {
218 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 217 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
219 ("Polling FW ready success!! " 218 "Polling FW ready success!! REG_MCUFWDL: 0x%x\n",
220 "REG_MCUFWDL: 0x%x .\n",
221 rtl_read_byte(rtlpriv, 219 rtl_read_byte(rtlpriv,
222 FW_MAC1_READY))); 220 FW_MAC1_READY));
223 return 0; 221 return 0;
224 } 222 }
225 udelay(5); 223 udelay(5);
@@ -228,18 +226,16 @@ static int _rtl92d_fw_init(struct ieee80211_hw *hw)
228 226
229 if (rtlhal->interfaceindex == 0) { 227 if (rtlhal->interfaceindex == 0) {
230 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 228 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
231 ("Polling FW ready fail!! MAC0 FW init not ready: " 229 "Polling FW ready fail!! MAC0 FW init not ready: 0x%x\n",
232 "0x%x .\n", 230 rtl_read_byte(rtlpriv, FW_MAC0_READY));
233 rtl_read_byte(rtlpriv, FW_MAC0_READY)));
234 } else { 231 } else {
235 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 232 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
236 ("Polling FW ready fail!! MAC1 FW init not ready: " 233 "Polling FW ready fail!! MAC1 FW init not ready: 0x%x\n",
237 "0x%x .\n", 234 rtl_read_byte(rtlpriv, FW_MAC1_READY));
238 rtl_read_byte(rtlpriv, FW_MAC1_READY)));
239 } 235 }
240 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 236 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
241 ("Polling FW ready fail!! REG_MCUFWDL:0x%08ul .\n", 237 "Polling FW ready fail!! REG_MCUFWDL:0x%08ul\n",
242 rtl_read_dword(rtlpriv, REG_MCUFWDL))); 238 rtl_read_dword(rtlpriv, REG_MCUFWDL));
243 return -1; 239 return -1;
244} 240}
245 241
@@ -264,13 +260,13 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
264 pfwdata = (u8 *) rtlhal->pfirmware; 260 pfwdata = (u8 *) rtlhal->pfirmware;
265 rtlhal->fw_version = (u16) GET_FIRMWARE_HDR_VERSION(pfwheader); 261 rtlhal->fw_version = (u16) GET_FIRMWARE_HDR_VERSION(pfwheader);
266 rtlhal->fw_subversion = (u16) GET_FIRMWARE_HDR_SUB_VER(pfwheader); 262 rtlhal->fw_subversion = (u16) GET_FIRMWARE_HDR_SUB_VER(pfwheader);
267 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, (" FirmwareVersion(%d)," 263 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
268 "FirmwareSubVersion(%d), Signature(%#x)\n", 264 "FirmwareVersion(%d), FirmwareSubVersion(%d), Signature(%#x)\n",
269 rtlhal->fw_version, rtlhal->fw_subversion, 265 rtlhal->fw_version, rtlhal->fw_subversion,
270 GET_FIRMWARE_HDR_SIGNATURE(pfwheader))); 266 GET_FIRMWARE_HDR_SIGNATURE(pfwheader));
271 if (IS_FW_HEADER_EXIST(pfwheader)) { 267 if (IS_FW_HEADER_EXIST(pfwheader)) {
272 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 268 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
273 ("Shift 32 bytes for FW header!!\n")); 269 "Shift 32 bytes for FW header!!\n");
274 pfwdata = pfwdata + 32; 270 pfwdata = pfwdata + 32;
275 fwsize = fwsize - 32; 271 fwsize = fwsize - 32;
276 } 272 }
@@ -302,8 +298,7 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
302 break; 298 break;
303 else 299 else
304 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, 300 RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
305 ("Wait for another mac " 301 "Wait for another mac download fw\n");
306 "download fw\n"));
307 } 302 }
308 spin_lock_irqsave(&globalmutex_for_fwdownload, flags); 303 spin_lock_irqsave(&globalmutex_for_fwdownload, flags);
309 value = rtl_read_byte(rtlpriv, 0x1f); 304 value = rtl_read_byte(rtlpriv, 0x1f);
@@ -337,11 +332,10 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
337 spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags); 332 spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
338 if (err) { 333 if (err) {
339 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 334 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
340 ("fw is not ready to run!\n")); 335 "fw is not ready to run!\n");
341 goto exit; 336 goto exit;
342 } else { 337 } else {
343 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, 338 RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
344 ("fw is ready to run!\n"));
345 } 339 }
346exit: 340exit:
347 err = _rtl92d_fw_init(hw); 341 err = _rtl92d_fw_init(hw);
@@ -381,24 +375,24 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
381 375
382 if (ppsc->rfpwr_state == ERFOFF || ppsc->inactive_pwrstate == ERFOFF) { 376 if (ppsc->rfpwr_state == ERFOFF || ppsc->inactive_pwrstate == ERFOFF) {
383 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 377 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
384 ("Return as RF is off!!!\n")); 378 "Return as RF is off!!!\n");
385 return; 379 return;
386 } 380 }
387 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("come in\n")); 381 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "come in\n");
388 while (true) { 382 while (true) {
389 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); 383 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
390 if (rtlhal->h2c_setinprogress) { 384 if (rtlhal->h2c_setinprogress) {
391 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 385 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
392 ("H2C set in progress! Wait to set.." 386 "H2C set in progress! Wait to set..element_id(%d)\n",
393 "element_id(%d).\n", element_id)); 387 element_id);
394 388
395 while (rtlhal->h2c_setinprogress) { 389 while (rtlhal->h2c_setinprogress) {
396 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, 390 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock,
397 flag); 391 flag);
398 h2c_waitcounter++; 392 h2c_waitcounter++;
399 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 393 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
400 ("Wait 100 us (%d times)...\n", 394 "Wait 100 us (%d times)...\n",
401 h2c_waitcounter)); 395 h2c_waitcounter);
402 udelay(100); 396 udelay(100);
403 397
404 if (h2c_waitcounter > 1000) 398 if (h2c_waitcounter > 1000)
@@ -418,8 +412,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
418 wait_writeh2c_limmit--; 412 wait_writeh2c_limmit--;
419 if (wait_writeh2c_limmit == 0) { 413 if (wait_writeh2c_limmit == 0) {
420 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 414 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
421 ("Write H2C fail because no trigger " 415 "Write H2C fail because no trigger for FW INT!\n");
422 "for FW INT!\n"));
423 break; 416 break;
424 } 417 }
425 boxnum = rtlhal->last_hmeboxnum; 418 boxnum = rtlhal->last_hmeboxnum;
@@ -442,7 +435,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
442 break; 435 break;
443 default: 436 default:
444 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 437 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
445 ("switch case not process\n")); 438 "switch case not processed\n");
446 break; 439 break;
447 } 440 }
448 isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum); 441 isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
@@ -450,29 +443,29 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
450 wait_h2c_limmit--; 443 wait_h2c_limmit--;
451 if (wait_h2c_limmit == 0) { 444 if (wait_h2c_limmit == 0) {
452 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 445 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
453 ("Wating too long for FW read " 446 "Waiting too long for FW read clear HMEBox(%d)!\n",
454 "clear HMEBox(%d)!\n", boxnum)); 447 boxnum);
455 break; 448 break;
456 } 449 }
457 udelay(10); 450 udelay(10);
458 isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum); 451 isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
459 u1b_tmp = rtl_read_byte(rtlpriv, 0x1BF); 452 u1b_tmp = rtl_read_byte(rtlpriv, 0x1BF);
460 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 453 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
461 ("Wating for FW read clear HMEBox(%d)!!! " 454 "Waiting for FW read clear HMEBox(%d)!!! 0x1BF = %2x\n",
462 "0x1BF = %2x\n", boxnum, u1b_tmp)); 455 boxnum, u1b_tmp);
463 } 456 }
464 if (!isfw_read) { 457 if (!isfw_read) {
465 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 458 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
466 ("Write H2C register BOX[%d] fail!!!!! " 459 "Write H2C register BOX[%d] fail!!!!! Fw do not read.\n",
467 "Fw do not read.\n", boxnum)); 460 boxnum);
468 break; 461 break;
469 } 462 }
470 memset(boxcontent, 0, sizeof(boxcontent)); 463 memset(boxcontent, 0, sizeof(boxcontent));
471 memset(boxextcontent, 0, sizeof(boxextcontent)); 464 memset(boxextcontent, 0, sizeof(boxextcontent));
472 boxcontent[0] = element_id; 465 boxcontent[0] = element_id;
473 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 466 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
474 ("Write element_id box_reg(%4x) = %2x\n", 467 "Write element_id box_reg(%4x) = %2x\n",
475 box_reg, element_id)); 468 box_reg, element_id);
476 switch (cmd_len) { 469 switch (cmd_len) {
477 case 1: 470 case 1:
478 boxcontent[0] &= ~(BIT(7)); 471 boxcontent[0] &= ~(BIT(7));
@@ -519,7 +512,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
519 break; 512 break;
520 default: 513 default:
521 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 514 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
522 ("switch case not process\n")); 515 "switch case not processed\n");
523 break; 516 break;
524 } 517 }
525 bwrite_sucess = true; 518 bwrite_sucess = true;
@@ -527,13 +520,13 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
527 if (rtlhal->last_hmeboxnum == 4) 520 if (rtlhal->last_hmeboxnum == 4)
528 rtlhal->last_hmeboxnum = 0; 521 rtlhal->last_hmeboxnum = 0;
529 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 522 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
530 ("pHalData->last_hmeboxnum = %d\n", 523 "pHalData->last_hmeboxnum = %d\n",
531 rtlhal->last_hmeboxnum)); 524 rtlhal->last_hmeboxnum);
532 } 525 }
533 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); 526 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag);
534 rtlhal->h2c_setinprogress = false; 527 rtlhal->h2c_setinprogress = false;
535 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); 528 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag);
536 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("go out\n")); 529 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "go out\n");
537} 530}
538 531
539void rtl92d_fill_h2c_cmd(struct ieee80211_hw *hw, 532void rtl92d_fill_h2c_cmd(struct ieee80211_hw *hw,
@@ -559,7 +552,7 @@ void rtl92d_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode)
559 u8 u1_h2c_set_pwrmode[3] = { 0 }; 552 u8 u1_h2c_set_pwrmode[3] = { 0 };
560 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 553 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
561 554
562 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("FW LPS mode = %d\n", mode)); 555 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "FW LPS mode = %d\n", mode);
563 SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, mode); 556 SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, mode);
564 SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode, 1); 557 SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode, 1);
565 SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(u1_h2c_set_pwrmode, 558 SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(u1_h2c_set_pwrmode,
@@ -771,14 +764,14 @@ void rtl92d_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool dl_finished)
771 dlok = true; 764 dlok = true;
772 if (dlok) { 765 if (dlok) {
773 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 766 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
774 ("Set RSVD page location to Fw.\n")); 767 "Set RSVD page location to Fw\n");
775 RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG, 768 RT_PRINT_DATA(rtlpriv, COMP_CMD, DBG_DMESG,
776 "H2C_RSVDPAGE", u1RsvdPageLoc, 3); 769 "H2C_RSVDPAGE", u1RsvdPageLoc, 3);
777 rtl92d_fill_h2c_cmd(hw, H2C_RSVDPAGE, 770 rtl92d_fill_h2c_cmd(hw, H2C_RSVDPAGE,
778 sizeof(u1RsvdPageLoc), u1RsvdPageLoc); 771 sizeof(u1RsvdPageLoc), u1RsvdPageLoc);
779 } else 772 } else
780 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 773 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
781 ("Set RSVD page location to Fw FAIL!!!!!!.\n")); 774 "Set RSVD page location to Fw FAIL!!!!!!\n");
782} 775}
783 776
784void rtl92d_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus) 777void rtl92d_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
index 5c8a639582ad..5eecf403a5c3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -166,7 +166,7 @@ void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
166 break; 166 break;
167 default: 167 default:
168 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 168 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
169 ("switch case not process\n")); 169 "switch case not processed\n");
170 break; 170 break;
171 } 171 }
172} 172}
@@ -230,7 +230,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
230 u8 e_aci; 230 u8 e_aci;
231 231
232 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 232 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
233 ("HW_VAR_SLOT_TIME %x\n", val[0])); 233 "HW_VAR_SLOT_TIME %x\n", val[0]);
234 rtl_write_byte(rtlpriv, REG_SLOT, val[0]); 234 rtl_write_byte(rtlpriv, REG_SLOT, val[0]);
235 for (e_aci = 0; e_aci < AC_MAX; e_aci++) 235 for (e_aci = 0; e_aci < AC_MAX; e_aci++)
236 rtlpriv->cfg->ops->set_hw_reg(hw, 236 rtlpriv->cfg->ops->set_hw_reg(hw,
@@ -261,8 +261,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
261 min_spacing_to_set); 261 min_spacing_to_set);
262 *val = min_spacing_to_set; 262 *val = min_spacing_to_set;
263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 263 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
264 ("Set HW_VAR_AMPDU_MIN_SPACE: %#x\n", 264 "Set HW_VAR_AMPDU_MIN_SPACE: %#x\n",
265 mac->min_space_cfg)); 265 mac->min_space_cfg);
266 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, 266 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE,
267 mac->min_space_cfg); 267 mac->min_space_cfg);
268 } 268 }
@@ -275,8 +275,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
275 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg; 275 mac->min_space_cfg = rtlpriv->rtlhal.minspace_cfg;
276 mac->min_space_cfg |= (density_to_set << 3); 276 mac->min_space_cfg |= (density_to_set << 3);
277 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 277 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
278 ("Set HW_VAR_SHORTGI_DENSITY: %#x\n", 278 "Set HW_VAR_SHORTGI_DENSITY: %#x\n",
279 mac->min_space_cfg)); 279 mac->min_space_cfg);
280 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, 280 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE,
281 mac->min_space_cfg); 281 mac->min_space_cfg);
282 break; 282 break;
@@ -310,8 +310,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
310 } 310 }
311 rtl_write_dword(rtlpriv, REG_AGGLEN_LMT, regtoSet); 311 rtl_write_dword(rtlpriv, REG_AGGLEN_LMT, regtoSet);
312 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 312 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
313 ("Set HW_VAR_AMPDU_FACTOR: %#x\n", 313 "Set HW_VAR_AMPDU_FACTOR: %#x\n",
314 factor_toset)); 314 factor_toset);
315 } 315 }
316 break; 316 break;
317 } 317 }
@@ -344,8 +344,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
344 break; 344 break;
345 default: 345 default:
346 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 346 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
347 ("HW_VAR_ACM_CTRL acm set " 347 "HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
348 "failed: eACI is %d\n", acm)); 348 acm);
349 break; 349 break;
350 } 350 }
351 } else { 351 } else {
@@ -361,13 +361,13 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
361 break; 361 break;
362 default: 362 default:
363 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 363 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
364 ("switch case not process\n")); 364 "switch case not processed\n");
365 break; 365 break;
366 } 366 }
367 } 367 }
368 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE, 368 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE,
369 ("SetHwReg8190pci(): [HW_VAR_ACM_CTRL] " 369 "SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n",
370 "Write 0x%X\n", acm_ctrl)); 370 acm_ctrl);
371 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl); 371 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl);
372 break; 372 break;
373 } 373 }
@@ -502,7 +502,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
502 } 502 }
503 default: 503 default:
504 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 504 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
505 ("switch case not process\n")); 505 "switch case not processed\n");
506 break; 506 break;
507 } 507 }
508} 508}
@@ -522,8 +522,8 @@ static bool _rtl92de_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
522 break; 522 break;
523 if (count > POLLING_LLT_THRESHOLD) { 523 if (count > POLLING_LLT_THRESHOLD) {
524 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 524 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
525 ("Failed to polling write LLT done at " 525 "Failed to polling write LLT done at address %d!\n",
526 "address %d!\n", address)); 526 address);
527 status = false; 527 status = false;
528 break; 528 break;
529 } 529 }
@@ -879,12 +879,12 @@ void rtl92de_enable_hw_security_config(struct ieee80211_hw *hw)
879 u8 sec_reg_value; 879 u8 sec_reg_value;
880 880
881 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 881 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
882 ("PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n", 882 "PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n",
883 rtlpriv->sec.pairwise_enc_algorithm, 883 rtlpriv->sec.pairwise_enc_algorithm,
884 rtlpriv->sec.group_enc_algorithm)); 884 rtlpriv->sec.group_enc_algorithm);
885 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { 885 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) {
886 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 886 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
887 ("not open hw encryption\n")); 887 "not open hw encryption\n");
888 return; 888 return;
889 } 889 }
890 sec_reg_value = SCR_TXENCENABLE | SCR_RXENCENABLE; 890 sec_reg_value = SCR_TXENCENABLE | SCR_RXENCENABLE;
@@ -895,7 +895,7 @@ void rtl92de_enable_hw_security_config(struct ieee80211_hw *hw)
895 sec_reg_value |= (SCR_RXBCUSEDK | SCR_TXBCUSEDK); 895 sec_reg_value |= (SCR_RXBCUSEDK | SCR_TXBCUSEDK);
896 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02); 896 rtl_write_byte(rtlpriv, REG_CR + 1, 0x02);
897 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 897 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
898 ("The SECR-value %x\n", sec_reg_value)); 898 "The SECR-value %x\n", sec_reg_value);
899 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); 899 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value);
900} 900}
901 901
@@ -921,7 +921,7 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
921 /* rtlpriv->intf_ops->disable_aspm(hw); */ 921 /* rtlpriv->intf_ops->disable_aspm(hw); */
922 rtstatus = _rtl92de_init_mac(hw); 922 rtstatus = _rtl92de_init_mac(hw);
923 if (rtstatus != true) { 923 if (rtstatus != true) {
924 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Init MAC failed\n")); 924 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
925 err = 1; 925 err = 1;
926 spin_unlock_irqrestore(&globalmutex_for_power_and_efuse, flags); 926 spin_unlock_irqrestore(&globalmutex_for_power_and_efuse, flags);
927 return err; 927 return err;
@@ -930,8 +930,7 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
930 spin_unlock_irqrestore(&globalmutex_for_power_and_efuse, flags); 930 spin_unlock_irqrestore(&globalmutex_for_power_and_efuse, flags);
931 if (err) { 931 if (err) {
932 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 932 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
933 ("Failed to download FW. Init HW " 933 "Failed to download FW. Init HW without FW..\n");
934 "without FW..\n"));
935 rtlhal->fw_ready = false; 934 rtlhal->fw_ready = false;
936 return 1; 935 return 1;
937 } else { 936 } else {
@@ -946,7 +945,7 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
946 945
947 if (rtlhal->earlymode_enable) { 946 if (rtlhal->earlymode_enable) {
948 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 947 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
949 ("EarlyMode Enabled!!!\n")); 948 "EarlyMode Enabled!!!\n");
950 949
951 tmp_u1b = rtl_read_byte(rtlpriv, 0x4d0); 950 tmp_u1b = rtl_read_byte(rtlpriv, 0x4d0);
952 tmp_u1b = tmp_u1b | 0x1f; 951 tmp_u1b = tmp_u1b | 0x1f;
@@ -1064,10 +1063,10 @@ static enum version_8192d _rtl92de_read_chip_version(struct ieee80211_hw *hw)
1064 value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG); 1063 value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG);
1065 if (!(value32 & 0x000f0000)) { 1064 if (!(value32 & 0x000f0000)) {
1066 version = VERSION_TEST_CHIP_92D_SINGLEPHY; 1065 version = VERSION_TEST_CHIP_92D_SINGLEPHY;
1067 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("TEST CHIP!!!\n")); 1066 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "TEST CHIP!!!\n");
1068 } else { 1067 } else {
1069 version = VERSION_NORMAL_CHIP_92D_SINGLEPHY; 1068 version = VERSION_NORMAL_CHIP_92D_SINGLEPHY;
1070 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Normal CHIP!!!\n")); 1069 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Normal CHIP!!!\n");
1071 } 1070 }
1072 return version; 1071 return version;
1073} 1072}
@@ -1092,8 +1091,8 @@ static int _rtl92de_set_media_status(struct ieee80211_hw *hw,
1092 _rtl92de_disable_bcn_sub_func(hw); 1091 _rtl92de_disable_bcn_sub_func(hw);
1093 } else { 1092 } else {
1094 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1093 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1095 ("Set HW_VAR_MEDIA_STATUS: No such media " 1094 "Set HW_VAR_MEDIA_STATUS: No such media status(%x)\n",
1096 "status(%x).\n", type)); 1095 type);
1097 } 1096 }
1098 bcnfunc_enable = rtl_read_byte(rtlpriv, REG_BCN_CTRL); 1097 bcnfunc_enable = rtl_read_byte(rtlpriv, REG_BCN_CTRL);
1099 switch (type) { 1098 switch (type) {
@@ -1102,30 +1101,30 @@ static int _rtl92de_set_media_status(struct ieee80211_hw *hw,
1102 ledaction = LED_CTL_LINK; 1101 ledaction = LED_CTL_LINK;
1103 bcnfunc_enable &= 0xF7; 1102 bcnfunc_enable &= 0xF7;
1104 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1103 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1105 ("Set Network type to NO LINK!\n")); 1104 "Set Network type to NO LINK!\n");
1106 break; 1105 break;
1107 case NL80211_IFTYPE_ADHOC: 1106 case NL80211_IFTYPE_ADHOC:
1108 bt_msr |= MSR_ADHOC; 1107 bt_msr |= MSR_ADHOC;
1109 bcnfunc_enable |= 0x08; 1108 bcnfunc_enable |= 0x08;
1110 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1109 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1111 ("Set Network type to Ad Hoc!\n")); 1110 "Set Network type to Ad Hoc!\n");
1112 break; 1111 break;
1113 case NL80211_IFTYPE_STATION: 1112 case NL80211_IFTYPE_STATION:
1114 bt_msr |= MSR_INFRA; 1113 bt_msr |= MSR_INFRA;
1115 ledaction = LED_CTL_LINK; 1114 ledaction = LED_CTL_LINK;
1116 bcnfunc_enable &= 0xF7; 1115 bcnfunc_enable &= 0xF7;
1117 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1116 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1118 ("Set Network type to STA!\n")); 1117 "Set Network type to STA!\n");
1119 break; 1118 break;
1120 case NL80211_IFTYPE_AP: 1119 case NL80211_IFTYPE_AP:
1121 bt_msr |= MSR_AP; 1120 bt_msr |= MSR_AP;
1122 bcnfunc_enable |= 0x08; 1121 bcnfunc_enable |= 0x08;
1123 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1122 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1124 ("Set Network type to AP!\n")); 1123 "Set Network type to AP!\n");
1125 break; 1124 break;
1126 default: 1125 default:
1127 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1126 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1128 ("Network type %d not support!\n", type)); 1127 "Network type %d not supported!\n", type);
1129 return 1; 1128 return 1;
1130 break; 1129 break;
1131 1130
@@ -1189,7 +1188,7 @@ void rtl92d_linked_set_reg(struct ieee80211_hw *hw)
1189 indexforchannel = rtl92d_get_rightchnlplace_for_iqk(channel); 1188 indexforchannel = rtl92d_get_rightchnlplace_for_iqk(channel);
1190 if (!rtlphy->iqk_matrix_regsetting[indexforchannel].iqk_done) { 1189 if (!rtlphy->iqk_matrix_regsetting[indexforchannel].iqk_done) {
1191 RT_TRACE(rtlpriv, COMP_SCAN | COMP_INIT, DBG_DMESG, 1190 RT_TRACE(rtlpriv, COMP_SCAN | COMP_INIT, DBG_DMESG,
1192 ("Do IQK for channel:%d.\n", channel)); 1191 "Do IQK for channel:%d\n", channel);
1193 rtl92d_phy_iq_calibrate(hw); 1192 rtl92d_phy_iq_calibrate(hw);
1194 } 1193 }
1195} 1194}
@@ -1305,8 +1304,8 @@ static void _rtl92de_poweroff_adapter(struct ieee80211_hw *hw)
1305 rtl_write_byte(rtlpriv, REG_APS_FSMCO + 1, 0x10); 1304 rtl_write_byte(rtlpriv, REG_APS_FSMCO + 1, 0x10);
1306 1305
1307 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1306 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1308 ("In PowerOff,reg0x%x=%X\n", REG_SPS0_CTRL, 1307 "In PowerOff,reg0x%x=%X\n",
1309 rtl_read_byte(rtlpriv, REG_SPS0_CTRL))); 1308 REG_SPS0_CTRL, rtl_read_byte(rtlpriv, REG_SPS0_CTRL));
1310 /* r. Note: for PCIe interface, PON will not turn */ 1309 /* r. Note: for PCIe interface, PON will not turn */
1311 /* off m-bias and BandGap in PCIe suspend mode. */ 1310 /* off m-bias and BandGap in PCIe suspend mode. */
1312 1311
@@ -1319,7 +1318,7 @@ static void _rtl92de_poweroff_adapter(struct ieee80211_hw *hw)
1319 spin_unlock_irqrestore(&globalmutex_power, flags); 1318 spin_unlock_irqrestore(&globalmutex_power, flags);
1320 } 1319 }
1321 1320
1322 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("<=======\n")); 1321 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "<=======\n");
1323} 1322}
1324 1323
1325void rtl92de_card_disable(struct ieee80211_hw *hw) 1324void rtl92de_card_disable(struct ieee80211_hw *hw)
@@ -1377,7 +1376,7 @@ void rtl92de_card_disable(struct ieee80211_hw *hw)
1377 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0xff); 1376 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0xff);
1378 udelay(50); 1377 udelay(50);
1379 rtl_write_byte(rtlpriv, REG_CR, 0x0); 1378 rtl_write_byte(rtlpriv, REG_CR, 0x0);
1380 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("==> Do power off.......\n")); 1379 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "==> Do power off.......\n");
1381 if (rtl92d_phy_check_poweroff(hw)) 1380 if (rtl92d_phy_check_poweroff(hw))
1382 _rtl92de_poweroff_adapter(hw); 1381 _rtl92de_poweroff_adapter(hw);
1383 return; 1382 return;
@@ -1425,7 +1424,7 @@ void rtl92de_set_beacon_interval(struct ieee80211_hw *hw)
1425 u16 bcn_interval = mac->beacon_interval; 1424 u16 bcn_interval = mac->beacon_interval;
1426 1425
1427 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, 1426 RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG,
1428 ("beacon_interval:%d\n", bcn_interval)); 1427 "beacon_interval:%d\n", bcn_interval);
1429 /* rtl92de_disable_interrupt(hw); */ 1428 /* rtl92de_disable_interrupt(hw); */
1430 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval); 1429 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval);
1431 /* rtl92de_enable_interrupt(hw); */ 1430 /* rtl92de_enable_interrupt(hw); */
@@ -1437,8 +1436,8 @@ void rtl92de_update_interrupt_mask(struct ieee80211_hw *hw,
1437 struct rtl_priv *rtlpriv = rtl_priv(hw); 1436 struct rtl_priv *rtlpriv = rtl_priv(hw);
1438 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1437 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
1439 1438
1440 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1439 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, "add_msr:%x, rm_msr:%x\n",
1441 ("add_msr:%x, rm_msr:%x\n", add_msr, rm_msr)); 1440 add_msr, rm_msr);
1442 if (add_msr) 1441 if (add_msr)
1443 rtlpci->irq_mask[0] |= add_msr; 1442 rtlpci->irq_mask[0] |= add_msr;
1444 if (rm_msr) 1443 if (rm_msr)
@@ -1615,9 +1614,9 @@ static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw,
1615 rtlefuse->internal_pa_5g[1] = 1614 rtlefuse->internal_pa_5g[1] =
1616 !((hwinfo[EEPROM_TSSI_B_5G] & BIT(6)) >> 6); 1615 !((hwinfo[EEPROM_TSSI_B_5G] & BIT(6)) >> 6);
1617 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1616 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1618 ("Is D cut,Internal PA0 %d Internal PA1 %d\n", 1617 "Is D cut,Internal PA0 %d Internal PA1 %d\n",
1619 rtlefuse->internal_pa_5g[0], 1618 rtlefuse->internal_pa_5g[0],
1620 rtlefuse->internal_pa_5g[1])); 1619 rtlefuse->internal_pa_5g[1]);
1621 } 1620 }
1622 rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6]; 1621 rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6];
1623 rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7]; 1622 rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7];
@@ -1667,14 +1666,14 @@ static void _rtl92de_read_txpower_info(struct ieee80211_hw *hw,
1667 if (rtlefuse->eeprom_c9 == 0xFF) 1666 if (rtlefuse->eeprom_c9 == 0xFF)
1668 rtlefuse->eeprom_c9 = 0x00; 1667 rtlefuse->eeprom_c9 = 0x00;
1669 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1668 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD,
1670 ("EEPROMRegulatory = 0x%x\n", rtlefuse->eeprom_regulatory)); 1669 "EEPROMRegulatory = 0x%x\n", rtlefuse->eeprom_regulatory);
1671 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1670 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD,
1672 ("ThermalMeter = 0x%x\n", rtlefuse->eeprom_thermalmeter)); 1671 "ThermalMeter = 0x%x\n", rtlefuse->eeprom_thermalmeter);
1673 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1672 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD,
1674 ("CrystalCap = 0x%x\n", rtlefuse->crystalcap)); 1673 "CrystalCap = 0x%x\n", rtlefuse->crystalcap);
1675 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1674 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD,
1676 ("Delta_IQK = 0x%x Delta_LCK = 0x%x\n", rtlefuse->delta_iqk, 1675 "Delta_IQK = 0x%x Delta_LCK = 0x%x\n",
1677 rtlefuse->delta_lck)); 1676 rtlefuse->delta_iqk, rtlefuse->delta_lck);
1678 1677
1679 for (rfPath = 0; rfPath < RF6052_MAX_PATH; rfPath++) { 1678 for (rfPath = 0; rfPath < RF6052_MAX_PATH; rfPath++) {
1680 for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) { 1679 for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
@@ -1710,11 +1709,11 @@ static void _rtl92de_read_macphymode_from_prom(struct ieee80211_hw *hw,
1710 if (macphy_crvalue & BIT(3)) { 1709 if (macphy_crvalue & BIT(3)) {
1711 rtlhal->macphymode = SINGLEMAC_SINGLEPHY; 1710 rtlhal->macphymode = SINGLEMAC_SINGLEPHY;
1712 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1711 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1713 ("MacPhyMode SINGLEMAC_SINGLEPHY\n")); 1712 "MacPhyMode SINGLEMAC_SINGLEPHY\n");
1714 } else { 1713 } else {
1715 rtlhal->macphymode = DUALMAC_DUALPHY; 1714 rtlhal->macphymode = DUALMAC_DUALPHY;
1716 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1715 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1717 ("MacPhyMode DUALMAC_DUALPHY\n")); 1716 "MacPhyMode DUALMAC_DUALPHY\n");
1718 } 1717 }
1719} 1718}
1720 1719
@@ -1741,15 +1740,15 @@ static void _rtl92de_efuse_update_chip_version(struct ieee80211_hw *hw)
1741 switch (chipvalue) { 1740 switch (chipvalue) {
1742 case 0xAA55: 1741 case 0xAA55:
1743 chipver |= CHIP_92D_C_CUT; 1742 chipver |= CHIP_92D_C_CUT;
1744 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("C-CUT!!!\n")); 1743 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "C-CUT!!!\n");
1745 break; 1744 break;
1746 case 0x9966: 1745 case 0x9966:
1747 chipver |= CHIP_92D_D_CUT; 1746 chipver |= CHIP_92D_D_CUT;
1748 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("D-CUT!!!\n")); 1747 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "D-CUT!!!\n");
1749 break; 1748 break;
1750 default: 1749 default:
1751 chipver |= CHIP_92D_D_CUT; 1750 chipver |= CHIP_92D_D_CUT;
1752 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, ("Unkown CUT!\n")); 1751 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unkown CUT!\n");
1753 break; 1752 break;
1754 } 1753 }
1755 rtlpriv->rtlhal.version = chipver; 1754 rtlpriv->rtlhal.version = chipver;
@@ -1775,7 +1774,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
1775 HWSET_MAX_SIZE); 1774 HWSET_MAX_SIZE);
1776 } else if (rtlefuse->epromtype == EEPROM_93C46) { 1775 } else if (rtlefuse->epromtype == EEPROM_93C46) {
1777 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1776 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1778 ("RTL819X Not boot from eeprom, check it !!")); 1777 "RTL819X Not boot from eeprom, check it !!\n");
1779 } 1778 }
1780 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, "MAP", 1779 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, "MAP",
1781 hwinfo, HWSET_MAX_SIZE); 1780 hwinfo, HWSET_MAX_SIZE);
@@ -1783,15 +1782,15 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
1783 eeprom_id = *((u16 *)&hwinfo[0]); 1782 eeprom_id = *((u16 *)&hwinfo[0]);
1784 if (eeprom_id != RTL8190_EEPROM_ID) { 1783 if (eeprom_id != RTL8190_EEPROM_ID) {
1785 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1784 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1786 ("EEPROM ID(%#x) is invalid!!\n", eeprom_id)); 1785 "EEPROM ID(%#x) is invalid!!\n", eeprom_id);
1787 rtlefuse->autoload_failflag = true; 1786 rtlefuse->autoload_failflag = true;
1788 } else { 1787 } else {
1789 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1788 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1790 rtlefuse->autoload_failflag = false; 1789 rtlefuse->autoload_failflag = false;
1791 } 1790 }
1792 if (rtlefuse->autoload_failflag) { 1791 if (rtlefuse->autoload_failflag) {
1793 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1792 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1794 ("RTL819X Not boot from eeprom, check it !!")); 1793 "RTL819X Not boot from eeprom, check it !!\n");
1795 return; 1794 return;
1796 } 1795 }
1797 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID]; 1796 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMER_ID];
@@ -1802,16 +1801,15 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
1802 rtlefuse->eeprom_did = *(u16 *)&hwinfo[EEPROM_DID]; 1801 rtlefuse->eeprom_did = *(u16 *)&hwinfo[EEPROM_DID];
1803 rtlefuse->eeprom_svid = *(u16 *)&hwinfo[EEPROM_SVID]; 1802 rtlefuse->eeprom_svid = *(u16 *)&hwinfo[EEPROM_SVID];
1804 rtlefuse->eeprom_smid = *(u16 *)&hwinfo[EEPROM_SMID]; 1803 rtlefuse->eeprom_smid = *(u16 *)&hwinfo[EEPROM_SMID];
1804 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROMId = 0x%4x\n", eeprom_id);
1805 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1805 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1806 ("EEPROMId = 0x%4x\n", eeprom_id)); 1806 "EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid);
1807 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1808 ("EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid));
1809 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1807 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1810 ("EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did)); 1808 "EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did);
1811 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1809 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1812 ("EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid)); 1810 "EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid);
1813 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1811 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1814 ("EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid)); 1812 "EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid);
1815 1813
1816 /* Read Permanent MAC address */ 1814 /* Read Permanent MAC address */
1817 if (rtlhal->interfaceindex == 0) { 1815 if (rtlhal->interfaceindex == 0) {
@@ -1827,8 +1825,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
1827 } 1825 }
1828 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, 1826 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR,
1829 rtlefuse->dev_addr); 1827 rtlefuse->dev_addr);
1830 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1828 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "%pM\n", rtlefuse->dev_addr);
1831 ("%pM\n", rtlefuse->dev_addr));
1832 _rtl92de_read_txpower_info(hw, rtlefuse->autoload_failflag, hwinfo); 1829 _rtl92de_read_txpower_info(hw, rtlefuse->autoload_failflag, hwinfo);
1833 1830
1834 /* Read Channel Plan */ 1831 /* Read Channel Plan */
@@ -1849,7 +1846,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
1849 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION]; 1846 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION];
1850 rtlefuse->txpwr_fromeprom = true; 1847 rtlefuse->txpwr_fromeprom = true;
1851 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1848 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1852 ("EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid)); 1849 "EEPROM Customer ID: 0x%2x\n", rtlefuse->eeprom_oemid);
1853} 1850}
1854 1851
1855void rtl92de_read_eeprom_info(struct ieee80211_hw *hw) 1852void rtl92de_read_eeprom_info(struct ieee80211_hw *hw)
@@ -1863,19 +1860,19 @@ void rtl92de_read_eeprom_info(struct ieee80211_hw *hw)
1863 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR); 1860 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR);
1864 rtlefuse->autoload_status = tmp_u1b; 1861 rtlefuse->autoload_status = tmp_u1b;
1865 if (tmp_u1b & BIT(4)) { 1862 if (tmp_u1b & BIT(4)) {
1866 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EEPROM\n")); 1863 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EEPROM\n");
1867 rtlefuse->epromtype = EEPROM_93C46; 1864 rtlefuse->epromtype = EEPROM_93C46;
1868 } else { 1865 } else {
1869 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EFUSE\n")); 1866 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EFUSE\n");
1870 rtlefuse->epromtype = EEPROM_BOOT_EFUSE; 1867 rtlefuse->epromtype = EEPROM_BOOT_EFUSE;
1871 } 1868 }
1872 if (tmp_u1b & BIT(5)) { 1869 if (tmp_u1b & BIT(5)) {
1873 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1870 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1874 1871
1875 rtlefuse->autoload_failflag = false; 1872 rtlefuse->autoload_failflag = false;
1876 _rtl92de_read_adapter_info(hw); 1873 _rtl92de_read_adapter_info(hw);
1877 } else { 1874 } else {
1878 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Autoload ERR!!\n")); 1875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
1879 } 1876 }
1880 return; 1877 return;
1881} 1878}
@@ -1958,8 +1955,8 @@ static void rtl92de_update_hal_rate_table(struct ieee80211_hw *hw,
1958 (shortgi_rate << 4) | (shortgi_rate); 1955 (shortgi_rate << 4) | (shortgi_rate);
1959 } 1956 }
1960 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value); 1957 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value);
1961 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 1958 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
1962 ("%x\n", rtl_read_dword(rtlpriv, REG_ARFR0))); 1959 rtl_read_dword(rtlpriv, REG_ARFR0));
1963} 1960}
1964 1961
1965static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw, 1962static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw,
@@ -2092,8 +2089,8 @@ static void rtl92de_update_hal_rate_mask(struct ieee80211_hw *hw,
2092 value[0] = (ratr_bitmap & 0x0fffffff) | (ratr_index << 28); 2089 value[0] = (ratr_bitmap & 0x0fffffff) | (ratr_index << 28);
2093 value[1] = macid | (shortgi ? 0x20 : 0x00) | 0x80; 2090 value[1] = macid | (shortgi ? 0x20 : 0x00) | 0x80;
2094 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 2091 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG,
2095 ("ratr_bitmap :%x value0:%x value1:%x\n", 2092 "ratr_bitmap :%x value0:%x value1:%x\n",
2096 ratr_bitmap, value[0], value[1])); 2093 ratr_bitmap, value[0], value[1]);
2097 rtl92d_fill_h2c_cmd(hw, H2C_RA_MASK, 5, (u8 *) value); 2094 rtl92d_fill_h2c_cmd(hw, H2C_RA_MASK, 5, (u8 *) value);
2098 if (macid != 0) 2095 if (macid != 0)
2099 sta_entry->ratr_index = ratr_index; 2096 sta_entry->ratr_index = ratr_index;
@@ -2153,14 +2150,14 @@ bool rtl92de_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
2153 e_rfpowerstate_toset = (u1tmp & BIT(3)) ? ERFON : ERFOFF; 2150 e_rfpowerstate_toset = (u1tmp & BIT(3)) ? ERFON : ERFOFF;
2154 if (ppsc->hwradiooff && (e_rfpowerstate_toset == ERFON)) { 2151 if (ppsc->hwradiooff && (e_rfpowerstate_toset == ERFON)) {
2155 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 2152 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
2156 ("GPIOChangeRF - HW Radio ON, RF ON\n")); 2153 "GPIOChangeRF - HW Radio ON, RF ON\n");
2157 e_rfpowerstate_toset = ERFON; 2154 e_rfpowerstate_toset = ERFON;
2158 ppsc->hwradiooff = false; 2155 ppsc->hwradiooff = false;
2159 actuallyset = true; 2156 actuallyset = true;
2160 } else if ((ppsc->hwradiooff == false) 2157 } else if ((ppsc->hwradiooff == false)
2161 && (e_rfpowerstate_toset == ERFOFF)) { 2158 && (e_rfpowerstate_toset == ERFOFF)) {
2162 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 2159 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
2163 ("GPIOChangeRF - HW Radio OFF, RF OFF\n")); 2160 "GPIOChangeRF - HW Radio OFF, RF OFF\n");
2164 e_rfpowerstate_toset = ERFOFF; 2161 e_rfpowerstate_toset = ERFOFF;
2165 ppsc->hwradiooff = true; 2162 ppsc->hwradiooff = true;
2166 actuallyset = true; 2163 actuallyset = true;
@@ -2204,7 +2201,7 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
2204 u8 idx; 2201 u8 idx;
2205 u8 cam_offset = 0; 2202 u8 cam_offset = 0;
2206 u8 clear_number = 5; 2203 u8 clear_number = 5;
2207 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("clear_all\n")); 2204 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "clear_all\n");
2208 for (idx = 0; idx < clear_number; idx++) { 2205 for (idx = 0; idx < clear_number; idx++) {
2209 rtl_cam_mark_invalid(hw, cam_offset + idx); 2206 rtl_cam_mark_invalid(hw, cam_offset + idx);
2210 rtl_cam_empty_entry(hw, cam_offset + idx); 2207 rtl_cam_empty_entry(hw, cam_offset + idx);
@@ -2230,8 +2227,8 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
2230 enc_algo = CAM_AES; 2227 enc_algo = CAM_AES;
2231 break; 2228 break;
2232 default: 2229 default:
2233 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("switch case " 2230 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
2234 "not process\n")); 2231 "switch case not processed\n");
2235 enc_algo = CAM_TKIP; 2232 enc_algo = CAM_TKIP;
2236 break; 2233 break;
2237 } 2234 }
@@ -2248,9 +2245,8 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
2248 p_macaddr); 2245 p_macaddr);
2249 if (entry_id >= TOTAL_CAM_ENTRY) { 2246 if (entry_id >= TOTAL_CAM_ENTRY) {
2250 RT_TRACE(rtlpriv, COMP_SEC, 2247 RT_TRACE(rtlpriv, COMP_SEC,
2251 DBG_EMERG, ("Can not " 2248 DBG_EMERG,
2252 "find free hw security" 2249 "Can not find free hw security cam entry\n");
2253 " cam entry\n"));
2254 return; 2250 return;
2255 } 2251 }
2256 } else { 2252 } else {
@@ -2262,21 +2258,21 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
2262 } 2258 }
2263 if (rtlpriv->sec.key_len[key_index] == 0) { 2259 if (rtlpriv->sec.key_len[key_index] == 0) {
2264 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2260 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2265 ("delete one entry, entry_id is %d\n", 2261 "delete one entry, entry_id is %d\n",
2266 entry_id)); 2262 entry_id);
2267 if (mac->opmode == NL80211_IFTYPE_AP) 2263 if (mac->opmode == NL80211_IFTYPE_AP)
2268 rtl_cam_del_entry(hw, p_macaddr); 2264 rtl_cam_del_entry(hw, p_macaddr);
2269 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); 2265 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id);
2270 } else { 2266 } else {
2271 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2267 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2272 ("The insert KEY length is %d\n", 2268 "The insert KEY length is %d\n",
2273 rtlpriv->sec.key_len[PAIRWISE_KEYIDX])); 2269 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]);
2274 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2270 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2275 ("The insert KEY is %x %x\n", 2271 "The insert KEY is %x %x\n",
2276 rtlpriv->sec.key_buf[0][0], 2272 rtlpriv->sec.key_buf[0][0],
2277 rtlpriv->sec.key_buf[0][1])); 2273 rtlpriv->sec.key_buf[0][1]);
2278 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2274 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2279 ("add one entry\n")); 2275 "add one entry\n");
2280 if (is_pairwise) { 2276 if (is_pairwise) {
2281 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD, 2277 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD,
2282 "Pairwise Key content", 2278 "Pairwise Key content",
@@ -2284,7 +2280,7 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
2284 rtlpriv-> 2280 rtlpriv->
2285 sec.key_len[PAIRWISE_KEYIDX]); 2281 sec.key_len[PAIRWISE_KEYIDX]);
2286 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2282 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2287 ("set Pairwiase key\n")); 2283 "set Pairwise key\n");
2288 rtl_cam_add_one_entry(hw, macaddr, key_index, 2284 rtl_cam_add_one_entry(hw, macaddr, key_index,
2289 entry_id, enc_algo, 2285 entry_id, enc_algo,
2290 CAM_CONFIG_NO_USEDK, 2286 CAM_CONFIG_NO_USEDK,
@@ -2292,7 +2288,7 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
2292 sec.key_buf[key_index]); 2288 sec.key_buf[key_index]);
2293 } else { 2289 } else {
2294 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2290 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2295 ("set group key\n")); 2291 "set group key\n");
2296 if (mac->opmode == NL80211_IFTYPE_ADHOC) { 2292 if (mac->opmode == NL80211_IFTYPE_ADHOC) {
2297 rtl_cam_add_one_entry(hw, 2293 rtl_cam_add_one_entry(hw,
2298 rtlefuse->dev_addr, 2294 rtlefuse->dev_addr,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/led.c b/drivers/net/wireless/rtlwifi/rtl8192de/led.c
index f1552f4df658..f2358f20b9cd 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/led.c
@@ -45,8 +45,8 @@ void rtl92de_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
45 u8 ledcfg; 45 u8 ledcfg;
46 struct rtl_priv *rtlpriv = rtl_priv(hw); 46 struct rtl_priv *rtlpriv = rtl_priv(hw);
47 47
48 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 48 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
49 ("LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin)); 49 REG_LEDCFG2, pled->ledpin);
50 50
51 switch (pled->ledpin) { 51 switch (pled->ledpin) {
52 case LED_PIN_GPIO0: 52 case LED_PIN_GPIO0:
@@ -71,7 +71,7 @@ void rtl92de_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
71 break; 71 break;
72 default: 72 default:
73 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 73 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
74 ("switch case not process\n")); 74 "switch case not processed\n");
75 break; 75 break;
76 } 76 }
77 pled->ledon = true; 77 pled->ledon = true;
@@ -83,8 +83,8 @@ void rtl92de_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
83 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); 83 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
84 u8 ledcfg; 84 u8 ledcfg;
85 85
86 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 86 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
87 ("LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin)); 87 REG_LEDCFG2, pled->ledpin);
88 88
89 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); 89 ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2);
90 90
@@ -106,7 +106,7 @@ void rtl92de_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
106 break; 106 break;
107 default: 107 default:
108 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 108 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
109 ("switch case not process\n")); 109 "switch case not processed\n");
110 break; 110 break;
111 } 111 }
112 pled->ledon = false; 112 pled->ledon = false;
@@ -153,7 +153,7 @@ void rtl92de_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction)
153 ledaction == LED_CTL_POWER_ON)) { 153 ledaction == LED_CTL_POWER_ON)) {
154 return; 154 return;
155 } 155 }
156 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, ("ledaction %d,\n", ledaction)); 156 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "ledaction %d,\n", ledaction);
157 157
158 _rtl92ce_sw_led_control(hw, ledaction); 158 _rtl92ce_sw_led_control(hw, ledaction);
159} 159}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
index 0883349e1c83..82cc052fc98f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c
@@ -204,8 +204,8 @@ u32 rtl92d_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
204 u32 returnvalue, originalvalue, bitshift; 204 u32 returnvalue, originalvalue, bitshift;
205 u8 dbi_direct; 205 u8 dbi_direct;
206 206
207 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 207 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n",
208 "bitmask(%#x)\n", regaddr, bitmask)); 208 regaddr, bitmask);
209 if (rtlhal->during_mac1init_radioa || rtlhal->during_mac0init_radiob) { 209 if (rtlhal->during_mac1init_radioa || rtlhal->during_mac0init_radiob) {
210 /* mac1 use phy0 read radio_b. */ 210 /* mac1 use phy0 read radio_b. */
211 /* mac0 use phy1 read radio_b. */ 211 /* mac0 use phy1 read radio_b. */
@@ -220,8 +220,9 @@ u32 rtl92d_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
220 } 220 }
221 bitshift = _rtl92d_phy_calculate_bit_shift(bitmask); 221 bitshift = _rtl92d_phy_calculate_bit_shift(bitmask);
222 returnvalue = (originalvalue & bitmask) >> bitshift; 222 returnvalue = (originalvalue & bitmask) >> bitshift;
223 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("BBR MASK=0x%x " 223 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
224 "Addr[0x%x]=0x%x\n", bitmask, regaddr, originalvalue)); 224 "BBR MASK=0x%x Addr[0x%x]=0x%x\n",
225 bitmask, regaddr, originalvalue);
225 return returnvalue; 226 return returnvalue;
226} 227}
227 228
@@ -233,8 +234,9 @@ void rtl92d_phy_set_bb_reg(struct ieee80211_hw *hw,
233 u8 dbi_direct = 0; 234 u8 dbi_direct = 0;
234 u32 originalvalue, bitshift; 235 u32 originalvalue, bitshift;
235 236
236 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 237 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
237 " data(%#x)\n", regaddr, bitmask, data)); 238 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
239 regaddr, bitmask, data);
238 if (rtlhal->during_mac1init_radioa) 240 if (rtlhal->during_mac1init_radioa)
239 dbi_direct = BIT(3); 241 dbi_direct = BIT(3);
240 else if (rtlhal->during_mac0init_radiob) 242 else if (rtlhal->during_mac0init_radiob)
@@ -255,8 +257,9 @@ void rtl92d_phy_set_bb_reg(struct ieee80211_hw *hw,
255 rtl92de_write_dword_dbi(hw, (u16) regaddr, data, dbi_direct); 257 rtl92de_write_dword_dbi(hw, (u16) regaddr, data, dbi_direct);
256 else 258 else
257 rtl_write_dword(rtlpriv, regaddr, data); 259 rtl_write_dword(rtlpriv, regaddr, data);
258 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 260 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
259 " data(%#x)\n", regaddr, bitmask, data)); 261 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
262 regaddr, bitmask, data);
260} 263}
261 264
262static u32 _rtl92d_phy_rf_serial_read(struct ieee80211_hw *hw, 265static u32 _rtl92d_phy_rf_serial_read(struct ieee80211_hw *hw,
@@ -300,8 +303,8 @@ static u32 _rtl92d_phy_rf_serial_read(struct ieee80211_hw *hw,
300 else 303 else
301 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback, 304 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback,
302 BLSSIREADBACKDATA); 305 BLSSIREADBACKDATA);
303 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFR-%d Addr[0x%x] = 0x%x\n", 306 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFR-%d Addr[0x%x] = 0x%x\n",
304 rfpath, pphyreg->rflssi_readback, retvalue)); 307 rfpath, pphyreg->rflssi_readback, retvalue);
305 return retvalue; 308 return retvalue;
306} 309}
307 310
@@ -319,8 +322,8 @@ static void _rtl92d_phy_rf_serial_write(struct ieee80211_hw *hw,
319 /* T65 RF */ 322 /* T65 RF */
320 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff; 323 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff;
321 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, BMASKDWORD, data_and_addr); 324 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, BMASKDWORD, data_and_addr);
322 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFW-%d Addr[0x%x]=0x%x\n", 325 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFW-%d Addr[0x%x]=0x%x\n",
323 rfpath, pphyreg->rf3wire_offset, data_and_addr)); 326 rfpath, pphyreg->rf3wire_offset, data_and_addr);
324} 327}
325 328
326u32 rtl92d_phy_query_rf_reg(struct ieee80211_hw *hw, 329u32 rtl92d_phy_query_rf_reg(struct ieee80211_hw *hw,
@@ -330,17 +333,17 @@ u32 rtl92d_phy_query_rf_reg(struct ieee80211_hw *hw,
330 u32 original_value, readback_value, bitshift; 333 u32 original_value, readback_value, bitshift;
331 unsigned long flags; 334 unsigned long flags;
332 335
333 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 336 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
334 "rfpath(%#x), bitmask(%#x)\n", 337 "regaddr(%#x), rfpath(%#x), bitmask(%#x)\n",
335 regaddr, rfpath, bitmask)); 338 regaddr, rfpath, bitmask);
336 spin_lock_irqsave(&rtlpriv->locks.rf_lock, flags); 339 spin_lock_irqsave(&rtlpriv->locks.rf_lock, flags);
337 original_value = _rtl92d_phy_rf_serial_read(hw, rfpath, regaddr); 340 original_value = _rtl92d_phy_rf_serial_read(hw, rfpath, regaddr);
338 bitshift = _rtl92d_phy_calculate_bit_shift(bitmask); 341 bitshift = _rtl92d_phy_calculate_bit_shift(bitmask);
339 readback_value = (original_value & bitmask) >> bitshift; 342 readback_value = (original_value & bitmask) >> bitshift;
340 spin_unlock_irqrestore(&rtlpriv->locks.rf_lock, flags); 343 spin_unlock_irqrestore(&rtlpriv->locks.rf_lock, flags);
341 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), rfpath(%#x), " 344 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
342 "bitmask(%#x), original_value(%#x)\n", 345 "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
343 regaddr, rfpath, bitmask, original_value)); 346 regaddr, rfpath, bitmask, original_value);
344 return readback_value; 347 return readback_value;
345} 348}
346 349
@@ -353,8 +356,8 @@ void rtl92d_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
353 unsigned long flags; 356 unsigned long flags;
354 357
355 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 358 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
356 ("regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n", 359 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
357 regaddr, bitmask, data, rfpath)); 360 regaddr, bitmask, data, rfpath);
358 if (bitmask == 0) 361 if (bitmask == 0)
359 return; 362 return;
360 spin_lock_irqsave(&rtlpriv->locks.rf_lock, flags); 363 spin_lock_irqsave(&rtlpriv->locks.rf_lock, flags);
@@ -369,9 +372,9 @@ void rtl92d_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
369 _rtl92d_phy_rf_serial_write(hw, rfpath, regaddr, data); 372 _rtl92d_phy_rf_serial_write(hw, rfpath, regaddr, data);
370 } 373 }
371 spin_unlock_irqrestore(&rtlpriv->locks.rf_lock, flags); 374 spin_unlock_irqrestore(&rtlpriv->locks.rf_lock, flags);
372 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), " 375 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
373 "bitmask(%#x), data(%#x), rfpath(%#x)\n", 376 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
374 regaddr, bitmask, data, rfpath)); 377 regaddr, bitmask, data, rfpath);
375} 378}
376 379
377bool rtl92d_phy_mac_config(struct ieee80211_hw *hw) 380bool rtl92d_phy_mac_config(struct ieee80211_hw *hw)
@@ -381,10 +384,10 @@ bool rtl92d_phy_mac_config(struct ieee80211_hw *hw)
381 u32 arraylength; 384 u32 arraylength;
382 u32 *ptrarray; 385 u32 *ptrarray;
383 386
384 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Read Rtl819XMACPHY_Array\n")); 387 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Read Rtl819XMACPHY_Array\n");
385 arraylength = MAC_2T_ARRAYLENGTH; 388 arraylength = MAC_2T_ARRAYLENGTH;
386 ptrarray = rtl8192de_mac_2tarray; 389 ptrarray = rtl8192de_mac_2tarray;
387 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Img:Rtl819XMAC_Array\n")); 390 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Img:Rtl819XMAC_Array\n");
388 for (i = 0; i < arraylength; i = i + 2) 391 for (i = 0; i < arraylength; i = i + 2)
389 rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]); 392 rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]);
390 if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) { 393 if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
@@ -561,25 +564,25 @@ static bool _rtl92d_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
561 agctab_arraylen = AGCTAB_ARRAYLENGTH; 564 agctab_arraylen = AGCTAB_ARRAYLENGTH;
562 agctab_array_table = rtl8192de_agctab_array; 565 agctab_array_table = rtl8192de_agctab_array;
563 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 566 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
564 (" ===> phy:MAC0, Rtl819XAGCTAB_Array\n")); 567 " ===> phy:MAC0, Rtl819XAGCTAB_Array\n");
565 } else { 568 } else {
566 if (rtlhal->current_bandtype == BAND_ON_2_4G) { 569 if (rtlhal->current_bandtype == BAND_ON_2_4G) {
567 agctab_arraylen = AGCTAB_2G_ARRAYLENGTH; 570 agctab_arraylen = AGCTAB_2G_ARRAYLENGTH;
568 agctab_array_table = rtl8192de_agctab_2garray; 571 agctab_array_table = rtl8192de_agctab_2garray;
569 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 572 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
570 (" ===> phy:MAC1, Rtl819XAGCTAB_2GArray\n")); 573 " ===> phy:MAC1, Rtl819XAGCTAB_2GArray\n");
571 } else { 574 } else {
572 agctab_5garraylen = AGCTAB_5G_ARRAYLENGTH; 575 agctab_5garraylen = AGCTAB_5G_ARRAYLENGTH;
573 agctab_5garray_table = rtl8192de_agctab_5garray; 576 agctab_5garray_table = rtl8192de_agctab_5garray;
574 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 577 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
575 (" ===> phy:MAC1, Rtl819XAGCTAB_5GArray\n")); 578 " ===> phy:MAC1, Rtl819XAGCTAB_5GArray\n");
576 579
577 } 580 }
578 } 581 }
579 phy_reg_arraylen = PHY_REG_2T_ARRAYLENGTH; 582 phy_reg_arraylen = PHY_REG_2T_ARRAYLENGTH;
580 phy_regarray_table = rtl8192de_phy_reg_2tarray; 583 phy_regarray_table = rtl8192de_phy_reg_2tarray;
581 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 584 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
582 (" ===> phy:Rtl819XPHY_REG_Array_PG\n")); 585 " ===> phy:Rtl819XPHY_REG_Array_PG\n");
583 if (configtype == BASEBAND_CONFIG_PHY_REG) { 586 if (configtype == BASEBAND_CONFIG_PHY_REG) {
584 for (i = 0; i < phy_reg_arraylen; i = i + 2) { 587 for (i = 0; i < phy_reg_arraylen; i = i + 2) {
585 if (phy_regarray_table[i] == 0xfe) 588 if (phy_regarray_table[i] == 0xfe)
@@ -598,10 +601,9 @@ static bool _rtl92d_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
598 phy_regarray_table[i + 1]); 601 phy_regarray_table[i + 1]);
599 udelay(1); 602 udelay(1);
600 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 603 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
601 ("The phy_regarray_table[0] is %x" 604 "The phy_regarray_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
602 " Rtl819XPHY_REGArray[1] is %x\n", 605 phy_regarray_table[i],
603 phy_regarray_table[i], 606 phy_regarray_table[i + 1]);
604 phy_regarray_table[i + 1]));
605 } 607 }
606 } else if (configtype == BASEBAND_CONFIG_AGC_TAB) { 608 } else if (configtype == BASEBAND_CONFIG_AGC_TAB) {
607 if (rtlhal->interfaceindex == 0) { 609 if (rtlhal->interfaceindex == 0) {
@@ -613,15 +615,12 @@ static bool _rtl92d_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
613 * setting. */ 615 * setting. */
614 udelay(1); 616 udelay(1);
615 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 617 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
616 ("The Rtl819XAGCTAB_Array_" 618 "The Rtl819XAGCTAB_Array_Table[0] is %ul Rtl819XPHY_REGArray[1] is %ul\n",
617 "Table[0] is %ul "
618 "Rtl819XPHY_REGArray[1] is %ul\n",
619 agctab_array_table[i], 619 agctab_array_table[i],
620 agctab_array_table[i + 1])); 620 agctab_array_table[i + 1]);
621 } 621 }
622 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 622 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
623 ("Normal Chip, MAC0, load " 623 "Normal Chip, MAC0, load Rtl819XAGCTAB_Array\n");
624 "Rtl819XAGCTAB_Array\n"));
625 } else { 624 } else {
626 if (rtlhal->current_bandtype == BAND_ON_2_4G) { 625 if (rtlhal->current_bandtype == BAND_ON_2_4G) {
627 for (i = 0; i < agctab_arraylen; i = i + 2) { 626 for (i = 0; i < agctab_arraylen; i = i + 2) {
@@ -632,14 +631,12 @@ static bool _rtl92d_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
632 * setting. */ 631 * setting. */
633 udelay(1); 632 udelay(1);
634 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 633 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
635 ("The Rtl819XAGCTAB_Array_" 634 "The Rtl819XAGCTAB_Array_Table[0] is %ul Rtl819XPHY_REGArray[1] is %ul\n",
636 "Table[0] is %ul Rtl819XPHY_"
637 "REGArray[1] is %ul\n",
638 agctab_array_table[i], 635 agctab_array_table[i],
639 agctab_array_table[i + 1])); 636 agctab_array_table[i + 1]);
640 } 637 }
641 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 638 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
642 ("Load Rtl819XAGCTAB_2GArray\n")); 639 "Load Rtl819XAGCTAB_2GArray\n");
643 } else { 640 } else {
644 for (i = 0; i < agctab_5garraylen; i = i + 2) { 641 for (i = 0; i < agctab_5garraylen; i = i + 2) {
645 rtl_set_bbreg(hw, 642 rtl_set_bbreg(hw,
@@ -650,14 +647,12 @@ static bool _rtl92d_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
650 * setting. */ 647 * setting. */
651 udelay(1); 648 udelay(1);
652 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 649 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
653 ("The Rtl819XAGCTAB_5GArray_" 650 "The Rtl819XAGCTAB_5GArray_Table[0] is %ul Rtl819XPHY_REGArray[1] is %ul\n",
654 "Table[0] is %ul Rtl819XPHY_"
655 "REGArray[1] is %ul\n",
656 agctab_5garray_table[i], 651 agctab_5garray_table[i],
657 agctab_5garray_table[i + 1])); 652 agctab_5garray_table[i + 1]);
658 } 653 }
659 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 654 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
660 ("Load Rtl819XAGCTAB_5GArray\n")); 655 "Load Rtl819XAGCTAB_5GArray\n");
661 } 656 }
662 } 657 }
663 } 658 }
@@ -675,145 +670,145 @@ static void _rtl92d_store_pwrindex_diffrate_offset(struct ieee80211_hw *hw,
675 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][0] = 670 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][0] =
676 data; 671 data;
677 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 672 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
678 ("MCSTxPowerLevelOriginalOffset[%d][0] = 0x%ulx\n", 673 "MCSTxPowerLevelOriginalOffset[%d][0] = 0x%ulx\n",
679 rtlphy->pwrgroup_cnt, 674 rtlphy->pwrgroup_cnt,
680 rtlphy->mcs_txpwrlevel_origoffset 675 rtlphy->mcs_txpwrlevel_origoffset
681 [rtlphy->pwrgroup_cnt][0])); 676 [rtlphy->pwrgroup_cnt][0]);
682 } 677 }
683 if (regaddr == RTXAGC_A_RATE54_24) { 678 if (regaddr == RTXAGC_A_RATE54_24) {
684 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][1] = 679 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][1] =
685 data; 680 data;
686 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 681 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
687 ("MCSTxPowerLevelOriginalOffset[%d][1] = 0x%ulx\n", 682 "MCSTxPowerLevelOriginalOffset[%d][1] = 0x%ulx\n",
688 rtlphy->pwrgroup_cnt, 683 rtlphy->pwrgroup_cnt,
689 rtlphy->mcs_txpwrlevel_origoffset 684 rtlphy->mcs_txpwrlevel_origoffset
690 [rtlphy->pwrgroup_cnt][1])); 685 [rtlphy->pwrgroup_cnt][1]);
691 } 686 }
692 if (regaddr == RTXAGC_A_CCK1_MCS32) { 687 if (regaddr == RTXAGC_A_CCK1_MCS32) {
693 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][6] = 688 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][6] =
694 data; 689 data;
695 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 690 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
696 ("MCSTxPowerLevelOriginalOffset[%d][6] = 0x%ulx\n", 691 "MCSTxPowerLevelOriginalOffset[%d][6] = 0x%ulx\n",
697 rtlphy->pwrgroup_cnt, 692 rtlphy->pwrgroup_cnt,
698 rtlphy->mcs_txpwrlevel_origoffset 693 rtlphy->mcs_txpwrlevel_origoffset
699 [rtlphy->pwrgroup_cnt][6])); 694 [rtlphy->pwrgroup_cnt][6]);
700 } 695 }
701 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0xffffff00) { 696 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0xffffff00) {
702 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][7] = 697 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][7] =
703 data; 698 data;
704 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 699 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
705 ("MCSTxPowerLevelOriginalOffset[%d][7] = 0x%ulx\n", 700 "MCSTxPowerLevelOriginalOffset[%d][7] = 0x%ulx\n",
706 rtlphy->pwrgroup_cnt, 701 rtlphy->pwrgroup_cnt,
707 rtlphy->mcs_txpwrlevel_origoffset 702 rtlphy->mcs_txpwrlevel_origoffset
708 [rtlphy->pwrgroup_cnt][7])); 703 [rtlphy->pwrgroup_cnt][7]);
709 } 704 }
710 if (regaddr == RTXAGC_A_MCS03_MCS00) { 705 if (regaddr == RTXAGC_A_MCS03_MCS00) {
711 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][2] = 706 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][2] =
712 data; 707 data;
713 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 708 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
714 ("MCSTxPowerLevelOriginalOffset[%d][2] = 0x%ulx\n", 709 "MCSTxPowerLevelOriginalOffset[%d][2] = 0x%ulx\n",
715 rtlphy->pwrgroup_cnt, 710 rtlphy->pwrgroup_cnt,
716 rtlphy->mcs_txpwrlevel_origoffset 711 rtlphy->mcs_txpwrlevel_origoffset
717 [rtlphy->pwrgroup_cnt][2])); 712 [rtlphy->pwrgroup_cnt][2]);
718 } 713 }
719 if (regaddr == RTXAGC_A_MCS07_MCS04) { 714 if (regaddr == RTXAGC_A_MCS07_MCS04) {
720 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][3] = 715 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][3] =
721 data; 716 data;
722 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 717 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
723 ("MCSTxPowerLevelOriginalOffset[%d][3] = 0x%ulx\n", 718 "MCSTxPowerLevelOriginalOffset[%d][3] = 0x%ulx\n",
724 rtlphy->pwrgroup_cnt, 719 rtlphy->pwrgroup_cnt,
725 rtlphy->mcs_txpwrlevel_origoffset 720 rtlphy->mcs_txpwrlevel_origoffset
726 [rtlphy->pwrgroup_cnt][3])); 721 [rtlphy->pwrgroup_cnt][3]);
727 } 722 }
728 if (regaddr == RTXAGC_A_MCS11_MCS08) { 723 if (regaddr == RTXAGC_A_MCS11_MCS08) {
729 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][4] = 724 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][4] =
730 data; 725 data;
731 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 726 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
732 ("MCSTxPowerLevelOriginalOffset[%d][4] = 0x%ulx\n", 727 "MCSTxPowerLevelOriginalOffset[%d][4] = 0x%ulx\n",
733 rtlphy->pwrgroup_cnt, 728 rtlphy->pwrgroup_cnt,
734 rtlphy->mcs_txpwrlevel_origoffset 729 rtlphy->mcs_txpwrlevel_origoffset
735 [rtlphy->pwrgroup_cnt][4])); 730 [rtlphy->pwrgroup_cnt][4]);
736 } 731 }
737 if (regaddr == RTXAGC_A_MCS15_MCS12) { 732 if (regaddr == RTXAGC_A_MCS15_MCS12) {
738 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][5] = 733 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][5] =
739 data; 734 data;
740 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 735 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
741 ("MCSTxPowerLevelOriginalOffset[%d][5] = 0x%ulx\n", 736 "MCSTxPowerLevelOriginalOffset[%d][5] = 0x%ulx\n",
742 rtlphy->pwrgroup_cnt, 737 rtlphy->pwrgroup_cnt,
743 rtlphy->mcs_txpwrlevel_origoffset 738 rtlphy->mcs_txpwrlevel_origoffset
744 [rtlphy->pwrgroup_cnt][5])); 739 [rtlphy->pwrgroup_cnt][5]);
745 } 740 }
746 if (regaddr == RTXAGC_B_RATE18_06) { 741 if (regaddr == RTXAGC_B_RATE18_06) {
747 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][8] = 742 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][8] =
748 data; 743 data;
749 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 744 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
750 ("MCSTxPowerLevelOriginalOffset[%d][8] = 0x%ulx\n", 745 "MCSTxPowerLevelOriginalOffset[%d][8] = 0x%ulx\n",
751 rtlphy->pwrgroup_cnt, 746 rtlphy->pwrgroup_cnt,
752 rtlphy->mcs_txpwrlevel_origoffset 747 rtlphy->mcs_txpwrlevel_origoffset
753 [rtlphy->pwrgroup_cnt][8])); 748 [rtlphy->pwrgroup_cnt][8]);
754 } 749 }
755 if (regaddr == RTXAGC_B_RATE54_24) { 750 if (regaddr == RTXAGC_B_RATE54_24) {
756 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][9] = 751 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][9] =
757 data; 752 data;
758 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 753 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
759 ("MCSTxPowerLevelOriginalOffset[%d][9] = 0x%ulx\n", 754 "MCSTxPowerLevelOriginalOffset[%d][9] = 0x%ulx\n",
760 rtlphy->pwrgroup_cnt, 755 rtlphy->pwrgroup_cnt,
761 rtlphy->mcs_txpwrlevel_origoffset 756 rtlphy->mcs_txpwrlevel_origoffset
762 [rtlphy->pwrgroup_cnt][9])); 757 [rtlphy->pwrgroup_cnt][9]);
763 } 758 }
764 if (regaddr == RTXAGC_B_CCK1_55_MCS32) { 759 if (regaddr == RTXAGC_B_CCK1_55_MCS32) {
765 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][14] = 760 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][14] =
766 data; 761 data;
767 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 762 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
768 ("MCSTxPowerLevelOriginalOffset[%d][14] = 0x%ulx\n", 763 "MCSTxPowerLevelOriginalOffset[%d][14] = 0x%ulx\n",
769 rtlphy->pwrgroup_cnt, 764 rtlphy->pwrgroup_cnt,
770 rtlphy->mcs_txpwrlevel_origoffset 765 rtlphy->mcs_txpwrlevel_origoffset
771 [rtlphy->pwrgroup_cnt][14])); 766 [rtlphy->pwrgroup_cnt][14]);
772 } 767 }
773 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0x000000ff) { 768 if (regaddr == RTXAGC_B_CCK11_A_CCK2_11 && bitmask == 0x000000ff) {
774 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][15] = 769 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][15] =
775 data; 770 data;
776 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 771 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
777 ("MCSTxPowerLevelOriginalOffset[%d][15] = 0x%ulx\n", 772 "MCSTxPowerLevelOriginalOffset[%d][15] = 0x%ulx\n",
778 rtlphy->pwrgroup_cnt, 773 rtlphy->pwrgroup_cnt,
779 rtlphy->mcs_txpwrlevel_origoffset 774 rtlphy->mcs_txpwrlevel_origoffset
780 [rtlphy->pwrgroup_cnt][15])); 775 [rtlphy->pwrgroup_cnt][15]);
781 } 776 }
782 if (regaddr == RTXAGC_B_MCS03_MCS00) { 777 if (regaddr == RTXAGC_B_MCS03_MCS00) {
783 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][10] = 778 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][10] =
784 data; 779 data;
785 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 780 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
786 ("MCSTxPowerLevelOriginalOffset[%d][10] = 0x%ulx\n", 781 "MCSTxPowerLevelOriginalOffset[%d][10] = 0x%ulx\n",
787 rtlphy->pwrgroup_cnt, 782 rtlphy->pwrgroup_cnt,
788 rtlphy->mcs_txpwrlevel_origoffset 783 rtlphy->mcs_txpwrlevel_origoffset
789 [rtlphy->pwrgroup_cnt][10])); 784 [rtlphy->pwrgroup_cnt][10]);
790 } 785 }
791 if (regaddr == RTXAGC_B_MCS07_MCS04) { 786 if (regaddr == RTXAGC_B_MCS07_MCS04) {
792 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][11] = 787 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][11] =
793 data; 788 data;
794 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 789 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
795 ("MCSTxPowerLevelOriginalOffset[%d][11] = 0x%ulx\n", 790 "MCSTxPowerLevelOriginalOffset[%d][11] = 0x%ulx\n",
796 rtlphy->pwrgroup_cnt, 791 rtlphy->pwrgroup_cnt,
797 rtlphy->mcs_txpwrlevel_origoffset 792 rtlphy->mcs_txpwrlevel_origoffset
798 [rtlphy->pwrgroup_cnt][11])); 793 [rtlphy->pwrgroup_cnt][11]);
799 } 794 }
800 if (regaddr == RTXAGC_B_MCS11_MCS08) { 795 if (regaddr == RTXAGC_B_MCS11_MCS08) {
801 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][12] = 796 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][12] =
802 data; 797 data;
803 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 798 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
804 ("MCSTxPowerLevelOriginalOffset[%d][12] = 0x%ulx\n", 799 "MCSTxPowerLevelOriginalOffset[%d][12] = 0x%ulx\n",
805 rtlphy->pwrgroup_cnt, 800 rtlphy->pwrgroup_cnt,
806 rtlphy->mcs_txpwrlevel_origoffset 801 rtlphy->mcs_txpwrlevel_origoffset
807 [rtlphy->pwrgroup_cnt][12])); 802 [rtlphy->pwrgroup_cnt][12]);
808 } 803 }
809 if (regaddr == RTXAGC_B_MCS15_MCS12) { 804 if (regaddr == RTXAGC_B_MCS15_MCS12) {
810 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][13] = 805 rtlphy->mcs_txpwrlevel_origoffset[rtlphy->pwrgroup_cnt][13] =
811 data; 806 data;
812 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 807 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
813 ("MCSTxPowerLevelOriginalOffset[%d][13] = 0x%ulx\n", 808 "MCSTxPowerLevelOriginalOffset[%d][13] = 0x%ulx\n",
814 rtlphy->pwrgroup_cnt, 809 rtlphy->pwrgroup_cnt,
815 rtlphy->mcs_txpwrlevel_origoffset 810 rtlphy->mcs_txpwrlevel_origoffset
816 [rtlphy->pwrgroup_cnt][13])); 811 [rtlphy->pwrgroup_cnt][13]);
817 rtlphy->pwrgroup_cnt++; 812 rtlphy->pwrgroup_cnt++;
818 } 813 }
819} 814}
@@ -849,7 +844,7 @@ static bool _rtl92d_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
849 } 844 }
850 } else { 845 } else {
851 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 846 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
852 ("configtype != BaseBand_Config_PHY_REG\n")); 847 "configtype != BaseBand_Config_PHY_REG\n");
853 } 848 }
854 return true; 849 return true;
855} 850}
@@ -861,17 +856,17 @@ static bool _rtl92d_phy_bb_config(struct ieee80211_hw *hw)
861 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 856 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
862 bool rtstatus = true; 857 bool rtstatus = true;
863 858
864 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("==>\n")); 859 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "==>\n");
865 rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw, 860 rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw,
866 BASEBAND_CONFIG_PHY_REG); 861 BASEBAND_CONFIG_PHY_REG);
867 if (rtstatus != true) { 862 if (rtstatus != true) {
868 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Write BB Reg Fail!!")); 863 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
869 return false; 864 return false;
870 } 865 }
871 866
872 /* if (rtlphy->rf_type == RF_1T2R) { 867 /* if (rtlphy->rf_type == RF_1T2R) {
873 * _rtl92c_phy_bb_config_1t(hw); 868 * _rtl92c_phy_bb_config_1t(hw);
874 * RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Config to 1T!!\n")); 869 * RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Config to 1T!!\n");
875 *} */ 870 *} */
876 871
877 if (rtlefuse->autoload_failflag == false) { 872 if (rtlefuse->autoload_failflag == false) {
@@ -880,13 +875,13 @@ static bool _rtl92d_phy_bb_config(struct ieee80211_hw *hw)
880 BASEBAND_CONFIG_PHY_REG); 875 BASEBAND_CONFIG_PHY_REG);
881 } 876 }
882 if (rtstatus != true) { 877 if (rtstatus != true) {
883 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("BB_PG Reg Fail!!")); 878 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
884 return false; 879 return false;
885 } 880 }
886 rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw, 881 rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw,
887 BASEBAND_CONFIG_AGC_TAB); 882 BASEBAND_CONFIG_AGC_TAB);
888 if (rtstatus != true) { 883 if (rtstatus != true) {
889 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("AGC Table Fail\n")); 884 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
890 return false; 885 return false;
891 } 886 }
892 rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw, 887 rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw,
@@ -951,19 +946,17 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
951 radiob_array_table = rtl8192de_radiob_2t_int_paarray; 946 radiob_array_table = rtl8192de_radiob_2t_int_paarray;
952 } 947 }
953 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 948 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
954 ("PHY_ConfigRFWithHeaderFile() " 949 "PHY_ConfigRFWithHeaderFile() Radio_A:Rtl819XRadioA_1TArray\n");
955 "Radio_A:Rtl819XRadioA_1TArray\n"));
956 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 950 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
957 ("PHY_ConfigRFWithHeaderFile() " 951 "PHY_ConfigRFWithHeaderFile() Radio_B:Rtl819XRadioB_1TArray\n");
958 "Radio_B:Rtl819XRadioB_1TArray\n")); 952 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Radio No %x\n", rfpath);
959 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("Radio No %x\n", rfpath));
960 953
961 /* this only happens when DMDP, mac0 start on 2.4G, 954 /* this only happens when DMDP, mac0 start on 2.4G,
962 * mac1 start on 5G, mac 0 has to set phy0&phy1 955 * mac1 start on 5G, mac 0 has to set phy0&phy1
963 * pathA or mac1 has to set phy0&phy1 pathA */ 956 * pathA or mac1 has to set phy0&phy1 pathA */
964 if ((content == radiob_txt) && (rfpath == RF90_PATH_A)) { 957 if ((content == radiob_txt) && (rfpath == RF90_PATH_A)) {
965 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 958 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
966 (" ===> althougth Path A, we load radiob.txt\n")); 959 " ===> althougth Path A, we load radiob.txt\n");
967 radioa_arraylen = radiob_arraylen; 960 radioa_arraylen = radiob_arraylen;
968 radioa_array_table = radiob_array_table; 961 radioa_array_table = radiob_array_table;
969 } 962 }
@@ -1022,11 +1015,11 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
1022 break; 1015 break;
1023 case RF90_PATH_C: 1016 case RF90_PATH_C:
1024 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1017 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1025 ("switch case not process\n")); 1018 "switch case not processed\n");
1026 break; 1019 break;
1027 case RF90_PATH_D: 1020 case RF90_PATH_D:
1028 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1021 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1029 ("switch case not process\n")); 1022 "switch case not processed\n");
1030 break; 1023 break;
1031 } 1024 }
1032 return true; 1025 return true;
@@ -1046,19 +1039,18 @@ void rtl92d_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
1046 rtlphy->default_initialgain[3] = 1039 rtlphy->default_initialgain[3] =
1047 (u8) rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, BMASKBYTE0); 1040 (u8) rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, BMASKBYTE0);
1048 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1041 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1049 ("Default initial gain (c50=0x%x, " 1042 "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x\n",
1050 "c58=0x%x, c60=0x%x, c68=0x%x\n", 1043 rtlphy->default_initialgain[0],
1051 rtlphy->default_initialgain[0], 1044 rtlphy->default_initialgain[1],
1052 rtlphy->default_initialgain[1], 1045 rtlphy->default_initialgain[2],
1053 rtlphy->default_initialgain[2], 1046 rtlphy->default_initialgain[3]);
1054 rtlphy->default_initialgain[3]));
1055 rtlphy->framesync = (u8)rtl_get_bbreg(hw, ROFDM0_RXDETECTOR3, 1047 rtlphy->framesync = (u8)rtl_get_bbreg(hw, ROFDM0_RXDETECTOR3,
1056 BMASKBYTE0); 1048 BMASKBYTE0);
1057 rtlphy->framesync_c34 = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR2, 1049 rtlphy->framesync_c34 = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR2,
1058 BMASKDWORD); 1050 BMASKDWORD);
1059 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1051 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1060 ("Default framesync (0x%x) = 0x%x\n", 1052 "Default framesync (0x%x) = 0x%x\n",
1061 ROFDM0_RXDETECTOR3, rtlphy->framesync)); 1053 ROFDM0_RXDETECTOR3, rtlphy->framesync);
1062} 1054}
1063 1055
1064static void _rtl92d_get_txpower_index(struct ieee80211_hw *hw, u8 channel, 1056static void _rtl92d_get_txpower_index(struct ieee80211_hw *hw, u8 channel,
@@ -1172,7 +1164,7 @@ void rtl92d_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
1172 break; 1164 break;
1173 default: 1165 default:
1174 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1166 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1175 ("Unknown Scan Backup operation.\n")); 1167 "Unknown Scan Backup operation\n");
1176 break; 1168 break;
1177 } 1169 }
1178 } 1170 }
@@ -1193,14 +1185,13 @@ void rtl92d_phy_set_bw_mode(struct ieee80211_hw *hw,
1193 return; 1185 return;
1194 if ((is_hal_stop(rtlhal)) || (RT_CANNOT_IO(hw))) { 1186 if ((is_hal_stop(rtlhal)) || (RT_CANNOT_IO(hw))) {
1195 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1187 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1196 ("FALSE driver sleep or unload\n")); 1188 "FALSE driver sleep or unload\n");
1197 return; 1189 return;
1198 } 1190 }
1199 rtlphy->set_bwmode_inprogress = true; 1191 rtlphy->set_bwmode_inprogress = true;
1200 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 1192 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "Switch to %s bandwidth\n",
1201 ("Switch to %s bandwidth\n", 1193 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
1202 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 1194 "20MHz" : "40MHz");
1203 "20MHz" : "40MHz"));
1204 reg_bw_opmode = rtl_read_byte(rtlpriv, REG_BWOPMODE); 1195 reg_bw_opmode = rtl_read_byte(rtlpriv, REG_BWOPMODE);
1205 reg_prsr_rsc = rtl_read_byte(rtlpriv, REG_RRSR + 2); 1196 reg_prsr_rsc = rtl_read_byte(rtlpriv, REG_RRSR + 2);
1206 switch (rtlphy->current_chan_bw) { 1197 switch (rtlphy->current_chan_bw) {
@@ -1218,7 +1209,7 @@ void rtl92d_phy_set_bw_mode(struct ieee80211_hw *hw,
1218 break; 1209 break;
1219 default: 1210 default:
1220 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1211 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1221 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 1212 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
1222 break; 1213 break;
1223 } 1214 }
1224 switch (rtlphy->current_chan_bw) { 1215 switch (rtlphy->current_chan_bw) {
@@ -1250,13 +1241,13 @@ void rtl92d_phy_set_bw_mode(struct ieee80211_hw *hw,
1250 break; 1241 break;
1251 default: 1242 default:
1252 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1243 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1253 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 1244 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
1254 break; 1245 break;
1255 1246
1256 } 1247 }
1257 rtl92d_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); 1248 rtl92d_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
1258 rtlphy->set_bwmode_inprogress = false; 1249 rtlphy->set_bwmode_inprogress = false;
1259 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 1250 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
1260} 1251}
1261 1252
1262static void _rtl92d_phy_stop_trx_before_changeband(struct ieee80211_hw *hw) 1253static void _rtl92d_phy_stop_trx_before_changeband(struct ieee80211_hw *hw)
@@ -1273,7 +1264,7 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band)
1273 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 1264 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
1274 u8 value8; 1265 u8 value8;
1275 1266
1276 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("==>\n")); 1267 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "==>\n");
1277 rtlhal->bandset = band; 1268 rtlhal->bandset = band;
1278 rtlhal->current_bandtype = band; 1269 rtlhal->current_bandtype = band;
1279 if (IS_92D_SINGLEPHY(rtlhal->version)) 1270 if (IS_92D_SINGLEPHY(rtlhal->version))
@@ -1283,13 +1274,13 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band)
1283 /* reconfig BB/RF according to wireless mode */ 1274 /* reconfig BB/RF according to wireless mode */
1284 if (rtlhal->current_bandtype == BAND_ON_2_4G) { 1275 if (rtlhal->current_bandtype == BAND_ON_2_4G) {
1285 /* BB & RF Config */ 1276 /* BB & RF Config */
1286 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, ("====>2.4G\n")); 1277 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "====>2.4G\n");
1287 if (rtlhal->interfaceindex == 1) 1278 if (rtlhal->interfaceindex == 1)
1288 _rtl92d_phy_config_bb_with_headerfile(hw, 1279 _rtl92d_phy_config_bb_with_headerfile(hw,
1289 BASEBAND_CONFIG_AGC_TAB); 1280 BASEBAND_CONFIG_AGC_TAB);
1290 } else { 1281 } else {
1291 /* 5G band */ 1282 /* 5G band */
1292 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, ("====>5G\n")); 1283 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "====>5G\n");
1293 if (rtlhal->interfaceindex == 1) 1284 if (rtlhal->interfaceindex == 1)
1294 _rtl92d_phy_config_bb_with_headerfile(hw, 1285 _rtl92d_phy_config_bb_with_headerfile(hw,
1295 BASEBAND_CONFIG_AGC_TAB); 1286 BASEBAND_CONFIG_AGC_TAB);
@@ -1317,7 +1308,7 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band)
1317 0 ? REG_MAC0 : REG_MAC1), value8); 1308 0 ? REG_MAC0 : REG_MAC1), value8);
1318 } 1309 }
1319 mdelay(1); 1310 mdelay(1);
1320 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("<==Switch Band OK.\n")); 1311 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "<==Switch Band OK\n");
1321} 1312}
1322 1313
1323static void _rtl92d_phy_reload_imr_setting(struct ieee80211_hw *hw, 1314static void _rtl92d_phy_reload_imr_setting(struct ieee80211_hw *hw,
@@ -1329,9 +1320,9 @@ static void _rtl92d_phy_reload_imr_setting(struct ieee80211_hw *hw,
1329 u8 group, i; 1320 u8 group, i;
1330 unsigned long flag = 0; 1321 unsigned long flag = 0;
1331 1322
1332 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("====>path %d\n", rfpath)); 1323 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "====>path %d\n", rfpath);
1333 if (rtlpriv->rtlhal.current_bandtype == BAND_ON_5G) { 1324 if (rtlpriv->rtlhal.current_bandtype == BAND_ON_5G) {
1334 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("====>5G\n")); 1325 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "====>5G\n");
1335 rtl_set_bbreg(hw, RFPGA0_RFMOD, BIT(25) | BIT(24), 0); 1326 rtl_set_bbreg(hw, RFPGA0_RFMOD, BIT(25) | BIT(24), 0);
1336 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER4, 0x00f00000, 0xf); 1327 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER4, 0x00f00000, 0xf);
1337 /* fc area 0xd2c */ 1328 /* fc area 0xd2c */
@@ -1353,14 +1344,13 @@ static void _rtl92d_phy_reload_imr_setting(struct ieee80211_hw *hw,
1353 } else { 1344 } else {
1354 /* G band. */ 1345 /* G band. */
1355 RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD, 1346 RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD,
1356 ("Load RF IMR parameters for G band. IMR already " 1347 "Load RF IMR parameters for G band. IMR already setting %d\n",
1357 "setting %d\n", 1348 rtlpriv->rtlhal.load_imrandiqk_setting_for2g);
1358 rtlpriv->rtlhal.load_imrandiqk_setting_for2g)); 1349 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "====>2.4G\n");
1359 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("====>2.4G\n"));
1360 if (!rtlpriv->rtlhal.load_imrandiqk_setting_for2g) { 1350 if (!rtlpriv->rtlhal.load_imrandiqk_setting_for2g) {
1361 RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD, 1351 RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD,
1362 ("Load RF IMR parameters " 1352 "Load RF IMR parameters for G band. %d\n",
1363 "for G band. %d\n", rfpath)); 1353 rfpath);
1364 rtl92d_acquire_cckandrw_pagea_ctl(hw, &flag); 1354 rtl92d_acquire_cckandrw_pagea_ctl(hw, &flag);
1365 rtl_set_bbreg(hw, RFPGA0_RFMOD, BIT(25) | BIT(24), 0); 1355 rtl_set_bbreg(hw, RFPGA0_RFMOD, BIT(25) | BIT(24), 0);
1366 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER4, 1356 rtl_set_bbreg(hw, RFPGA0_ANALOGPARAMETER4,
@@ -1378,7 +1368,7 @@ static void _rtl92d_phy_reload_imr_setting(struct ieee80211_hw *hw,
1378 rtl92d_release_cckandrw_pagea_ctl(hw, &flag); 1368 rtl92d_release_cckandrw_pagea_ctl(hw, &flag);
1379 } 1369 }
1380 } 1370 }
1381 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("<====\n")); 1371 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "<====\n");
1382} 1372}
1383 1373
1384static void _rtl92d_phy_enable_rf_env(struct ieee80211_hw *hw, 1374static void _rtl92d_phy_enable_rf_env(struct ieee80211_hw *hw,
@@ -1388,7 +1378,7 @@ static void _rtl92d_phy_enable_rf_env(struct ieee80211_hw *hw,
1388 struct rtl_phy *rtlphy = &(rtlpriv->phy); 1378 struct rtl_phy *rtlphy = &(rtlpriv->phy);
1389 struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath]; 1379 struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
1390 1380
1391 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("====>\n")); 1381 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "====>\n");
1392 /*----Store original RFENV control type----*/ 1382 /*----Store original RFENV control type----*/
1393 switch (rfpath) { 1383 switch (rfpath) {
1394 case RF90_PATH_A: 1384 case RF90_PATH_A:
@@ -1414,7 +1404,7 @@ static void _rtl92d_phy_enable_rf_env(struct ieee80211_hw *hw,
1414 /*Set 0 to 12 bits for 8255 */ 1404 /*Set 0 to 12 bits for 8255 */
1415 rtl_set_bbreg(hw, pphyreg->rfhssi_para2, B3WIREDATALENGTH, 0x0); 1405 rtl_set_bbreg(hw, pphyreg->rfhssi_para2, B3WIREDATALENGTH, 0x0);
1416 udelay(1); 1406 udelay(1);
1417 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("<====\n")); 1407 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "<====\n");
1418} 1408}
1419 1409
1420static void _rtl92d_phy_restore_rf_env(struct ieee80211_hw *hw, u8 rfpath, 1410static void _rtl92d_phy_restore_rf_env(struct ieee80211_hw *hw, u8 rfpath,
@@ -1424,7 +1414,7 @@ static void _rtl92d_phy_restore_rf_env(struct ieee80211_hw *hw, u8 rfpath,
1424 struct rtl_phy *rtlphy = &(rtlpriv->phy); 1414 struct rtl_phy *rtlphy = &(rtlpriv->phy);
1425 struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath]; 1415 struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
1426 1416
1427 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("=====>\n")); 1417 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "=====>\n");
1428 /*----Restore RFENV control type----*/ ; 1418 /*----Restore RFENV control type----*/ ;
1429 switch (rfpath) { 1419 switch (rfpath) {
1430 case RF90_PATH_A: 1420 case RF90_PATH_A:
@@ -1437,7 +1427,7 @@ static void _rtl92d_phy_restore_rf_env(struct ieee80211_hw *hw, u8 rfpath,
1437 *pu4_regval); 1427 *pu4_regval);
1438 break; 1428 break;
1439 } 1429 }
1440 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("<=====\n")); 1430 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "<=====\n");
1441} 1431}
1442 1432
1443static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel) 1433static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
@@ -1451,10 +1441,10 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
1451 bool need_pwr_down = false, internal_pa = false; 1441 bool need_pwr_down = false, internal_pa = false;
1452 u32 u4regvalue, mask = 0x1C000, value = 0, u4tmp, u4tmp2; 1442 u32 u4regvalue, mask = 0x1C000, value = 0, u4tmp, u4tmp2;
1453 1443
1454 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("====>\n")); 1444 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "====>\n");
1455 /* config path A for 5G */ 1445 /* config path A for 5G */
1456 if (rtlhal->current_bandtype == BAND_ON_5G) { 1446 if (rtlhal->current_bandtype == BAND_ON_5G) {
1457 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("====>5G\n")); 1447 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "====>5G\n");
1458 u4tmp = curveindex_5g[channel - 1]; 1448 u4tmp = curveindex_5g[channel - 1];
1459 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("ver 1 set RF-A, 5G, " 1449 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("ver 1 set RF-A, 5G, "
1460 "0x28 = 0x%x !!\n", u4tmp)); 1450 "0x28 = 0x%x !!\n", u4tmp));
@@ -1503,12 +1493,13 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
1503 rf_reg_pram_c_5g[index][i]); 1493 rf_reg_pram_c_5g[index][i]);
1504 } 1494 }
1505 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 1495 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
1506 ("offset 0x%x value 0x%x " 1496 "offset 0x%x value 0x%x path %d index %d readback 0x%x\n",
1507 "path %d index %d readback 0x%x\n", 1497 rf_reg_for_c_cut_5g[i],
1508 rf_reg_for_c_cut_5g[i], 1498 rf_reg_pram_c_5g[index][i],
1509 rf_reg_pram_c_5g[index][i], path, 1499 path, index,
1510 index, rtl_get_rfreg(hw, (enum radio_path)path, 1500 rtl_get_rfreg(hw, (enum radio_path)path,
1511 rf_reg_for_c_cut_5g[i], BRFREGOFFSETMASK))); 1501 rf_reg_for_c_cut_5g[i],
1502 BRFREGOFFSETMASK));
1512 } 1503 }
1513 if (need_pwr_down) 1504 if (need_pwr_down)
1514 _rtl92d_phy_restore_rf_env(hw, path, &u4regvalue); 1505 _rtl92d_phy_restore_rf_env(hw, path, &u4regvalue);
@@ -1541,11 +1532,10 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
1541 BRFREGOFFSETMASK, 1532 BRFREGOFFSETMASK,
1542 rf_pram_c_5g_int_pa[index][i]); 1533 rf_pram_c_5g_int_pa[index][i]);
1543 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, 1534 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD,
1544 ("offset 0x%x value 0x%x " 1535 "offset 0x%x value 0x%x path %d index %d\n",
1545 "path %d index %d\n",
1546 rf_for_c_cut_5g_internal_pa[i], 1536 rf_for_c_cut_5g_internal_pa[i],
1547 rf_pram_c_5g_int_pa[index][i], 1537 rf_pram_c_5g_int_pa[index][i],
1548 rfpath, index)); 1538 rfpath, index);
1549 } 1539 }
1550 } else { 1540 } else {
1551 rtl_set_rfreg(hw, (enum radio_path)rfpath, 0x0B, 1541 rtl_set_rfreg(hw, (enum radio_path)rfpath, 0x0B,
@@ -1553,7 +1543,7 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
1553 } 1543 }
1554 } 1544 }
1555 } else if (rtlhal->current_bandtype == BAND_ON_2_4G) { 1545 } else if (rtlhal->current_bandtype == BAND_ON_2_4G) {
1556 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("====>2.4G\n")); 1546 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "====>2.4G\n");
1557 u4tmp = curveindex_2g[channel - 1]; 1547 u4tmp = curveindex_2g[channel - 1];
1558 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("ver 3 set RF-B, 2G, " 1548 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("ver 3 set RF-B, 2G, "
1559 "0x28 = 0x%x !!\n", u4tmp)); 1549 "0x28 = 0x%x !!\n", u4tmp));
@@ -1590,14 +1580,13 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
1590 rf_reg_param_for_c_cut_2g 1580 rf_reg_param_for_c_cut_2g
1591 [index][i]); 1581 [index][i]);
1592 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 1582 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
1593 ("offset 0x%x value 0x%x mak 0x%x path %d " 1583 "offset 0x%x value 0x%x mak 0x%x path %d index %d readback 0x%x\n",
1594 "index %d readback 0x%x\n", 1584 rf_reg_for_c_cut_2g[i],
1595 rf_reg_for_c_cut_2g[i], 1585 rf_reg_param_for_c_cut_2g[index][i],
1596 rf_reg_param_for_c_cut_2g[index][i], 1586 rf_reg_mask_for_c_cut_2g[i], path, index,
1597 rf_reg_mask_for_c_cut_2g[i], path, index, 1587 rtl_get_rfreg(hw, (enum radio_path)path,
1598 rtl_get_rfreg(hw, (enum radio_path)path, 1588 rf_reg_for_c_cut_2g[i],
1599 rf_reg_for_c_cut_2g[i], 1589 BRFREGOFFSETMASK));
1600 BRFREGOFFSETMASK)));
1601 } 1590 }
1602 RTPRINT(rtlpriv, FINIT, INIT_IQK, 1591 RTPRINT(rtlpriv, FINIT, INIT_IQK,
1603 ("cosa ver 3 set RF-B, 2G, 0x28 = 0x%x !!\n", 1592 ("cosa ver 3 set RF-B, 2G, 0x28 = 0x%x !!\n",
@@ -1611,7 +1600,7 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel)
1611 if (rtlhal->during_mac0init_radiob) 1600 if (rtlhal->during_mac0init_radiob)
1612 rtl92d_phy_powerdown_anotherphy(hw, true); 1601 rtl92d_phy_powerdown_anotherphy(hw, true);
1613 } 1602 }
1614 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("<====\n")); 1603 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "<====\n");
1615} 1604}
1616 1605
1617u8 rtl92d_get_rightchnlplace_for_iqk(u8 chnl) 1606u8 rtl92d_get_rightchnlplace_for_iqk(u8 chnl)
@@ -2618,7 +2607,7 @@ void rtl92d_phy_iq_calibrate(struct ieee80211_hw *hw)
2618 true; 2607 true;
2619 2608
2620 RT_TRACE(rtlpriv, COMP_SCAN | COMP_MLME, DBG_LOUD, 2609 RT_TRACE(rtlpriv, COMP_SCAN | COMP_MLME, DBG_LOUD,
2621 ("\nIQK OK indexforchannel %d.\n", indexforchannel)); 2610 "IQK OK indexforchannel %d\n", indexforchannel);
2622 } 2611 }
2623} 2612}
2624 2613
@@ -2629,17 +2618,17 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)
2629 struct rtl_hal *rtlhal = &(rtlpriv->rtlhal); 2618 struct rtl_hal *rtlhal = &(rtlpriv->rtlhal);
2630 u8 indexforchannel; 2619 u8 indexforchannel;
2631 2620
2632 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("channel %d\n", channel)); 2621 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "channel %d\n", channel);
2633 /*------Do IQK for normal chip and test chip 5G band------- */ 2622 /*------Do IQK for normal chip and test chip 5G band------- */
2634 indexforchannel = rtl92d_get_rightchnlplace_for_iqk(channel); 2623 indexforchannel = rtl92d_get_rightchnlplace_for_iqk(channel);
2635 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 2624 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "indexforchannel %d done %d\n",
2636 ("indexforchannel %d done %d\n", indexforchannel, 2625 indexforchannel,
2637 rtlphy->iqk_matrix_regsetting[indexforchannel].iqk_done)); 2626 rtlphy->iqk_matrix_regsetting[indexforchannel].iqk_done);
2638 if (0 && !rtlphy->iqk_matrix_regsetting[indexforchannel].iqk_done && 2627 if (0 && !rtlphy->iqk_matrix_regsetting[indexforchannel].iqk_done &&
2639 rtlphy->need_iqk) { 2628 rtlphy->need_iqk) {
2640 /* Re Do IQK. */ 2629 /* Re Do IQK. */
2641 RT_TRACE(rtlpriv, COMP_SCAN | COMP_INIT, DBG_LOUD, 2630 RT_TRACE(rtlpriv, COMP_SCAN | COMP_INIT, DBG_LOUD,
2642 ("Do IQK Matrix reg for channel:%d....\n", channel)); 2631 "Do IQK Matrix reg for channel:%d....\n", channel);
2643 rtl92d_phy_iq_calibrate(hw); 2632 rtl92d_phy_iq_calibrate(hw);
2644 } else { 2633 } else {
2645 /* Just load the value. */ 2634 /* Just load the value. */
@@ -2647,8 +2636,8 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)
2647 if (((!rtlhal->load_imrandiqk_setting_for2g) && 2636 if (((!rtlhal->load_imrandiqk_setting_for2g) &&
2648 indexforchannel == 0) || indexforchannel > 0) { 2637 indexforchannel == 0) || indexforchannel > 0) {
2649 RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD, 2638 RT_TRACE(rtlpriv, COMP_SCAN, DBG_LOUD,
2650 ("Just Read IQK Matrix reg for channel:%d" 2639 "Just Read IQK Matrix reg for channel:%d....\n",
2651 "....\n", channel)); 2640 channel);
2652 if ((rtlphy->iqk_matrix_regsetting[indexforchannel]. 2641 if ((rtlphy->iqk_matrix_regsetting[indexforchannel].
2653 value[0] != NULL) 2642 value[0] != NULL)
2654 /*&&(regea4 != 0) */) 2643 /*&&(regea4 != 0) */)
@@ -2672,7 +2661,7 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel)
2672 } 2661 }
2673 } 2662 }
2674 rtlphy->need_iqk = false; 2663 rtlphy->need_iqk = false;
2675 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("<====\n")); 2664 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "<====\n");
2676} 2665}
2677 2666
2678static u32 _rtl92d_phy_get_abs(u32 val1, u32 val2) 2667static u32 _rtl92d_phy_get_abs(u32 val1, u32 val2)
@@ -2743,7 +2732,7 @@ static void _rtl92d_phy_reload_lck_setting(struct ieee80211_hw *hw,
2743 u32 u4tmp = 0, u4regvalue = 0; 2732 u32 u4tmp = 0, u4regvalue = 0;
2744 bool bneed_powerdown_radio = false; 2733 bool bneed_powerdown_radio = false;
2745 2734
2746 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("path %d\n", erfpath)); 2735 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "path %d\n", erfpath);
2747 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("band type = %d\n", 2736 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("band type = %d\n",
2748 rtlpriv->rtlhal.current_bandtype)); 2737 rtlpriv->rtlhal.current_bandtype));
2749 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("channel = %d\n", channel)); 2738 RTPRINT(rtlpriv, FINIT, INIT_IQK, ("channel = %d\n", channel));
@@ -2788,7 +2777,7 @@ static void _rtl92d_phy_reload_lck_setting(struct ieee80211_hw *hw,
2788 if (rtlpriv->rtlhal.during_mac0init_radiob) 2777 if (rtlpriv->rtlhal.during_mac0init_radiob)
2789 rtl92d_phy_powerdown_anotherphy(hw, true); 2778 rtl92d_phy_powerdown_anotherphy(hw, true);
2790 } 2779 }
2791 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("<====\n")); 2780 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "<====\n");
2792} 2781}
2793 2782
2794static void _rtl92d_phy_lc_calibrate_sw(struct ieee80211_hw *hw, bool is2t) 2783static void _rtl92d_phy_lc_calibrate_sw(struct ieee80211_hw *hw, bool is2t)
@@ -2962,10 +2951,10 @@ void rtl92d_phy_reset_iqk_result(struct ieee80211_hw *hw)
2962 u8 i; 2951 u8 i;
2963 2952
2964 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 2953 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
2965 ("settings regs %d default regs %d\n", 2954 "settings regs %d default regs %d\n",
2966 (int)(sizeof(rtlphy->iqk_matrix_regsetting) / 2955 (int)(sizeof(rtlphy->iqk_matrix_regsetting) /
2967 sizeof(struct iqk_matrix_regs)), 2956 sizeof(struct iqk_matrix_regs)),
2968 IQK_MATRIX_REG_NUM)); 2957 IQK_MATRIX_REG_NUM);
2969 /* 0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc */ 2958 /* 0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc */
2970 for (i = 0; i < IQK_MATRIX_SETTINGS_NUM; i++) { 2959 for (i = 0; i < IQK_MATRIX_SETTINGS_NUM; i++) {
2971 rtlphy->iqk_matrix_regsetting[i].value[0][0] = 0x100; 2960 rtlphy->iqk_matrix_regsetting[i].value[0][0] = 0x100;
@@ -3084,7 +3073,7 @@ static bool _rtl92d_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
3084 break; 3073 break;
3085 default: 3074 default:
3086 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 3075 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
3087 ("switch case not process\n")); 3076 "switch case not processed\n");
3088 break; 3077 break;
3089 } 3078 }
3090 break; 3079 break;
@@ -3111,7 +3100,7 @@ u8 rtl92d_phy_sw_chnl(struct ieee80211_hw *hw)
3111 3100
3112 if ((is_hal_stop(rtlhal)) || (RT_CANNOT_IO(hw))) { 3101 if ((is_hal_stop(rtlhal)) || (RT_CANNOT_IO(hw))) {
3113 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD, 3102 RT_TRACE(rtlpriv, COMP_CHAN, DBG_LOUD,
3114 ("sw_chnl_inprogress false driver sleep or unload\n")); 3103 "sw_chnl_inprogress false driver sleep or unload\n");
3115 return 0; 3104 return 0;
3116 } 3105 }
3117 while (rtlphy->lck_inprogress && timecount < timeout) { 3106 while (rtlphy->lck_inprogress && timecount < timeout) {
@@ -3154,7 +3143,7 @@ u8 rtl92d_phy_sw_chnl(struct ieee80211_hw *hw)
3154 rtlphy->sw_chnl_stage = 0; 3143 rtlphy->sw_chnl_stage = 0;
3155 rtlphy->sw_chnl_step = 0; 3144 rtlphy->sw_chnl_step = 0;
3156 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 3145 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE,
3157 ("switch to channel%d\n", rtlphy->current_channel)); 3146 "switch to channel%d\n", rtlphy->current_channel);
3158 3147
3159 do { 3148 do {
3160 if (!rtlphy->sw_chnl_inprogress) 3149 if (!rtlphy->sw_chnl_inprogress)
@@ -3171,7 +3160,7 @@ u8 rtl92d_phy_sw_chnl(struct ieee80211_hw *hw)
3171 } 3160 }
3172 break; 3161 break;
3173 } while (true); 3162 } while (true);
3174 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 3163 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
3175 rtlphy->sw_chnl_inprogress = false; 3164 rtlphy->sw_chnl_inprogress = false;
3176 return 1; 3165 return 1;
3177} 3166}
@@ -3182,8 +3171,8 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw)
3182 struct rtl_phy *rtlphy = &(rtlpriv->phy); 3171 struct rtl_phy *rtlphy = &(rtlpriv->phy);
3183 3172
3184 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 3173 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
3185 ("--->Cmd(%#x), set_io_inprogress(%d)\n", 3174 "--->Cmd(%#x), set_io_inprogress(%d)\n",
3186 rtlphy->current_io_type, rtlphy->set_io_inprogress)); 3175 rtlphy->current_io_type, rtlphy->set_io_inprogress);
3187 switch (rtlphy->current_io_type) { 3176 switch (rtlphy->current_io_type) {
3188 case IO_CMD_RESUME_DM_BY_SCAN: 3177 case IO_CMD_RESUME_DM_BY_SCAN:
3189 de_digtable.cur_igvalue = rtlphy->initgain_backup.xaagccore1; 3178 de_digtable.cur_igvalue = rtlphy->initgain_backup.xaagccore1;
@@ -3197,12 +3186,12 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw)
3197 break; 3186 break;
3198 default: 3187 default:
3199 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 3188 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
3200 ("switch case not process\n")); 3189 "switch case not processed\n");
3201 break; 3190 break;
3202 } 3191 }
3203 rtlphy->set_io_inprogress = false; 3192 rtlphy->set_io_inprogress = false;
3204 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 3193 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, "<---(%#x)\n",
3205 ("<---(%#x)\n", rtlphy->current_io_type)); 3194 rtlphy->current_io_type);
3206} 3195}
3207 3196
3208bool rtl92d_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype) 3197bool rtl92d_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
@@ -3212,23 +3201,23 @@ bool rtl92d_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
3212 bool postprocessing = false; 3201 bool postprocessing = false;
3213 3202
3214 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 3203 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
3215 ("-->IO Cmd(%#x), set_io_inprogress(%d)\n", 3204 "-->IO Cmd(%#x), set_io_inprogress(%d)\n",
3216 iotype, rtlphy->set_io_inprogress)); 3205 iotype, rtlphy->set_io_inprogress);
3217 do { 3206 do {
3218 switch (iotype) { 3207 switch (iotype) {
3219 case IO_CMD_RESUME_DM_BY_SCAN: 3208 case IO_CMD_RESUME_DM_BY_SCAN:
3220 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 3209 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
3221 ("[IO CMD] Resume DM after scan.\n")); 3210 "[IO CMD] Resume DM after scan\n");
3222 postprocessing = true; 3211 postprocessing = true;
3223 break; 3212 break;
3224 case IO_CMD_PAUSE_DM_BY_SCAN: 3213 case IO_CMD_PAUSE_DM_BY_SCAN:
3225 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, 3214 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE,
3226 ("[IO CMD] Pause DM before scan.\n")); 3215 "[IO CMD] Pause DM before scan\n");
3227 postprocessing = true; 3216 postprocessing = true;
3228 break; 3217 break;
3229 default: 3218 default:
3230 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 3219 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
3231 ("switch case not process\n")); 3220 "switch case not processed\n");
3232 break; 3221 break;
3233 } 3222 }
3234 } while (false); 3223 } while (false);
@@ -3239,7 +3228,7 @@ bool rtl92d_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
3239 return false; 3228 return false;
3240 } 3229 }
3241 rtl92d_phy_set_io(hw); 3230 rtl92d_phy_set_io(hw);
3242 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, ("<--IO Type(%#x)\n", iotype)); 3231 RT_TRACE(rtlpriv, COMP_CMD, DBG_TRACE, "<--IO Type(%#x)\n", iotype);
3243 return true; 3232 return true;
3244} 3233}
3245 3234
@@ -3297,7 +3286,7 @@ static void _rtl92d_phy_set_rfsleep(struct ieee80211_hw *hw)
3297 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); 3286 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3);
3298 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00); 3287 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00);
3299 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 3288 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
3300 ("Fail !!! Switch RF timeout.\n")); 3289 "Fail !!! Switch RF timeout\n");
3301 return; 3290 return;
3302 } 3291 }
3303 /* e. For PCIE: SYS_FUNC_EN 0x02[7:0] = 0xE2 reset BB TRX function */ 3292 /* e. For PCIE: SYS_FUNC_EN 0x02[7:0] = 0xE2 reset BB TRX function */
@@ -3332,7 +3321,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
3332 do { 3321 do {
3333 InitializeCount++; 3322 InitializeCount++;
3334 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 3323 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
3335 ("IPS Set eRf nic enable\n")); 3324 "IPS Set eRf nic enable\n");
3336 rtstatus = rtl_ps_enable_nic(hw); 3325 rtstatus = rtl_ps_enable_nic(hw);
3337 } while ((rtstatus != true) && 3326 } while ((rtstatus != true) &&
3338 (InitializeCount < 10)); 3327 (InitializeCount < 10));
@@ -3341,11 +3330,10 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
3341 RT_RF_OFF_LEVL_HALT_NIC); 3330 RT_RF_OFF_LEVL_HALT_NIC);
3342 } else { 3331 } else {
3343 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 3332 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
3344 ("awake, sleeped:%d ms state_" 3333 "awake, sleeped:%d ms state_inap:%x\n",
3345 "inap:%x\n",
3346 jiffies_to_msecs(jiffies - 3334 jiffies_to_msecs(jiffies -
3347 ppsc->last_sleep_jiffies), 3335 ppsc->last_sleep_jiffies),
3348 rtlpriv->psc.state_inap)); 3336 rtlpriv->psc.state_inap);
3349 ppsc->last_awake_jiffies = jiffies; 3337 ppsc->last_awake_jiffies = jiffies;
3350 _rtl92d_phy_set_rfon(hw); 3338 _rtl92d_phy_set_rfon(hw);
3351 } 3339 }
@@ -3360,7 +3348,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
3360 case ERFOFF: 3348 case ERFOFF:
3361 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) { 3349 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) {
3362 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 3350 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
3363 ("IPS Set eRf nic disable\n")); 3351 "IPS Set eRf nic disable\n");
3364 rtl_ps_disable_nic(hw); 3352 rtl_ps_disable_nic(hw);
3365 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC); 3353 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC);
3366 } else { 3354 } else {
@@ -3385,41 +3373,40 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
3385 continue; 3373 continue;
3386 } else if (rtlpci->pdev->current_state != PCI_D0) { 3374 } else if (rtlpci->pdev->current_state != PCI_D0) {
3387 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 3375 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
3388 ("eRf Off/Sleep: %d times TcbBusyQueu" 3376 "eRf Off/Sleep: %d times TcbBusyQueue[%d] !=0 but lower power state!\n",
3389 "e[%d] !=0 but lower power state!\n", 3377 i + 1, queue_id);
3390 (i + 1), queue_id));
3391 break; 3378 break;
3392 } else { 3379 } else {
3393 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 3380 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
3394 ("eRf Off/Sleep: %d times TcbBusyQueu" 3381 "eRf Off/Sleep: %d times TcbBusyQueue[%d] =%d before doze!\n",
3395 "e[%d] =%d " 3382 i + 1, queue_id,
3396 "before doze!\n", (i + 1), queue_id, 3383 skb_queue_len(&ring->queue));
3397 skb_queue_len(&ring->queue)));
3398 udelay(10); 3384 udelay(10);
3399 i++; 3385 i++;
3400 } 3386 }
3401 3387
3402 if (i >= MAX_DOZE_WAITING_TIMES_9x) { 3388 if (i >= MAX_DOZE_WAITING_TIMES_9x) {
3403 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 3389 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
3404 ("\nERFOFF: %d times TcbBusyQueue[%d] " 3390 "ERFOFF: %d times TcbBusyQueue[%d] = %d !\n",
3405 "= %d !\n", 3391 MAX_DOZE_WAITING_TIMES_9x, queue_id,
3406 MAX_DOZE_WAITING_TIMES_9x, queue_id, 3392 skb_queue_len(&ring->queue));
3407 skb_queue_len(&ring->queue)));
3408 break; 3393 break;
3409 } 3394 }
3410 } 3395 }
3411 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 3396 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
3412 ("Set rfsleep awaked:%d ms\n", 3397 "Set rfsleep awaked:%d ms\n",
3413 jiffies_to_msecs(jiffies - ppsc->last_awake_jiffies))); 3398 jiffies_to_msecs(jiffies - ppsc->last_awake_jiffies));
3414 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, ("sleep awaked:%d ms " 3399 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
3415 "state_inap:%x\n", jiffies_to_msecs(jiffies - 3400 "sleep awaked:%d ms state_inap:%x\n",
3416 ppsc->last_awake_jiffies), rtlpriv->psc.state_inap)); 3401 jiffies_to_msecs(jiffies -
3402 ppsc->last_awake_jiffies),
3403 rtlpriv->psc.state_inap);
3417 ppsc->last_sleep_jiffies = jiffies; 3404 ppsc->last_sleep_jiffies = jiffies;
3418 _rtl92d_phy_set_rfsleep(hw); 3405 _rtl92d_phy_set_rfsleep(hw);
3419 break; 3406 break;
3420 default: 3407 default:
3421 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 3408 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
3422 ("switch case not process\n")); 3409 "switch case not processed\n");
3423 bresult = false; 3410 bresult = false;
3424 break; 3411 break;
3425 } 3412 }
@@ -3437,17 +3424,17 @@ void rtl92d_phy_config_macphymode(struct ieee80211_hw *hw)
3437 switch (rtlhal->macphymode) { 3424 switch (rtlhal->macphymode) {
3438 case DUALMAC_DUALPHY: 3425 case DUALMAC_DUALPHY:
3439 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 3426 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
3440 ("MacPhyMode: DUALMAC_DUALPHY\n")); 3427 "MacPhyMode: DUALMAC_DUALPHY\n");
3441 rtl_write_byte(rtlpriv, offset, 0xF3); 3428 rtl_write_byte(rtlpriv, offset, 0xF3);
3442 break; 3429 break;
3443 case SINGLEMAC_SINGLEPHY: 3430 case SINGLEMAC_SINGLEPHY:
3444 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 3431 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
3445 ("MacPhyMode: SINGLEMAC_SINGLEPHY\n")); 3432 "MacPhyMode: SINGLEMAC_SINGLEPHY\n");
3446 rtl_write_byte(rtlpriv, offset, 0xF4); 3433 rtl_write_byte(rtlpriv, offset, 0xF4);
3447 break; 3434 break;
3448 case DUALMAC_SINGLEPHY: 3435 case DUALMAC_SINGLEPHY:
3449 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 3436 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
3450 ("MacPhyMode: DUALMAC_SINGLEPHY\n")); 3437 "MacPhyMode: DUALMAC_SINGLEPHY\n");
3451 rtl_write_byte(rtlpriv, offset, 0xF1); 3438 rtl_write_byte(rtlpriv, offset, 0xF1);
3452 break; 3439 break;
3453 } 3440 }
@@ -3615,7 +3602,7 @@ void rtl92d_update_bbrf_configuration(struct ieee80211_hw *hw)
3615 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 3602 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
3616 u8 rfpath, i; 3603 u8 rfpath, i;
3617 3604
3618 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("==>\n")); 3605 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "==>\n");
3619 /* r_select_5G for path_A/B 0 for 2.4G, 1 for 5G */ 3606 /* r_select_5G for path_A/B 0 for 2.4G, 1 for 5G */
3620 if (rtlhal->current_bandtype == BAND_ON_2_4G) { 3607 if (rtlhal->current_bandtype == BAND_ON_2_4G) {
3621 /* r_select_5G for path_A/B,0x878 */ 3608 /* r_select_5G for path_A/B,0x878 */
@@ -3764,7 +3751,7 @@ void rtl92d_update_bbrf_configuration(struct ieee80211_hw *hw)
3764 } else { 3751 } else {
3765 rtl92d_phy_enable_anotherphy(hw, false); 3752 rtl92d_phy_enable_anotherphy(hw, false);
3766 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 3753 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
3767 ("MAC1 use DBI to update 0x888")); 3754 "MAC1 use DBI to update 0x888\n");
3768 /* 0x888 */ 3755 /* 0x888 */
3769 rtl92de_write_dword_dbi(hw, RFPGA0_ADDALLOCKEN, 3756 rtl92de_write_dword_dbi(hw, RFPGA0_ADDALLOCKEN,
3770 rtl92de_read_dword_dbi(hw, 3757 rtl92de_read_dword_dbi(hw,
@@ -3789,9 +3776,9 @@ void rtl92d_update_bbrf_configuration(struct ieee80211_hw *hw)
3789 BRFREGOFFSETMASK); 3776 BRFREGOFFSETMASK);
3790 } 3777 }
3791 for (i = 0; i < 2; i++) 3778 for (i = 0; i < 2; i++)
3792 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("RF 0x18 = 0x%x\n", 3779 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "RF 0x18 = 0x%x\n",
3793 rtlphy->rfreg_chnlval[i])); 3780 rtlphy->rfreg_chnlval[i]);
3794 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("<==\n")); 3781 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "<==\n");
3795 3782
3796} 3783}
3797 3784
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/rf.c b/drivers/net/wireless/rtlwifi/rtl8192de/rf.c
index db27cebaac2c..3bf21c2cf085 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/rf.c
@@ -50,8 +50,8 @@ void rtl92d_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
50 BIT(11), 0x01); 50 BIT(11), 0x01);
51 51
52 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, 52 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD,
53 ("20M RF 0x18 = 0x%x\n", 53 "20M RF 0x18 = 0x%x\n",
54 rtlphy->rfreg_chnlval[rfpath])); 54 rtlphy->rfreg_chnlval[rfpath]);
55 } 55 }
56 56
57 break; 57 break;
@@ -62,13 +62,13 @@ void rtl92d_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
62 rtl_set_rfreg(hw, rfpath, RF_CHNLBW, BIT(10) | BIT(11), 62 rtl_set_rfreg(hw, rfpath, RF_CHNLBW, BIT(10) | BIT(11),
63 0x00); 63 0x00);
64 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, 64 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD,
65 ("40M RF 0x18 = 0x%x\n", 65 "40M RF 0x18 = 0x%x\n",
66 rtlphy->rfreg_chnlval[rfpath])); 66 rtlphy->rfreg_chnlval[rfpath]);
67 } 67 }
68 break; 68 break;
69 default: 69 default:
70 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 70 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
71 ("unknown bandwidth: %#X\n", bandwidth)); 71 "unknown bandwidth: %#X\n", bandwidth);
72 break; 72 break;
73 } 73 }
74} 74}
@@ -423,11 +423,11 @@ bool rtl92d_phy_enable_anotherphy(struct ieee80211_hw *hw, bool bmac0)
423 423
424 rtlhal->during_mac0init_radiob = false; 424 rtlhal->during_mac0init_radiob = false;
425 rtlhal->during_mac1init_radioa = false; 425 rtlhal->during_mac1init_radioa = false;
426 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("===>\n")); 426 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "===>\n");
427 /* MAC0 Need PHY1 load radio_b.txt . Driver use DBI to write. */ 427 /* MAC0 Need PHY1 load radio_b.txt . Driver use DBI to write. */
428 u1btmp = rtl_read_byte(rtlpriv, mac_reg); 428 u1btmp = rtl_read_byte(rtlpriv, mac_reg);
429 if (!(u1btmp & mac_on_bit)) { 429 if (!(u1btmp & mac_on_bit)) {
430 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("enable BB & RF\n")); 430 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "enable BB & RF\n");
431 /* Enable BB and RF power */ 431 /* Enable BB and RF power */
432 rtl92de_write_dword_dbi(hw, REG_SYS_ISO_CTRL, 432 rtl92de_write_dword_dbi(hw, REG_SYS_ISO_CTRL,
433 rtl92de_read_dword_dbi(hw, REG_SYS_ISO_CTRL, direct) | 433 rtl92de_read_dword_dbi(hw, REG_SYS_ISO_CTRL, direct) |
@@ -437,7 +437,7 @@ bool rtl92d_phy_enable_anotherphy(struct ieee80211_hw *hw, bool bmac0)
437 * and radio_b.txt has been load. */ 437 * and radio_b.txt has been load. */
438 bresult = false; 438 bresult = false;
439 } 439 }
440 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("<===\n")); 440 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "<===\n");
441 return bresult; 441 return bresult;
442 442
443} 443}
@@ -453,17 +453,17 @@ void rtl92d_phy_powerdown_anotherphy(struct ieee80211_hw *hw, bool bmac0)
453 453
454 rtlhal->during_mac0init_radiob = false; 454 rtlhal->during_mac0init_radiob = false;
455 rtlhal->during_mac1init_radioa = false; 455 rtlhal->during_mac1init_radioa = false;
456 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("====>\n")); 456 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "====>\n");
457 /* check MAC0 enable or not again now, if 457 /* check MAC0 enable or not again now, if
458 * enabled, not power down radio A. */ 458 * enabled, not power down radio A. */
459 u1btmp = rtl_read_byte(rtlpriv, mac_reg); 459 u1btmp = rtl_read_byte(rtlpriv, mac_reg);
460 if (!(u1btmp & mac_on_bit)) { 460 if (!(u1btmp & mac_on_bit)) {
461 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("power down\n")); 461 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "power down\n");
462 /* power down RF radio A according to YuNan's advice. */ 462 /* power down RF radio A according to YuNan's advice. */
463 rtl92de_write_dword_dbi(hw, RFPGA0_XA_LSSIPARAMETER, 463 rtl92de_write_dword_dbi(hw, RFPGA0_XA_LSSIPARAMETER,
464 0x00000000, direct); 464 0x00000000, direct);
465 } 465 }
466 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, ("<====\n")); 466 RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "<====\n");
467} 467}
468 468
469bool rtl92d_phy_rf6052_config(struct ieee80211_hw *hw) 469bool rtl92d_phy_rf6052_config(struct ieee80211_hw *hw)
@@ -606,7 +606,7 @@ bool rtl92d_phy_rf6052_config(struct ieee80211_hw *hw)
606 } 606 }
607 if (rtstatus != true) { 607 if (rtstatus != true) {
608 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 608 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
609 ("Radio[%d] Fail!!", rfpath)); 609 "Radio[%d] Fail!!", rfpath);
610 goto phy_rf_cfg_fail; 610 goto phy_rf_cfg_fail;
611 } 611 }
612 612
@@ -620,7 +620,7 @@ bool rtl92d_phy_rf6052_config(struct ieee80211_hw *hw)
620 rtl92d_phy_powerdown_anotherphy(hw, false); 620 rtl92d_phy_powerdown_anotherphy(hw, false);
621 else if (need_pwrdown_radiob) 621 else if (need_pwrdown_radiob)
622 rtl92d_phy_powerdown_anotherphy(hw, true); 622 rtl92d_phy_powerdown_anotherphy(hw, true);
623 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, ("<---\n")); 623 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "<---\n");
624 return rtstatus; 624 return rtstatus;
625 625
626phy_rf_cfg_fail: 626phy_rf_cfg_fail:
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
index 7911c9c87085..db7579684b11 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
@@ -174,7 +174,7 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw)
174 rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); 174 rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
175 if (!rtlpriv->rtlhal.pfirmware) { 175 if (!rtlpriv->rtlhal.pfirmware) {
176 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 176 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
177 ("Can't alloc buffer for fw.\n")); 177 "Can't alloc buffer for fw\n");
178 return 1; 178 return 1;
179 } 179 }
180 180
@@ -188,12 +188,12 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw)
188 rtlpriv->io.dev); 188 rtlpriv->io.dev);
189 if (err) { 189 if (err) {
190 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 190 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
191 ("Failed to request firmware!\n")); 191 "Failed to request firmware!\n");
192 return 1; 192 return 1;
193 } 193 }
194 if (firmware->size > 0x8000) { 194 if (firmware->size > 0x8000) {
195 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 195 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
196 ("Firmware is too big!\n")); 196 "Firmware is too big!\n");
197 release_firmware(firmware); 197 release_firmware(firmware);
198 return 1; 198 return 1;
199 } 199 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
index e84b8d5e4b1b..f6ec0a12884f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
@@ -602,8 +602,8 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
602 EM_HDR_LEN); 602 EM_HDR_LEN);
603 if (ptcb_desc->empkt_num) { 603 if (ptcb_desc->empkt_num) {
604 RT_TRACE(rtlpriv, COMP_SEND, DBG_LOUD, 604 RT_TRACE(rtlpriv, COMP_SEND, DBG_LOUD,
605 ("Insert 8 byte.pTcb->EMPktNum:%d\n", 605 "Insert 8 byte.pTcb->EMPktNum:%d\n",
606 ptcb_desc->empkt_num)); 606 ptcb_desc->empkt_num);
607 _rtl92de_insert_emcontent(ptcb_desc, 607 _rtl92de_insert_emcontent(ptcb_desc,
608 (u8 *)(skb->data)); 608 (u8 *)(skb->data));
609 } 609 }
@@ -700,7 +700,7 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
700 if (ieee80211_is_data_qos(fc)) { 700 if (ieee80211_is_data_qos(fc)) {
701 if (mac->rdg_en) { 701 if (mac->rdg_en) {
702 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, 702 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
703 ("Enable RDG function.\n")); 703 "Enable RDG function\n");
704 SET_TX_DESC_RDG_ENABLE(pdesc, 1); 704 SET_TX_DESC_RDG_ENABLE(pdesc, 1);
705 SET_TX_DESC_HTC(pdesc, 1); 705 SET_TX_DESC_HTC(pdesc, 1);
706 } 706 }
@@ -726,7 +726,7 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
726 SET_TX_DESC_PKT_ID(pdesc, 8); 726 SET_TX_DESC_PKT_ID(pdesc, 8);
727 } 727 }
728 SET_TX_DESC_MORE_FRAG(pdesc, (lastseg ? 0 : 1)); 728 SET_TX_DESC_MORE_FRAG(pdesc, (lastseg ? 0 : 1));
729 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, ("\n")); 729 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
730} 730}
731 731
732void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw, 732void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
index 4203a8531ca0..4a5e3a952a47 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
@@ -170,9 +170,9 @@ static void _rtl92s_dm_txpowertracking_callback_thermalmeter(
170 thermalvalue = (u8)rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0x1f); 170 thermalvalue = (u8)rtl_get_rfreg(hw, RF90_PATH_A, RF_T_METER, 0x1f);
171 171
172 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, 172 RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
173 ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x " 173 "Readback Thermal Meter = 0x%x pre thermal meter 0x%x eeprom_thermal meter 0x%x\n",
174 "eeprom_thermalmeter 0x%x\n", thermalvalue, 174 thermalvalue,
175 rtlpriv->dm.thermalvalue, rtlefuse->eeprom_thermalmeter)); 175 rtlpriv->dm.thermalvalue, rtlefuse->eeprom_thermalmeter);
176 176
177 if (thermalvalue) { 177 if (thermalvalue) {
178 rtlpriv->dm.thermalvalue = thermalvalue; 178 rtlpriv->dm.thermalvalue = thermalvalue;
@@ -282,11 +282,11 @@ static void _rtl92s_dm_refresh_rateadaptive_mask(struct ieee80211_hw *hw)
282 } 282 }
283 283
284 if (ra->pre_ratr_state != ra->ratr_state) { 284 if (ra->pre_ratr_state != ra->ratr_state) {
285 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, ("RSSI = %ld " 285 RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD,
286 "RSSI_LEVEL = %d PreState = %d, CurState = %d\n", 286 "RSSI = %ld RSSI_LEVEL = %d PreState = %d, CurState = %d\n",
287 rtlpriv->dm.undecorated_smoothed_pwdb, 287 rtlpriv->dm.undecorated_smoothed_pwdb,
288 ra->ratr_state, 288 ra->ratr_state,
289 ra->pre_ratr_state, ra->ratr_state)); 289 ra->pre_ratr_state, ra->ratr_state);
290 290
291 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 291 rtlpriv->cfg->ops->update_rate_tbl(hw, sta,
292 ra->ratr_state); 292 ra->ratr_state);
@@ -586,7 +586,7 @@ static void _rtl92s_dm_dynamic_txpower(struct ieee80211_hw *hw)
586 if ((mac->link_state < MAC80211_LINKED) && 586 if ((mac->link_state < MAC80211_LINKED) &&
587 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) { 587 (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb == 0)) {
588 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE, 588 RT_TRACE(rtlpriv, COMP_POWER, DBG_TRACE,
589 ("Not connected to any\n")); 589 "Not connected to any\n");
590 590
591 rtlpriv->dm.dynamic_txhighpower_lvl = TX_HIGHPWR_LEVEL_NORMAL; 591 rtlpriv->dm.dynamic_txhighpower_lvl = TX_HIGHPWR_LEVEL_NORMAL;
592 592
@@ -599,22 +599,22 @@ static void _rtl92s_dm_dynamic_txpower(struct ieee80211_hw *hw)
599 undecorated_smoothed_pwdb = 599 undecorated_smoothed_pwdb =
600 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 600 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
601 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 601 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
602 ("AP Client PWDB = 0x%lx\n", 602 "AP Client PWDB = 0x%lx\n",
603 undecorated_smoothed_pwdb)); 603 undecorated_smoothed_pwdb);
604 } else { 604 } else {
605 undecorated_smoothed_pwdb = 605 undecorated_smoothed_pwdb =
606 rtlpriv->dm.undecorated_smoothed_pwdb; 606 rtlpriv->dm.undecorated_smoothed_pwdb;
607 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 607 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
608 ("STA Default Port PWDB = 0x%lx\n", 608 "STA Default Port PWDB = 0x%lx\n",
609 undecorated_smoothed_pwdb)); 609 undecorated_smoothed_pwdb);
610 } 610 }
611 } else { 611 } else {
612 undecorated_smoothed_pwdb = 612 undecorated_smoothed_pwdb =
613 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; 613 rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb;
614 614
615 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 615 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
616 ("AP Ext Port PWDB = 0x%lx\n", 616 "AP Ext Port PWDB = 0x%lx\n",
617 undecorated_smoothed_pwdb)); 617 undecorated_smoothed_pwdb);
618 } 618 }
619 619
620 txpwr_threshold_lv2 = TX_POWER_NEAR_FIELD_THRESH_LVL2; 620 txpwr_threshold_lv2 = TX_POWER_NEAR_FIELD_THRESH_LVL2;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/fw.c b/drivers/net/wireless/rtlwifi/rtl8192se/fw.c
index 3fda6b1dcf46..2a9699feee3b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.c
@@ -66,7 +66,7 @@ static bool _rtl92s_firmware_enable_cpu(struct ieee80211_hw *hw)
66 cpustatus = rtl_read_byte(rtlpriv, TCR); 66 cpustatus = rtl_read_byte(rtlpriv, TCR);
67 if (cpustatus & IMEM_RDY) { 67 if (cpustatus & IMEM_RDY) {
68 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 68 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
69 ("IMEM Ready after CPU has refilled.\n")); 69 "IMEM Ready after CPU has refilled\n");
70 break; 70 break;
71 } 71 }
72 72
@@ -120,9 +120,8 @@ static u8 _rtl92s_firmware_header_map_rftype(struct ieee80211_hw *hw)
120 return 0x22; 120 return 0x22;
121 break; 121 break;
122 default: 122 default:
123 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 123 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unknown RF type(%x)\n",
124 ("Unknown RF type(%x)\n", 124 rtlphy->rf_type);
125 rtlphy->rf_type));
126 break; 125 break;
127 } 126 }
128 return 0x22; 127 return 0x22;
@@ -177,7 +176,7 @@ static bool _rtl92s_firmware_downloadcode(struct ieee80211_hw *hw,
177 176
178 if (buffer_len >= MAX_FIRMWARE_CODE_SIZE) { 177 if (buffer_len >= MAX_FIRMWARE_CODE_SIZE) {
179 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 178 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
180 ("Size over FIRMWARE_CODE_SIZE!\n")); 179 "Size over FIRMWARE_CODE_SIZE!\n");
181 180
182 return false; 181 return false;
183 } 182 }
@@ -231,8 +230,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
231 short pollingcnt = 1000; 230 short pollingcnt = 1000;
232 bool rtstatus = true; 231 bool rtstatus = true;
233 232
234 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("LoadStaus(%d)\n", 233 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
235 loadfw_status)); 234 "LoadStaus(%d)\n", loadfw_status);
236 235
237 firmware->fwstatus = (enum fw_status)loadfw_status; 236 firmware->fwstatus = (enum fw_status)loadfw_status;
238 237
@@ -248,8 +247,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
248 247
249 if (!(cpustatus & IMEM_CHK_RPT) || (pollingcnt <= 0)) { 248 if (!(cpustatus & IMEM_CHK_RPT) || (pollingcnt <= 0)) {
250 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 249 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
251 ("FW_STATUS_LOAD_IMEM" 250 "FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
252 " FAIL CPU, Status=%x\r\n", cpustatus)); 251 cpustatus);
253 goto status_check_fail; 252 goto status_check_fail;
254 } 253 }
255 break; 254 break;
@@ -266,8 +265,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
266 265
267 if (!(cpustatus & EMEM_CHK_RPT) || (pollingcnt <= 0)) { 266 if (!(cpustatus & EMEM_CHK_RPT) || (pollingcnt <= 0)) {
268 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 267 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
269 ("FW_STATUS_LOAD_EMEM" 268 "FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
270 " FAIL CPU, Status=%x\r\n", cpustatus)); 269 cpustatus);
271 goto status_check_fail; 270 goto status_check_fail;
272 } 271 }
273 272
@@ -275,7 +274,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
275 rtstatus = _rtl92s_firmware_enable_cpu(hw); 274 rtstatus = _rtl92s_firmware_enable_cpu(hw);
276 if (rtstatus != true) { 275 if (rtstatus != true) {
277 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 276 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
278 ("Enable CPU fail!\n")); 277 "Enable CPU fail!\n");
279 goto status_check_fail; 278 goto status_check_fail;
280 } 279 }
281 break; 280 break;
@@ -291,14 +290,14 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
291 290
292 if (!(cpustatus & DMEM_CODE_DONE) || (pollingcnt <= 0)) { 291 if (!(cpustatus & DMEM_CODE_DONE) || (pollingcnt <= 0)) {
293 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 292 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
294 ("Polling DMEM code done" 293 "Polling DMEM code done fail ! cpustatus(%#x)\n",
295 " fail ! cpustatus(%#x)\n", cpustatus)); 294 cpustatus);
296 goto status_check_fail; 295 goto status_check_fail;
297 } 296 }
298 297
299 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 298 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
300 ("DMEM code download success," 299 "DMEM code download success, cpustatus(%#x)\n",
301 " cpustatus(%#x)\n", cpustatus)); 300 cpustatus);
302 301
303 /* Prevent Delay too much and being scheduled out */ 302 /* Prevent Delay too much and being scheduled out */
304 /* Polling Load Firmware ready */ 303 /* Polling Load Firmware ready */
@@ -311,14 +310,14 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
311 } while (pollingcnt--); 310 } while (pollingcnt--);
312 311
313 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 312 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
314 ("Polling Load Firmware ready," 313 "Polling Load Firmware ready, cpustatus(%x)\n",
315 " cpustatus(%x)\n", cpustatus)); 314 cpustatus);
316 315
317 if (((cpustatus & LOAD_FW_READY) != LOAD_FW_READY) || 316 if (((cpustatus & LOAD_FW_READY) != LOAD_FW_READY) ||
318 (pollingcnt <= 0)) { 317 (pollingcnt <= 0)) {
319 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 318 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
320 ("Polling Load Firmware" 319 "Polling Load Firmware ready fail ! cpustatus(%x)\n",
321 " ready fail ! cpustatus(%x)\n", cpustatus)); 320 cpustatus);
322 goto status_check_fail; 321 goto status_check_fail;
323 } 322 }
324 323
@@ -332,7 +331,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
332 RCR_APP_ICV | RCR_APP_MIC)); 331 RCR_APP_ICV | RCR_APP_MIC));
333 332
334 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 333 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
335 ("Current RCR settings(%#x)\n", tmpu4b)); 334 "Current RCR settings(%#x)\n", tmpu4b);
336 335
337 /* Set to normal mode. */ 336 /* Set to normal mode. */
338 rtl_write_byte(rtlpriv, LBKMD_SEL, LBK_NORMAL); 337 rtl_write_byte(rtlpriv, LBKMD_SEL, LBK_NORMAL);
@@ -340,14 +339,15 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
340 339
341 default: 340 default:
342 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 341 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
343 ("Unknown status check!\n")); 342 "Unknown status check!\n");
344 rtstatus = false; 343 rtstatus = false;
345 break; 344 break;
346 } 345 }
347 346
348status_check_fail: 347status_check_fail:
349 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("loadfw_status(%d), " 348 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
350 "rtstatus(%x)\n", loadfw_status, rtstatus)); 349 "loadfw_status(%d), rtstatus(%x)\n",
350 loadfw_status, rtstatus);
351 return rtstatus; 351 return rtstatus;
352} 352}
353 353
@@ -378,17 +378,17 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
378 firmware->firmwareversion = byte(pfwheader->version, 0); 378 firmware->firmwareversion = byte(pfwheader->version, 0);
379 firmware->pfwheader->fwpriv.hci_sel = 1;/* pcie */ 379 firmware->pfwheader->fwpriv.hci_sel = 1;/* pcie */
380 380
381 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("signature:%x, version:" 381 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
382 "%x, size:%x," 382 "signature:%x, version:%x, size:%x, imemsize:%x, sram size:%x\n",
383 "imemsize:%x, sram size:%x\n", pfwheader->signature, 383 pfwheader->signature,
384 pfwheader->version, pfwheader->dmem_size, 384 pfwheader->version, pfwheader->dmem_size,
385 pfwheader->img_imem_size, pfwheader->img_sram_size)); 385 pfwheader->img_imem_size, pfwheader->img_sram_size);
386 386
387 /* 2. Retrieve IMEM image. */ 387 /* 2. Retrieve IMEM image. */
388 if ((pfwheader->img_imem_size == 0) || (pfwheader->img_imem_size > 388 if ((pfwheader->img_imem_size == 0) || (pfwheader->img_imem_size >
389 sizeof(firmware->fw_imem))) { 389 sizeof(firmware->fw_imem))) {
390 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 390 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
391 ("memory for data image is less than IMEM required\n")); 391 "memory for data image is less than IMEM required\n");
392 goto fail; 392 goto fail;
393 } else { 393 } else {
394 puc_mappedfile += fwhdr_size; 394 puc_mappedfile += fwhdr_size;
@@ -401,7 +401,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
401 /* 3. Retriecve EMEM image. */ 401 /* 3. Retriecve EMEM image. */
402 if (pfwheader->img_sram_size > sizeof(firmware->fw_emem)) { 402 if (pfwheader->img_sram_size > sizeof(firmware->fw_emem)) {
403 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 403 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
404 ("memory for data image is less than EMEM required\n")); 404 "memory for data image is less than EMEM required\n");
405 goto fail; 405 goto fail;
406 } else { 406 } else {
407 puc_mappedfile += firmware->fw_imem_len; 407 puc_mappedfile += firmware->fw_imem_len;
@@ -436,7 +436,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
436 break; 436 break;
437 default: 437 default:
438 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 438 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
439 ("Unexpected Download step!!\n")); 439 "Unexpected Download step!!\n");
440 goto fail; 440 goto fail;
441 break; 441 break;
442 } 442 }
@@ -446,14 +446,14 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
446 ul_filelength); 446 ul_filelength);
447 447
448 if (rtstatus != true) { 448 if (rtstatus != true) {
449 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("fail!\n")); 449 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "fail!\n");
450 goto fail; 450 goto fail;
451 } 451 }
452 452
453 /* <3> Check whether load FW process is ready */ 453 /* <3> Check whether load FW process is ready */
454 rtstatus = _rtl92s_firmware_checkready(hw, fwstatus); 454 rtstatus = _rtl92s_firmware_checkready(hw, fwstatus);
455 if (rtstatus != true) { 455 if (rtstatus != true) {
456 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("fail!\n")); 456 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "fail!\n");
457 goto fail; 457 goto fail;
458 } 458 }
459 459
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index f9ba077bc18f..dffcafe01a39 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -80,8 +80,8 @@ void rtl92se_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
80 break; 80 break;
81 } 81 }
82 default: { 82 default: {
83 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 83 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
84 ("switch case not process\n")); 84 "switch case not processed\n");
85 break; 85 break;
86 } 86 }
87 } 87 }
@@ -140,7 +140,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
140 u8 e_aci; 140 u8 e_aci;
141 141
142 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 142 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
143 ("HW_VAR_SLOT_TIME %x\n", val[0])); 143 "HW_VAR_SLOT_TIME %x\n", val[0]);
144 144
145 rtl_write_byte(rtlpriv, SLOT_TIME, val[0]); 145 rtl_write_byte(rtlpriv, SLOT_TIME, val[0]);
146 146
@@ -185,8 +185,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
185 *val = min_spacing_to_set; 185 *val = min_spacing_to_set;
186 186
187 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 187 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
188 ("Set HW_VAR_AMPDU_MIN_SPACE: %#x\n", 188 "Set HW_VAR_AMPDU_MIN_SPACE: %#x\n",
189 mac->min_space_cfg)); 189 mac->min_space_cfg);
190 190
191 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE, 191 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE,
192 mac->min_space_cfg); 192 mac->min_space_cfg);
@@ -201,8 +201,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
201 mac->min_space_cfg |= (density_to_set << 3); 201 mac->min_space_cfg |= (density_to_set << 3);
202 202
203 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 203 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
204 ("Set HW_VAR_SHORTGI_DENSITY: %#x\n", 204 "Set HW_VAR_SHORTGI_DENSITY: %#x\n",
205 mac->min_space_cfg)); 205 mac->min_space_cfg);
206 206
207 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE, 207 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE,
208 mac->min_space_cfg); 208 mac->min_space_cfg);
@@ -244,8 +244,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
244 rtl_write_byte(rtlpriv, AGGLEN_LMT_H, regtoset); 244 rtl_write_byte(rtlpriv, AGGLEN_LMT_H, regtoset);
245 245
246 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 246 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
247 ("Set HW_VAR_AMPDU_FACTOR: %#x\n", 247 "Set HW_VAR_AMPDU_FACTOR: %#x\n",
248 factor_toset)); 248 factor_toset);
249 } 249 }
250 break; 250 break;
251 } 251 }
@@ -282,8 +282,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
282 break; 282 break;
283 default: 283 default:
284 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 284 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
285 ("HW_VAR_ACM_CTRL acm set " 285 "HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
286 "failed: eACI is %d\n", acm)); 286 acm);
287 break; 287 break;
288 } 288 }
289 } else { 289 } else {
@@ -299,13 +299,13 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
299 break; 299 break;
300 default: 300 default:
301 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 301 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
302 ("switch case not process\n")); 302 "switch case not processed\n");
303 break; 303 break;
304 } 304 }
305 } 305 }
306 306
307 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE, 307 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE,
308 ("HW_VAR_ACM_CTRL Write 0x%X\n", acm_ctrl)); 308 "HW_VAR_ACM_CTRL Write 0x%X\n", acm_ctrl);
309 rtl_write_byte(rtlpriv, AcmHwCtrl, acm_ctrl); 309 rtl_write_byte(rtlpriv, AcmHwCtrl, acm_ctrl);
310 break; 310 break;
311 } 311 }
@@ -404,7 +404,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
404 } 404 }
405 default: 405 default:
406 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 406 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
407 ("switch case not process\n")); 407 "switch case not processed\n");
408 break; 408 break;
409 } 409 }
410 410
@@ -415,14 +415,14 @@ void rtl92se_enable_hw_security_config(struct ieee80211_hw *hw)
415 struct rtl_priv *rtlpriv = rtl_priv(hw); 415 struct rtl_priv *rtlpriv = rtl_priv(hw);
416 u8 sec_reg_value = 0x0; 416 u8 sec_reg_value = 0x0;
417 417
418 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("PairwiseEncAlgorithm = %d " 418 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
419 "GroupEncAlgorithm = %d\n", 419 "PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n",
420 rtlpriv->sec.pairwise_enc_algorithm, 420 rtlpriv->sec.pairwise_enc_algorithm,
421 rtlpriv->sec.group_enc_algorithm)); 421 rtlpriv->sec.group_enc_algorithm);
422 422
423 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { 423 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) {
424 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 424 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
425 ("not open hw encryption\n")); 425 "not open hw encryption\n");
426 return; 426 return;
427 } 427 }
428 428
@@ -433,8 +433,8 @@ void rtl92se_enable_hw_security_config(struct ieee80211_hw *hw)
433 sec_reg_value |= SCR_RXUSEDK; 433 sec_reg_value |= SCR_RXUSEDK;
434 } 434 }
435 435
436 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, ("The SECR-value %x\n", 436 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "The SECR-value %x\n",
437 sec_reg_value)); 437 sec_reg_value);
438 438
439 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); 439 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value);
440 440
@@ -718,8 +718,8 @@ static void _rtl92se_macconfig_before_fwdownload(struct ieee80211_hw *hw)
718 718
719 if (pollingcnt <= 0) { 719 if (pollingcnt <= 0) {
720 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 720 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
721 ("Polling TXDMA_INIT_VALUE " 721 "Polling TXDMA_INIT_VALUE timeout!! Current TCR(%#x)\n",
722 "timeout!! Current TCR(%#x)\n", tmpu1b)); 722 tmpu1b);
723 tmpu1b = rtl_read_byte(rtlpriv, CMDR); 723 tmpu1b = rtl_read_byte(rtlpriv, CMDR);
724 rtl_write_byte(rtlpriv, CMDR, tmpu1b & (~TXDMA_EN)); 724 rtl_write_byte(rtlpriv, CMDR, tmpu1b & (~TXDMA_EN));
725 udelay(2); 725 udelay(2);
@@ -870,10 +870,10 @@ static void _rtl92se_macconfig_after_fwdownload(struct ieee80211_hw *hw)
870 870
871 /* Change Program timing */ 871 /* Change Program timing */
872 rtl_write_byte(rtlpriv, REG_EFUSE_CTRL + 3, 0x72); 872 rtl_write_byte(rtlpriv, REG_EFUSE_CTRL + 3, 0x72);
873 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("EFUSE CONFIG OK\n")); 873 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "EFUSE CONFIG OK\n");
874 } 874 }
875 875
876 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("OK\n")); 876 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "OK\n");
877 877
878} 878}
879 879
@@ -951,9 +951,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
951 rtstatus = rtl92s_download_fw(hw); 951 rtstatus = rtl92s_download_fw(hw);
952 if (!rtstatus) { 952 if (!rtstatus) {
953 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 953 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
954 ("Failed to download FW. " 954 "Failed to download FW. Init HW without FW now... Please copy FW into /lib/firmware/rtlwifi\n");
955 "Init HW without FW now.., Please copy FW into"
956 "/lib/firmware/rtlwifi\n"));
957 rtlhal->fw_ready = false; 955 rtlhal->fw_ready = false;
958 } else { 956 } else {
959 rtlhal->fw_ready = true; 957 rtlhal->fw_ready = true;
@@ -968,7 +966,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
968 966
969 /* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */ 967 /* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */
970 if (rtl92s_phy_mac_config(hw) != true) { 968 if (rtl92s_phy_mac_config(hw) != true) {
971 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("MAC Config failed\n")); 969 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "MAC Config failed\n");
972 return rtstatus; 970 return rtstatus;
973 } 971 }
974 972
@@ -978,7 +976,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
978 976
979 /* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */ 977 /* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */
980 if (rtl92s_phy_bb_config(hw) != true) { 978 if (rtl92s_phy_bb_config(hw) != true) {
981 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, ("BB Config failed\n")); 979 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "BB Config failed\n");
982 return rtstatus; 980 return rtstatus;
983 } 981 }
984 982
@@ -1014,7 +1012,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
1014 rtl_write_byte(rtlpriv, RF_CTRL, 0x07); 1012 rtl_write_byte(rtlpriv, RF_CTRL, 0x07);
1015 1013
1016 if (rtl92s_phy_rf_config(hw) != true) { 1014 if (rtl92s_phy_rf_config(hw) != true) {
1017 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("RF Config failed\n")); 1015 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "RF Config failed\n");
1018 return rtstatus; 1016 return rtstatus;
1019 } 1017 }
1020 1018
@@ -1129,26 +1127,26 @@ static int _rtl92se_set_media_status(struct ieee80211_hw *hw,
1129 case NL80211_IFTYPE_UNSPECIFIED: 1127 case NL80211_IFTYPE_UNSPECIFIED:
1130 bt_msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT); 1128 bt_msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT);
1131 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1129 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1132 ("Set Network type to NO LINK!\n")); 1130 "Set Network type to NO LINK!\n");
1133 break; 1131 break;
1134 case NL80211_IFTYPE_ADHOC: 1132 case NL80211_IFTYPE_ADHOC:
1135 bt_msr |= (MSR_LINK_ADHOC << MSR_LINK_SHIFT); 1133 bt_msr |= (MSR_LINK_ADHOC << MSR_LINK_SHIFT);
1136 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1134 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1137 ("Set Network type to Ad Hoc!\n")); 1135 "Set Network type to Ad Hoc!\n");
1138 break; 1136 break;
1139 case NL80211_IFTYPE_STATION: 1137 case NL80211_IFTYPE_STATION:
1140 bt_msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT); 1138 bt_msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT);
1141 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1139 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1142 ("Set Network type to STA!\n")); 1140 "Set Network type to STA!\n");
1143 break; 1141 break;
1144 case NL80211_IFTYPE_AP: 1142 case NL80211_IFTYPE_AP:
1145 bt_msr |= (MSR_LINK_MASTER << MSR_LINK_SHIFT); 1143 bt_msr |= (MSR_LINK_MASTER << MSR_LINK_SHIFT);
1146 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1144 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1147 ("Set Network type to AP!\n")); 1145 "Set Network type to AP!\n");
1148 break; 1146 break;
1149 default: 1147 default:
1150 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1148 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1151 ("Network type %d not support!\n", type)); 1149 "Network type %d not supported!\n", type);
1152 return 1; 1150 return 1;
1153 break; 1151 break;
1154 1152
@@ -1583,8 +1581,8 @@ void rtl92se_update_interrupt_mask(struct ieee80211_hw *hw,
1583 struct rtl_priv *rtlpriv = rtl_priv(hw); 1581 struct rtl_priv *rtlpriv = rtl_priv(hw);
1584 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1582 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
1585 1583
1586 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1584 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, "add_msr:%x, rm_msr:%x\n",
1587 ("add_msr:%x, rm_msr:%x\n", add_msr, rm_msr)); 1585 add_msr, rm_msr);
1588 1586
1589 if (add_msr) 1587 if (add_msr)
1590 rtlpci->irq_mask[0] |= add_msr; 1588 rtlpci->irq_mask[0] |= add_msr;
@@ -1627,7 +1625,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1627 1625
1628 if (rtlefuse->epromtype == EEPROM_93C46) { 1626 if (rtlefuse->epromtype == EEPROM_93C46) {
1629 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1627 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1630 ("RTL819X Not boot from eeprom, check it !!")); 1628 "RTL819X Not boot from eeprom, check it !!\n");
1631 } else if (rtlefuse->epromtype == EEPROM_BOOT_EFUSE) { 1629 } else if (rtlefuse->epromtype == EEPROM_BOOT_EFUSE) {
1632 rtl_efuse_shadow_map_update(hw); 1630 rtl_efuse_shadow_map_update(hw);
1633 1631
@@ -1642,10 +1640,10 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1642 eeprom_id = *((u16 *)&hwinfo[0]); 1640 eeprom_id = *((u16 *)&hwinfo[0]);
1643 if (eeprom_id != RTL8190_EEPROM_ID) { 1641 if (eeprom_id != RTL8190_EEPROM_ID) {
1644 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1642 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1645 ("EEPROM ID(%#x) is invalid!!\n", eeprom_id)); 1643 "EEPROM ID(%#x) is invalid!!\n", eeprom_id);
1646 rtlefuse->autoload_failflag = true; 1644 rtlefuse->autoload_failflag = true;
1647 } else { 1645 } else {
1648 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1646 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1649 rtlefuse->autoload_failflag = false; 1647 rtlefuse->autoload_failflag = false;
1650 } 1648 }
1651 1649
@@ -1663,15 +1661,15 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1663 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION]; 1661 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION];
1664 1662
1665 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1663 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1666 ("EEPROMId = 0x%4x\n", eeprom_id)); 1664 "EEPROMId = 0x%4x\n", eeprom_id);
1667 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1665 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1668 ("EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid)); 1666 "EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid);
1669 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1667 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1670 ("EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did)); 1668 "EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did);
1671 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1669 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1672 ("EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid)); 1670 "EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid);
1673 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1671 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1674 ("EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid)); 1672 "EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid);
1675 1673
1676 for (i = 0; i < 6; i += 2) { 1674 for (i = 0; i < 6; i += 2) {
1677 usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i]; 1675 usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i];
@@ -1681,8 +1679,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1681 for (i = 0; i < 6; i++) 1679 for (i = 0; i < 6; i++)
1682 rtl_write_byte(rtlpriv, MACIDR0 + i, rtlefuse->dev_addr[i]); 1680 rtl_write_byte(rtlpriv, MACIDR0 + i, rtlefuse->dev_addr[i]);
1683 1681
1684 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1682 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "%pM\n", rtlefuse->dev_addr);
1685 ("%pM\n", rtlefuse->dev_addr));
1686 1683
1687 /* Get Tx Power Level by Channel */ 1684 /* Get Tx Power Level by Channel */
1688 /* Read Tx power of Channel 1 ~ 14 from EEPROM. */ 1685 /* Read Tx power of Channel 1 ~ 14 from EEPROM. */
@@ -1937,14 +1934,14 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1937 if (!(tempval & BIT(0))) { 1934 if (!(tempval & BIT(0))) {
1938 rtlefuse->b1x1_recvcombine = true; 1935 rtlefuse->b1x1_recvcombine = true;
1939 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1936 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1940 ("RF_TYPE=1T2R but only 1SS\n")); 1937 "RF_TYPE=1T2R but only 1SS\n");
1941 } 1938 }
1942 } 1939 }
1943 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine; 1940 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine;
1944 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMID]; 1941 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMID];
1945 1942
1946 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("EEPROM Customer ID: 0x%2x", 1943 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x",
1947 rtlefuse->eeprom_oemid)); 1944 rtlefuse->eeprom_oemid);
1948 1945
1949 /* set channel paln to world wide 13 */ 1946 /* set channel paln to world wide 13 */
1950 rtlefuse->channel_plan = COUNTRY_CODE_WORLD_WIDE_13; 1947 rtlefuse->channel_plan = COUNTRY_CODE_WORLD_WIDE_13;
@@ -1959,19 +1956,19 @@ void rtl92se_read_eeprom_info(struct ieee80211_hw *hw)
1959 tmp_u1b = rtl_read_byte(rtlpriv, EPROM_CMD); 1956 tmp_u1b = rtl_read_byte(rtlpriv, EPROM_CMD);
1960 1957
1961 if (tmp_u1b & BIT(4)) { 1958 if (tmp_u1b & BIT(4)) {
1962 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EEPROM\n")); 1959 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EEPROM\n");
1963 rtlefuse->epromtype = EEPROM_93C46; 1960 rtlefuse->epromtype = EEPROM_93C46;
1964 } else { 1961 } else {
1965 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EFUSE\n")); 1962 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EFUSE\n");
1966 rtlefuse->epromtype = EEPROM_BOOT_EFUSE; 1963 rtlefuse->epromtype = EEPROM_BOOT_EFUSE;
1967 } 1964 }
1968 1965
1969 if (tmp_u1b & BIT(5)) { 1966 if (tmp_u1b & BIT(5)) {
1970 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1967 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1971 rtlefuse->autoload_failflag = false; 1968 rtlefuse->autoload_failflag = false;
1972 _rtl92se_read_adapter_info(hw); 1969 _rtl92se_read_adapter_info(hw);
1973 } else { 1970 } else {
1974 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Autoload ERR!!\n")); 1971 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
1975 rtlefuse->autoload_failflag = true; 1972 rtlefuse->autoload_failflag = true;
1976 } 1973 }
1977} 1974}
@@ -2071,8 +2068,8 @@ static void rtl92se_update_hal_rate_table(struct ieee80211_hw *hw,
2071 else 2068 else
2072 rtl92s_phy_set_fw_cmd(hw, FW_CMD_RA_REFRESH_BG); 2069 rtl92s_phy_set_fw_cmd(hw, FW_CMD_RA_REFRESH_BG);
2073 2070
2074 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 2071 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
2075 ("%x\n", rtl_read_dword(rtlpriv, ARFR0))); 2072 rtl_read_dword(rtlpriv, ARFR0));
2076} 2073}
2077 2074
2078static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw, 2075static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw,
@@ -2224,8 +2221,8 @@ static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw,
2224 2221
2225 mask |= (bmulticast ? 1 : 0) << 9 | (macid & 0x1f) << 4 | (band & 0xf); 2222 mask |= (bmulticast ? 1 : 0) << 9 | (macid & 0x1f) << 4 | (band & 0xf);
2226 2223
2227 RT_TRACE(rtlpriv, COMP_RATR, DBG_TRACE, ("mask = %x, bitmap = %x\n", 2224 RT_TRACE(rtlpriv, COMP_RATR, DBG_TRACE, "mask = %x, bitmap = %x\n",
2228 mask, ratr_bitmap)); 2225 mask, ratr_bitmap);
2229 rtl_write_dword(rtlpriv, 0x2c4, ratr_bitmap); 2226 rtl_write_dword(rtlpriv, 0x2c4, ratr_bitmap);
2230 rtl_write_dword(rtlpriv, WFM5, (FW_RA_UPDATE_MASK | (mask << 8))); 2227 rtl_write_dword(rtlpriv, WFM5, (FW_RA_UPDATE_MASK | (mask << 8)));
2231 2228
@@ -2301,14 +2298,14 @@ bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
2301 2298
2302 if ((ppsc->hwradiooff) && (rfpwr_toset == ERFON)) { 2299 if ((ppsc->hwradiooff) && (rfpwr_toset == ERFON)) {
2303 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 2300 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
2304 ("RFKILL-HW Radio ON, RF ON\n")); 2301 "RFKILL-HW Radio ON, RF ON\n");
2305 2302
2306 rfpwr_toset = ERFON; 2303 rfpwr_toset = ERFON;
2307 ppsc->hwradiooff = false; 2304 ppsc->hwradiooff = false;
2308 actuallyset = true; 2305 actuallyset = true;
2309 } else if ((ppsc->hwradiooff == false) && (rfpwr_toset == ERFOFF)) { 2306 } else if ((ppsc->hwradiooff == false) && (rfpwr_toset == ERFOFF)) {
2310 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 2307 RT_TRACE(rtlpriv, COMP_RF,
2311 ("RFKILL-HW Radio OFF, RF OFF\n")); 2308 DBG_DMESG, "RFKILL-HW Radio OFF, RF OFF\n");
2312 2309
2313 rfpwr_toset = ERFOFF; 2310 rfpwr_toset = ERFOFF;
2314 ppsc->hwradiooff = true; 2311 ppsc->hwradiooff = true;
@@ -2372,7 +2369,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2372 u8 cam_offset = 0; 2369 u8 cam_offset = 0;
2373 u8 clear_number = 5; 2370 u8 clear_number = 5;
2374 2371
2375 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("clear_all\n")); 2372 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "clear_all\n");
2376 2373
2377 for (idx = 0; idx < clear_number; idx++) { 2374 for (idx = 0; idx < clear_number; idx++) {
2378 rtl_cam_mark_invalid(hw, cam_offset + idx); 2375 rtl_cam_mark_invalid(hw, cam_offset + idx);
@@ -2401,7 +2398,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2401 break; 2398 break;
2402 default: 2399 default:
2403 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 2400 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
2404 ("switch case not process\n")); 2401 "switch case not processed\n");
2405 enc_algo = CAM_TKIP; 2402 enc_algo = CAM_TKIP;
2406 break; 2403 break;
2407 } 2404 }
@@ -2419,9 +2416,8 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2419 p_macaddr); 2416 p_macaddr);
2420 if (entry_id >= TOTAL_CAM_ENTRY) { 2417 if (entry_id >= TOTAL_CAM_ENTRY) {
2421 RT_TRACE(rtlpriv, 2418 RT_TRACE(rtlpriv,
2422 COMP_SEC, DBG_EMERG, 2419 COMP_SEC, DBG_EMERG,
2423 ("Can not find free hw" 2420 "Can not find free hw security cam entry\n");
2424 " security cam entry\n"));
2425 return; 2421 return;
2426 } 2422 }
2427 } else { 2423 } else {
@@ -2435,30 +2431,31 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2435 2431
2436 if (rtlpriv->sec.key_len[key_index] == 0) { 2432 if (rtlpriv->sec.key_len[key_index] == 0) {
2437 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2433 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2438 ("delete one entry, entry_id is %d\n", 2434 "delete one entry, entry_id is %d\n",
2439 entry_id)); 2435 entry_id);
2440 if (mac->opmode == NL80211_IFTYPE_AP) 2436 if (mac->opmode == NL80211_IFTYPE_AP)
2441 rtl_cam_del_entry(hw, p_macaddr); 2437 rtl_cam_del_entry(hw, p_macaddr);
2442 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); 2438 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id);
2443 } else { 2439 } else {
2444 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2440 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2445 ("The insert KEY length is %d\n", 2441 "The insert KEY length is %d\n",
2446 rtlpriv->sec.key_len[PAIRWISE_KEYIDX])); 2442 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]);
2447 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2443 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2448 ("The insert KEY is %x %x\n", 2444 "The insert KEY is %x %x\n",
2449 rtlpriv->sec.key_buf[0][0], 2445 rtlpriv->sec.key_buf[0][0],
2450 rtlpriv->sec.key_buf[0][1])); 2446 rtlpriv->sec.key_buf[0][1]);
2451 2447
2452 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2448 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2453 ("add one entry\n")); 2449 "add one entry\n");
2454 if (is_pairwise) { 2450 if (is_pairwise) {
2455 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD, 2451 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD,
2456 "Pairwise Key content", 2452 "Pairwise Key content",
2457 rtlpriv->sec.pairwise_key, 2453 rtlpriv->sec.pairwise_key,
2458 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]); 2454 rtlpriv->sec.
2455 key_len[PAIRWISE_KEYIDX]);
2459 2456
2460 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2457 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2461 ("set Pairwiase key\n")); 2458 "set Pairwise key\n");
2462 2459
2463 rtl_cam_add_one_entry(hw, macaddr, key_index, 2460 rtl_cam_add_one_entry(hw, macaddr, key_index,
2464 entry_id, enc_algo, 2461 entry_id, enc_algo,
@@ -2466,7 +2463,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2466 rtlpriv->sec.key_buf[key_index]); 2463 rtlpriv->sec.key_buf[key_index]);
2467 } else { 2464 } else {
2468 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2465 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2469 ("set group key\n")); 2466 "set group key\n");
2470 2467
2471 if (mac->opmode == NL80211_IFTYPE_ADHOC) { 2468 if (mac->opmode == NL80211_IFTYPE_ADHOC) {
2472 rtl_cam_add_one_entry(hw, 2469 rtl_cam_add_one_entry(hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/led.c b/drivers/net/wireless/rtlwifi/rtl8192se/led.c
index e3fe7c90ebf4..1a6b0caf0841 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/led.c
@@ -52,8 +52,8 @@ void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
52 u8 ledcfg; 52 u8 ledcfg;
53 struct rtl_priv *rtlpriv = rtl_priv(hw); 53 struct rtl_priv *rtlpriv = rtl_priv(hw);
54 54
55 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 55 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
56 ("LedAddr:%X ledpin=%d\n", LEDCFG, pled->ledpin)); 56 LEDCFG, pled->ledpin);
57 57
58 ledcfg = rtl_read_byte(rtlpriv, LEDCFG); 58 ledcfg = rtl_read_byte(rtlpriv, LEDCFG);
59 59
@@ -68,7 +68,7 @@ void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
68 break; 68 break;
69 default: 69 default:
70 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 70 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
71 ("switch case not process\n")); 71 "switch case not processed\n");
72 break; 72 break;
73 } 73 }
74 pled->ledon = true; 74 pled->ledon = true;
@@ -80,8 +80,8 @@ void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
80 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); 80 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
81 u8 ledcfg; 81 u8 ledcfg;
82 82
83 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, 83 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
84 ("LedAddr:%X ledpin=%d\n", LEDCFG, pled->ledpin)); 84 LEDCFG, pled->ledpin);
85 85
86 ledcfg = rtl_read_byte(rtlpriv, LEDCFG); 86 ledcfg = rtl_read_byte(rtlpriv, LEDCFG);
87 87
@@ -101,7 +101,7 @@ void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
101 break; 101 break;
102 default: 102 default:
103 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 103 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
104 ("switch case not process\n")); 104 "switch case not processed\n");
105 break; 105 break;
106 } 106 }
107 pled->ledon = false; 107 pled->ledon = false;
@@ -141,8 +141,7 @@ void rtl92se_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction)
141 ledaction == LED_CTL_POWER_ON)) { 141 ledaction == LED_CTL_POWER_ON)) {
142 return; 142 return;
143 } 143 }
144 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, ("ledaction %d,\n", 144 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "ledaction %d\n", ledaction);
145 ledaction));
146 145
147 _rtl92se_sw_led_control(hw, ledaction); 146 _rtl92se_sw_led_control(hw, ledaction);
148} 147}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
index f10ac1ad9087..ec5520e68472 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
@@ -58,16 +58,15 @@ u32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
58 struct rtl_priv *rtlpriv = rtl_priv(hw); 58 struct rtl_priv *rtlpriv = rtl_priv(hw);
59 u32 returnvalue = 0, originalvalue, bitshift; 59 u32 returnvalue = 0, originalvalue, bitshift;
60 60
61 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)\n", 61 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n",
62 regaddr, bitmask)); 62 regaddr, bitmask);
63 63
64 originalvalue = rtl_read_dword(rtlpriv, regaddr); 64 originalvalue = rtl_read_dword(rtlpriv, regaddr);
65 bitshift = _rtl92s_phy_calculate_bit_shift(bitmask); 65 bitshift = _rtl92s_phy_calculate_bit_shift(bitmask);
66 returnvalue = (originalvalue & bitmask) >> bitshift; 66 returnvalue = (originalvalue & bitmask) >> bitshift;
67 67
68 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 68 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "BBR MASK=0x%x Addr[0x%x]=0x%x\n",
69 ("BBR MASK=0x%x Addr[0x%x]=0x%x\n", 69 bitmask, regaddr, originalvalue);
70 bitmask, regaddr, originalvalue));
71 70
72 return returnvalue; 71 return returnvalue;
73 72
@@ -79,8 +78,9 @@ void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
79 struct rtl_priv *rtlpriv = rtl_priv(hw); 78 struct rtl_priv *rtlpriv = rtl_priv(hw);
80 u32 originalvalue, bitshift; 79 u32 originalvalue, bitshift;
81 80
82 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 81 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
83 " data(%#x)\n", regaddr, bitmask, data)); 82 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
83 regaddr, bitmask, data);
84 84
85 if (bitmask != MASKDWORD) { 85 if (bitmask != MASKDWORD) {
86 originalvalue = rtl_read_dword(rtlpriv, regaddr); 86 originalvalue = rtl_read_dword(rtlpriv, regaddr);
@@ -90,8 +90,9 @@ void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
90 90
91 rtl_write_dword(rtlpriv, regaddr, data); 91 rtl_write_dword(rtlpriv, regaddr, data);
92 92
93 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 93 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
94 " data(%#x)\n", regaddr, bitmask, data)); 94 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
95 regaddr, bitmask, data);
95 96
96} 97}
97 98
@@ -149,8 +150,8 @@ static u32 _rtl92s_phy_rf_serial_read(struct ieee80211_hw *hw,
149 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback, 150 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback,
150 BLSSI_READBACK_DATA); 151 BLSSI_READBACK_DATA);
151 152
152 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFR-%d Addr[0x%x]=0x%x\n", 153 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFR-%d Addr[0x%x]=0x%x\n",
153 rfpath, pphyreg->rflssi_readback, retvalue)); 154 rfpath, pphyreg->rflssi_readback, retvalue);
154 155
155 return retvalue; 156 return retvalue;
156 157
@@ -172,8 +173,8 @@ static void _rtl92s_phy_rf_serial_write(struct ieee80211_hw *hw,
172 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff; 173 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff;
173 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr); 174 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr);
174 175
175 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFW-%d Addr[0x%x]=0x%x\n", 176 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFW-%d Addr[0x%x]=0x%x\n",
176 rfpath, pphyreg->rf3wire_offset, data_and_addr)); 177 rfpath, pphyreg->rf3wire_offset, data_and_addr);
177} 178}
178 179
179 180
@@ -183,8 +184,9 @@ u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
183 struct rtl_priv *rtlpriv = rtl_priv(hw); 184 struct rtl_priv *rtlpriv = rtl_priv(hw);
184 u32 original_value, readback_value, bitshift; 185 u32 original_value, readback_value, bitshift;
185 186
186 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), rfpath(%#x), " 187 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
187 "bitmask(%#x)\n", regaddr, rfpath, bitmask)); 188 "regaddr(%#x), rfpath(%#x), bitmask(%#x)\n",
189 regaddr, rfpath, bitmask);
188 190
189 spin_lock(&rtlpriv->locks.rf_lock); 191 spin_lock(&rtlpriv->locks.rf_lock);
190 192
@@ -195,9 +197,9 @@ u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
195 197
196 spin_unlock(&rtlpriv->locks.rf_lock); 198 spin_unlock(&rtlpriv->locks.rf_lock);
197 199
198 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), rfpath(%#x), " 200 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
199 "bitmask(%#x), original_value(%#x)\n", regaddr, rfpath, 201 "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
200 bitmask, original_value)); 202 regaddr, rfpath, bitmask, original_value);
201 203
202 return readback_value; 204 return readback_value;
203} 205}
@@ -212,8 +214,9 @@ void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
212 if (!((rtlphy->rf_pathmap >> rfpath) & 0x1)) 214 if (!((rtlphy->rf_pathmap >> rfpath) & 0x1))
213 return; 215 return;
214 216
215 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 217 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
216 " data(%#x), rfpath(%#x)\n", regaddr, bitmask, data, rfpath)); 218 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
219 regaddr, bitmask, data, rfpath);
217 220
218 spin_lock(&rtlpriv->locks.rf_lock); 221 spin_lock(&rtlpriv->locks.rf_lock);
219 222
@@ -228,8 +231,9 @@ void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
228 231
229 spin_unlock(&rtlpriv->locks.rf_lock); 232 spin_unlock(&rtlpriv->locks.rf_lock);
230 233
231 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x), " 234 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
232 "data(%#x), rfpath(%#x)\n", regaddr, bitmask, data, rfpath)); 235 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
236 regaddr, bitmask, data, rfpath);
233 237
234} 238}
235 239
@@ -249,7 +253,7 @@ void rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw,
249 break; 253 break;
250 default: 254 default:
251 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 255 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
252 ("Unknown operation.\n")); 256 "Unknown operation\n");
253 break; 257 break;
254 } 258 }
255 } 259 }
@@ -264,9 +268,9 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
264 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 268 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
265 u8 reg_bw_opmode; 269 u8 reg_bw_opmode;
266 270
267 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("Switch to %s bandwidth\n", 271 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "Switch to %s bandwidth\n",
268 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 272 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
269 "20MHz" : "40MHz")); 273 "20MHz" : "40MHz");
270 274
271 if (rtlphy->set_bwmode_inprogress) 275 if (rtlphy->set_bwmode_inprogress)
272 return; 276 return;
@@ -290,8 +294,7 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
290 break; 294 break;
291 default: 295 default:
292 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 296 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
293 ("unknown bandwidth: %#X\n", 297 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
294 rtlphy->current_chan_bw));
295 break; 298 break;
296 } 299 }
297 300
@@ -316,13 +319,13 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
316 break; 319 break;
317 default: 320 default:
318 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 321 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
319 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 322 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
320 break; 323 break;
321 } 324 }
322 325
323 rtl92s_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); 326 rtl92s_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
324 rtlphy->set_bwmode_inprogress = false; 327 rtlphy->set_bwmode_inprogress = false;
325 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 328 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
326} 329}
327 330
328static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable, 331static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
@@ -438,7 +441,7 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
438 break; 441 break;
439 default: 442 default:
440 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 443 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
441 ("switch case not process\n")); 444 "switch case not processed\n");
442 break; 445 break;
443 } 446 }
444 447
@@ -458,9 +461,8 @@ u8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw)
458 u32 delay; 461 u32 delay;
459 bool ret; 462 bool ret;
460 463
461 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 464 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "switch to channel%d\n",
462 ("switch to channel%d\n", 465 rtlphy->current_channel);
463 rtlphy->current_channel));
464 466
465 if (rtlphy->sw_chnl_inprogress) 467 if (rtlphy->sw_chnl_inprogress)
466 return 0; 468 return 0;
@@ -496,7 +498,7 @@ u8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw)
496 498
497 rtlphy->sw_chnl_inprogress = false; 499 rtlphy->sw_chnl_inprogress = false;
498 500
499 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 501 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
500 502
501 return 1; 503 return 1;
502} 504}
@@ -556,7 +558,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
556 do { 558 do {
557 InitializeCount++; 559 InitializeCount++;
558 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 560 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
559 ("IPS Set eRf nic enable\n")); 561 "IPS Set eRf nic enable\n");
560 rtstatus = rtl_ps_enable_nic(hw); 562 rtstatus = rtl_ps_enable_nic(hw);
561 } while ((rtstatus != true) && 563 } while ((rtstatus != true) &&
562 (InitializeCount < 10)); 564 (InitializeCount < 10));
@@ -565,11 +567,11 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
565 RT_RF_OFF_LEVL_HALT_NIC); 567 RT_RF_OFF_LEVL_HALT_NIC);
566 } else { 568 } else {
567 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 569 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
568 ("awake, sleeped:%d ms " 570 "awake, sleeped:%d ms state_inap:%x\n",
569 "state_inap:%x\n", 571 jiffies_to_msecs(jiffies -
570 jiffies_to_msecs(jiffies - 572 ppsc->
571 ppsc->last_sleep_jiffies), 573 last_sleep_jiffies),
572 rtlpriv->psc.state_inap)); 574 rtlpriv->psc.state_inap);
573 ppsc->last_awake_jiffies = jiffies; 575 ppsc->last_awake_jiffies = jiffies;
574 rtl_write_word(rtlpriv, CMDR, 0x37FC); 576 rtl_write_word(rtlpriv, CMDR, 0x37FC);
575 rtl_write_byte(rtlpriv, TXPAUSE, 0x00); 577 rtl_write_byte(rtlpriv, TXPAUSE, 0x00);
@@ -587,7 +589,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
587 case ERFOFF:{ 589 case ERFOFF:{
588 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) { 590 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) {
589 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 591 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
590 ("IPS Set eRf nic disable\n")); 592 "IPS Set eRf nic disable\n");
591 rtl_ps_disable_nic(hw); 593 rtl_ps_disable_nic(hw);
592 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC); 594 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC);
593 } else { 595 } else {
@@ -613,11 +615,9 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
613 continue; 615 continue;
614 } else { 616 } else {
615 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 617 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
616 ("eRf Off/Sleep: " 618 "eRf Off/Sleep: %d times TcbBusyQueue[%d] = %d before doze!\n",
617 "%d times TcbBusyQueue[%d] = " 619 i + 1, queue_id,
618 "%d before doze!\n", 620 skb_queue_len(&ring->queue));
619 (i + 1), queue_id,
620 skb_queue_len(&ring->queue)));
621 621
622 udelay(10); 622 udelay(10);
623 i++; 623 i++;
@@ -625,31 +625,30 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
625 625
626 if (i >= MAX_DOZE_WAITING_TIMES_9x) { 626 if (i >= MAX_DOZE_WAITING_TIMES_9x) {
627 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 627 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
628 ("\nERFOFF: %d times" 628 "ERFOFF: %d times TcbBusyQueue[%d] = %d !\n",
629 "TcbBusyQueue[%d] = %d !\n",
630 MAX_DOZE_WAITING_TIMES_9x, 629 MAX_DOZE_WAITING_TIMES_9x,
631 queue_id, 630 queue_id,
632 skb_queue_len(&ring->queue))); 631 skb_queue_len(&ring->queue));
633 break; 632 break;
634 } 633 }
635 } 634 }
636 635
637 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 636 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
638 ("Set ERFSLEEP awaked:%d ms\n", 637 "Set ERFSLEEP awaked:%d ms\n",
639 jiffies_to_msecs(jiffies - 638 jiffies_to_msecs(jiffies -
640 ppsc->last_awake_jiffies))); 639 ppsc->last_awake_jiffies));
641 640
642 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 641 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
643 ("sleep awaked:%d ms " 642 "sleep awaked:%d ms state_inap:%x\n",
644 "state_inap:%x\n", jiffies_to_msecs(jiffies - 643 jiffies_to_msecs(jiffies -
645 ppsc->last_awake_jiffies), 644 ppsc->last_awake_jiffies),
646 rtlpriv->psc.state_inap)); 645 rtlpriv->psc.state_inap);
647 ppsc->last_sleep_jiffies = jiffies; 646 ppsc->last_sleep_jiffies = jiffies;
648 _rtl92se_phy_set_rf_sleep(hw); 647 _rtl92se_phy_set_rf_sleep(hw);
649 break; 648 break;
650 default: 649 default:
651 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 650 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
652 ("switch case not process\n")); 651 "switch case not processed\n");
653 bresult = false; 652 bresult = false;
654 break; 653 break;
655 } 654 }
@@ -995,7 +994,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
995 994
996 if (rtstatus != true) { 995 if (rtstatus != true) {
997 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 996 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
998 ("Write BB Reg Fail!!")); 997 "Write BB Reg Fail!!\n");
999 goto phy_BB8190_Config_ParaFile_Fail; 998 goto phy_BB8190_Config_ParaFile_Fail;
1000 } 999 }
1001 1000
@@ -1009,8 +1008,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
1009 } 1008 }
1010 if (rtstatus != true) { 1009 if (rtstatus != true) {
1011 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 1010 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
1012 ("_rtl92s_phy_bb_config_parafile(): " 1011 "_rtl92s_phy_bb_config_parafile(): BB_PG Reg Fail!!\n");
1013 "BB_PG Reg Fail!!"));
1014 goto phy_BB8190_Config_ParaFile_Fail; 1012 goto phy_BB8190_Config_ParaFile_Fail;
1015 } 1013 }
1016 1014
@@ -1053,7 +1051,7 @@ u8 rtl92s_phy_config_rf(struct ieee80211_hw *hw, enum radio_path rfpath)
1053 radio_b_tblen = RADIOB_ARRAYLENGTH; 1051 radio_b_tblen = RADIOB_ARRAYLENGTH;
1054 } 1052 }
1055 1053
1056 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Radio No %x\n", rfpath)); 1054 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Radio No %x\n", rfpath);
1057 rtstatus = true; 1055 rtstatus = true;
1058 1056
1059 switch (rfpath) { 1057 switch (rfpath) {
@@ -1175,11 +1173,11 @@ bool rtl92s_phy_bb_config(struct ieee80211_hw *hw)
1175 (rtlphy->rf_type == RF_2T2R && rf_num != 2) || 1173 (rtlphy->rf_type == RF_2T2R && rf_num != 2) ||
1176 (rtlphy->rf_type == RF_2T2R_GREEN && rf_num != 2)) { 1174 (rtlphy->rf_type == RF_2T2R_GREEN && rf_num != 2)) {
1177 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 1175 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
1178 ("RF_Type(%x) does not match " 1176 "RF_Type(%x) does not match RF_Num(%x)!!\n",
1179 "RF_Num(%x)!!\n", rtlphy->rf_type, rf_num)); 1177 rtlphy->rf_type, rf_num);
1180 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 1178 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
1181 ("path1 0x%x, path2 0x%x, pathmap " 1179 "path1 0x%x, path2 0x%x, pathmap 0x%x\n",
1182 "0x%x\n", path1, path2, pathmap)); 1180 path1, path2, pathmap);
1183 } 1181 }
1184 1182
1185 return rtstatus; 1183 return rtstatus;
@@ -1214,20 +1212,20 @@ void rtl92s_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
1214 ROFDM0_XCAGCCORE1, MASKBYTE0); 1212 ROFDM0_XCAGCCORE1, MASKBYTE0);
1215 rtlphy->default_initialgain[3] = rtl_get_bbreg(hw, 1213 rtlphy->default_initialgain[3] = rtl_get_bbreg(hw,
1216 ROFDM0_XDAGCCORE1, MASKBYTE0); 1214 ROFDM0_XDAGCCORE1, MASKBYTE0);
1217 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Default initial gain " 1215 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1218 "(c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n", 1216 "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n",
1219 rtlphy->default_initialgain[0], 1217 rtlphy->default_initialgain[0],
1220 rtlphy->default_initialgain[1], 1218 rtlphy->default_initialgain[1],
1221 rtlphy->default_initialgain[2], 1219 rtlphy->default_initialgain[2],
1222 rtlphy->default_initialgain[3])); 1220 rtlphy->default_initialgain[3]);
1223 1221
1224 /* read framesync */ 1222 /* read framesync */
1225 rtlphy->framesync = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR3, MASKBYTE0); 1223 rtlphy->framesync = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR3, MASKBYTE0);
1226 rtlphy->framesync_c34 = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR2, 1224 rtlphy->framesync_c34 = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR2,
1227 MASKDWORD); 1225 MASKDWORD);
1228 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1226 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1229 ("Default framesync (0x%x) = 0x%x\n", 1227 "Default framesync (0x%x) = 0x%x\n",
1230 ROFDM0_RXDETECTOR3, rtlphy->framesync)); 1228 ROFDM0_RXDETECTOR3, rtlphy->framesync);
1231 1229
1232} 1230}
1233 1231
@@ -1287,10 +1285,9 @@ void rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8 channel)
1287 &ofdmpowerLevel[0]); 1285 &ofdmpowerLevel[0]);
1288 1286
1289 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1287 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1290 ("Channel-%d, cckPowerLevel (A / B) = " 1288 "Channel-%d, cckPowerLevel (A / B) = 0x%x / 0x%x, ofdmPowerLevel (A / B) = 0x%x / 0x%x\n",
1291 "0x%x / 0x%x, ofdmPowerLevel (A / B) = 0x%x / 0x%x\n", 1289 channel, cckpowerlevel[0], cckpowerlevel[1],
1292 channel, cckpowerlevel[0], cckpowerlevel[1], 1290 ofdmpowerLevel[0], ofdmpowerLevel[1]);
1293 ofdmpowerLevel[0], ofdmpowerLevel[1]));
1294 1291
1295 _rtl92s_phy_ccxpower_indexcheck(hw, channel, &cckpowerlevel[0], 1292 _rtl92s_phy_ccxpower_indexcheck(hw, channel, &cckpowerlevel[0],
1296 &ofdmpowerLevel[0]); 1293 &ofdmpowerLevel[0]);
@@ -1316,7 +1313,7 @@ void rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw)
1316 } while (--pollingcnt); 1313 } while (--pollingcnt);
1317 1314
1318 if (pollingcnt == 0) 1315 if (pollingcnt == 0)
1319 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Set FW Cmd fail!!\n")); 1316 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Set FW Cmd fail!!\n");
1320} 1317}
1321 1318
1322 1319
@@ -1345,20 +1342,17 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1345 1342
1346 switch (rtlhal->current_fwcmd_io) { 1343 switch (rtlhal->current_fwcmd_io) {
1347 case FW_CMD_RA_RESET: 1344 case FW_CMD_RA_RESET:
1348 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1345 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_RA_RESET\n");
1349 ("FW_CMD_RA_RESET\n"));
1350 rtl_write_dword(rtlpriv, WFM5, FW_RA_RESET); 1346 rtl_write_dword(rtlpriv, WFM5, FW_RA_RESET);
1351 rtl92s_phy_chk_fwcmd_iodone(hw); 1347 rtl92s_phy_chk_fwcmd_iodone(hw);
1352 break; 1348 break;
1353 case FW_CMD_RA_ACTIVE: 1349 case FW_CMD_RA_ACTIVE:
1354 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1350 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_RA_ACTIVE\n");
1355 ("FW_CMD_RA_ACTIVE\n"));
1356 rtl_write_dword(rtlpriv, WFM5, FW_RA_ACTIVE); 1351 rtl_write_dword(rtlpriv, WFM5, FW_RA_ACTIVE);
1357 rtl92s_phy_chk_fwcmd_iodone(hw); 1352 rtl92s_phy_chk_fwcmd_iodone(hw);
1358 break; 1353 break;
1359 case FW_CMD_RA_REFRESH_N: 1354 case FW_CMD_RA_REFRESH_N:
1360 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1355 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_RA_REFRESH_N\n");
1361 ("FW_CMD_RA_REFRESH_N\n"));
1362 input = FW_RA_REFRESH; 1356 input = FW_RA_REFRESH;
1363 rtl_write_dword(rtlpriv, WFM5, input); 1357 rtl_write_dword(rtlpriv, WFM5, input);
1364 rtl92s_phy_chk_fwcmd_iodone(hw); 1358 rtl92s_phy_chk_fwcmd_iodone(hw);
@@ -1367,7 +1361,7 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1367 break; 1361 break;
1368 case FW_CMD_RA_REFRESH_BG: 1362 case FW_CMD_RA_REFRESH_BG:
1369 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1363 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
1370 ("FW_CMD_RA_REFRESH_BG\n")); 1364 "FW_CMD_RA_REFRESH_BG\n");
1371 rtl_write_dword(rtlpriv, WFM5, FW_RA_REFRESH); 1365 rtl_write_dword(rtlpriv, WFM5, FW_RA_REFRESH);
1372 rtl92s_phy_chk_fwcmd_iodone(hw); 1366 rtl92s_phy_chk_fwcmd_iodone(hw);
1373 rtl_write_dword(rtlpriv, WFM5, FW_RA_DISABLE_RSSI_MASK); 1367 rtl_write_dword(rtlpriv, WFM5, FW_RA_DISABLE_RSSI_MASK);
@@ -1375,21 +1369,20 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1375 break; 1369 break;
1376 case FW_CMD_RA_REFRESH_N_COMB: 1370 case FW_CMD_RA_REFRESH_N_COMB:
1377 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1371 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
1378 ("FW_CMD_RA_REFRESH_N_COMB\n")); 1372 "FW_CMD_RA_REFRESH_N_COMB\n");
1379 input = FW_RA_IOT_N_COMB; 1373 input = FW_RA_IOT_N_COMB;
1380 rtl_write_dword(rtlpriv, WFM5, input); 1374 rtl_write_dword(rtlpriv, WFM5, input);
1381 rtl92s_phy_chk_fwcmd_iodone(hw); 1375 rtl92s_phy_chk_fwcmd_iodone(hw);
1382 break; 1376 break;
1383 case FW_CMD_RA_REFRESH_BG_COMB: 1377 case FW_CMD_RA_REFRESH_BG_COMB:
1384 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1378 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
1385 ("FW_CMD_RA_REFRESH_BG_COMB\n")); 1379 "FW_CMD_RA_REFRESH_BG_COMB\n");
1386 input = FW_RA_IOT_BG_COMB; 1380 input = FW_RA_IOT_BG_COMB;
1387 rtl_write_dword(rtlpriv, WFM5, input); 1381 rtl_write_dword(rtlpriv, WFM5, input);
1388 rtl92s_phy_chk_fwcmd_iodone(hw); 1382 rtl92s_phy_chk_fwcmd_iodone(hw);
1389 break; 1383 break;
1390 case FW_CMD_IQK_ENABLE: 1384 case FW_CMD_IQK_ENABLE:
1391 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1385 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_IQK_ENABLE\n");
1392 ("FW_CMD_IQK_ENABLE\n"));
1393 rtl_write_dword(rtlpriv, WFM5, FW_IQK_ENABLE); 1386 rtl_write_dword(rtlpriv, WFM5, FW_IQK_ENABLE);
1394 rtl92s_phy_chk_fwcmd_iodone(hw); 1387 rtl92s_phy_chk_fwcmd_iodone(hw);
1395 break; 1388 break;
@@ -1424,8 +1417,7 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1424 rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, 0xcd); 1417 rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, 0xcd);
1425 break; 1418 break;
1426 case FW_CMD_LPS_ENTER: 1419 case FW_CMD_LPS_ENTER:
1427 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1420 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_LPS_ENTER\n");
1428 ("FW_CMD_LPS_ENTER\n"));
1429 current_aid = rtlpriv->mac80211.assoc_id; 1421 current_aid = rtlpriv->mac80211.assoc_id;
1430 rtl_write_dword(rtlpriv, WFM5, (FW_LPS_ENTER | 1422 rtl_write_dword(rtlpriv, WFM5, (FW_LPS_ENTER |
1431 ((current_aid | 0xc000) << 8))); 1423 ((current_aid | 0xc000) << 8)));
@@ -1434,20 +1426,18 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1434 * turbo mode until driver leave LPS */ 1426 * turbo mode until driver leave LPS */
1435 break; 1427 break;
1436 case FW_CMD_LPS_LEAVE: 1428 case FW_CMD_LPS_LEAVE:
1437 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1429 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_LPS_LEAVE\n");
1438 ("FW_CMD_LPS_LEAVE\n"));
1439 rtl_write_dword(rtlpriv, WFM5, FW_LPS_LEAVE); 1430 rtl_write_dword(rtlpriv, WFM5, FW_LPS_LEAVE);
1440 rtl92s_phy_chk_fwcmd_iodone(hw); 1431 rtl92s_phy_chk_fwcmd_iodone(hw);
1441 break; 1432 break;
1442 case FW_CMD_ADD_A2_ENTRY: 1433 case FW_CMD_ADD_A2_ENTRY:
1443 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1434 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, "FW_CMD_ADD_A2_ENTRY\n");
1444 ("FW_CMD_ADD_A2_ENTRY\n"));
1445 rtl_write_dword(rtlpriv, WFM5, FW_ADD_A2_ENTRY); 1435 rtl_write_dword(rtlpriv, WFM5, FW_ADD_A2_ENTRY);
1446 rtl92s_phy_chk_fwcmd_iodone(hw); 1436 rtl92s_phy_chk_fwcmd_iodone(hw);
1447 break; 1437 break;
1448 case FW_CMD_CTRL_DM_BY_DRIVER: 1438 case FW_CMD_CTRL_DM_BY_DRIVER:
1449 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1439 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1450 ("FW_CMD_CTRL_DM_BY_DRIVER\n")); 1440 "FW_CMD_CTRL_DM_BY_DRIVER\n");
1451 rtl_write_dword(rtlpriv, WFM5, FW_CTRL_DM_BY_DRIVER); 1441 rtl_write_dword(rtlpriv, WFM5, FW_CTRL_DM_BY_DRIVER);
1452 rtl92s_phy_chk_fwcmd_iodone(hw); 1442 rtl92s_phy_chk_fwcmd_iodone(hw);
1453 break; 1443 break;
@@ -1472,8 +1462,8 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1472 bool bPostProcessing = false; 1462 bool bPostProcessing = false;
1473 1463
1474 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1464 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1475 ("Set FW Cmd(%#x), set_fwcmd_inprogress(%d)\n", 1465 "Set FW Cmd(%#x), set_fwcmd_inprogress(%d)\n",
1476 fw_cmdio, rtlhal->set_fwcmd_inprogress)); 1466 fw_cmdio, rtlhal->set_fwcmd_inprogress);
1477 1467
1478 do { 1468 do {
1479 /* We re-map to combined FW CMD ones if firmware version */ 1469 /* We re-map to combined FW CMD ones if firmware version */
@@ -1501,7 +1491,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1501 * DM map table in the future. */ 1491 * DM map table in the future. */
1502 switch (fw_cmdio) { 1492 switch (fw_cmdio) {
1503 case FW_CMD_RA_INIT: 1493 case FW_CMD_RA_INIT:
1504 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("RA init!!\n")); 1494 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "RA init!!\n");
1505 fw_cmdmap |= FW_RA_INIT_CTL; 1495 fw_cmdmap |= FW_RA_INIT_CTL;
1506 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1496 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1507 /* Clear control flag to sync with FW. */ 1497 /* Clear control flag to sync with FW. */
@@ -1509,7 +1499,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1509 break; 1499 break;
1510 case FW_CMD_DIG_DISABLE: 1500 case FW_CMD_DIG_DISABLE:
1511 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1501 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1512 ("Set DIG disable!!\n")); 1502 "Set DIG disable!!\n");
1513 fw_cmdmap &= ~FW_DIG_ENABLE_CTL; 1503 fw_cmdmap &= ~FW_DIG_ENABLE_CTL;
1514 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1504 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1515 break; 1505 break;
@@ -1517,14 +1507,14 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1517 case FW_CMD_DIG_RESUME: 1507 case FW_CMD_DIG_RESUME:
1518 if (!(rtlpriv->dm.dm_flag & HAL_DM_DIG_DISABLE)) { 1508 if (!(rtlpriv->dm.dm_flag & HAL_DM_DIG_DISABLE)) {
1519 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1509 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1520 ("Set DIG enable or resume!!\n")); 1510 "Set DIG enable or resume!!\n");
1521 fw_cmdmap |= (FW_DIG_ENABLE_CTL | FW_SS_CTL); 1511 fw_cmdmap |= (FW_DIG_ENABLE_CTL | FW_SS_CTL);
1522 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1512 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1523 } 1513 }
1524 break; 1514 break;
1525 case FW_CMD_DIG_HALT: 1515 case FW_CMD_DIG_HALT:
1526 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1516 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1527 ("Set DIG halt!!\n")); 1517 "Set DIG halt!!\n");
1528 fw_cmdmap &= ~(FW_DIG_ENABLE_CTL | FW_SS_CTL); 1518 fw_cmdmap &= ~(FW_DIG_ENABLE_CTL | FW_SS_CTL);
1529 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1519 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1530 break; 1520 break;
@@ -1540,9 +1530,8 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1540 (rtlefuse->thermalmeter[0] << 16)); 1530 (rtlefuse->thermalmeter[0] << 16));
1541 1531
1542 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1532 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1543 ("Set TxPwr tracking!! " 1533 "Set TxPwr tracking!! FwCmdMap(%#x), FwParam(%#x)\n",
1544 "FwCmdMap(%#x), FwParam(%#x)\n", 1534 fw_cmdmap, fw_param);
1545 fw_cmdmap, fw_param));
1546 1535
1547 FW_CMD_PARA_SET(rtlpriv, fw_param); 1536 FW_CMD_PARA_SET(rtlpriv, fw_param);
1548 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1537 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
@@ -1563,9 +1552,8 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1563 fw_param &= FW_RA_PARAM_CLR; 1552 fw_param &= FW_RA_PARAM_CLR;
1564 1553
1565 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1554 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1566 ("[FW CMD] [New Version] " 1555 "[FW CMD] [New Version] Set RA/IOT Comb in n mode!! FwCmdMap(%#x), FwParam(%#x)\n",
1567 "Set RA/IOT Comb in n mode!! FwCmdMap(%#x), " 1556 fw_cmdmap, fw_param);
1568 "FwParam(%#x)\n", fw_cmdmap, fw_param));
1569 1557
1570 FW_CMD_PARA_SET(rtlpriv, fw_param); 1558 FW_CMD_PARA_SET(rtlpriv, fw_param);
1571 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1559 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
@@ -1652,7 +1640,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1652 break; 1640 break;
1653 case FW_CMD_PAPE_CONTROL: 1641 case FW_CMD_PAPE_CONTROL:
1654 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1642 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1655 ("[FW CMD] Set PAPE Control\n")); 1643 "[FW CMD] Set PAPE Control\n");
1656 fw_cmdmap &= ~FW_PAPE_CTL_BY_SW_HW; 1644 fw_cmdmap &= ~FW_PAPE_CTL_BY_SW_HW;
1657 1645
1658 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1646 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/rf.c b/drivers/net/wireless/rtlwifi/rtl8192se/rf.c
index 0ad50fe44aa2..8966b731f7e2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/rf.c
@@ -123,13 +123,13 @@ static void _rtl92s_get_powerbase(struct ieee80211_hw *hw, u8 *p_pwrlevel,
123 } 123 }
124 124
125 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) { 125 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
126 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("40MHz finalpwr_idx " 126 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
127 "(A / B) = 0x%x / 0x%x\n", p_final_pwridx[0], 127 "40MHz finalpwr_idx (A / B) = 0x%x / 0x%x\n",
128 p_final_pwridx[1])); 128 p_final_pwridx[0], p_final_pwridx[1]);
129 } else { 129 } else {
130 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("20MHz finalpwr_idx " 130 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
131 "(A / B) = 0x%x / 0x%x\n", p_final_pwridx[0], 131 "20MHz finalpwr_idx (A / B) = 0x%x / 0x%x\n",
132 p_final_pwridx[1])); 132 p_final_pwridx[0], p_final_pwridx[1]);
133 } 133 }
134} 134}
135 135
@@ -153,9 +153,8 @@ static void _rtl92s_set_antennadiff(struct ieee80211_hw *hw,
153 ant_pwr_diff = -8; 153 ant_pwr_diff = -8;
154 154
155 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 155 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
156 ("Antenna Diff from RF-B " 156 "Antenna Diff from RF-B to RF-A = %d (0x%x)\n",
157 "to RF-A = %d (0x%x)\n", ant_pwr_diff, 157 ant_pwr_diff, ant_pwr_diff & 0xf);
158 ant_pwr_diff & 0xf));
159 158
160 ant_pwr_diff &= 0xf; 159 ant_pwr_diff &= 0xf;
161 } 160 }
@@ -172,9 +171,8 @@ static void _rtl92s_set_antennadiff(struct ieee80211_hw *hw,
172 rtl_set_bbreg(hw, RFPGA0_TXGAINSTAGE, (BXBTXAGC | BXCTXAGC | BXDTXAGC), 171 rtl_set_bbreg(hw, RFPGA0_TXGAINSTAGE, (BXBTXAGC | BXCTXAGC | BXDTXAGC),
173 u4reg_val); 172 u4reg_val);
174 173
175 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 174 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "Write BCD-Diff(0x%x) = 0x%x\n",
176 ("Write BCD-Diff(0x%x) = 0x%x\n", 175 RFPGA0_TXGAINSTAGE, u4reg_val);
177 RFPGA0_TXGAINSTAGE, u4reg_val));
178} 176}
179 177
180static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw, 178static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
@@ -201,8 +199,7 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
201 ((index < 2) ? pwrbase0 : pwrbase1); 199 ((index < 2) ? pwrbase0 : pwrbase1);
202 200
203 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 201 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
204 ("RTK better performance, " 202 "RTK better performance, writeval = 0x%x\n", writeval);
205 "writeval = 0x%x\n", writeval));
206 break; 203 break;
207 case 1: 204 case 1:
208 /* Realtek regulatory increase power diff defined 205 /* Realtek regulatory increase power diff defined
@@ -211,8 +208,8 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
211 writeval = ((index < 2) ? pwrbase0 : pwrbase1); 208 writeval = ((index < 2) ? pwrbase0 : pwrbase1);
212 209
213 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 210 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
214 ("Realtek regulatory, " 211 "Realtek regulatory, 40MHz, writeval = 0x%x\n",
215 "40MHz, writeval = 0x%x\n", writeval)); 212 writeval);
216 } else { 213 } else {
217 if (rtlphy->pwrgroup_cnt == 1) 214 if (rtlphy->pwrgroup_cnt == 1)
218 chnlgroup = 0; 215 chnlgroup = 0;
@@ -234,16 +231,15 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
234 pwrbase0 : pwrbase1); 231 pwrbase0 : pwrbase1);
235 232
236 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 233 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
237 ("Realtek regulatory, " 234 "Realtek regulatory, 20MHz, writeval = 0x%x\n",
238 "20MHz, writeval = 0x%x\n", writeval)); 235 writeval);
239 } 236 }
240 break; 237 break;
241 case 2: 238 case 2:
242 /* Better regulatory don't increase any power diff */ 239 /* Better regulatory don't increase any power diff */
243 writeval = ((index < 2) ? pwrbase0 : pwrbase1); 240 writeval = ((index < 2) ? pwrbase0 : pwrbase1);
244 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 241 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
245 ("Better regulatory, " 242 "Better regulatory, writeval = 0x%x\n", writeval);
246 "writeval = 0x%x\n", writeval));
247 break; 243 break;
248 case 3: 244 case 3:
249 /* Customer defined power diff. increase power diff 245 /* Customer defined power diff. increase power diff
@@ -252,14 +248,14 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
252 248
253 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) { 249 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
254 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 250 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
255 ("customer's limit, 40MHz = 0x%x\n", 251 "customer's limit, 40MHz = 0x%x\n",
256 rtlefuse->pwrgroup_ht40 252 rtlefuse->pwrgroup_ht40
257 [RF90_PATH_A][chnl - 1])); 253 [RF90_PATH_A][chnl - 1]);
258 } else { 254 } else {
259 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 255 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
260 ("customer's limit, 20MHz = 0x%x\n", 256 "customer's limit, 20MHz = 0x%x\n",
261 rtlefuse->pwrgroup_ht20 257 rtlefuse->pwrgroup_ht20
262 [RF90_PATH_A][chnl - 1])); 258 [RF90_PATH_A][chnl - 1]);
263 } 259 }
264 260
265 for (i = 0; i < 4; i++) { 261 for (i = 0; i < 4; i++) {
@@ -293,22 +289,19 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
293 (pwrdiff_limit[1] << 8) | 289 (pwrdiff_limit[1] << 8) |
294 (pwrdiff_limit[0]); 290 (pwrdiff_limit[0]);
295 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 291 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
296 ("Customer's limit = 0x%x\n", 292 "Customer's limit = 0x%x\n", customer_limit);
297 customer_limit));
298 293
299 writeval = customer_limit + ((index < 2) ? 294 writeval = customer_limit + ((index < 2) ?
300 pwrbase0 : pwrbase1); 295 pwrbase0 : pwrbase1);
301 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 296 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
302 ("Customer, writeval = " 297 "Customer, writeval = 0x%x\n", writeval);
303 "0x%x\n", writeval));
304 break; 298 break;
305 default: 299 default:
306 chnlgroup = 0; 300 chnlgroup = 0;
307 writeval = rtlphy->mcs_txpwrlevel_origoffset[chnlgroup][index] + 301 writeval = rtlphy->mcs_txpwrlevel_origoffset[chnlgroup][index] +
308 ((index < 2) ? pwrbase0 : pwrbase1); 302 ((index < 2) ? pwrbase0 : pwrbase1);
309 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 303 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
310 ("RTK better performance, " 304 "RTK better performance, writeval = 0x%x\n", writeval);
311 "writeval = 0x%x\n", writeval));
312 break; 305 break;
313 } 306 }
314 307
@@ -541,8 +534,7 @@ void rtl92s_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
541 break; 534 break;
542 default: 535 default:
543 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 536 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
544 ("unknown bandwidth: %#X\n", 537 "unknown bandwidth: %#X\n", bandwidth);
545 bandwidth));
546 break; 538 break;
547 } 539 }
548} 540}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 78723cf59491..bc4b6fa4fc85 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -188,7 +188,7 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
188 rtlpriv->rtlhal.pfirmware = vzalloc(sizeof(struct rt_firmware)); 188 rtlpriv->rtlhal.pfirmware = vzalloc(sizeof(struct rt_firmware));
189 if (!rtlpriv->rtlhal.pfirmware) { 189 if (!rtlpriv->rtlhal.pfirmware) {
190 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 190 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
191 ("Can't alloc buffer for fw.\n")); 191 "Can't alloc buffer for fw\n");
192 return 1; 192 return 1;
193 } 193 }
194 194
@@ -199,12 +199,12 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
199 rtlpriv->io.dev); 199 rtlpriv->io.dev);
200 if (err) { 200 if (err) {
201 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 201 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
202 ("Failed to request firmware!\n")); 202 "Failed to request firmware!\n");
203 return 1; 203 return 1;
204 } 204 }
205 if (firmware->size > sizeof(struct rt_firmware)) { 205 if (firmware->size > sizeof(struct rt_firmware)) {
206 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 206 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
207 ("Firmware is too big!\n")); 207 "Firmware is too big!\n");
208 release_firmware(firmware); 208 release_firmware(firmware);
209 return 1; 209 return 1;
210 } 210 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index fbebe3ea0a22..1f266d1d7951 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -756,7 +756,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
756 /* DOWRD 8 */ 756 /* DOWRD 8 */
757 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); 757 SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping));
758 758
759 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, ("\n")); 759 RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n");
760} 760}
761 761
762void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, 762void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 1b8e68e70f8a..d670e6886c1f 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -276,14 +276,14 @@ static int _rtl_usb_init_tx(struct ieee80211_hw *hw)
276 ? USB_HIGH_SPEED_BULK_SIZE 276 ? USB_HIGH_SPEED_BULK_SIZE
277 : USB_FULL_SPEED_BULK_SIZE; 277 : USB_FULL_SPEED_BULK_SIZE;
278 278
279 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("USB Max Bulk-out Size=%d\n", 279 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "USB Max Bulk-out Size=%d\n",
280 rtlusb->max_bulk_out_size)); 280 rtlusb->max_bulk_out_size);
281 281
282 for (i = 0; i < __RTL_TXQ_NUM; i++) { 282 for (i = 0; i < __RTL_TXQ_NUM; i++) {
283 u32 ep_num = rtlusb->ep_map.ep_mapping[i]; 283 u32 ep_num = rtlusb->ep_map.ep_mapping[i];
284 if (!ep_num) { 284 if (!ep_num) {
285 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 285 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
286 ("Invalid endpoint map setting!\n")); 286 "Invalid endpoint map setting!\n");
287 return -EINVAL; 287 return -EINVAL;
288 } 288 }
289 } 289 }
@@ -345,9 +345,9 @@ static int _rtl_usb_init(struct ieee80211_hw *hw)
345 rtlusb->out_ep_nums++; 345 rtlusb->out_ep_nums++;
346 346
347 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 347 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
348 ("USB EP(0x%02x), MaxPacketSize=%d ,Interval=%d.\n", 348 "USB EP(0x%02x), MaxPacketSize=%d, Interval=%d\n",
349 pep_desc->bEndpointAddress, pep_desc->wMaxPacketSize, 349 pep_desc->bEndpointAddress, pep_desc->wMaxPacketSize,
350 pep_desc->bInterval)); 350 pep_desc->bInterval);
351 } 351 }
352 if (rtlusb->in_ep_nums < rtlpriv->cfg->usb_interface_cfg->in_ep_num) 352 if (rtlusb->in_ep_nums < rtlpriv->cfg->usb_interface_cfg->in_ep_num)
353 return -EINVAL ; 353 return -EINVAL ;
@@ -414,7 +414,7 @@ static struct sk_buff *_rtl_prep_rx_urb(struct ieee80211_hw *hw,
414 gfp_mask); 414 gfp_mask);
415 if (!skb) { 415 if (!skb) {
416 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 416 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
417 ("Failed to __dev_alloc_skb!!\n")); 417 "Failed to __dev_alloc_skb!!\n");
418 return ERR_PTR(-ENOMEM); 418 return ERR_PTR(-ENOMEM);
419 } 419 }
420 420
@@ -575,7 +575,7 @@ static void _rtl_rx_completed(struct urb *_urb)
575 if (IS_ERR(_skb)) { 575 if (IS_ERR(_skb)) {
576 err = PTR_ERR(_skb); 576 err = PTR_ERR(_skb);
577 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 577 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
578 ("Can't allocate skb for bulk IN!\n")); 578 "Can't allocate skb for bulk IN!\n");
579 return; 579 return;
580 } 580 }
581 skb = _skb; 581 skb = _skb;
@@ -632,14 +632,14 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
632 urb = usb_alloc_urb(0, GFP_KERNEL); 632 urb = usb_alloc_urb(0, GFP_KERNEL);
633 if (!urb) { 633 if (!urb) {
634 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 634 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
635 ("Failed to alloc URB!!\n")); 635 "Failed to alloc URB!!\n");
636 goto err_out; 636 goto err_out;
637 } 637 }
638 638
639 skb = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL); 639 skb = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL);
640 if (IS_ERR(skb)) { 640 if (IS_ERR(skb)) {
641 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 641 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
642 ("Failed to prep_rx_urb!!\n")); 642 "Failed to prep_rx_urb!!\n");
643 err = PTR_ERR(skb); 643 err = PTR_ERR(skb);
644 goto err_out; 644 goto err_out;
645 } 645 }
@@ -745,7 +745,7 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
745 struct sk_buff *skb; 745 struct sk_buff *skb;
746 746
747 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 747 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
748 ("Failed to submit urb.\n")); 748 "Failed to submit urb\n");
749 usb_unanchor_urb(_urb); 749 usb_unanchor_urb(_urb);
750 skb = (struct sk_buff *)_urb->context; 750 skb = (struct sk_buff *)_urb->context;
751 kfree_skb(skb); 751 kfree_skb(skb);
@@ -768,7 +768,7 @@ static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
768 768
769 if (urb->status) { 769 if (urb->status) {
770 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 770 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
771 ("Urb has error status 0x%X\n", urb->status)); 771 "Urb has error status 0x%X\n", urb->status);
772 goto out; 772 goto out;
773 } 773 }
774 /* TODO: statistics */ 774 /* TODO: statistics */
@@ -805,7 +805,7 @@ static struct urb *_rtl_usb_tx_urb_setup(struct ieee80211_hw *hw,
805 _urb = usb_alloc_urb(0, GFP_ATOMIC); 805 _urb = usb_alloc_urb(0, GFP_ATOMIC);
806 if (!_urb) { 806 if (!_urb) {
807 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 807 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
808 ("Can't allocate URB for bulk out!\n")); 808 "Can't allocate URB for bulk out!\n");
809 kfree_skb(skb); 809 kfree_skb(skb);
810 return NULL; 810 return NULL;
811 } 811 }
@@ -830,7 +830,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
830 WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl); 830 WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl);
831 if (unlikely(IS_USB_STOP(rtlusb))) { 831 if (unlikely(IS_USB_STOP(rtlusb))) {
832 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, 832 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
833 ("USB device is stopping...\n")); 833 "USB device is stopping...\n");
834 kfree_skb(skb); 834 kfree_skb(skb);
835 return; 835 return;
836 } 836 }
@@ -840,7 +840,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
840 _urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num); 840 _urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num);
841 if (unlikely(!_urb)) { 841 if (unlikely(!_urb)) {
842 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 842 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
843 ("Can't allocate urb. Drop skb!\n")); 843 "Can't allocate urb. Drop skb!\n");
844 return; 844 return;
845 } 845 }
846 urb_list = &rtlusb->tx_pending[ep_num]; 846 urb_list = &rtlusb->tx_pending[ep_num];
@@ -865,7 +865,7 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb,
865 865
866 memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); 866 memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc));
867 if (ieee80211_is_auth(fc)) { 867 if (ieee80211_is_auth(fc)) {
868 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n")); 868 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "MAC80211_LINKING\n");
869 rtl_ips_nic_on(hw); 869 rtl_ips_nic_on(hw);
870 } 870 }
871 871
@@ -969,8 +969,7 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
969 /*like read eeprom and so on */ 969 /*like read eeprom and so on */
970 rtlpriv->cfg->ops->read_eeprom_info(hw); 970 rtlpriv->cfg->ops->read_eeprom_info(hw);
971 if (rtlpriv->cfg->ops->init_sw_vars(hw)) { 971 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
972 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 972 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
973 ("Can't init_sw_vars.\n"));
974 goto error_out; 973 goto error_out;
975 } 974 }
976 rtlpriv->cfg->ops->init_sw_leds(hw); 975 rtlpriv->cfg->ops->init_sw_leds(hw);
@@ -980,7 +979,7 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
980 err = rtl_init_core(hw); 979 err = rtl_init_core(hw);
981 if (err) { 980 if (err) {
982 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 981 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
983 ("Can't allocate sw for mac80211.\n")); 982 "Can't allocate sw for mac80211\n");
984 goto error_out; 983 goto error_out;
985 } 984 }
986 985
@@ -990,7 +989,7 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
990 err = ieee80211_register_hw(hw); 989 err = ieee80211_register_hw(hw);
991 if (err) { 990 if (err) {
992 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 991 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
993 ("Can't register mac80211 hw.\n")); 992 "Can't register mac80211 hw\n");
994 goto error_out; 993 goto error_out;
995 } else { 994 } else {
996 rtlpriv->mac80211.mac80211_registered = 1; 995 rtlpriv->mac80211.mac80211_registered = 1;