aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/rtl8192se
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192se')
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/def.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/dm.c32
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/dm.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/fw.c70
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/fw.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/hw.c262
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/hw.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/led.c22
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/led.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/phy.c208
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/phy.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/reg.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/rf.c64
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/rf.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/sw.c82
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/sw.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/table.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/table.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c20
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.h2
20 files changed, 397 insertions, 387 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
index c6c044816d39..d1b0a1e14971 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
index 4203a8531ca0..fbabae17259e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -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/dm.h b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
index 9051a556acc4..e1b19a641765 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/fw.c b/drivers/net/wireless/rtlwifi/rtl8192se/fw.c
index 3fda6b1dcf46..0d8bf5657008 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -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
@@ -364,7 +364,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
364 u8 fwstatus = FW_STATUS_INIT; 364 u8 fwstatus = FW_STATUS_INIT;
365 bool rtstatus = true; 365 bool rtstatus = true;
366 366
367 if (!rtlhal->pfirmware) 367 if (rtlpriv->max_fw_size == 0 || !rtlhal->pfirmware)
368 return 1; 368 return 1;
369 369
370 firmware = (struct rt_firmware *)rtlhal->pfirmware; 370 firmware = (struct rt_firmware *)rtlhal->pfirmware;
@@ -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/fw.h b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
index 74cc503efe8a..babe85d4b694 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index c474486e3911..22098c2f38f1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -27,8 +27,6 @@
27 * 27 *
28 *****************************************************************************/ 28 *****************************************************************************/
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
32#include "../wifi.h" 30#include "../wifi.h"
33#include "../efuse.h" 31#include "../efuse.h"
34#include "../base.h" 32#include "../base.h"
@@ -80,8 +78,8 @@ void rtl92se_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
80 break; 78 break;
81 } 79 }
82 default: { 80 default: {
83 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 81 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
84 ("switch case not process\n")); 82 "switch case not processed\n");
85 break; 83 break;
86 } 84 }
87 } 85 }
@@ -140,7 +138,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
140 u8 e_aci; 138 u8 e_aci;
141 139
142 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 140 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
143 ("HW_VAR_SLOT_TIME %x\n", val[0])); 141 "HW_VAR_SLOT_TIME %x\n", val[0]);
144 142
145 rtl_write_byte(rtlpriv, SLOT_TIME, val[0]); 143 rtl_write_byte(rtlpriv, SLOT_TIME, val[0]);
146 144
@@ -185,8 +183,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
185 *val = min_spacing_to_set; 183 *val = min_spacing_to_set;
186 184
187 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 185 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
188 ("Set HW_VAR_AMPDU_MIN_SPACE: %#x\n", 186 "Set HW_VAR_AMPDU_MIN_SPACE: %#x\n",
189 mac->min_space_cfg)); 187 mac->min_space_cfg);
190 188
191 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE, 189 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE,
192 mac->min_space_cfg); 190 mac->min_space_cfg);
@@ -201,8 +199,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
201 mac->min_space_cfg |= (density_to_set << 3); 199 mac->min_space_cfg |= (density_to_set << 3);
202 200
203 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 201 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
204 ("Set HW_VAR_SHORTGI_DENSITY: %#x\n", 202 "Set HW_VAR_SHORTGI_DENSITY: %#x\n",
205 mac->min_space_cfg)); 203 mac->min_space_cfg);
206 204
207 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE, 205 rtl_write_byte(rtlpriv, AMPDU_MIN_SPACE,
208 mac->min_space_cfg); 206 mac->min_space_cfg);
@@ -244,8 +242,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
244 rtl_write_byte(rtlpriv, AGGLEN_LMT_H, regtoset); 242 rtl_write_byte(rtlpriv, AGGLEN_LMT_H, regtoset);
245 243
246 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD, 244 RT_TRACE(rtlpriv, COMP_MLME, DBG_LOUD,
247 ("Set HW_VAR_AMPDU_FACTOR: %#x\n", 245 "Set HW_VAR_AMPDU_FACTOR: %#x\n",
248 factor_toset)); 246 factor_toset);
249 } 247 }
250 break; 248 break;
251 } 249 }
@@ -282,8 +280,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
282 break; 280 break;
283 default: 281 default:
284 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 282 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
285 ("HW_VAR_ACM_CTRL acm set " 283 "HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
286 "failed: eACI is %d\n", acm)); 284 acm);
287 break; 285 break;
288 } 286 }
289 } else { 287 } else {
@@ -299,13 +297,13 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
299 break; 297 break;
300 default: 298 default:
301 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 299 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
302 ("switch case not process\n")); 300 "switch case not processed\n");
303 break; 301 break;
304 } 302 }
305 } 303 }
306 304
307 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE, 305 RT_TRACE(rtlpriv, COMP_QOS, DBG_TRACE,
308 ("HW_VAR_ACM_CTRL Write 0x%X\n", acm_ctrl)); 306 "HW_VAR_ACM_CTRL Write 0x%X\n", acm_ctrl);
309 rtl_write_byte(rtlpriv, AcmHwCtrl, acm_ctrl); 307 rtl_write_byte(rtlpriv, AcmHwCtrl, acm_ctrl);
310 break; 308 break;
311 } 309 }
@@ -404,7 +402,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
404 } 402 }
405 default: 403 default:
406 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 404 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
407 ("switch case not process\n")); 405 "switch case not processed\n");
408 break; 406 break;
409 } 407 }
410 408
@@ -415,14 +413,14 @@ void rtl92se_enable_hw_security_config(struct ieee80211_hw *hw)
415 struct rtl_priv *rtlpriv = rtl_priv(hw); 413 struct rtl_priv *rtlpriv = rtl_priv(hw);
416 u8 sec_reg_value = 0x0; 414 u8 sec_reg_value = 0x0;
417 415
418 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("PairwiseEncAlgorithm = %d " 416 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
419 "GroupEncAlgorithm = %d\n", 417 "PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n",
420 rtlpriv->sec.pairwise_enc_algorithm, 418 rtlpriv->sec.pairwise_enc_algorithm,
421 rtlpriv->sec.group_enc_algorithm)); 419 rtlpriv->sec.group_enc_algorithm);
422 420
423 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { 421 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) {
424 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 422 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
425 ("not open hw encryption\n")); 423 "not open hw encryption\n");
426 return; 424 return;
427 } 425 }
428 426
@@ -433,8 +431,8 @@ void rtl92se_enable_hw_security_config(struct ieee80211_hw *hw)
433 sec_reg_value |= SCR_RXUSEDK; 431 sec_reg_value |= SCR_RXUSEDK;
434 } 432 }
435 433
436 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, ("The SECR-value %x\n", 434 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, "The SECR-value %x\n",
437 sec_reg_value)); 435 sec_reg_value);
438 436
439 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); 437 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value);
440 438
@@ -718,8 +716,8 @@ static void _rtl92se_macconfig_before_fwdownload(struct ieee80211_hw *hw)
718 716
719 if (pollingcnt <= 0) { 717 if (pollingcnt <= 0) {
720 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 718 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
721 ("Polling TXDMA_INIT_VALUE " 719 "Polling TXDMA_INIT_VALUE timeout!! Current TCR(%#x)\n",
722 "timeout!! Current TCR(%#x)\n", tmpu1b)); 720 tmpu1b);
723 tmpu1b = rtl_read_byte(rtlpriv, CMDR); 721 tmpu1b = rtl_read_byte(rtlpriv, CMDR);
724 rtl_write_byte(rtlpriv, CMDR, tmpu1b & (~TXDMA_EN)); 722 rtl_write_byte(rtlpriv, CMDR, tmpu1b & (~TXDMA_EN));
725 udelay(2); 723 udelay(2);
@@ -870,10 +868,10 @@ static void _rtl92se_macconfig_after_fwdownload(struct ieee80211_hw *hw)
870 868
871 /* Change Program timing */ 869 /* Change Program timing */
872 rtl_write_byte(rtlpriv, REG_EFUSE_CTRL + 3, 0x72); 870 rtl_write_byte(rtlpriv, REG_EFUSE_CTRL + 3, 0x72);
873 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("EFUSE CONFIG OK\n")); 871 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "EFUSE CONFIG OK\n");
874 } 872 }
875 873
876 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("OK\n")); 874 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "OK\n");
877 875
878} 876}
879 877
@@ -951,12 +949,9 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
951 rtstatus = rtl92s_download_fw(hw); 949 rtstatus = rtl92s_download_fw(hw);
952 if (!rtstatus) { 950 if (!rtstatus) {
953 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 951 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
954 ("Failed to download FW. " 952 "Failed to download FW. Init HW without FW now... "
955 "Init HW without FW now.., Please copy FW into" 953 "Please copy FW into /lib/firmware/rtlwifi\n");
956 "/lib/firmware/rtlwifi\n")); 954 return 1;
957 rtlhal->fw_ready = false;
958 } else {
959 rtlhal->fw_ready = true;
960 } 955 }
961 956
962 /* After FW download, we have to reset MAC register */ 957 /* After FW download, we have to reset MAC register */
@@ -968,7 +963,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
968 963
969 /* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */ 964 /* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */
970 if (rtl92s_phy_mac_config(hw) != true) { 965 if (rtl92s_phy_mac_config(hw) != true) {
971 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("MAC Config failed\n")); 966 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "MAC Config failed\n");
972 return rtstatus; 967 return rtstatus;
973 } 968 }
974 969
@@ -978,7 +973,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
978 973
979 /* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */ 974 /* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */
980 if (rtl92s_phy_bb_config(hw) != true) { 975 if (rtl92s_phy_bb_config(hw) != true) {
981 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, ("BB Config failed\n")); 976 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "BB Config failed\n");
982 return rtstatus; 977 return rtstatus;
983 } 978 }
984 979
@@ -1014,7 +1009,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
1014 rtl_write_byte(rtlpriv, RF_CTRL, 0x07); 1009 rtl_write_byte(rtlpriv, RF_CTRL, 0x07);
1015 1010
1016 if (rtl92s_phy_rf_config(hw) != true) { 1011 if (rtl92s_phy_rf_config(hw) != true) {
1017 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("RF Config failed\n")); 1012 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "RF Config failed\n");
1018 return rtstatus; 1013 return rtstatus;
1019 } 1014 }
1020 1015
@@ -1129,26 +1124,26 @@ static int _rtl92se_set_media_status(struct ieee80211_hw *hw,
1129 case NL80211_IFTYPE_UNSPECIFIED: 1124 case NL80211_IFTYPE_UNSPECIFIED:
1130 bt_msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT); 1125 bt_msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT);
1131 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1126 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1132 ("Set Network type to NO LINK!\n")); 1127 "Set Network type to NO LINK!\n");
1133 break; 1128 break;
1134 case NL80211_IFTYPE_ADHOC: 1129 case NL80211_IFTYPE_ADHOC:
1135 bt_msr |= (MSR_LINK_ADHOC << MSR_LINK_SHIFT); 1130 bt_msr |= (MSR_LINK_ADHOC << MSR_LINK_SHIFT);
1136 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1131 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1137 ("Set Network type to Ad Hoc!\n")); 1132 "Set Network type to Ad Hoc!\n");
1138 break; 1133 break;
1139 case NL80211_IFTYPE_STATION: 1134 case NL80211_IFTYPE_STATION:
1140 bt_msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT); 1135 bt_msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT);
1141 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1136 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1142 ("Set Network type to STA!\n")); 1137 "Set Network type to STA!\n");
1143 break; 1138 break;
1144 case NL80211_IFTYPE_AP: 1139 case NL80211_IFTYPE_AP:
1145 bt_msr |= (MSR_LINK_MASTER << MSR_LINK_SHIFT); 1140 bt_msr |= (MSR_LINK_MASTER << MSR_LINK_SHIFT);
1146 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, 1141 RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE,
1147 ("Set Network type to AP!\n")); 1142 "Set Network type to AP!\n");
1148 break; 1143 break;
1149 default: 1144 default:
1150 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1145 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1151 ("Network type %d not support!\n", type)); 1146 "Network type %d not supported!\n", type);
1152 return 1; 1147 return 1;
1153 break; 1148 break;
1154 1149
@@ -1202,7 +1197,7 @@ void rtl92se_set_qos(struct ieee80211_hw *hw, int aci)
1202 rtl_write_dword(rtlpriv, EDCAPARA_VO, 0x2f3222); 1197 rtl_write_dword(rtlpriv, EDCAPARA_VO, 0x2f3222);
1203 break; 1198 break;
1204 default: 1199 default:
1205 RT_ASSERT(false, ("invalid aci: %d !\n", aci)); 1200 RT_ASSERT(false, "invalid aci: %d !\n", aci);
1206 break; 1201 break;
1207 } 1202 }
1208} 1203}
@@ -1219,9 +1214,14 @@ void rtl92se_enable_interrupt(struct ieee80211_hw *hw)
1219 1214
1220void rtl92se_disable_interrupt(struct ieee80211_hw *hw) 1215void rtl92se_disable_interrupt(struct ieee80211_hw *hw)
1221{ 1216{
1222 struct rtl_priv *rtlpriv = rtl_priv(hw); 1217 struct rtl_priv *rtlpriv;
1223 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1218 struct rtl_pci *rtlpci;
1224 1219
1220 rtlpriv = rtl_priv(hw);
1221 /* if firmware not available, no interrupts */
1222 if (!rtlpriv || !rtlpriv->max_fw_size)
1223 return;
1224 rtlpci = rtl_pcidev(rtl_pcipriv(hw));
1225 rtl_write_dword(rtlpriv, INTA_MASK, 0); 1225 rtl_write_dword(rtlpriv, INTA_MASK, 0);
1226 rtl_write_dword(rtlpriv, INTA_MASK + 4, 0); 1226 rtl_write_dword(rtlpriv, INTA_MASK + 4, 0);
1227 1227
@@ -1583,8 +1583,8 @@ void rtl92se_update_interrupt_mask(struct ieee80211_hw *hw,
1583 struct rtl_priv *rtlpriv = rtl_priv(hw); 1583 struct rtl_priv *rtlpriv = rtl_priv(hw);
1584 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 1584 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
1585 1585
1586 RT_TRACE(rtlpriv, COMP_INTR, DBG_LOUD, 1586 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)); 1587 add_msr, rm_msr);
1588 1588
1589 if (add_msr) 1589 if (add_msr)
1590 rtlpci->irq_mask[0] |= add_msr; 1590 rtlpci->irq_mask[0] |= add_msr;
@@ -1627,7 +1627,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1627 1627
1628 if (rtlefuse->epromtype == EEPROM_93C46) { 1628 if (rtlefuse->epromtype == EEPROM_93C46) {
1629 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1629 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
1630 ("RTL819X Not boot from eeprom, check it !!")); 1630 "RTL819X Not boot from eeprom, check it !!\n");
1631 } else if (rtlefuse->epromtype == EEPROM_BOOT_EFUSE) { 1631 } else if (rtlefuse->epromtype == EEPROM_BOOT_EFUSE) {
1632 rtl_efuse_shadow_map_update(hw); 1632 rtl_efuse_shadow_map_update(hw);
1633 1633
@@ -1636,16 +1636,16 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1636 HWSET_MAX_SIZE_92S); 1636 HWSET_MAX_SIZE_92S);
1637 } 1637 }
1638 1638
1639 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, ("MAP\n"), 1639 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_DMESG, "MAP",
1640 hwinfo, HWSET_MAX_SIZE_92S); 1640 hwinfo, HWSET_MAX_SIZE_92S);
1641 1641
1642 eeprom_id = *((u16 *)&hwinfo[0]); 1642 eeprom_id = *((u16 *)&hwinfo[0]);
1643 if (eeprom_id != RTL8190_EEPROM_ID) { 1643 if (eeprom_id != RTL8190_EEPROM_ID) {
1644 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 1644 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
1645 ("EEPROM ID(%#x) is invalid!!\n", eeprom_id)); 1645 "EEPROM ID(%#x) is invalid!!\n", eeprom_id);
1646 rtlefuse->autoload_failflag = true; 1646 rtlefuse->autoload_failflag = true;
1647 } else { 1647 } else {
1648 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1648 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1649 rtlefuse->autoload_failflag = false; 1649 rtlefuse->autoload_failflag = false;
1650 } 1650 }
1651 1651
@@ -1663,15 +1663,15 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1663 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION]; 1663 rtlefuse->eeprom_version = *(u16 *)&hwinfo[EEPROM_VERSION];
1664 1664
1665 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1665 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1666 ("EEPROMId = 0x%4x\n", eeprom_id)); 1666 "EEPROMId = 0x%4x\n", eeprom_id);
1667 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1667 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1668 ("EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid)); 1668 "EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid);
1669 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1669 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1670 ("EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did)); 1670 "EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did);
1671 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1671 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1672 ("EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid)); 1672 "EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid);
1673 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1673 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1674 ("EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid)); 1674 "EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid);
1675 1675
1676 for (i = 0; i < 6; i += 2) { 1676 for (i = 0; i < 6; i += 2) {
1677 usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i]; 1677 usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i];
@@ -1681,8 +1681,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1681 for (i = 0; i < 6; i++) 1681 for (i = 0; i < 6; i++)
1682 rtl_write_byte(rtlpriv, MACIDR0 + i, rtlefuse->dev_addr[i]); 1682 rtl_write_byte(rtlpriv, MACIDR0 + i, rtlefuse->dev_addr[i]);
1683 1683
1684 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1684 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "%pM\n", rtlefuse->dev_addr);
1685 ("%pM\n", rtlefuse->dev_addr));
1686 1685
1687 /* Get Tx Power Level by Channel */ 1686 /* Get Tx Power Level by Channel */
1688 /* Read Tx power of Channel 1 ~ 14 from EEPROM. */ 1687 /* Read Tx power of Channel 1 ~ 14 from EEPROM. */
@@ -1707,23 +1706,24 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1707 for (rf_path = 0; rf_path < 2; rf_path++) 1706 for (rf_path = 0; rf_path < 2; rf_path++)
1708 for (i = 0; i < 3; i++) 1707 for (i = 0; i < 3; i++)
1709 RTPRINT(rtlpriv, FINIT, INIT_EEPROM, 1708 RTPRINT(rtlpriv, FINIT, INIT_EEPROM,
1710 ("RF(%d) EEPROM CCK Area(%d) = 0x%x\n", rf_path, 1709 "RF(%d) EEPROM CCK Area(%d) = 0x%x\n",
1711 i, rtlefuse->eeprom_chnlarea_txpwr_cck 1710 rf_path, i,
1712 [rf_path][i])); 1711 rtlefuse->eeprom_chnlarea_txpwr_cck
1712 [rf_path][i]);
1713 for (rf_path = 0; rf_path < 2; rf_path++) 1713 for (rf_path = 0; rf_path < 2; rf_path++)
1714 for (i = 0; i < 3; i++) 1714 for (i = 0; i < 3; i++)
1715 RTPRINT(rtlpriv, FINIT, INIT_EEPROM, 1715 RTPRINT(rtlpriv, FINIT, INIT_EEPROM,
1716 ("RF(%d) EEPROM HT40 1S Area(%d) = 0x%x\n", 1716 "RF(%d) EEPROM HT40 1S Area(%d) = 0x%x\n",
1717 rf_path, i, 1717 rf_path, i,
1718 rtlefuse->eeprom_chnlarea_txpwr_ht40_1s 1718 rtlefuse->eeprom_chnlarea_txpwr_ht40_1s
1719 [rf_path][i])); 1719 [rf_path][i]);
1720 for (rf_path = 0; rf_path < 2; rf_path++) 1720 for (rf_path = 0; rf_path < 2; rf_path++)
1721 for (i = 0; i < 3; i++) 1721 for (i = 0; i < 3; i++)
1722 RTPRINT(rtlpriv, FINIT, INIT_EEPROM, 1722 RTPRINT(rtlpriv, FINIT, INIT_EEPROM,
1723 ("RF(%d) EEPROM HT40 2S Diff Area(%d) = 0x%x\n", 1723 "RF(%d) EEPROM HT40 2S Diff Area(%d) = 0x%x\n",
1724 rf_path, i, 1724 rf_path, i,
1725 rtlefuse->eeprom_chnlarea_txpwr_ht40_2sdiif 1725 rtlefuse->eeprom_chnlarea_txpwr_ht40_2sdiif
1726 [rf_path][i])); 1726 [rf_path][i]);
1727 1727
1728 for (rf_path = 0; rf_path < 2; rf_path++) { 1728 for (rf_path = 0; rf_path < 2; rf_path++) {
1729 1729
@@ -1754,11 +1754,11 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1754 1754
1755 for (i = 0; i < 14; i++) { 1755 for (i = 0; i < 14; i++) {
1756 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1756 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1757 ("RF(%d)-Ch(%d) [CCK / HT40_1S / HT40_2S] = " 1757 "RF(%d)-Ch(%d) [CCK / HT40_1S / HT40_2S] = [0x%x / 0x%x / 0x%x]\n",
1758 "[0x%x / 0x%x / 0x%x]\n", rf_path, i, 1758 rf_path, i,
1759 rtlefuse->txpwrlevel_cck[rf_path][i], 1759 rtlefuse->txpwrlevel_cck[rf_path][i],
1760 rtlefuse->txpwrlevel_ht40_1s[rf_path][i], 1760 rtlefuse->txpwrlevel_ht40_1s[rf_path][i],
1761 rtlefuse->txpwrlevel_ht40_2s[rf_path][i])); 1761 rtlefuse->txpwrlevel_ht40_2s[rf_path][i]);
1762 } 1762 }
1763 } 1763 }
1764 1764
@@ -1791,13 +1791,13 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1791 0xf0) >> 4); 1791 0xf0) >> 4);
1792 1792
1793 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1793 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1794 ("RF-%d pwrgroup_ht20[%d] = 0x%x\n", 1794 "RF-%d pwrgroup_ht20[%d] = 0x%x\n",
1795 rf_path, i, 1795 rf_path, i,
1796 rtlefuse->pwrgroup_ht20[rf_path][i])); 1796 rtlefuse->pwrgroup_ht20[rf_path][i]);
1797 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1797 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1798 ("RF-%d pwrgroup_ht40[%d] = 0x%x\n", 1798 "RF-%d pwrgroup_ht40[%d] = 0x%x\n",
1799 rf_path, i, 1799 rf_path, i,
1800 rtlefuse->pwrgroup_ht40[rf_path][i])); 1800 rtlefuse->pwrgroup_ht40[rf_path][i]);
1801 } 1801 }
1802 } 1802 }
1803 1803
@@ -1852,27 +1852,27 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1852 (hwinfo[EEPROM_REGULATORY] & 0x1); 1852 (hwinfo[EEPROM_REGULATORY] & 0x1);
1853 } 1853 }
1854 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1854 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1855 ("eeprom_regulatory = 0x%x\n", rtlefuse->eeprom_regulatory)); 1855 "eeprom_regulatory = 0x%x\n", rtlefuse->eeprom_regulatory);
1856 1856
1857 for (i = 0; i < 14; i++) 1857 for (i = 0; i < 14; i++)
1858 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1858 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1859 ("RF-A Ht20 to HT40 Diff[%d] = 0x%x\n", i, 1859 "RF-A Ht20 to HT40 Diff[%d] = 0x%x\n",
1860 rtlefuse->txpwr_ht20diff[RF90_PATH_A][i])); 1860 i, rtlefuse->txpwr_ht20diff[RF90_PATH_A][i]);
1861 for (i = 0; i < 14; i++) 1861 for (i = 0; i < 14; i++)
1862 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1862 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1863 ("RF-A Legacy to Ht40 Diff[%d] = 0x%x\n", i, 1863 "RF-A Legacy to Ht40 Diff[%d] = 0x%x\n",
1864 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][i])); 1864 i, rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][i]);
1865 for (i = 0; i < 14; i++) 1865 for (i = 0; i < 14; i++)
1866 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1866 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1867 ("RF-B Ht20 to HT40 Diff[%d] = 0x%x\n", i, 1867 "RF-B Ht20 to HT40 Diff[%d] = 0x%x\n",
1868 rtlefuse->txpwr_ht20diff[RF90_PATH_B][i])); 1868 i, rtlefuse->txpwr_ht20diff[RF90_PATH_B][i]);
1869 for (i = 0; i < 14; i++) 1869 for (i = 0; i < 14; i++)
1870 RTPRINT(rtlpriv, FINIT, INIT_TxPower, 1870 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1871 ("RF-B Legacy to HT40 Diff[%d] = 0x%x\n", i, 1871 "RF-B Legacy to HT40 Diff[%d] = 0x%x\n",
1872 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_B][i])); 1872 i, rtlefuse->txpwr_legacyhtdiff[RF90_PATH_B][i]);
1873 1873
1874 RTPRINT(rtlpriv, FINIT, INIT_TxPower, ("TxPwrSafetyFlag = %d\n", 1874 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1875 rtlefuse->txpwr_safetyflag)); 1875 "TxPwrSafetyFlag = %d\n", rtlefuse->txpwr_safetyflag);
1876 1876
1877 /* Read RF-indication and Tx Power gain 1877 /* Read RF-indication and Tx Power gain
1878 * index diff of legacy to HT OFDM rate. */ 1878 * index diff of legacy to HT OFDM rate. */
@@ -1881,8 +1881,8 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1881 rtlefuse->legacy_httxpowerdiff = 1881 rtlefuse->legacy_httxpowerdiff =
1882 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][0]; 1882 rtlefuse->txpwr_legacyhtdiff[RF90_PATH_A][0];
1883 1883
1884 RTPRINT(rtlpriv, FINIT, INIT_TxPower, ("TxPowerDiff = %#x\n", 1884 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1885 rtlefuse->eeprom_txpowerdiff)); 1885 "TxPowerDiff = %#x\n", rtlefuse->eeprom_txpowerdiff);
1886 1886
1887 /* Get TSSI value for each path. */ 1887 /* Get TSSI value for each path. */
1888 usvalue = *(u16 *)&hwinfo[EEPROM_TSSI_A]; 1888 usvalue = *(u16 *)&hwinfo[EEPROM_TSSI_A];
@@ -1890,16 +1890,16 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1890 usvalue = *(u8 *)&hwinfo[EEPROM_TSSI_B]; 1890 usvalue = *(u8 *)&hwinfo[EEPROM_TSSI_B];
1891 rtlefuse->eeprom_tssi[RF90_PATH_B] = (u8)(usvalue & 0xff); 1891 rtlefuse->eeprom_tssi[RF90_PATH_B] = (u8)(usvalue & 0xff);
1892 1892
1893 RTPRINT(rtlpriv, FINIT, INIT_TxPower, ("TSSI_A = 0x%x, TSSI_B = 0x%x\n", 1893 RTPRINT(rtlpriv, FINIT, INIT_TxPower, "TSSI_A = 0x%x, TSSI_B = 0x%x\n",
1894 rtlefuse->eeprom_tssi[RF90_PATH_A], 1894 rtlefuse->eeprom_tssi[RF90_PATH_A],
1895 rtlefuse->eeprom_tssi[RF90_PATH_B])); 1895 rtlefuse->eeprom_tssi[RF90_PATH_B]);
1896 1896
1897 /* Read antenna tx power offset of B/C/D to A from EEPROM */ 1897 /* Read antenna tx power offset of B/C/D to A from EEPROM */
1898 /* and read ThermalMeter from EEPROM */ 1898 /* and read ThermalMeter from EEPROM */
1899 tempval = *(u8 *)&hwinfo[EEPROM_THERMALMETER]; 1899 tempval = *(u8 *)&hwinfo[EEPROM_THERMALMETER];
1900 rtlefuse->eeprom_thermalmeter = tempval; 1900 rtlefuse->eeprom_thermalmeter = tempval;
1901 RTPRINT(rtlpriv, FINIT, INIT_TxPower, ("thermalmeter = 0x%x\n", 1901 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1902 rtlefuse->eeprom_thermalmeter)); 1902 "thermalmeter = 0x%x\n", rtlefuse->eeprom_thermalmeter);
1903 1903
1904 /* ThermalMeter, BIT(0)~3 for RFIC1, BIT(4)~7 for RFIC2 */ 1904 /* ThermalMeter, BIT(0)~3 for RFIC1, BIT(4)~7 for RFIC2 */
1905 rtlefuse->thermalmeter[0] = (rtlefuse->eeprom_thermalmeter & 0x1f); 1905 rtlefuse->thermalmeter[0] = (rtlefuse->eeprom_thermalmeter & 0x1f);
@@ -1915,8 +1915,8 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1915 /* Version ID, Channel plan */ 1915 /* Version ID, Channel plan */
1916 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; 1916 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN];
1917 rtlefuse->txpwr_fromeprom = true; 1917 rtlefuse->txpwr_fromeprom = true;
1918 RTPRINT(rtlpriv, FINIT, INIT_TxPower, ("EEPROM ChannelPlan = 0x%4x\n", 1918 RTPRINT(rtlpriv, FINIT, INIT_TxPower,
1919 rtlefuse->eeprom_channelplan)); 1919 "EEPROM ChannelPlan = 0x%4x\n", rtlefuse->eeprom_channelplan);
1920 1920
1921 /* Read Customer ID or Board Type!!! */ 1921 /* Read Customer ID or Board Type!!! */
1922 tempval = *(u8 *)&hwinfo[EEPROM_BOARDTYPE]; 1922 tempval = *(u8 *)&hwinfo[EEPROM_BOARDTYPE];
@@ -1937,14 +1937,14 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
1937 if (!(tempval & BIT(0))) { 1937 if (!(tempval & BIT(0))) {
1938 rtlefuse->b1x1_recvcombine = true; 1938 rtlefuse->b1x1_recvcombine = true;
1939 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1939 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1940 ("RF_TYPE=1T2R but only 1SS\n")); 1940 "RF_TYPE=1T2R but only 1SS\n");
1941 } 1941 }
1942 } 1942 }
1943 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine; 1943 rtlefuse->b1ss_support = rtlefuse->b1x1_recvcombine;
1944 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMID]; 1944 rtlefuse->eeprom_oemid = *(u8 *)&hwinfo[EEPROM_CUSTOMID];
1945 1945
1946 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("EEPROM Customer ID: 0x%2x", 1946 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "EEPROM Customer ID: 0x%2x",
1947 rtlefuse->eeprom_oemid)); 1947 rtlefuse->eeprom_oemid);
1948 1948
1949 /* set channel paln to world wide 13 */ 1949 /* set channel paln to world wide 13 */
1950 rtlefuse->channel_plan = COUNTRY_CODE_WORLD_WIDE_13; 1950 rtlefuse->channel_plan = COUNTRY_CODE_WORLD_WIDE_13;
@@ -1959,19 +1959,19 @@ void rtl92se_read_eeprom_info(struct ieee80211_hw *hw)
1959 tmp_u1b = rtl_read_byte(rtlpriv, EPROM_CMD); 1959 tmp_u1b = rtl_read_byte(rtlpriv, EPROM_CMD);
1960 1960
1961 if (tmp_u1b & BIT(4)) { 1961 if (tmp_u1b & BIT(4)) {
1962 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EEPROM\n")); 1962 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EEPROM\n");
1963 rtlefuse->epromtype = EEPROM_93C46; 1963 rtlefuse->epromtype = EEPROM_93C46;
1964 } else { 1964 } else {
1965 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, ("Boot from EFUSE\n")); 1965 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EFUSE\n");
1966 rtlefuse->epromtype = EEPROM_BOOT_EFUSE; 1966 rtlefuse->epromtype = EEPROM_BOOT_EFUSE;
1967 } 1967 }
1968 1968
1969 if (tmp_u1b & BIT(5)) { 1969 if (tmp_u1b & BIT(5)) {
1970 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); 1970 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n");
1971 rtlefuse->autoload_failflag = false; 1971 rtlefuse->autoload_failflag = false;
1972 _rtl92se_read_adapter_info(hw); 1972 _rtl92se_read_adapter_info(hw);
1973 } else { 1973 } else {
1974 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Autoload ERR!!\n")); 1974 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
1975 rtlefuse->autoload_failflag = true; 1975 rtlefuse->autoload_failflag = true;
1976 } 1976 }
1977} 1977}
@@ -2071,8 +2071,8 @@ static void rtl92se_update_hal_rate_table(struct ieee80211_hw *hw,
2071 else 2071 else
2072 rtl92s_phy_set_fw_cmd(hw, FW_CMD_RA_REFRESH_BG); 2072 rtl92s_phy_set_fw_cmd(hw, FW_CMD_RA_REFRESH_BG);
2073 2073
2074 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, 2074 RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, "%x\n",
2075 ("%x\n", rtl_read_dword(rtlpriv, ARFR0))); 2075 rtl_read_dword(rtlpriv, ARFR0));
2076} 2076}
2077 2077
2078static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw, 2078static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw,
@@ -2224,8 +2224,8 @@ static void rtl92se_update_hal_rate_mask(struct ieee80211_hw *hw,
2224 2224
2225 mask |= (bmulticast ? 1 : 0) << 9 | (macid & 0x1f) << 4 | (band & 0xf); 2225 mask |= (bmulticast ? 1 : 0) << 9 | (macid & 0x1f) << 4 | (band & 0xf);
2226 2226
2227 RT_TRACE(rtlpriv, COMP_RATR, DBG_TRACE, ("mask = %x, bitmap = %x\n", 2227 RT_TRACE(rtlpriv, COMP_RATR, DBG_TRACE, "mask = %x, bitmap = %x\n",
2228 mask, ratr_bitmap)); 2228 mask, ratr_bitmap);
2229 rtl_write_dword(rtlpriv, 0x2c4, ratr_bitmap); 2229 rtl_write_dword(rtlpriv, 0x2c4, ratr_bitmap);
2230 rtl_write_dword(rtlpriv, WFM5, (FW_RA_UPDATE_MASK | (mask << 8))); 2230 rtl_write_dword(rtlpriv, WFM5, (FW_RA_UPDATE_MASK | (mask << 8)));
2231 2231
@@ -2301,14 +2301,14 @@ bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
2301 2301
2302 if ((ppsc->hwradiooff) && (rfpwr_toset == ERFON)) { 2302 if ((ppsc->hwradiooff) && (rfpwr_toset == ERFON)) {
2303 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 2303 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
2304 ("RFKILL-HW Radio ON, RF ON\n")); 2304 "RFKILL-HW Radio ON, RF ON\n");
2305 2305
2306 rfpwr_toset = ERFON; 2306 rfpwr_toset = ERFON;
2307 ppsc->hwradiooff = false; 2307 ppsc->hwradiooff = false;
2308 actuallyset = true; 2308 actuallyset = true;
2309 } else if ((ppsc->hwradiooff == false) && (rfpwr_toset == ERFOFF)) { 2309 } else if ((ppsc->hwradiooff == false) && (rfpwr_toset == ERFOFF)) {
2310 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 2310 RT_TRACE(rtlpriv, COMP_RF,
2311 ("RFKILL-HW Radio OFF, RF OFF\n")); 2311 DBG_DMESG, "RFKILL-HW Radio OFF, RF OFF\n");
2312 2312
2313 rfpwr_toset = ERFOFF; 2313 rfpwr_toset = ERFOFF;
2314 ppsc->hwradiooff = true; 2314 ppsc->hwradiooff = true;
@@ -2372,7 +2372,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2372 u8 cam_offset = 0; 2372 u8 cam_offset = 0;
2373 u8 clear_number = 5; 2373 u8 clear_number = 5;
2374 2374
2375 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, ("clear_all\n")); 2375 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "clear_all\n");
2376 2376
2377 for (idx = 0; idx < clear_number; idx++) { 2377 for (idx = 0; idx < clear_number; idx++) {
2378 rtl_cam_mark_invalid(hw, cam_offset + idx); 2378 rtl_cam_mark_invalid(hw, cam_offset + idx);
@@ -2401,7 +2401,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2401 break; 2401 break;
2402 default: 2402 default:
2403 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 2403 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
2404 ("switch case not process\n")); 2404 "switch case not processed\n");
2405 enc_algo = CAM_TKIP; 2405 enc_algo = CAM_TKIP;
2406 break; 2406 break;
2407 } 2407 }
@@ -2419,9 +2419,8 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2419 p_macaddr); 2419 p_macaddr);
2420 if (entry_id >= TOTAL_CAM_ENTRY) { 2420 if (entry_id >= TOTAL_CAM_ENTRY) {
2421 RT_TRACE(rtlpriv, 2421 RT_TRACE(rtlpriv,
2422 COMP_SEC, DBG_EMERG, 2422 COMP_SEC, DBG_EMERG,
2423 ("Can not find free hw" 2423 "Can not find free hw security cam entry\n");
2424 " security cam entry\n"));
2425 return; 2424 return;
2426 } 2425 }
2427 } else { 2426 } else {
@@ -2435,30 +2434,31 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2435 2434
2436 if (rtlpriv->sec.key_len[key_index] == 0) { 2435 if (rtlpriv->sec.key_len[key_index] == 0) {
2437 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2436 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2438 ("delete one entry, entry_id is %d\n", 2437 "delete one entry, entry_id is %d\n",
2439 entry_id)); 2438 entry_id);
2440 if (mac->opmode == NL80211_IFTYPE_AP) 2439 if (mac->opmode == NL80211_IFTYPE_AP)
2441 rtl_cam_del_entry(hw, p_macaddr); 2440 rtl_cam_del_entry(hw, p_macaddr);
2442 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); 2441 rtl_cam_delete_one_entry(hw, p_macaddr, entry_id);
2443 } else { 2442 } else {
2444 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2443 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2445 ("The insert KEY length is %d\n", 2444 "The insert KEY length is %d\n",
2446 rtlpriv->sec.key_len[PAIRWISE_KEYIDX])); 2445 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]);
2447 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD, 2446 RT_TRACE(rtlpriv, COMP_SEC, DBG_LOUD,
2448 ("The insert KEY is %x %x\n", 2447 "The insert KEY is %x %x\n",
2449 rtlpriv->sec.key_buf[0][0], 2448 rtlpriv->sec.key_buf[0][0],
2450 rtlpriv->sec.key_buf[0][1])); 2449 rtlpriv->sec.key_buf[0][1]);
2451 2450
2452 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2451 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2453 ("add one entry\n")); 2452 "add one entry\n");
2454 if (is_pairwise) { 2453 if (is_pairwise) {
2455 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD, 2454 RT_PRINT_DATA(rtlpriv, COMP_SEC, DBG_LOUD,
2456 "Pairwiase Key content :", 2455 "Pairwise Key content",
2457 rtlpriv->sec.pairwise_key, 2456 rtlpriv->sec.pairwise_key,
2458 rtlpriv->sec.key_len[PAIRWISE_KEYIDX]); 2457 rtlpriv->sec.
2458 key_len[PAIRWISE_KEYIDX]);
2459 2459
2460 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2460 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2461 ("set Pairwiase key\n")); 2461 "set Pairwise key\n");
2462 2462
2463 rtl_cam_add_one_entry(hw, macaddr, key_index, 2463 rtl_cam_add_one_entry(hw, macaddr, key_index,
2464 entry_id, enc_algo, 2464 entry_id, enc_algo,
@@ -2466,7 +2466,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
2466 rtlpriv->sec.key_buf[key_index]); 2466 rtlpriv->sec.key_buf[key_index]);
2467 } else { 2467 } else {
2468 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, 2468 RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
2469 ("set group key\n")); 2469 "set group key\n");
2470 2470
2471 if (mac->opmode == NL80211_IFTYPE_ADHOC) { 2471 if (mac->opmode == NL80211_IFTYPE_ADHOC) {
2472 rtl_cam_add_one_entry(hw, 2472 rtl_cam_add_one_entry(hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.h b/drivers/net/wireless/rtlwifi/rtl8192se/hw.h
index 6160a9bfe98a..1886c2644a26 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/led.c b/drivers/net/wireless/rtlwifi/rtl8192se/led.c
index e3fe7c90ebf4..44949b5cbb87 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/led.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/led.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -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;
@@ -76,12 +76,15 @@ void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
76 76
77void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) 77void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
78{ 78{
79 struct rtl_priv *rtlpriv = rtl_priv(hw); 79 struct rtl_priv *rtlpriv;
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 rtlpriv = rtl_priv(hw);
84 ("LedAddr:%X ledpin=%d\n", LEDCFG, pled->ledpin)); 84 if (!rtlpriv || rtlpriv->max_fw_size)
85 return;
86 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n",
87 LEDCFG, pled->ledpin);
85 88
86 ledcfg = rtl_read_byte(rtlpriv, LEDCFG); 89 ledcfg = rtl_read_byte(rtlpriv, LEDCFG);
87 90
@@ -101,7 +104,7 @@ void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
101 break; 104 break;
102 default: 105 default:
103 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 106 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
104 ("switch case not process\n")); 107 "switch case not processed\n");
105 break; 108 break;
106 } 109 }
107 pled->ledon = false; 110 pled->ledon = false;
@@ -141,8 +144,7 @@ void rtl92se_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction)
141 ledaction == LED_CTL_POWER_ON)) { 144 ledaction == LED_CTL_POWER_ON)) {
142 return; 145 return;
143 } 146 }
144 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, ("ledaction %d,\n", 147 RT_TRACE(rtlpriv, COMP_LED, DBG_LOUD, "ledaction %d\n", ledaction);
145 ledaction));
146 148
147 _rtl92se_sw_led_control(hw, ledaction); 149 _rtl92se_sw_led_control(hw, ledaction);
148} 150}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/led.h b/drivers/net/wireless/rtlwifi/rtl8192se/led.h
index 8cce3870af3c..2182dbeb5f32 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/led.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/led.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
index f10ac1ad9087..05b4e2790e99 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -27,8 +27,6 @@
27 * 27 *
28 *****************************************************************************/ 28 *****************************************************************************/
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
32#include "../wifi.h" 30#include "../wifi.h"
33#include "../pci.h" 31#include "../pci.h"
34#include "../ps.h" 32#include "../ps.h"
@@ -58,16 +56,15 @@ u32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
58 struct rtl_priv *rtlpriv = rtl_priv(hw); 56 struct rtl_priv *rtlpriv = rtl_priv(hw);
59 u32 returnvalue = 0, originalvalue, bitshift; 57 u32 returnvalue = 0, originalvalue, bitshift;
60 58
61 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)\n", 59 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n",
62 regaddr, bitmask)); 60 regaddr, bitmask);
63 61
64 originalvalue = rtl_read_dword(rtlpriv, regaddr); 62 originalvalue = rtl_read_dword(rtlpriv, regaddr);
65 bitshift = _rtl92s_phy_calculate_bit_shift(bitmask); 63 bitshift = _rtl92s_phy_calculate_bit_shift(bitmask);
66 returnvalue = (originalvalue & bitmask) >> bitshift; 64 returnvalue = (originalvalue & bitmask) >> bitshift;
67 65
68 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, 66 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", 67 bitmask, regaddr, originalvalue);
70 bitmask, regaddr, originalvalue));
71 68
72 return returnvalue; 69 return returnvalue;
73 70
@@ -79,8 +76,9 @@ void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
79 struct rtl_priv *rtlpriv = rtl_priv(hw); 76 struct rtl_priv *rtlpriv = rtl_priv(hw);
80 u32 originalvalue, bitshift; 77 u32 originalvalue, bitshift;
81 78
82 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 79 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
83 " data(%#x)\n", regaddr, bitmask, data)); 80 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
81 regaddr, bitmask, data);
84 82
85 if (bitmask != MASKDWORD) { 83 if (bitmask != MASKDWORD) {
86 originalvalue = rtl_read_dword(rtlpriv, regaddr); 84 originalvalue = rtl_read_dword(rtlpriv, regaddr);
@@ -90,8 +88,9 @@ void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
90 88
91 rtl_write_dword(rtlpriv, regaddr, data); 89 rtl_write_dword(rtlpriv, regaddr, data);
92 90
93 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 91 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
94 " data(%#x)\n", regaddr, bitmask, data)); 92 "regaddr(%#x), bitmask(%#x), data(%#x)\n",
93 regaddr, bitmask, data);
95 94
96} 95}
97 96
@@ -149,8 +148,8 @@ static u32 _rtl92s_phy_rf_serial_read(struct ieee80211_hw *hw,
149 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback, 148 retvalue = rtl_get_bbreg(hw, pphyreg->rflssi_readback,
150 BLSSI_READBACK_DATA); 149 BLSSI_READBACK_DATA);
151 150
152 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFR-%d Addr[0x%x]=0x%x\n", 151 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFR-%d Addr[0x%x]=0x%x\n",
153 rfpath, pphyreg->rflssi_readback, retvalue)); 152 rfpath, pphyreg->rflssi_readback, retvalue);
154 153
155 return retvalue; 154 return retvalue;
156 155
@@ -172,8 +171,8 @@ static void _rtl92s_phy_rf_serial_write(struct ieee80211_hw *hw,
172 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff; 171 data_and_addr = ((newoffset << 20) | (data & 0x000fffff)) & 0x0fffffff;
173 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr); 172 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr);
174 173
175 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("RFW-%d Addr[0x%x]=0x%x\n", 174 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "RFW-%d Addr[0x%x]=0x%x\n",
176 rfpath, pphyreg->rf3wire_offset, data_and_addr)); 175 rfpath, pphyreg->rf3wire_offset, data_and_addr);
177} 176}
178 177
179 178
@@ -183,8 +182,9 @@ u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
183 struct rtl_priv *rtlpriv = rtl_priv(hw); 182 struct rtl_priv *rtlpriv = rtl_priv(hw);
184 u32 original_value, readback_value, bitshift; 183 u32 original_value, readback_value, bitshift;
185 184
186 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), rfpath(%#x), " 185 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
187 "bitmask(%#x)\n", regaddr, rfpath, bitmask)); 186 "regaddr(%#x), rfpath(%#x), bitmask(%#x)\n",
187 regaddr, rfpath, bitmask);
188 188
189 spin_lock(&rtlpriv->locks.rf_lock); 189 spin_lock(&rtlpriv->locks.rf_lock);
190 190
@@ -195,9 +195,9 @@ u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
195 195
196 spin_unlock(&rtlpriv->locks.rf_lock); 196 spin_unlock(&rtlpriv->locks.rf_lock);
197 197
198 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), rfpath(%#x), " 198 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
199 "bitmask(%#x), original_value(%#x)\n", regaddr, rfpath, 199 "regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
200 bitmask, original_value)); 200 regaddr, rfpath, bitmask, original_value);
201 201
202 return readback_value; 202 return readback_value;
203} 203}
@@ -212,8 +212,9 @@ void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
212 if (!((rtlphy->rf_pathmap >> rfpath) & 0x1)) 212 if (!((rtlphy->rf_pathmap >> rfpath) & 0x1))
213 return; 213 return;
214 214
215 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x)," 215 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
216 " data(%#x), rfpath(%#x)\n", regaddr, bitmask, data, rfpath)); 216 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
217 regaddr, bitmask, data, rfpath);
217 218
218 spin_lock(&rtlpriv->locks.rf_lock); 219 spin_lock(&rtlpriv->locks.rf_lock);
219 220
@@ -228,8 +229,9 @@ void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
228 229
229 spin_unlock(&rtlpriv->locks.rf_lock); 230 spin_unlock(&rtlpriv->locks.rf_lock);
230 231
231 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, ("regaddr(%#x), bitmask(%#x), " 232 RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE,
232 "data(%#x), rfpath(%#x)\n", regaddr, bitmask, data, rfpath)); 233 "regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
234 regaddr, bitmask, data, rfpath);
233 235
234} 236}
235 237
@@ -249,7 +251,7 @@ void rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw,
249 break; 251 break;
250 default: 252 default:
251 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 253 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
252 ("Unknown operation.\n")); 254 "Unknown operation\n");
253 break; 255 break;
254 } 256 }
255 } 257 }
@@ -264,9 +266,9 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
264 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 266 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
265 u8 reg_bw_opmode; 267 u8 reg_bw_opmode;
266 268
267 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("Switch to %s bandwidth\n", 269 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "Switch to %s bandwidth\n",
268 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ? 270 rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20 ?
269 "20MHz" : "40MHz")); 271 "20MHz" : "40MHz");
270 272
271 if (rtlphy->set_bwmode_inprogress) 273 if (rtlphy->set_bwmode_inprogress)
272 return; 274 return;
@@ -290,8 +292,7 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
290 break; 292 break;
291 default: 293 default:
292 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 294 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
293 ("unknown bandwidth: %#X\n", 295 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
294 rtlphy->current_chan_bw));
295 break; 296 break;
296 } 297 }
297 298
@@ -316,13 +317,13 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
316 break; 317 break;
317 default: 318 default:
318 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 319 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
319 ("unknown bandwidth: %#X\n", rtlphy->current_chan_bw)); 320 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
320 break; 321 break;
321 } 322 }
322 323
323 rtl92s_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); 324 rtl92s_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
324 rtlphy->set_bwmode_inprogress = false; 325 rtlphy->set_bwmode_inprogress = false;
325 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 326 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
326} 327}
327 328
328static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable, 329static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
@@ -332,7 +333,7 @@ static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
332 struct swchnlcmd *pcmd; 333 struct swchnlcmd *pcmd;
333 334
334 if (cmdtable == NULL) { 335 if (cmdtable == NULL) {
335 RT_ASSERT(false, ("cmdtable cannot be NULL.\n")); 336 RT_ASSERT(false, "cmdtable cannot be NULL\n");
336 return false; 337 return false;
337 } 338 }
338 339
@@ -377,7 +378,7 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
377 rfdependcmdcnt = 0; 378 rfdependcmdcnt = 0;
378 379
379 RT_ASSERT((channel >= 1 && channel <= 14), 380 RT_ASSERT((channel >= 1 && channel <= 14),
380 ("illegal channel for Zebra: %d\n", channel)); 381 "invalid channel for Zebra: %d\n", channel);
381 382
382 _rtl92s_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++, 383 _rtl92s_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
383 MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG, 384 MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
@@ -438,7 +439,7 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
438 break; 439 break;
439 default: 440 default:
440 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 441 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
441 ("switch case not process\n")); 442 "switch case not processed\n");
442 break; 443 break;
443 } 444 }
444 445
@@ -458,9 +459,8 @@ u8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw)
458 u32 delay; 459 u32 delay;
459 bool ret; 460 bool ret;
460 461
461 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, 462 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "switch to channel%d\n",
462 ("switch to channel%d\n", 463 rtlphy->current_channel);
463 rtlphy->current_channel));
464 464
465 if (rtlphy->sw_chnl_inprogress) 465 if (rtlphy->sw_chnl_inprogress)
466 return 0; 466 return 0;
@@ -496,7 +496,7 @@ u8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw)
496 496
497 rtlphy->sw_chnl_inprogress = false; 497 rtlphy->sw_chnl_inprogress = false;
498 498
499 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, ("<==\n")); 499 RT_TRACE(rtlpriv, COMP_SCAN, DBG_TRACE, "<==\n");
500 500
501 return 1; 501 return 1;
502} 502}
@@ -556,7 +556,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
556 do { 556 do {
557 InitializeCount++; 557 InitializeCount++;
558 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 558 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
559 ("IPS Set eRf nic enable\n")); 559 "IPS Set eRf nic enable\n");
560 rtstatus = rtl_ps_enable_nic(hw); 560 rtstatus = rtl_ps_enable_nic(hw);
561 } while ((rtstatus != true) && 561 } while ((rtstatus != true) &&
562 (InitializeCount < 10)); 562 (InitializeCount < 10));
@@ -565,11 +565,11 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
565 RT_RF_OFF_LEVL_HALT_NIC); 565 RT_RF_OFF_LEVL_HALT_NIC);
566 } else { 566 } else {
567 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 567 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
568 ("awake, sleeped:%d ms " 568 "awake, sleeped:%d ms state_inap:%x\n",
569 "state_inap:%x\n", 569 jiffies_to_msecs(jiffies -
570 jiffies_to_msecs(jiffies - 570 ppsc->
571 ppsc->last_sleep_jiffies), 571 last_sleep_jiffies),
572 rtlpriv->psc.state_inap)); 572 rtlpriv->psc.state_inap);
573 ppsc->last_awake_jiffies = jiffies; 573 ppsc->last_awake_jiffies = jiffies;
574 rtl_write_word(rtlpriv, CMDR, 0x37FC); 574 rtl_write_word(rtlpriv, CMDR, 0x37FC);
575 rtl_write_byte(rtlpriv, TXPAUSE, 0x00); 575 rtl_write_byte(rtlpriv, TXPAUSE, 0x00);
@@ -587,7 +587,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
587 case ERFOFF:{ 587 case ERFOFF:{
588 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) { 588 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) {
589 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG, 589 RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
590 ("IPS Set eRf nic disable\n")); 590 "IPS Set eRf nic disable\n");
591 rtl_ps_disable_nic(hw); 591 rtl_ps_disable_nic(hw);
592 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC); 592 RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC);
593 } else { 593 } else {
@@ -613,11 +613,9 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
613 continue; 613 continue;
614 } else { 614 } else {
615 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 615 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
616 ("eRf Off/Sleep: " 616 "eRf Off/Sleep: %d times TcbBusyQueue[%d] = %d before doze!\n",
617 "%d times TcbBusyQueue[%d] = " 617 i + 1, queue_id,
618 "%d before doze!\n", 618 skb_queue_len(&ring->queue));
619 (i + 1), queue_id,
620 skb_queue_len(&ring->queue)));
621 619
622 udelay(10); 620 udelay(10);
623 i++; 621 i++;
@@ -625,31 +623,30 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
625 623
626 if (i >= MAX_DOZE_WAITING_TIMES_9x) { 624 if (i >= MAX_DOZE_WAITING_TIMES_9x) {
627 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, 625 RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
628 ("\nERFOFF: %d times" 626 "ERFOFF: %d times TcbBusyQueue[%d] = %d !\n",
629 "TcbBusyQueue[%d] = %d !\n",
630 MAX_DOZE_WAITING_TIMES_9x, 627 MAX_DOZE_WAITING_TIMES_9x,
631 queue_id, 628 queue_id,
632 skb_queue_len(&ring->queue))); 629 skb_queue_len(&ring->queue));
633 break; 630 break;
634 } 631 }
635 } 632 }
636 633
637 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 634 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
638 ("Set ERFSLEEP awaked:%d ms\n", 635 "Set ERFSLEEP awaked:%d ms\n",
639 jiffies_to_msecs(jiffies - 636 jiffies_to_msecs(jiffies -
640 ppsc->last_awake_jiffies))); 637 ppsc->last_awake_jiffies));
641 638
642 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, 639 RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG,
643 ("sleep awaked:%d ms " 640 "sleep awaked:%d ms state_inap:%x\n",
644 "state_inap:%x\n", jiffies_to_msecs(jiffies - 641 jiffies_to_msecs(jiffies -
645 ppsc->last_awake_jiffies), 642 ppsc->last_awake_jiffies),
646 rtlpriv->psc.state_inap)); 643 rtlpriv->psc.state_inap);
647 ppsc->last_sleep_jiffies = jiffies; 644 ppsc->last_sleep_jiffies = jiffies;
648 _rtl92se_phy_set_rf_sleep(hw); 645 _rtl92se_phy_set_rf_sleep(hw);
649 break; 646 break;
650 default: 647 default:
651 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 648 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
652 ("switch case not process\n")); 649 "switch case not processed\n");
653 bresult = false; 650 bresult = false;
654 break; 651 break;
655 } 652 }
@@ -995,7 +992,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
995 992
996 if (rtstatus != true) { 993 if (rtstatus != true) {
997 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 994 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
998 ("Write BB Reg Fail!!")); 995 "Write BB Reg Fail!!\n");
999 goto phy_BB8190_Config_ParaFile_Fail; 996 goto phy_BB8190_Config_ParaFile_Fail;
1000 } 997 }
1001 998
@@ -1009,8 +1006,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
1009 } 1006 }
1010 if (rtstatus != true) { 1007 if (rtstatus != true) {
1011 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 1008 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
1012 ("_rtl92s_phy_bb_config_parafile(): " 1009 "_rtl92s_phy_bb_config_parafile(): BB_PG Reg Fail!!\n");
1013 "BB_PG Reg Fail!!"));
1014 goto phy_BB8190_Config_ParaFile_Fail; 1010 goto phy_BB8190_Config_ParaFile_Fail;
1015 } 1011 }
1016 1012
@@ -1053,7 +1049,7 @@ u8 rtl92s_phy_config_rf(struct ieee80211_hw *hw, enum radio_path rfpath)
1053 radio_b_tblen = RADIOB_ARRAYLENGTH; 1049 radio_b_tblen = RADIOB_ARRAYLENGTH;
1054 } 1050 }
1055 1051
1056 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Radio No %x\n", rfpath)); 1052 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Radio No %x\n", rfpath);
1057 rtstatus = true; 1053 rtstatus = true;
1058 1054
1059 switch (rfpath) { 1055 switch (rfpath) {
@@ -1175,11 +1171,11 @@ bool rtl92s_phy_bb_config(struct ieee80211_hw *hw)
1175 (rtlphy->rf_type == RF_2T2R && rf_num != 2) || 1171 (rtlphy->rf_type == RF_2T2R && rf_num != 2) ||
1176 (rtlphy->rf_type == RF_2T2R_GREEN && rf_num != 2)) { 1172 (rtlphy->rf_type == RF_2T2R_GREEN && rf_num != 2)) {
1177 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 1173 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
1178 ("RF_Type(%x) does not match " 1174 "RF_Type(%x) does not match RF_Num(%x)!!\n",
1179 "RF_Num(%x)!!\n", rtlphy->rf_type, rf_num)); 1175 rtlphy->rf_type, rf_num);
1180 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, 1176 RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
1181 ("path1 0x%x, path2 0x%x, pathmap " 1177 "path1 0x%x, path2 0x%x, pathmap 0x%x\n",
1182 "0x%x\n", path1, path2, pathmap)); 1178 path1, path2, pathmap);
1183 } 1179 }
1184 1180
1185 return rtstatus; 1181 return rtstatus;
@@ -1214,20 +1210,20 @@ void rtl92s_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
1214 ROFDM0_XCAGCCORE1, MASKBYTE0); 1210 ROFDM0_XCAGCCORE1, MASKBYTE0);
1215 rtlphy->default_initialgain[3] = rtl_get_bbreg(hw, 1211 rtlphy->default_initialgain[3] = rtl_get_bbreg(hw,
1216 ROFDM0_XDAGCCORE1, MASKBYTE0); 1212 ROFDM0_XDAGCCORE1, MASKBYTE0);
1217 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Default initial gain " 1213 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1218 "(c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n", 1214 "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n",
1219 rtlphy->default_initialgain[0], 1215 rtlphy->default_initialgain[0],
1220 rtlphy->default_initialgain[1], 1216 rtlphy->default_initialgain[1],
1221 rtlphy->default_initialgain[2], 1217 rtlphy->default_initialgain[2],
1222 rtlphy->default_initialgain[3])); 1218 rtlphy->default_initialgain[3]);
1223 1219
1224 /* read framesync */ 1220 /* read framesync */
1225 rtlphy->framesync = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR3, MASKBYTE0); 1221 rtlphy->framesync = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR3, MASKBYTE0);
1226 rtlphy->framesync_c34 = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR2, 1222 rtlphy->framesync_c34 = rtl_get_bbreg(hw, ROFDM0_RXDETECTOR2,
1227 MASKDWORD); 1223 MASKDWORD);
1228 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 1224 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
1229 ("Default framesync (0x%x) = 0x%x\n", 1225 "Default framesync (0x%x) = 0x%x\n",
1230 ROFDM0_RXDETECTOR3, rtlphy->framesync)); 1226 ROFDM0_RXDETECTOR3, rtlphy->framesync);
1231 1227
1232} 1228}
1233 1229
@@ -1287,10 +1283,9 @@ void rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8 channel)
1287 &ofdmpowerLevel[0]); 1283 &ofdmpowerLevel[0]);
1288 1284
1289 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 1285 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
1290 ("Channel-%d, cckPowerLevel (A / B) = " 1286 "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", 1287 channel, cckpowerlevel[0], cckpowerlevel[1],
1292 channel, cckpowerlevel[0], cckpowerlevel[1], 1288 ofdmpowerLevel[0], ofdmpowerLevel[1]);
1293 ofdmpowerLevel[0], ofdmpowerLevel[1]));
1294 1289
1295 _rtl92s_phy_ccxpower_indexcheck(hw, channel, &cckpowerlevel[0], 1290 _rtl92s_phy_ccxpower_indexcheck(hw, channel, &cckpowerlevel[0],
1296 &ofdmpowerLevel[0]); 1291 &ofdmpowerLevel[0]);
@@ -1316,7 +1311,7 @@ void rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw)
1316 } while (--pollingcnt); 1311 } while (--pollingcnt);
1317 1312
1318 if (pollingcnt == 0) 1313 if (pollingcnt == 0)
1319 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("Set FW Cmd fail!!\n")); 1314 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Set FW Cmd fail!!\n");
1320} 1315}
1321 1316
1322 1317
@@ -1345,20 +1340,17 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1345 1340
1346 switch (rtlhal->current_fwcmd_io) { 1341 switch (rtlhal->current_fwcmd_io) {
1347 case FW_CMD_RA_RESET: 1342 case FW_CMD_RA_RESET:
1348 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1343 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); 1344 rtl_write_dword(rtlpriv, WFM5, FW_RA_RESET);
1351 rtl92s_phy_chk_fwcmd_iodone(hw); 1345 rtl92s_phy_chk_fwcmd_iodone(hw);
1352 break; 1346 break;
1353 case FW_CMD_RA_ACTIVE: 1347 case FW_CMD_RA_ACTIVE:
1354 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1348 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); 1349 rtl_write_dword(rtlpriv, WFM5, FW_RA_ACTIVE);
1357 rtl92s_phy_chk_fwcmd_iodone(hw); 1350 rtl92s_phy_chk_fwcmd_iodone(hw);
1358 break; 1351 break;
1359 case FW_CMD_RA_REFRESH_N: 1352 case FW_CMD_RA_REFRESH_N:
1360 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1353 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; 1354 input = FW_RA_REFRESH;
1363 rtl_write_dword(rtlpriv, WFM5, input); 1355 rtl_write_dword(rtlpriv, WFM5, input);
1364 rtl92s_phy_chk_fwcmd_iodone(hw); 1356 rtl92s_phy_chk_fwcmd_iodone(hw);
@@ -1367,7 +1359,7 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1367 break; 1359 break;
1368 case FW_CMD_RA_REFRESH_BG: 1360 case FW_CMD_RA_REFRESH_BG:
1369 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1361 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
1370 ("FW_CMD_RA_REFRESH_BG\n")); 1362 "FW_CMD_RA_REFRESH_BG\n");
1371 rtl_write_dword(rtlpriv, WFM5, FW_RA_REFRESH); 1363 rtl_write_dword(rtlpriv, WFM5, FW_RA_REFRESH);
1372 rtl92s_phy_chk_fwcmd_iodone(hw); 1364 rtl92s_phy_chk_fwcmd_iodone(hw);
1373 rtl_write_dword(rtlpriv, WFM5, FW_RA_DISABLE_RSSI_MASK); 1365 rtl_write_dword(rtlpriv, WFM5, FW_RA_DISABLE_RSSI_MASK);
@@ -1375,21 +1367,20 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1375 break; 1367 break;
1376 case FW_CMD_RA_REFRESH_N_COMB: 1368 case FW_CMD_RA_REFRESH_N_COMB:
1377 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1369 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
1378 ("FW_CMD_RA_REFRESH_N_COMB\n")); 1370 "FW_CMD_RA_REFRESH_N_COMB\n");
1379 input = FW_RA_IOT_N_COMB; 1371 input = FW_RA_IOT_N_COMB;
1380 rtl_write_dword(rtlpriv, WFM5, input); 1372 rtl_write_dword(rtlpriv, WFM5, input);
1381 rtl92s_phy_chk_fwcmd_iodone(hw); 1373 rtl92s_phy_chk_fwcmd_iodone(hw);
1382 break; 1374 break;
1383 case FW_CMD_RA_REFRESH_BG_COMB: 1375 case FW_CMD_RA_REFRESH_BG_COMB:
1384 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1376 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG,
1385 ("FW_CMD_RA_REFRESH_BG_COMB\n")); 1377 "FW_CMD_RA_REFRESH_BG_COMB\n");
1386 input = FW_RA_IOT_BG_COMB; 1378 input = FW_RA_IOT_BG_COMB;
1387 rtl_write_dword(rtlpriv, WFM5, input); 1379 rtl_write_dword(rtlpriv, WFM5, input);
1388 rtl92s_phy_chk_fwcmd_iodone(hw); 1380 rtl92s_phy_chk_fwcmd_iodone(hw);
1389 break; 1381 break;
1390 case FW_CMD_IQK_ENABLE: 1382 case FW_CMD_IQK_ENABLE:
1391 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1383 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); 1384 rtl_write_dword(rtlpriv, WFM5, FW_IQK_ENABLE);
1394 rtl92s_phy_chk_fwcmd_iodone(hw); 1385 rtl92s_phy_chk_fwcmd_iodone(hw);
1395 break; 1386 break;
@@ -1424,8 +1415,7 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1424 rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, 0xcd); 1415 rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, 0xcd);
1425 break; 1416 break;
1426 case FW_CMD_LPS_ENTER: 1417 case FW_CMD_LPS_ENTER:
1427 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1418 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; 1419 current_aid = rtlpriv->mac80211.assoc_id;
1430 rtl_write_dword(rtlpriv, WFM5, (FW_LPS_ENTER | 1420 rtl_write_dword(rtlpriv, WFM5, (FW_LPS_ENTER |
1431 ((current_aid | 0xc000) << 8))); 1421 ((current_aid | 0xc000) << 8)));
@@ -1434,20 +1424,18 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
1434 * turbo mode until driver leave LPS */ 1424 * turbo mode until driver leave LPS */
1435 break; 1425 break;
1436 case FW_CMD_LPS_LEAVE: 1426 case FW_CMD_LPS_LEAVE:
1437 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1427 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); 1428 rtl_write_dword(rtlpriv, WFM5, FW_LPS_LEAVE);
1440 rtl92s_phy_chk_fwcmd_iodone(hw); 1429 rtl92s_phy_chk_fwcmd_iodone(hw);
1441 break; 1430 break;
1442 case FW_CMD_ADD_A2_ENTRY: 1431 case FW_CMD_ADD_A2_ENTRY:
1443 RT_TRACE(rtlpriv, COMP_CMD, DBG_DMESG, 1432 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); 1433 rtl_write_dword(rtlpriv, WFM5, FW_ADD_A2_ENTRY);
1446 rtl92s_phy_chk_fwcmd_iodone(hw); 1434 rtl92s_phy_chk_fwcmd_iodone(hw);
1447 break; 1435 break;
1448 case FW_CMD_CTRL_DM_BY_DRIVER: 1436 case FW_CMD_CTRL_DM_BY_DRIVER:
1449 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1437 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1450 ("FW_CMD_CTRL_DM_BY_DRIVER\n")); 1438 "FW_CMD_CTRL_DM_BY_DRIVER\n");
1451 rtl_write_dword(rtlpriv, WFM5, FW_CTRL_DM_BY_DRIVER); 1439 rtl_write_dword(rtlpriv, WFM5, FW_CTRL_DM_BY_DRIVER);
1452 rtl92s_phy_chk_fwcmd_iodone(hw); 1440 rtl92s_phy_chk_fwcmd_iodone(hw);
1453 break; 1441 break;
@@ -1472,8 +1460,8 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1472 bool bPostProcessing = false; 1460 bool bPostProcessing = false;
1473 1461
1474 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1462 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1475 ("Set FW Cmd(%#x), set_fwcmd_inprogress(%d)\n", 1463 "Set FW Cmd(%#x), set_fwcmd_inprogress(%d)\n",
1476 fw_cmdio, rtlhal->set_fwcmd_inprogress)); 1464 fw_cmdio, rtlhal->set_fwcmd_inprogress);
1477 1465
1478 do { 1466 do {
1479 /* We re-map to combined FW CMD ones if firmware version */ 1467 /* We re-map to combined FW CMD ones if firmware version */
@@ -1501,7 +1489,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1501 * DM map table in the future. */ 1489 * DM map table in the future. */
1502 switch (fw_cmdio) { 1490 switch (fw_cmdio) {
1503 case FW_CMD_RA_INIT: 1491 case FW_CMD_RA_INIT:
1504 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, ("RA init!!\n")); 1492 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, "RA init!!\n");
1505 fw_cmdmap |= FW_RA_INIT_CTL; 1493 fw_cmdmap |= FW_RA_INIT_CTL;
1506 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1494 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1507 /* Clear control flag to sync with FW. */ 1495 /* Clear control flag to sync with FW. */
@@ -1509,7 +1497,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1509 break; 1497 break;
1510 case FW_CMD_DIG_DISABLE: 1498 case FW_CMD_DIG_DISABLE:
1511 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1499 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1512 ("Set DIG disable!!\n")); 1500 "Set DIG disable!!\n");
1513 fw_cmdmap &= ~FW_DIG_ENABLE_CTL; 1501 fw_cmdmap &= ~FW_DIG_ENABLE_CTL;
1514 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1502 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1515 break; 1503 break;
@@ -1517,14 +1505,14 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1517 case FW_CMD_DIG_RESUME: 1505 case FW_CMD_DIG_RESUME:
1518 if (!(rtlpriv->dm.dm_flag & HAL_DM_DIG_DISABLE)) { 1506 if (!(rtlpriv->dm.dm_flag & HAL_DM_DIG_DISABLE)) {
1519 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1507 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1520 ("Set DIG enable or resume!!\n")); 1508 "Set DIG enable or resume!!\n");
1521 fw_cmdmap |= (FW_DIG_ENABLE_CTL | FW_SS_CTL); 1509 fw_cmdmap |= (FW_DIG_ENABLE_CTL | FW_SS_CTL);
1522 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1510 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1523 } 1511 }
1524 break; 1512 break;
1525 case FW_CMD_DIG_HALT: 1513 case FW_CMD_DIG_HALT:
1526 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1514 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1527 ("Set DIG halt!!\n")); 1515 "Set DIG halt!!\n");
1528 fw_cmdmap &= ~(FW_DIG_ENABLE_CTL | FW_SS_CTL); 1516 fw_cmdmap &= ~(FW_DIG_ENABLE_CTL | FW_SS_CTL);
1529 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1517 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
1530 break; 1518 break;
@@ -1540,9 +1528,8 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1540 (rtlefuse->thermalmeter[0] << 16)); 1528 (rtlefuse->thermalmeter[0] << 16));
1541 1529
1542 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1530 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1543 ("Set TxPwr tracking!! " 1531 "Set TxPwr tracking!! FwCmdMap(%#x), FwParam(%#x)\n",
1544 "FwCmdMap(%#x), FwParam(%#x)\n", 1532 fw_cmdmap, fw_param);
1545 fw_cmdmap, fw_param));
1546 1533
1547 FW_CMD_PARA_SET(rtlpriv, fw_param); 1534 FW_CMD_PARA_SET(rtlpriv, fw_param);
1548 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1535 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
@@ -1563,9 +1550,8 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1563 fw_param &= FW_RA_PARAM_CLR; 1550 fw_param &= FW_RA_PARAM_CLR;
1564 1551
1565 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1552 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1566 ("[FW CMD] [New Version] " 1553 "[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), " 1554 fw_cmdmap, fw_param);
1568 "FwParam(%#x)\n", fw_cmdmap, fw_param));
1569 1555
1570 FW_CMD_PARA_SET(rtlpriv, fw_param); 1556 FW_CMD_PARA_SET(rtlpriv, fw_param);
1571 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1557 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
@@ -1652,7 +1638,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
1652 break; 1638 break;
1653 case FW_CMD_PAPE_CONTROL: 1639 case FW_CMD_PAPE_CONTROL:
1654 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 1640 RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
1655 ("[FW CMD] Set PAPE Control\n")); 1641 "[FW CMD] Set PAPE Control\n");
1656 fw_cmdmap &= ~FW_PAPE_CTL_BY_SW_HW; 1642 fw_cmdmap &= ~FW_PAPE_CTL_BY_SW_HW;
1657 1643
1658 FW_CMD_IO_SET(rtlpriv, fw_cmdmap); 1644 FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/phy.h b/drivers/net/wireless/rtlwifi/rtl8192se/phy.h
index 37e504af6446..ac0387770630 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/phy.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/phy.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/reg.h b/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
index 11f125c030ce..84d1181795b8 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/rf.c b/drivers/net/wireless/rtlwifi/rtl8192se/rf.c
index 0ad50fe44aa2..ad51906124db 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/rf.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -27,8 +27,6 @@
27 * 27 *
28 *****************************************************************************/ 28 *****************************************************************************/
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
32#include "../wifi.h" 30#include "../wifi.h"
33#include "reg.h" 31#include "reg.h"
34#include "def.h" 32#include "def.h"
@@ -123,13 +121,13 @@ static void _rtl92s_get_powerbase(struct ieee80211_hw *hw, u8 *p_pwrlevel,
123 } 121 }
124 122
125 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) { 123 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
126 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("40MHz finalpwr_idx " 124 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
127 "(A / B) = 0x%x / 0x%x\n", p_final_pwridx[0], 125 "40MHz finalpwr_idx (A / B) = 0x%x / 0x%x\n",
128 p_final_pwridx[1])); 126 p_final_pwridx[0], p_final_pwridx[1]);
129 } else { 127 } else {
130 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, ("20MHz finalpwr_idx " 128 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
131 "(A / B) = 0x%x / 0x%x\n", p_final_pwridx[0], 129 "20MHz finalpwr_idx (A / B) = 0x%x / 0x%x\n",
132 p_final_pwridx[1])); 130 p_final_pwridx[0], p_final_pwridx[1]);
133 } 131 }
134} 132}
135 133
@@ -153,9 +151,8 @@ static void _rtl92s_set_antennadiff(struct ieee80211_hw *hw,
153 ant_pwr_diff = -8; 151 ant_pwr_diff = -8;
154 152
155 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 153 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
156 ("Antenna Diff from RF-B " 154 "Antenna Diff from RF-B to RF-A = %d (0x%x)\n",
157 "to RF-A = %d (0x%x)\n", ant_pwr_diff, 155 ant_pwr_diff, ant_pwr_diff & 0xf);
158 ant_pwr_diff & 0xf));
159 156
160 ant_pwr_diff &= 0xf; 157 ant_pwr_diff &= 0xf;
161 } 158 }
@@ -172,9 +169,8 @@ static void _rtl92s_set_antennadiff(struct ieee80211_hw *hw,
172 rtl_set_bbreg(hw, RFPGA0_TXGAINSTAGE, (BXBTXAGC | BXCTXAGC | BXDTXAGC), 169 rtl_set_bbreg(hw, RFPGA0_TXGAINSTAGE, (BXBTXAGC | BXCTXAGC | BXDTXAGC),
173 u4reg_val); 170 u4reg_val);
174 171
175 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 172 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "Write BCD-Diff(0x%x) = 0x%x\n",
176 ("Write BCD-Diff(0x%x) = 0x%x\n", 173 RFPGA0_TXGAINSTAGE, u4reg_val);
177 RFPGA0_TXGAINSTAGE, u4reg_val));
178} 174}
179 175
180static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw, 176static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
@@ -201,8 +197,7 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
201 ((index < 2) ? pwrbase0 : pwrbase1); 197 ((index < 2) ? pwrbase0 : pwrbase1);
202 198
203 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 199 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
204 ("RTK better performance, " 200 "RTK better performance, writeval = 0x%x\n", writeval);
205 "writeval = 0x%x\n", writeval));
206 break; 201 break;
207 case 1: 202 case 1:
208 /* Realtek regulatory increase power diff defined 203 /* Realtek regulatory increase power diff defined
@@ -211,8 +206,8 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
211 writeval = ((index < 2) ? pwrbase0 : pwrbase1); 206 writeval = ((index < 2) ? pwrbase0 : pwrbase1);
212 207
213 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 208 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
214 ("Realtek regulatory, " 209 "Realtek regulatory, 40MHz, writeval = 0x%x\n",
215 "40MHz, writeval = 0x%x\n", writeval)); 210 writeval);
216 } else { 211 } else {
217 if (rtlphy->pwrgroup_cnt == 1) 212 if (rtlphy->pwrgroup_cnt == 1)
218 chnlgroup = 0; 213 chnlgroup = 0;
@@ -234,16 +229,15 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
234 pwrbase0 : pwrbase1); 229 pwrbase0 : pwrbase1);
235 230
236 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 231 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
237 ("Realtek regulatory, " 232 "Realtek regulatory, 20MHz, writeval = 0x%x\n",
238 "20MHz, writeval = 0x%x\n", writeval)); 233 writeval);
239 } 234 }
240 break; 235 break;
241 case 2: 236 case 2:
242 /* Better regulatory don't increase any power diff */ 237 /* Better regulatory don't increase any power diff */
243 writeval = ((index < 2) ? pwrbase0 : pwrbase1); 238 writeval = ((index < 2) ? pwrbase0 : pwrbase1);
244 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 239 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
245 ("Better regulatory, " 240 "Better regulatory, writeval = 0x%x\n", writeval);
246 "writeval = 0x%x\n", writeval));
247 break; 241 break;
248 case 3: 242 case 3:
249 /* Customer defined power diff. increase power diff 243 /* Customer defined power diff. increase power diff
@@ -252,14 +246,14 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
252 246
253 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) { 247 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
254 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 248 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
255 ("customer's limit, 40MHz = 0x%x\n", 249 "customer's limit, 40MHz = 0x%x\n",
256 rtlefuse->pwrgroup_ht40 250 rtlefuse->pwrgroup_ht40
257 [RF90_PATH_A][chnl - 1])); 251 [RF90_PATH_A][chnl - 1]);
258 } else { 252 } else {
259 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 253 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
260 ("customer's limit, 20MHz = 0x%x\n", 254 "customer's limit, 20MHz = 0x%x\n",
261 rtlefuse->pwrgroup_ht20 255 rtlefuse->pwrgroup_ht20
262 [RF90_PATH_A][chnl - 1])); 256 [RF90_PATH_A][chnl - 1]);
263 } 257 }
264 258
265 for (i = 0; i < 4; i++) { 259 for (i = 0; i < 4; i++) {
@@ -293,22 +287,19 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
293 (pwrdiff_limit[1] << 8) | 287 (pwrdiff_limit[1] << 8) |
294 (pwrdiff_limit[0]); 288 (pwrdiff_limit[0]);
295 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 289 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
296 ("Customer's limit = 0x%x\n", 290 "Customer's limit = 0x%x\n", customer_limit);
297 customer_limit));
298 291
299 writeval = customer_limit + ((index < 2) ? 292 writeval = customer_limit + ((index < 2) ?
300 pwrbase0 : pwrbase1); 293 pwrbase0 : pwrbase1);
301 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 294 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
302 ("Customer, writeval = " 295 "Customer, writeval = 0x%x\n", writeval);
303 "0x%x\n", writeval));
304 break; 296 break;
305 default: 297 default:
306 chnlgroup = 0; 298 chnlgroup = 0;
307 writeval = rtlphy->mcs_txpwrlevel_origoffset[chnlgroup][index] + 299 writeval = rtlphy->mcs_txpwrlevel_origoffset[chnlgroup][index] +
308 ((index < 2) ? pwrbase0 : pwrbase1); 300 ((index < 2) ? pwrbase0 : pwrbase1);
309 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, 301 RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
310 ("RTK better performance, " 302 "RTK better performance, writeval = 0x%x\n", writeval);
311 "writeval = 0x%x\n", writeval));
312 break; 303 break;
313 } 304 }
314 305
@@ -541,8 +532,7 @@ void rtl92s_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
541 break; 532 break;
542 default: 533 default:
543 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 534 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
544 ("unknown bandwidth: %#X\n", 535 "unknown bandwidth: %#X\n", bandwidth);
545 bandwidth));
546 break; 536 break;
547 } 537 }
548} 538}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/rf.h b/drivers/net/wireless/rtlwifi/rtl8192se/rf.h
index 3843baa1a874..8a29eb94ab17 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/rf.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/rf.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 36140ccf2abd..eda30b9d0f15 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -27,14 +27,11 @@
27 * 27 *
28 *****************************************************************************/ 28 *****************************************************************************/
29 29
30#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31
32#include <linux/vmalloc.h>
33#include <linux/module.h>
34
35#include "../wifi.h" 30#include "../wifi.h"
36#include "../core.h" 31#include "../core.h"
37#include "../pci.h" 32#include "../pci.h"
33#include "../base.h"
34#include "../pci.h"
38#include "reg.h" 35#include "reg.h"
39#include "def.h" 36#include "def.h"
40#include "phy.h" 37#include "phy.h"
@@ -45,6 +42,8 @@
45#include "trx.h" 42#include "trx.h"
46#include "led.h" 43#include "led.h"
47 44
45#include <linux/module.h>
46
48static void rtl92s_init_aspm_vars(struct ieee80211_hw *hw) 47static void rtl92s_init_aspm_vars(struct ieee80211_hw *hw)
49{ 48{
50 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 49 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
@@ -89,12 +88,53 @@ static void rtl92s_init_aspm_vars(struct ieee80211_hw *hw)
89 rtlpci->const_support_pciaspm = 2; 88 rtlpci->const_support_pciaspm = 2;
90} 89}
91 90
91static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
92{
93 struct ieee80211_hw *hw = context;
94 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
95 struct rtl_priv *rtlpriv = rtl_priv(hw);
96 struct rtl_pci *rtlpci = rtl_pcidev(pcipriv);
97 struct rt_firmware *pfirmware = NULL;
98 int err;
99
100 RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
101 "Firmware callback routine entered!\n");
102 complete(&rtlpriv->firmware_loading_complete);
103 if (!firmware) {
104 pr_err("Firmware %s not available\n", rtlpriv->cfg->fw_name);
105 rtlpriv->max_fw_size = 0;
106 return;
107 }
108 if (firmware->size > rtlpriv->max_fw_size) {
109 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
110 "Firmware is too big!\n");
111 release_firmware(firmware);
112 return;
113 }
114 pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;
115 memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
116 pfirmware->sz_fw_tmpbufferlen = firmware->size;
117 release_firmware(firmware);
118
119 err = ieee80211_register_hw(hw);
120 if (err) {
121 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
122 "Can't register mac80211 hw\n");
123 return;
124 } else {
125 rtlpriv->mac80211.mac80211_registered = 1;
126 }
127 rtlpci->irq_alloc = 1;
128 set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
129
130 /*init rfkill */
131 rtl_init_rfkill(hw);
132}
133
92static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) 134static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
93{ 135{
94 struct rtl_priv *rtlpriv = rtl_priv(hw); 136 struct rtl_priv *rtlpriv = rtl_priv(hw);
95 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 137 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
96 const struct firmware *firmware;
97 struct rt_firmware *pfirmware = NULL;
98 int err = 0; 138 int err = 0;
99 u16 earlyrxthreshold = 7; 139 u16 earlyrxthreshold = 7;
100 140
@@ -168,9 +208,9 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
168 rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; 208 rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
169 rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; 209 rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
170 if (!rtlpriv->psc.inactiveps) 210 if (!rtlpriv->psc.inactiveps)
171 pr_info("rtl8192ce: Power Save off (module option)\n"); 211 pr_info("Power Save off (module option)\n");
172 if (!rtlpriv->psc.fwctrl_lps) 212 if (!rtlpriv->psc.fwctrl_lps)
173 pr_info("rtl8192ce: FW Power Save off (module option)\n"); 213 pr_info("FW Power Save off (module option)\n");
174 rtlpriv->psc.reg_fwctrl_lps = 3; 214 rtlpriv->psc.reg_fwctrl_lps = 3;
175 rtlpriv->psc.reg_max_lps_awakeintvl = 5; 215 rtlpriv->psc.reg_max_lps_awakeintvl = 5;
176 /* for ASPM, you can close aspm through 216 /* for ASPM, you can close aspm through
@@ -189,27 +229,19 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
189 if (!rtlpriv->rtlhal.pfirmware) 229 if (!rtlpriv->rtlhal.pfirmware)
190 return 1; 230 return 1;
191 231
232 rtlpriv->max_fw_size = sizeof(struct rt_firmware);
233
192 pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n" 234 pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n"
193 "Loading firmware %s\n", rtlpriv->cfg->fw_name); 235 "Loading firmware %s\n", rtlpriv->cfg->fw_name);
194 /* request fw */ 236 /* request fw */
195 err = request_firmware(&firmware, rtlpriv->cfg->fw_name, 237 err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name,
196 rtlpriv->io.dev); 238 rtlpriv->io.dev, GFP_KERNEL, hw,
239 rtl92se_fw_cb);
197 if (err) { 240 if (err) {
198 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 241 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
199 ("Failed to request firmware!\n")); 242 "Failed to request firmware!\n");
200 return 1; 243 return 1;
201 } 244 }
202 if (firmware->size > sizeof(struct rt_firmware)) {
203 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
204 ("Firmware is too big!\n"));
205 release_firmware(firmware);
206 return 1;
207 }
208
209 pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;
210 memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
211 pfirmware->sz_fw_tmpbufferlen = firmware->size;
212 release_firmware(firmware);
213 245
214 return err; 246 return err;
215} 247}
@@ -423,7 +455,7 @@ static int __init rtl92se_module_init(void)
423 455
424 ret = pci_register_driver(&rtl92se_driver); 456 ret = pci_register_driver(&rtl92se_driver);
425 if (ret) 457 if (ret)
426 RT_ASSERT(false, (": No device found\n")); 458 RT_ASSERT(false, "No device found\n");
427 459
428 return ret; 460 return ret;
429} 461}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.h b/drivers/net/wireless/rtlwifi/rtl8192se/sw.h
index fc4eb285a0ac..2eb88862ebe4 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/table.c b/drivers/net/wireless/rtlwifi/rtl8192se/table.c
index 154185b3969d..f1a73f75127e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/table.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/table.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/table.h b/drivers/net/wireless/rtlwifi/rtl8192se/table.h
index b4ed6d951ebb..2feb73b71a4f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/table.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/table.h
@@ -1,5 +1,5 @@
1/****************************************************************************** 1/******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. 2 * Copyright(c) 2008 - 2012 Realtek Corporation. All rights reserved.
3 * 3 *
4 * This program is distributed in the hope that it will be useful, but WITHOUT 4 * This program is distributed in the hope that it will be useful, but WITHOUT
5 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index fbebe3ea0a22..2fd3d13b7ced 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -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,
@@ -823,8 +823,8 @@ void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val)
823 SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val); 823 SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
824 break; 824 break;
825 default: 825 default:
826 RT_ASSERT(false, ("ERR txdesc :%d not process\n", 826 RT_ASSERT(false, "ERR txdesc :%d not process\n",
827 desc_name)); 827 desc_name);
828 break; 828 break;
829 } 829 }
830 } else { 830 } else {
@@ -843,8 +843,8 @@ void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val)
843 SET_RX_STATUS_DESC_EOR(pdesc, 1); 843 SET_RX_STATUS_DESC_EOR(pdesc, 1);
844 break; 844 break;
845 default: 845 default:
846 RT_ASSERT(false, ("ERR rxdesc :%d not process\n", 846 RT_ASSERT(false, "ERR rxdesc :%d not process\n",
847 desc_name)); 847 desc_name);
848 break; 848 break;
849 } 849 }
850 } 850 }
@@ -863,8 +863,8 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
863 ret = GET_TX_DESC_TX_BUFFER_ADDRESS(desc); 863 ret = GET_TX_DESC_TX_BUFFER_ADDRESS(desc);
864 break; 864 break;
865 default: 865 default:
866 RT_ASSERT(false, ("ERR txdesc :%d not process\n", 866 RT_ASSERT(false, "ERR txdesc :%d not process\n",
867 desc_name)); 867 desc_name);
868 break; 868 break;
869 } 869 }
870 } else { 870 } else {
@@ -876,8 +876,8 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
876 ret = GET_RX_STATUS_DESC_PKT_LEN(desc); 876 ret = GET_RX_STATUS_DESC_PKT_LEN(desc);
877 break; 877 break;
878 default: 878 default:
879 RT_ASSERT(false, ("ERR rxdesc :%d not process\n", 879 RT_ASSERT(false, "ERR rxdesc :%d not process\n",
880 desc_name)); 880 desc_name);
881 break; 881 break;
882 } 882 }
883 } 883 }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.h b/drivers/net/wireless/rtlwifi/rtl8192se/trx.h
index 05862c51b861..011e7b0695f2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009-2010 Realtek Corporation. 3 * Copyright(c) 2009-2012 Realtek Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as