aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2009-01-27 17:27:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-09 15:03:34 -0500
commite1623446bb1de1834ff1c57b3e8ed341d5d4a927 (patch)
treeece3595deda6d6bad747961be257d5f2cbb507b1 /drivers/net/wireless/iwlwifi
parent450154e4f471248e188d18e45c2409b37a133765 (diff)
iwlwifi: don't use implicit priv in IWL_DEBUG
Call IWL_DEBUG macro with explicit priv argument. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-led.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c74
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c109
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c126
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c54
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c104
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c281
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-calib.c74
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c72
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h103
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-io.h20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rfkill.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c28
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c62
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-spectrum.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c36
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c52
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c427
22 files changed, 859 insertions, 839 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
index fab137365000..2e507e912dad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
@@ -137,7 +137,7 @@ static int iwl3945_led_off(struct iwl_priv *priv, int led_id)
137 .off = 0, 137 .off = 0,
138 .interval = IWL_DEF_LED_INTRVL 138 .interval = IWL_DEF_LED_INTRVL
139 }; 139 };
140 IWL_DEBUG_LED("led off %d\n", led_id); 140 IWL_DEBUG_LED(priv, "led off %d\n", led_id);
141 return iwl_send_led_cmd(priv, &led_cmd); 141 return iwl_send_led_cmd(priv, &led_cmd);
142} 142}
143 143
@@ -174,7 +174,7 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev,
174 case LED_FULL: 174 case LED_FULL:
175 if (led->type == IWL_LED_TRG_ASSOC) { 175 if (led->type == IWL_LED_TRG_ASSOC) {
176 priv->allow_blinking = 1; 176 priv->allow_blinking = 1;
177 IWL_DEBUG_LED("MAC is associated\n"); 177 IWL_DEBUG_LED(priv, "MAC is associated\n");
178 } 178 }
179 if (led->led_on) 179 if (led->led_on)
180 led->led_on(priv, IWL_LED_LINK); 180 led->led_on(priv, IWL_LED_LINK);
@@ -182,7 +182,7 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev,
182 case LED_OFF: 182 case LED_OFF:
183 if (led->type == IWL_LED_TRG_ASSOC) { 183 if (led->type == IWL_LED_TRG_ASSOC) {
184 priv->allow_blinking = 0; 184 priv->allow_blinking = 0;
185 IWL_DEBUG_LED("MAC is disassociated\n"); 185 IWL_DEBUG_LED(priv, "MAC is disassociated\n");
186 } 186 }
187 if (led->led_off) 187 if (led->led_off)
188 led->led_off(priv, IWL_LED_LINK); 188 led->led_off(priv, IWL_LED_LINK);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 45ce3ff653ab..7db8198c6253 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -197,7 +197,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
197 spin_lock_irqsave(&rs_sta->lock, flags); 197 spin_lock_irqsave(&rs_sta->lock, flags);
198 if (time_after(jiffies, rs_sta->win[i].stamp + 198 if (time_after(jiffies, rs_sta->win[i].stamp +
199 IWL_RATE_WIN_FLUSH)) { 199 IWL_RATE_WIN_FLUSH)) {
200 IWL_DEBUG_RATE("flushing %d samples of rate " 200 IWL_DEBUG_RATE(priv, "flushing %d samples of rate "
201 "index %d\n", 201 "index %d\n",
202 rs_sta->win[i].counter, i); 202 rs_sta->win[i].counter, i);
203 iwl3945_clear_window(&rs_sta->win[i]); 203 iwl3945_clear_window(&rs_sta->win[i]);
@@ -221,7 +221,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)
221 unsigned long flags; 221 unsigned long flags;
222 u32 packet_count, duration, pps; 222 u32 packet_count, duration, pps;
223 223
224 IWL_DEBUG_RATE("enter\n"); 224 IWL_DEBUG_RATE(priv, "enter\n");
225 225
226 unflushed = iwl3945_rate_scale_flush_windows(rs_sta); 226 unflushed = iwl3945_rate_scale_flush_windows(rs_sta);
227 227
@@ -236,7 +236,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)
236 duration = 236 duration =
237 jiffies_to_msecs(jiffies - rs_sta->last_partial_flush); 237 jiffies_to_msecs(jiffies - rs_sta->last_partial_flush);
238 238
239 IWL_DEBUG_RATE("Tx'd %d packets in %dms\n", 239 IWL_DEBUG_RATE(priv, "Tx'd %d packets in %dms\n",
240 packet_count, duration); 240 packet_count, duration);
241 241
242 /* Determine packets per second */ 242 /* Determine packets per second */
@@ -256,7 +256,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)
256 256
257 rs_sta->flush_time = msecs_to_jiffies(duration); 257 rs_sta->flush_time = msecs_to_jiffies(duration);
258 258
259 IWL_DEBUG_RATE("new flush period: %d msec ave %d\n", 259 IWL_DEBUG_RATE(priv, "new flush period: %d msec ave %d\n",
260 duration, packet_count); 260 duration, packet_count);
261 261
262 mod_timer(&rs_sta->rate_scale_flush, jiffies + 262 mod_timer(&rs_sta->rate_scale_flush, jiffies +
@@ -274,7 +274,7 @@ static void iwl3945_bg_rate_scale_flush(unsigned long data)
274 274
275 spin_unlock_irqrestore(&rs_sta->lock, flags); 275 spin_unlock_irqrestore(&rs_sta->lock, flags);
276 276
277 IWL_DEBUG_RATE("leave\n"); 277 IWL_DEBUG_RATE(priv, "leave\n");
278} 278}
279 279
280/** 280/**
@@ -293,7 +293,7 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
293 struct iwl_priv *priv __maybe_unused = rs_sta->priv; 293 struct iwl_priv *priv __maybe_unused = rs_sta->priv;
294 294
295 if (!retries) { 295 if (!retries) {
296 IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n"); 296 IWL_DEBUG_RATE(priv, "leave: retries == 0 -- should be at least 1\n");
297 return; 297 return;
298 } 298 }
299 299
@@ -347,7 +347,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
347 struct iwl_priv *priv = (struct iwl_priv *)priv_r; 347 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
348 int i; 348 int i;
349 349
350 IWL_DEBUG_RATE("enter\n"); 350 IWL_DEBUG_RATE(priv, "enter\n");
351 351
352 /* TODO: what is a good starting rate for STA? About middle? Maybe not 352 /* TODO: what is a good starting rate for STA? About middle? Maybe not
353 * the lowest or the highest rate.. Could consider using RSSI from 353 * the lowest or the highest rate.. Could consider using RSSI from
@@ -370,7 +370,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
370 } 370 }
371 371
372 372
373 IWL_DEBUG_RATE("leave\n"); 373 IWL_DEBUG_RATE(priv, "leave\n");
374} 374}
375 375
376static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) 376static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
@@ -396,11 +396,11 @@ static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
396 * as well just put all the information there. 396 * as well just put all the information there.
397 */ 397 */
398 398
399 IWL_DEBUG_RATE("enter\n"); 399 IWL_DEBUG_RATE(priv, "enter\n");
400 400
401 rs_sta = kzalloc(sizeof(struct iwl3945_rs_sta), gfp); 401 rs_sta = kzalloc(sizeof(struct iwl3945_rs_sta), gfp);
402 if (!rs_sta) { 402 if (!rs_sta) {
403 IWL_DEBUG_RATE("leave: ENOMEM\n"); 403 IWL_DEBUG_RATE(priv, "leave: ENOMEM\n");
404 return NULL; 404 return NULL;
405 } 405 }
406 406
@@ -428,7 +428,7 @@ static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
428 for (i = 0; i < IWL_RATE_COUNT_3945; i++) 428 for (i = 0; i < IWL_RATE_COUNT_3945; i++)
429 iwl3945_clear_window(&rs_sta->win[i]); 429 iwl3945_clear_window(&rs_sta->win[i]);
430 430
431 IWL_DEBUG_RATE("leave\n"); 431 IWL_DEBUG_RATE(priv, "leave\n");
432 432
433 return rs_sta; 433 return rs_sta;
434} 434}
@@ -442,10 +442,10 @@ static void rs_free_sta(void *iwl_priv, struct ieee80211_sta *sta,
442 442
443 psta->rs_sta = NULL; 443 psta->rs_sta = NULL;
444 444
445 IWL_DEBUG_RATE("enter\n"); 445 IWL_DEBUG_RATE(priv, "enter\n");
446 del_timer_sync(&rs_sta->rate_scale_flush); 446 del_timer_sync(&rs_sta->rate_scale_flush);
447 kfree(rs_sta); 447 kfree(rs_sta);
448 IWL_DEBUG_RATE("leave\n"); 448 IWL_DEBUG_RATE(priv, "leave\n");
449} 449}
450 450
451 451
@@ -466,18 +466,18 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
466 struct iwl3945_rs_sta *rs_sta = priv_sta; 466 struct iwl3945_rs_sta *rs_sta = priv_sta;
467 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 467 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
468 468
469 IWL_DEBUG_RATE("enter\n"); 469 IWL_DEBUG_RATE(priv, "enter\n");
470 470
471 retries = info->status.rates[0].count; 471 retries = info->status.rates[0].count;
472 472
473 first_index = sband->bitrates[info->status.rates[0].idx].hw_value; 473 first_index = sband->bitrates[info->status.rates[0].idx].hw_value;
474 if ((first_index < 0) || (first_index >= IWL_RATE_COUNT_3945)) { 474 if ((first_index < 0) || (first_index >= IWL_RATE_COUNT_3945)) {
475 IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); 475 IWL_DEBUG_RATE(priv, "leave: Rate out of bounds: %d\n", first_index);
476 return; 476 return;
477 } 477 }
478 478
479 if (!priv_sta) { 479 if (!priv_sta) {
480 IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); 480 IWL_DEBUG_RATE(priv, "leave: No STA priv data to update!\n");
481 return; 481 return;
482 } 482 }
483 483
@@ -511,7 +511,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
511 iwl3945_collect_tx_data(rs_sta, 511 iwl3945_collect_tx_data(rs_sta,
512 &rs_sta->win[scale_rate_index], 512 &rs_sta->win[scale_rate_index],
513 0, current_count, scale_rate_index); 513 0, current_count, scale_rate_index);
514 IWL_DEBUG_RATE("Update rate %d for %d retries.\n", 514 IWL_DEBUG_RATE(priv, "Update rate %d for %d retries.\n",
515 scale_rate_index, current_count); 515 scale_rate_index, current_count);
516 516
517 retries -= current_count; 517 retries -= current_count;
@@ -521,7 +521,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
521 521
522 522
523 /* Update the last index window with success/failure based on ACK */ 523 /* Update the last index window with success/failure based on ACK */
524 IWL_DEBUG_RATE("Update rate %d with %s.\n", 524 IWL_DEBUG_RATE(priv, "Update rate %d with %s.\n",
525 last_index, 525 last_index,
526 (info->flags & IEEE80211_TX_STAT_ACK) ? 526 (info->flags & IEEE80211_TX_STAT_ACK) ?
527 "success" : "failure"); 527 "success" : "failure");
@@ -546,7 +546,7 @@ static void rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband
546 546
547 spin_unlock_irqrestore(&rs_sta->lock, flags); 547 spin_unlock_irqrestore(&rs_sta->lock, flags);
548 548
549 IWL_DEBUG_RATE("leave\n"); 549 IWL_DEBUG_RATE(priv, "leave\n");
550 550
551 return; 551 return;
552} 552}
@@ -596,7 +596,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
596 break; 596 break;
597 if (rate_mask & (1 << low)) 597 if (rate_mask & (1 << low))
598 break; 598 break;
599 IWL_DEBUG_RATE("Skipping masked lower rate: %d\n", low); 599 IWL_DEBUG_RATE(priv, "Skipping masked lower rate: %d\n", low);
600 } 600 }
601 601
602 high = index; 602 high = index;
@@ -609,7 +609,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
609 break; 609 break;
610 if (rate_mask & (1 << high)) 610 if (rate_mask & (1 << high))
611 break; 611 break;
612 IWL_DEBUG_RATE("Skipping masked higher rate: %d\n", high); 612 IWL_DEBUG_RATE(priv, "Skipping masked higher rate: %d\n", high);
613 } 613 }
614 614
615 return (high << 8) | low; 615 return (high << 8) | low;
@@ -655,7 +655,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
655 struct iwl_priv *priv = (struct iwl_priv *)priv_r; 655 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
656 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 656 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
657 657
658 IWL_DEBUG_RATE("enter\n"); 658 IWL_DEBUG_RATE(priv, "enter\n");
659 659
660 if (sta) 660 if (sta)
661 rate_mask = sta->supp_rates[sband->band]; 661 rate_mask = sta->supp_rates[sband->band];
@@ -666,7 +666,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
666 if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA || 666 if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
667 is_multicast_ether_addr(hdr->addr1) || 667 is_multicast_ether_addr(hdr->addr1) ||
668 !sta || !priv_sta) { 668 !sta || !priv_sta) {
669 IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); 669 IWL_DEBUG_RATE(priv, "leave: No STA priv data to update!\n");
670 if (!rate_mask) 670 if (!rate_mask)
671 info->control.rates[0].idx = 671 info->control.rates[0].idx =
672 rate_lowest_index(sband, NULL); 672 rate_lowest_index(sband, NULL);
@@ -693,7 +693,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
693 u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 693 u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
694 694
695 if (sta_id == IWL_INVALID_STATION) { 695 if (sta_id == IWL_INVALID_STATION) {
696 IWL_DEBUG_RATE("LQ: ADD station %pm\n", 696 IWL_DEBUG_RATE(priv, "LQ: ADD station %pm\n",
697 hdr->addr1); 697 hdr->addr1);
698 sta_id = iwl3945_add_station(priv, 698 sta_id = iwl3945_add_station(priv,
699 hdr->addr1, 0, CMD_ASYNC); 699 hdr->addr1, 0, CMD_ASYNC);
@@ -728,7 +728,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
728 (window->success_counter < IWL_RATE_MIN_SUCCESS_TH))) { 728 (window->success_counter < IWL_RATE_MIN_SUCCESS_TH))) {
729 spin_unlock_irqrestore(&rs_sta->lock, flags); 729 spin_unlock_irqrestore(&rs_sta->lock, flags);
730 730
731 IWL_DEBUG_RATE("Invalid average_tpt on rate %d: " 731 IWL_DEBUG_RATE(priv, "Invalid average_tpt on rate %d: "
732 "counter: %d, success_counter: %d, " 732 "counter: %d, success_counter: %d, "
733 "expected_tpt is %sNULL\n", 733 "expected_tpt is %sNULL\n",
734 index, 734 index,
@@ -761,7 +761,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
761 scale_action = 1; 761 scale_action = 1;
762 762
763 if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) { 763 if ((window->success_ratio < IWL_RATE_DECREASE_TH) || !current_tpt) {
764 IWL_DEBUG_RATE("decrease rate because of low success_ratio\n"); 764 IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n");
765 scale_action = -1; 765 scale_action = -1;
766 } else if ((low_tpt == IWL_INVALID_VALUE) && 766 } else if ((low_tpt == IWL_INVALID_VALUE) &&
767 (high_tpt == IWL_INVALID_VALUE)) 767 (high_tpt == IWL_INVALID_VALUE))
@@ -769,7 +769,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
769 else if ((low_tpt != IWL_INVALID_VALUE) && 769 else if ((low_tpt != IWL_INVALID_VALUE) &&
770 (high_tpt != IWL_INVALID_VALUE) && 770 (high_tpt != IWL_INVALID_VALUE) &&
771 (low_tpt < current_tpt) && (high_tpt < current_tpt)) { 771 (low_tpt < current_tpt) && (high_tpt < current_tpt)) {
772 IWL_DEBUG_RATE("No action -- low [%d] & high [%d] < " 772 IWL_DEBUG_RATE(priv, "No action -- low [%d] & high [%d] < "
773 "current_tpt [%d]\n", 773 "current_tpt [%d]\n",
774 low_tpt, high_tpt, current_tpt); 774 low_tpt, high_tpt, current_tpt);
775 scale_action = 0; 775 scale_action = 0;
@@ -778,14 +778,14 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
778 if (high_tpt > current_tpt) 778 if (high_tpt > current_tpt)
779 scale_action = 1; 779 scale_action = 1;
780 else { 780 else {
781 IWL_DEBUG_RATE 781 IWL_DEBUG_RATE(priv,
782 ("decrease rate because of high tpt\n"); 782 "decrease rate because of high tpt\n");
783 scale_action = -1; 783 scale_action = -1;
784 } 784 }
785 } else if (low_tpt != IWL_INVALID_VALUE) { 785 } else if (low_tpt != IWL_INVALID_VALUE) {
786 if (low_tpt > current_tpt) { 786 if (low_tpt > current_tpt) {
787 IWL_DEBUG_RATE 787 IWL_DEBUG_RATE(priv,
788 ("decrease rate because of low tpt\n"); 788 "decrease rate because of low tpt\n");
789 scale_action = -1; 789 scale_action = -1;
790 } else 790 } else
791 scale_action = 1; 791 scale_action = 1;
@@ -797,7 +797,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
797 scale_action = 0; 797 scale_action = 0;
798 } else if (scale_action == 1) { 798 } else if (scale_action == 1) {
799 if (window->success_ratio < IWL_SUCCESS_UP_TH) { 799 if (window->success_ratio < IWL_SUCCESS_UP_TH) {
800 IWL_DEBUG_RATE("No action -- success_ratio [%d] < " 800 IWL_DEBUG_RATE(priv, "No action -- success_ratio [%d] < "
801 "SUCCESS UP\n", window->success_ratio); 801 "SUCCESS UP\n", window->success_ratio);
802 scale_action = 0; 802 scale_action = 0;
803 } 803 }
@@ -820,7 +820,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
820 break; 820 break;
821 } 821 }
822 822
823 IWL_DEBUG_RATE("Selected %d (action %d) - low %d high %d\n", 823 IWL_DEBUG_RATE(priv, "Selected %d (action %d) - low %d high %d\n",
824 index, scale_action, low, high); 824 index, scale_action, low, high);
825 825
826 out: 826 out:
@@ -832,7 +832,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
832 else 832 else
833 info->control.rates[0].idx = rs_sta->last_txrate_idx; 833 info->control.rates[0].idx = rs_sta->last_txrate_idx;
834 834
835 IWL_DEBUG_RATE("leave: %d\n", index); 835 IWL_DEBUG_RATE(priv, "leave: %d\n", index);
836} 836}
837 837
838#ifdef CONFIG_MAC80211_DEBUGFS 838#ifdef CONFIG_MAC80211_DEBUGFS
@@ -915,7 +915,7 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
915 struct ieee80211_sta *sta; 915 struct ieee80211_sta *sta;
916 struct iwl3945_sta_priv *psta; 916 struct iwl3945_sta_priv *psta;
917 917
918 IWL_DEBUG_RATE("enter\n"); 918 IWL_DEBUG_RATE(priv, "enter\n");
919 919
920 rcu_read_lock(); 920 rcu_read_lock();
921 921
@@ -955,11 +955,11 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
955 if (rssi == 0) 955 if (rssi == 0)
956 rssi = IWL_MIN_RSSI_VAL; 956 rssi = IWL_MIN_RSSI_VAL;
957 957
958 IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi); 958 IWL_DEBUG_RATE(priv, "Network RSSI: %d\n", rssi);
959 959
960 rs_sta->start_rate = iwl3945_get_rate_index_by_rssi(rssi, priv->band); 960 rs_sta->start_rate = iwl3945_get_rate_index_by_rssi(rssi, priv->band);
961 961
962 IWL_DEBUG_RATE("leave: rssi %d assign rate index: " 962 IWL_DEBUG_RATE(priv, "leave: rssi %d assign rate index: "
963 "%d (plcp 0x%x)\n", rssi, rs_sta->start_rate, 963 "%d (plcp 0x%x)\n", rssi, rs_sta->start_rate,
964 iwl3945_rates[rs_sta->start_rate].plcp); 964 iwl3945_rates[rs_sta->start_rate].plcp);
965 rcu_read_unlock(); 965 rcu_read_unlock();
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index b4b186db0fd9..8ff5798ad641 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -170,7 +170,7 @@ void iwl3945_disable_events(struct iwl_priv *priv)
170 iwl_release_nic_access(priv); 170 iwl_release_nic_access(priv);
171 171
172 if (IWL_EVT_DISABLE && (array_size == IWL_EVT_DISABLE_SIZE)) { 172 if (IWL_EVT_DISABLE && (array_size == IWL_EVT_DISABLE_SIZE)) {
173 IWL_DEBUG_INFO("Disabling selected uCode log events at 0x%x\n", 173 IWL_DEBUG_INFO(priv, "Disabling selected uCode log events at 0x%x\n",
174 disable_ptr); 174 disable_ptr);
175 ret = iwl_grab_nic_access(priv); 175 ret = iwl_grab_nic_access(priv);
176 for (i = 0; i < IWL_EVT_DISABLE_SIZE; i++) 176 for (i = 0; i < IWL_EVT_DISABLE_SIZE; i++)
@@ -180,9 +180,9 @@ void iwl3945_disable_events(struct iwl_priv *priv)
180 180
181 iwl_release_nic_access(priv); 181 iwl_release_nic_access(priv);
182 } else { 182 } else {
183 IWL_DEBUG_INFO("Selected uCode log events may be disabled\n"); 183 IWL_DEBUG_INFO(priv, "Selected uCode log events may be disabled\n");
184 IWL_DEBUG_INFO(" by writing \"1\"s into disable bitmap\n"); 184 IWL_DEBUG_INFO(priv, " by writing \"1\"s into disable bitmap\n");
185 IWL_DEBUG_INFO(" in SRAM at 0x%x, size %d u32s\n", 185 IWL_DEBUG_INFO(priv, " in SRAM at 0x%x, size %d u32s\n",
186 disable_ptr, array_size); 186 disable_ptr, array_size);
187 } 187 }
188 188
@@ -338,11 +338,11 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
338 info->flags |= ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ? 338 info->flags |= ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ?
339 IEEE80211_TX_STAT_ACK : 0; 339 IEEE80211_TX_STAT_ACK : 0;
340 340
341 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n", 341 IWL_DEBUG_TX(priv, "Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n",
342 txq_id, iwl3945_get_tx_fail_reason(status), status, 342 txq_id, iwl3945_get_tx_fail_reason(status), status,
343 tx_resp->rate, tx_resp->failure_frame); 343 tx_resp->rate, tx_resp->failure_frame);
344 344
345 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); 345 IWL_DEBUG_TX_REPLY(priv, "Tx queue reclaim %d\n", index);
346 iwl3945_tx_queue_reclaim(priv, txq_id, index); 346 iwl3945_tx_queue_reclaim(priv, txq_id, index);
347 347
348 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) 348 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
@@ -362,7 +362,7 @@ static void iwl3945_rx_reply_tx(struct iwl_priv *priv,
362void iwl3945_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) 362void iwl3945_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
363{ 363{
364 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 364 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
365 IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n", 365 IWL_DEBUG_RX(priv, "Statistics notification received (%d vs %d).\n",
366 (int)sizeof(struct iwl3945_notif_statistics), 366 (int)sizeof(struct iwl3945_notif_statistics),
367 le32_to_cpu(pkt->len)); 367 le32_to_cpu(pkt->len));
368 368
@@ -496,13 +496,13 @@ static void _iwl3945_dbg_report_frame(struct iwl_priv *priv,
496 * MAC addresses show just the last byte (for brevity), 496 * MAC addresses show just the last byte (for brevity),
497 * but you can hack it to show more, if you'd like to. */ 497 * but you can hack it to show more, if you'd like to. */
498 if (dataframe) 498 if (dataframe)
499 IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " 499 IWL_DEBUG_RX(priv, "%s: mhd=0x%04x, dst=0x%02x, "
500 "len=%u, rssi=%d, chnl=%d, rate=%d, \n", 500 "len=%u, rssi=%d, chnl=%d, rate=%d, \n",
501 title, le16_to_cpu(fc), header->addr1[5], 501 title, le16_to_cpu(fc), header->addr1[5],
502 length, rssi, channel, rate); 502 length, rssi, channel, rate);
503 else { 503 else {
504 /* src/dst addresses assume managed mode */ 504 /* src/dst addresses assume managed mode */
505 IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, " 505 IWL_DEBUG_RX(priv, "%s: 0x%04x, dst=0x%02x, "
506 "src=0x%02x, rssi=%u, tim=%lu usec, " 506 "src=0x%02x, rssi=%u, tim=%lu usec, "
507 "phy=0x%02x, chnl=%d\n", 507 "phy=0x%02x, chnl=%d\n",
508 title, le16_to_cpu(fc), header->addr1[5], 508 title, le16_to_cpu(fc), header->addr1[5],
@@ -563,14 +563,14 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
563 563
564 /* We received data from the HW, so stop the watchdog */ 564 /* We received data from the HW, so stop the watchdog */
565 if (unlikely((len + IWL39_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) { 565 if (unlikely((len + IWL39_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) {
566 IWL_DEBUG_DROP("Corruption detected!\n"); 566 IWL_DEBUG_DROP(priv, "Corruption detected!\n");
567 return; 567 return;
568 } 568 }
569 569
570 /* We only process data packets if the interface is open */ 570 /* We only process data packets if the interface is open */
571 if (unlikely(!priv->is_open)) { 571 if (unlikely(!priv->is_open)) {
572 IWL_DEBUG_DROP_LIMIT 572 IWL_DEBUG_DROP_LIMIT(priv,
573 ("Dropping packet while interface is not open.\n"); 573 "Dropping packet while interface is not open.\n");
574 return; 574 return;
575 } 575 }
576 576
@@ -626,15 +626,14 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
626 rx_status.flag |= RX_FLAG_SHORTPRE; 626 rx_status.flag |= RX_FLAG_SHORTPRE;
627 627
628 if ((unlikely(rx_stats->phy_count > 20))) { 628 if ((unlikely(rx_stats->phy_count > 20))) {
629 IWL_DEBUG_DROP 629 IWL_DEBUG_DROP(priv, "dsp size out of range [0,20]: %d/n",
630 ("dsp size out of range [0,20]: " 630 rx_stats->phy_count);
631 "%d/n", rx_stats->phy_count);
632 return; 631 return;
633 } 632 }
634 633
635 if (!(rx_end->status & RX_RES_STATUS_NO_CRC32_ERROR) 634 if (!(rx_end->status & RX_RES_STATUS_NO_CRC32_ERROR)
636 || !(rx_end->status & RX_RES_STATUS_NO_RXE_OVERFLOW)) { 635 || !(rx_end->status & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
637 IWL_DEBUG_RX("Bad CRC or FIFO: 0x%08X.\n", rx_end->status); 636 IWL_DEBUG_RX(priv, "Bad CRC or FIFO: 0x%08X.\n", rx_end->status);
638 return; 637 return;
639 } 638 }
640 639
@@ -673,7 +672,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
673 } 672 }
674 673
675 674
676 IWL_DEBUG_STATS("Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n", 675 IWL_DEBUG_STATS(priv, "Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n",
677 rx_status.signal, rx_status.noise, rx_status.qual, 676 rx_status.signal, rx_status.noise, rx_status.qual,
678 rx_stats_sig_avg, rx_stats_noise_diff); 677 rx_stats_sig_avg, rx_stats_noise_diff);
679 678
@@ -681,7 +680,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
681 680
682 network_packet = iwl3945_is_network_packet(priv, header); 681 network_packet = iwl3945_is_network_packet(priv, header);
683 682
684 IWL_DEBUG_STATS_LIMIT("[%c] %d RSSI:%d Signal:%u, Noise:%u, Rate:%u\n", 683 IWL_DEBUG_STATS_LIMIT(priv, "[%c] %d RSSI:%d Signal:%u, Noise:%u, Rate:%u\n",
685 network_packet ? '*' : ' ', 684 network_packet ? '*' : ' ',
686 le16_to_cpu(rx_hdr->channel), 685 le16_to_cpu(rx_hdr->channel),
687 rx_status.signal, rx_status.signal, 686 rx_status.signal, rx_status.signal,
@@ -799,7 +798,7 @@ u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *addr)
799 goto out; 798 goto out;
800 } 799 }
801 800
802 IWL_DEBUG_INFO("can not find STA %pM (total %d)\n", 801 IWL_DEBUG_INFO(priv, "can not find STA %pM (total %d)\n",
803 addr, priv->num_stations); 802 addr, priv->num_stations);
804 out: 803 out:
805 spin_unlock_irqrestore(&priv->sta_lock, flags); 804 spin_unlock_irqrestore(&priv->sta_lock, flags);
@@ -874,7 +873,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd,
874 /* CCK */ 873 /* CCK */
875 tx->supp_rates[1] = (rate_mask & 0xF); 874 tx->supp_rates[1] = (rate_mask & 0xF);
876 875
877 IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X " 876 IWL_DEBUG_RATE(priv, "Tx sta id: %d, rate: %d (plcp), flags: 0x%4X "
878 "cck/ofdm mask: 0x%x/0x%x\n", sta_id, 877 "cck/ofdm mask: 0x%x/0x%x\n", sta_id,
879 tx->rate, le32_to_cpu(tx->tx_flags), 878 tx->rate, le32_to_cpu(tx->tx_flags),
880 tx->supp_rates[1], tx->supp_rates[0]); 879 tx->supp_rates[1], tx->supp_rates[0]);
@@ -899,7 +898,7 @@ u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)
899 898
900 iwl_send_add_sta(priv, 899 iwl_send_add_sta(priv,
901 (struct iwl_addsta_cmd *)&station->sta, flags); 900 (struct iwl_addsta_cmd *)&station->sta, flags);
902 IWL_DEBUG_RATE("SCALE sync station %d to rate %d\n", 901 IWL_DEBUG_RATE(priv, "SCALE sync station %d to rate %d\n",
903 sta_id, tx_rate); 902 sta_id, tx_rate);
904 return sta_id; 903 return sta_id;
905} 904}
@@ -1080,7 +1079,7 @@ static int iwl3945_apm_init(struct iwl_priv *priv)
1080 iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 1079 iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
1081 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 1080 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
1082 if (ret < 0) { 1081 if (ret < 0) {
1083 IWL_DEBUG_INFO("Failed to init the card\n"); 1082 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
1084 goto out; 1083 goto out;
1085 } 1084 }
1086 1085
@@ -1112,31 +1111,31 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
1112 spin_lock_irqsave(&priv->lock, flags); 1111 spin_lock_irqsave(&priv->lock, flags);
1113 1112
1114 if (rev_id & PCI_CFG_REV_ID_BIT_RTP) 1113 if (rev_id & PCI_CFG_REV_ID_BIT_RTP)
1115 IWL_DEBUG_INFO("RTP type \n"); 1114 IWL_DEBUG_INFO(priv, "RTP type \n");
1116 else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) { 1115 else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) {
1117 IWL_DEBUG_INFO("3945 RADIO-MB type\n"); 1116 IWL_DEBUG_INFO(priv, "3945 RADIO-MB type\n");
1118 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1117 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1119 CSR39_HW_IF_CONFIG_REG_BIT_3945_MB); 1118 CSR39_HW_IF_CONFIG_REG_BIT_3945_MB);
1120 } else { 1119 } else {
1121 IWL_DEBUG_INFO("3945 RADIO-MM type\n"); 1120 IWL_DEBUG_INFO(priv, "3945 RADIO-MM type\n");
1122 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1121 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1123 CSR39_HW_IF_CONFIG_REG_BIT_3945_MM); 1122 CSR39_HW_IF_CONFIG_REG_BIT_3945_MM);
1124 } 1123 }
1125 1124
1126 if (EEPROM_SKU_CAP_OP_MODE_MRC == eeprom->sku_cap) { 1125 if (EEPROM_SKU_CAP_OP_MODE_MRC == eeprom->sku_cap) {
1127 IWL_DEBUG_INFO("SKU OP mode is mrc\n"); 1126 IWL_DEBUG_INFO(priv, "SKU OP mode is mrc\n");
1128 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1127 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1129 CSR39_HW_IF_CONFIG_REG_BIT_SKU_MRC); 1128 CSR39_HW_IF_CONFIG_REG_BIT_SKU_MRC);
1130 } else 1129 } else
1131 IWL_DEBUG_INFO("SKU OP mode is basic\n"); 1130 IWL_DEBUG_INFO(priv, "SKU OP mode is basic\n");
1132 1131
1133 if ((eeprom->board_revision & 0xF0) == 0xD0) { 1132 if ((eeprom->board_revision & 0xF0) == 0xD0) {
1134 IWL_DEBUG_INFO("3945ABG revision is 0x%X\n", 1133 IWL_DEBUG_INFO(priv, "3945ABG revision is 0x%X\n",
1135 eeprom->board_revision); 1134 eeprom->board_revision);
1136 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1135 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1137 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE); 1136 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
1138 } else { 1137 } else {
1139 IWL_DEBUG_INFO("3945ABG revision is 0x%X\n", 1138 IWL_DEBUG_INFO(priv, "3945ABG revision is 0x%X\n",
1140 eeprom->board_revision); 1139 eeprom->board_revision);
1141 iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG, 1140 iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
1142 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE); 1141 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
@@ -1145,10 +1144,10 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
1145 if (eeprom->almgor_m_version <= 1) { 1144 if (eeprom->almgor_m_version <= 1) {
1146 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1145 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1147 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A); 1146 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A);
1148 IWL_DEBUG_INFO("Card M type A version is 0x%X\n", 1147 IWL_DEBUG_INFO(priv, "Card M type A version is 0x%X\n",
1149 eeprom->almgor_m_version); 1148 eeprom->almgor_m_version);
1150 } else { 1149 } else {
1151 IWL_DEBUG_INFO("Card M type B version is 0x%X\n", 1150 IWL_DEBUG_INFO(priv, "Card M type B version is 0x%X\n",
1152 eeprom->almgor_m_version); 1151 eeprom->almgor_m_version);
1153 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1152 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1154 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B); 1153 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B);
@@ -1156,10 +1155,10 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
1156 spin_unlock_irqrestore(&priv->lock, flags); 1155 spin_unlock_irqrestore(&priv->lock, flags);
1157 1156
1158 if (eeprom->sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE) 1157 if (eeprom->sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE)
1159 IWL_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n"); 1158 IWL_DEBUG_RF_KILL(priv, "SW RF KILL supported in EEPROM.\n");
1160 1159
1161 if (eeprom->sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE) 1160 if (eeprom->sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE)
1162 IWL_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n"); 1161 IWL_DEBUG_RF_KILL(priv, "HW RF KILL supported in EEPROM.\n");
1163} 1162}
1164 1163
1165int iwl3945_hw_nic_init(struct iwl_priv *priv) 1164int iwl3945_hw_nic_init(struct iwl_priv *priv)
@@ -1177,7 +1176,7 @@ int iwl3945_hw_nic_init(struct iwl_priv *priv)
1177 rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id); 1176 rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
1178 if (rc) 1177 if (rc)
1179 return rc; 1178 return rc;
1180 IWL_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id); 1179 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", rev_id);
1181 1180
1182 rc = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN); 1181 rc = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN);
1183 if(rc) 1182 if(rc)
@@ -1286,7 +1285,7 @@ static int iwl3945_apm_stop_master(struct iwl_priv *priv)
1286 1285
1287out: 1286out:
1288 spin_unlock_irqrestore(&priv->lock, flags); 1287 spin_unlock_irqrestore(&priv->lock, flags);
1289 IWL_DEBUG_INFO("stop master\n"); 1288 IWL_DEBUG_INFO(priv, "stop master\n");
1290 1289
1291 return ret; 1290 return ret;
1292} 1291}
@@ -1391,7 +1390,7 @@ static int iwl3945_hw_reg_txpower_get_temperature(struct iwl_priv *priv)
1391 1390
1392 /* driver's okay range is -260 to +25. 1391 /* driver's okay range is -260 to +25.
1393 * human readable okay range is 0 to +285 */ 1392 * human readable okay range is 0 to +285 */
1394 IWL_DEBUG_INFO("Temperature: %d\n", temperature + IWL_TEMP_CONVERT); 1393 IWL_DEBUG_INFO(priv, "Temperature: %d\n", temperature + IWL_TEMP_CONVERT);
1395 1394
1396 /* handle insane temp reading */ 1395 /* handle insane temp reading */
1397 if (iwl3945_hw_reg_temp_out_of_range(temperature)) { 1396 if (iwl3945_hw_reg_temp_out_of_range(temperature)) {
@@ -1428,20 +1427,20 @@ static int is_temp_calib_needed(struct iwl_priv *priv)
1428 1427
1429 /* get absolute value */ 1428 /* get absolute value */
1430 if (temp_diff < 0) { 1429 if (temp_diff < 0) {
1431 IWL_DEBUG_POWER("Getting cooler, delta %d,\n", temp_diff); 1430 IWL_DEBUG_POWER(priv, "Getting cooler, delta %d,\n", temp_diff);
1432 temp_diff = -temp_diff; 1431 temp_diff = -temp_diff;
1433 } else if (temp_diff == 0) 1432 } else if (temp_diff == 0)
1434 IWL_DEBUG_POWER("Same temp,\n"); 1433 IWL_DEBUG_POWER(priv, "Same temp,\n");
1435 else 1434 else
1436 IWL_DEBUG_POWER("Getting warmer, delta %d,\n", temp_diff); 1435 IWL_DEBUG_POWER(priv, "Getting warmer, delta %d,\n", temp_diff);
1437 1436
1438 /* if we don't need calibration, *don't* update last_temperature */ 1437 /* if we don't need calibration, *don't* update last_temperature */
1439 if (temp_diff < IWL_TEMPERATURE_LIMIT_TIMER) { 1438 if (temp_diff < IWL_TEMPERATURE_LIMIT_TIMER) {
1440 IWL_DEBUG_POWER("Timed thermal calib not needed\n"); 1439 IWL_DEBUG_POWER(priv, "Timed thermal calib not needed\n");
1441 return 0; 1440 return 0;
1442 } 1441 }
1443 1442
1444 IWL_DEBUG_POWER("Timed thermal calib needed\n"); 1443 IWL_DEBUG_POWER(priv, "Timed thermal calib needed\n");
1445 1444
1446 /* assume that caller will actually do calib ... 1445 /* assume that caller will actually do calib ...
1447 * update the "last temperature" value */ 1446 * update the "last temperature" value */
@@ -1710,7 +1709,7 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
1710 } 1709 }
1711 1710
1712 if (!is_channel_valid(ch_info)) { 1711 if (!is_channel_valid(ch_info)) {
1713 IWL_DEBUG_POWER("Not calling TX_PWR_TABLE_CMD on " 1712 IWL_DEBUG_POWER(priv, "Not calling TX_PWR_TABLE_CMD on "
1714 "non-Tx channel.\n"); 1713 "non-Tx channel.\n");
1715 return 0; 1714 return 0;
1716 } 1715 }
@@ -1723,7 +1722,7 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
1723 txpower.power[i].tpc = ch_info->power_info[i].tpc; 1722 txpower.power[i].tpc = ch_info->power_info[i].tpc;
1724 txpower.power[i].rate = iwl3945_rates[rate_idx].plcp; 1723 txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;
1725 1724
1726 IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n", 1725 IWL_DEBUG_POWER(priv, "ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
1727 le16_to_cpu(txpower.channel), 1726 le16_to_cpu(txpower.channel),
1728 txpower.band, 1727 txpower.band,
1729 txpower.power[i].tpc.tx_gain, 1728 txpower.power[i].tpc.tx_gain,
@@ -1736,7 +1735,7 @@ static int iwl3945_send_tx_power(struct iwl_priv *priv)
1736 txpower.power[i].tpc = ch_info->power_info[i].tpc; 1735 txpower.power[i].tpc = ch_info->power_info[i].tpc;
1737 txpower.power[i].rate = iwl3945_rates[rate_idx].plcp; 1736 txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;
1738 1737
1739 IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n", 1738 IWL_DEBUG_POWER(priv, "ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
1740 le16_to_cpu(txpower.channel), 1739 le16_to_cpu(txpower.channel),
1741 txpower.band, 1740 txpower.band,
1742 txpower.power[i].tpc.tx_gain, 1741 txpower.power[i].tpc.tx_gain,
@@ -1927,12 +1926,12 @@ int iwl3945_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
1927 u8 i; 1926 u8 i;
1928 1927
1929 if (priv->tx_power_user_lmt == power) { 1928 if (priv->tx_power_user_lmt == power) {
1930 IWL_DEBUG_POWER("Requested Tx power same as current " 1929 IWL_DEBUG_POWER(priv, "Requested Tx power same as current "
1931 "limit: %ddBm.\n", power); 1930 "limit: %ddBm.\n", power);
1932 return 0; 1931 return 0;
1933 } 1932 }
1934 1933
1935 IWL_DEBUG_POWER("Setting upper limit clamp to %ddBm.\n", power); 1934 IWL_DEBUG_POWER(priv, "Setting upper limit clamp to %ddBm.\n", power);
1936 priv->tx_power_user_lmt = power; 1935 priv->tx_power_user_lmt = power;
1937 1936
1938 /* set up new Tx powers for each and every channel, 2.4 and 5.x */ 1937 /* set up new Tx powers for each and every channel, 2.4 and 5.x */
@@ -2042,7 +2041,7 @@ static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl_priv *priv,
2042 } else 2041 } else
2043 group_index = 0; /* 2.4 GHz, group 0 */ 2042 group_index = 0; /* 2.4 GHz, group 0 */
2044 2043
2045 IWL_DEBUG_POWER("Chnl %d mapped to grp %d\n", ch_info->channel, 2044 IWL_DEBUG_POWER(priv, "Chnl %d mapped to grp %d\n", ch_info->channel,
2046 group_index); 2045 group_index);
2047 return group_index; 2046 return group_index;
2048} 2047}
@@ -2109,7 +2108,7 @@ static void iwl3945_hw_reg_init_channel_groups(struct iwl_priv *priv)
2109 struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom; 2108 struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom;
2110 const struct iwl3945_eeprom_txpower_group *group; 2109 const struct iwl3945_eeprom_txpower_group *group;
2111 2110
2112 IWL_DEBUG_POWER("Initializing factory calib info from EEPROM\n"); 2111 IWL_DEBUG_POWER(priv, "Initializing factory calib info from EEPROM\n");
2113 2112
2114 for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) { 2113 for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) {
2115 s8 *clip_pwrs; /* table of power levels for each rate */ 2114 s8 *clip_pwrs; /* table of power levels for each rate */
@@ -2225,7 +2224,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
2225 eeprom->groups[ch_info->group_index]. 2224 eeprom->groups[ch_info->group_index].
2226 temperature); 2225 temperature);
2227 2226
2228 IWL_DEBUG_POWER("Delta index for channel %d: %d [%d]\n", 2227 IWL_DEBUG_POWER(priv, "Delta index for channel %d: %d [%d]\n",
2229 ch_info->channel, delta_index, temperature + 2228 ch_info->channel, delta_index, temperature +
2230 IWL_TEMP_CONVERT); 2229 IWL_TEMP_CONVERT);
2231 2230
@@ -2410,7 +2409,7 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
2410 2409
2411 switch (priv->band) { 2410 switch (priv->band) {
2412 case IEEE80211_BAND_5GHZ: 2411 case IEEE80211_BAND_5GHZ:
2413 IWL_DEBUG_RATE("Select A mode rate scale\n"); 2412 IWL_DEBUG_RATE(priv, "Select A mode rate scale\n");
2414 /* If one of the following CCK rates is used, 2413 /* If one of the following CCK rates is used,
2415 * have it fall back to the 6M OFDM rate */ 2414 * have it fall back to the 6M OFDM rate */
2416 for (i = IWL_RATE_1M_INDEX_TABLE; 2415 for (i = IWL_RATE_1M_INDEX_TABLE;
@@ -2428,7 +2427,7 @@ int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
2428 break; 2427 break;
2429 2428
2430 case IEEE80211_BAND_2GHZ: 2429 case IEEE80211_BAND_2GHZ:
2431 IWL_DEBUG_RATE("Select B/G mode rate scale\n"); 2430 IWL_DEBUG_RATE(priv, "Select B/G mode rate scale\n");
2432 /* If an OFDM rate is used, have it fall back to the 2431 /* If an OFDM rate is used, have it fall back to the
2433 * 1M CCK rates */ 2432 * 1M CCK rates */
2434 2433
@@ -2553,7 +2552,7 @@ static int iwl3945_verify_bsm(struct iwl_priv *priv)
2553 u32 reg; 2552 u32 reg;
2554 u32 val; 2553 u32 val;
2555 2554
2556 IWL_DEBUG_INFO("Begin verify bsm\n"); 2555 IWL_DEBUG_INFO(priv, "Begin verify bsm\n");
2557 2556
2558 /* verify BSM SRAM contents */ 2557 /* verify BSM SRAM contents */
2559 val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG); 2558 val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG);
@@ -2571,7 +2570,7 @@ static int iwl3945_verify_bsm(struct iwl_priv *priv)
2571 } 2570 }
2572 } 2571 }
2573 2572
2574 IWL_DEBUG_INFO("BSM bootstrap uCode image OK\n"); 2573 IWL_DEBUG_INFO(priv, "BSM bootstrap uCode image OK\n");
2575 2574
2576 return 0; 2575 return 0;
2577} 2576}
@@ -2648,7 +2647,7 @@ static int iwl3945_load_bsm(struct iwl_priv *priv)
2648 u32 done; 2647 u32 done;
2649 u32 reg_offset; 2648 u32 reg_offset;
2650 2649
2651 IWL_DEBUG_INFO("Begin load bsm\n"); 2650 IWL_DEBUG_INFO(priv, "Begin load bsm\n");
2652 2651
2653 /* make sure bootstrap program is no larger than BSM's SRAM size */ 2652 /* make sure bootstrap program is no larger than BSM's SRAM size */
2654 if (len > IWL39_MAX_BSM_SIZE) 2653 if (len > IWL39_MAX_BSM_SIZE)
@@ -2705,7 +2704,7 @@ static int iwl3945_load_bsm(struct iwl_priv *priv)
2705 udelay(10); 2704 udelay(10);
2706 } 2705 }
2707 if (i < 100) 2706 if (i < 100)
2708 IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i); 2707 IWL_DEBUG_INFO(priv, "BSM write complete, poll %d iterations\n", i);
2709 else { 2708 else {
2710 IWL_ERR(priv, "BSM write did not complete!\n"); 2709 IWL_ERR(priv, "BSM write did not complete!\n");
2711 return -EIO; 2710 return -EIO;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index d7d956db19d1..7e9c8cfaa61a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -76,7 +76,7 @@ static int iwl4965_verify_bsm(struct iwl_priv *priv)
76 u32 reg; 76 u32 reg;
77 u32 val; 77 u32 val;
78 78
79 IWL_DEBUG_INFO("Begin verify bsm\n"); 79 IWL_DEBUG_INFO(priv, "Begin verify bsm\n");
80 80
81 /* verify BSM SRAM contents */ 81 /* verify BSM SRAM contents */
82 val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG); 82 val = iwl_read_prph(priv, BSM_WR_DWCOUNT_REG);
@@ -94,7 +94,7 @@ static int iwl4965_verify_bsm(struct iwl_priv *priv)
94 } 94 }
95 } 95 }
96 96
97 IWL_DEBUG_INFO("BSM bootstrap uCode image OK\n"); 97 IWL_DEBUG_INFO(priv, "BSM bootstrap uCode image OK\n");
98 98
99 return 0; 99 return 0;
100} 100}
@@ -144,7 +144,7 @@ static int iwl4965_load_bsm(struct iwl_priv *priv)
144 u32 reg_offset; 144 u32 reg_offset;
145 int ret; 145 int ret;
146 146
147 IWL_DEBUG_INFO("Begin load bsm\n"); 147 IWL_DEBUG_INFO(priv, "Begin load bsm\n");
148 148
149 priv->ucode_type = UCODE_RT; 149 priv->ucode_type = UCODE_RT;
150 150
@@ -201,7 +201,7 @@ static int iwl4965_load_bsm(struct iwl_priv *priv)
201 udelay(10); 201 udelay(10);
202 } 202 }
203 if (i < 100) 203 if (i < 100)
204 IWL_DEBUG_INFO("BSM write complete, poll %d iterations\n", i); 204 IWL_DEBUG_INFO(priv, "BSM write complete, poll %d iterations\n", i);
205 else { 205 else {
206 IWL_ERR(priv, "BSM write did not complete!\n"); 206 IWL_ERR(priv, "BSM write did not complete!\n");
207 return -EIO; 207 return -EIO;
@@ -257,7 +257,7 @@ static int iwl4965_set_ucode_ptrs(struct iwl_priv *priv)
257 257
258 spin_unlock_irqrestore(&priv->lock, flags); 258 spin_unlock_irqrestore(&priv->lock, flags);
259 259
260 IWL_DEBUG_INFO("Runtime uCode pointers are set.\n"); 260 IWL_DEBUG_INFO(priv, "Runtime uCode pointers are set.\n");
261 261
262 return ret; 262 return ret;
263} 263}
@@ -279,7 +279,7 @@ static void iwl4965_init_alive_start(struct iwl_priv *priv)
279 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { 279 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
280 /* We had an error bringing up the hardware, so take it 280 /* We had an error bringing up the hardware, so take it
281 * all the way back down so we can try again */ 281 * all the way back down so we can try again */
282 IWL_DEBUG_INFO("Initialize Alive failed.\n"); 282 IWL_DEBUG_INFO(priv, "Initialize Alive failed.\n");
283 goto restart; 283 goto restart;
284 } 284 }
285 285
@@ -289,7 +289,7 @@ static void iwl4965_init_alive_start(struct iwl_priv *priv)
289 if (iwl_verify_ucode(priv)) { 289 if (iwl_verify_ucode(priv)) {
290 /* Runtime instruction load was bad; 290 /* Runtime instruction load was bad;
291 * take it all the way back down so we can try again */ 291 * take it all the way back down so we can try again */
292 IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n"); 292 IWL_DEBUG_INFO(priv, "Bad \"initialize\" uCode load.\n");
293 goto restart; 293 goto restart;
294 } 294 }
295 295
@@ -299,11 +299,11 @@ static void iwl4965_init_alive_start(struct iwl_priv *priv)
299 /* Send pointers to protocol/runtime uCode image ... init code will 299 /* Send pointers to protocol/runtime uCode image ... init code will
300 * load and launch runtime uCode, which will send us another "Alive" 300 * load and launch runtime uCode, which will send us another "Alive"
301 * notification. */ 301 * notification. */
302 IWL_DEBUG_INFO("Initialization Alive received.\n"); 302 IWL_DEBUG_INFO(priv, "Initialization Alive received.\n");
303 if (iwl4965_set_ucode_ptrs(priv)) { 303 if (iwl4965_set_ucode_ptrs(priv)) {
304 /* Runtime instruction load won't happen; 304 /* Runtime instruction load won't happen;
305 * take it all the way back down so we can try again */ 305 * take it all the way back down so we can try again */
306 IWL_DEBUG_INFO("Couldn't set up uCode pointers.\n"); 306 IWL_DEBUG_INFO(priv, "Couldn't set up uCode pointers.\n");
307 goto restart; 307 goto restart;
308 } 308 }
309 return; 309 return;
@@ -354,7 +354,7 @@ static int iwl4965_apm_init(struct iwl_priv *priv)
354 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 354 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
355 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 355 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
356 if (ret < 0) { 356 if (ret < 0) {
357 IWL_DEBUG_INFO("Failed to init the card\n"); 357 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
358 goto out; 358 goto out;
359 } 359 }
360 360
@@ -437,7 +437,7 @@ static int iwl4965_apm_stop_master(struct iwl_priv *priv)
437 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); 437 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
438 438
439 spin_unlock_irqrestore(&priv->lock, flags); 439 spin_unlock_irqrestore(&priv->lock, flags);
440 IWL_DEBUG_INFO("stop master\n"); 440 IWL_DEBUG_INFO(priv, "stop master\n");
441 441
442 return 0; 442 return 0;
443} 443}
@@ -526,7 +526,7 @@ static void iwl4965_chain_noise_reset(struct iwl_priv *priv)
526 IWL_ERR(priv, 526 IWL_ERR(priv,
527 "Could not send REPLY_PHY_CALIBRATION_CMD\n"); 527 "Could not send REPLY_PHY_CALIBRATION_CMD\n");
528 data->state = IWL_CHAIN_NOISE_ACCUMULATE; 528 data->state = IWL_CHAIN_NOISE_ACCUMULATE;
529 IWL_DEBUG_CALIB("Run chain_noise_calibrate\n"); 529 IWL_DEBUG_CALIB(priv, "Run chain_noise_calibrate\n");
530 } 530 }
531} 531}
532 532
@@ -558,7 +558,7 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,
558 data->delta_gain_code[i] = 0; 558 data->delta_gain_code[i] = 0;
559 } 559 }
560 } 560 }
561 IWL_DEBUG_CALIB("delta_gain_codes: a %d b %d c %d\n", 561 IWL_DEBUG_CALIB(priv, "delta_gain_codes: a %d b %d c %d\n",
562 data->delta_gain_code[0], 562 data->delta_gain_code[0],
563 data->delta_gain_code[1], 563 data->delta_gain_code[1],
564 data->delta_gain_code[2]); 564 data->delta_gain_code[2]);
@@ -576,7 +576,7 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,
576 ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD, 576 ret = iwl_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
577 sizeof(cmd), &cmd); 577 sizeof(cmd), &cmd);
578 if (ret) 578 if (ret)
579 IWL_DEBUG_CALIB("fail sending cmd " 579 IWL_DEBUG_CALIB(priv, "fail sending cmd "
580 "REPLY_PHY_CALIBRATION_CMD \n"); 580 "REPLY_PHY_CALIBRATION_CMD \n");
581 581
582 /* TODO we might want recalculate 582 /* TODO we might want recalculate
@@ -669,7 +669,7 @@ static void iwl4965_tx_queue_set_status(struct iwl_priv *priv,
669 669
670 txq->sched_retry = scd_retry; 670 txq->sched_retry = scd_retry;
671 671
672 IWL_DEBUG_INFO("%s %s Queue %d on AC %d\n", 672 IWL_DEBUG_INFO(priv, "%s %s Queue %d on AC %d\n",
673 active ? "Activate" : "Deactivate", 673 active ? "Activate" : "Deactivate",
674 scd_retry ? "BA" : "AC", txq_id, tx_fifo_id); 674 scd_retry ? "BA" : "AC", txq_id, tx_fifo_id);
675} 675}
@@ -968,7 +968,7 @@ static int iwl4965_interpolate_chan(struct iwl_priv *priv, u32 channel,
968 ch_i2 = priv->calib_info->band_info[s].ch2.ch_num; 968 ch_i2 = priv->calib_info->band_info[s].ch2.ch_num;
969 chan_info->ch_num = (u8) channel; 969 chan_info->ch_num = (u8) channel;
970 970
971 IWL_DEBUG_TXPOWER("channel %d subband %d factory cal ch %d & %d\n", 971 IWL_DEBUG_TXPOWER(priv, "channel %d subband %d factory cal ch %d & %d\n",
972 channel, s, ch_i1, ch_i2); 972 channel, s, ch_i1, ch_i2);
973 973
974 for (c = 0; c < EEPROM_TX_POWER_TX_CHAINS; c++) { 974 for (c = 0; c < EEPROM_TX_POWER_TX_CHAINS; c++) {
@@ -998,19 +998,19 @@ static int iwl4965_interpolate_chan(struct iwl_priv *priv, u32 channel,
998 m1->pa_det, ch_i2, 998 m1->pa_det, ch_i2,
999 m2->pa_det); 999 m2->pa_det);
1000 1000
1001 IWL_DEBUG_TXPOWER 1001 IWL_DEBUG_TXPOWER(priv,
1002 ("chain %d meas %d AP1=%d AP2=%d AP=%d\n", c, m, 1002 "chain %d meas %d AP1=%d AP2=%d AP=%d\n", c, m,
1003 m1->actual_pow, m2->actual_pow, omeas->actual_pow); 1003 m1->actual_pow, m2->actual_pow, omeas->actual_pow);
1004 IWL_DEBUG_TXPOWER 1004 IWL_DEBUG_TXPOWER(priv,
1005 ("chain %d meas %d NI1=%d NI2=%d NI=%d\n", c, m, 1005 "chain %d meas %d NI1=%d NI2=%d NI=%d\n", c, m,
1006 m1->gain_idx, m2->gain_idx, omeas->gain_idx); 1006 m1->gain_idx, m2->gain_idx, omeas->gain_idx);
1007 IWL_DEBUG_TXPOWER 1007 IWL_DEBUG_TXPOWER(priv,
1008 ("chain %d meas %d PA1=%d PA2=%d PA=%d\n", c, m, 1008 "chain %d meas %d PA1=%d PA2=%d PA=%d\n", c, m,
1009 m1->pa_det, m2->pa_det, omeas->pa_det); 1009 m1->pa_det, m2->pa_det, omeas->pa_det);
1010 IWL_DEBUG_TXPOWER 1010 IWL_DEBUG_TXPOWER(priv,
1011 ("chain %d meas %d T1=%d T2=%d T=%d\n", c, m, 1011 "chain %d meas %d T1=%d T2=%d T=%d\n", c, m,
1012 m1->temperature, m2->temperature, 1012 m1->temperature, m2->temperature,
1013 omeas->temperature); 1013 omeas->temperature);
1014 } 1014 }
1015 } 1015 }
1016 1016
@@ -1312,7 +1312,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1312 user_target_power = 2 * priv->tx_power_user_lmt; 1312 user_target_power = 2 * priv->tx_power_user_lmt;
1313 1313
1314 /* Get current (RXON) channel, band, width */ 1314 /* Get current (RXON) channel, band, width */
1315 IWL_DEBUG_TXPOWER("chan %d band %d is_fat %d\n", channel, band, 1315 IWL_DEBUG_TXPOWER(priv, "chan %d band %d is_fat %d\n", channel, band,
1316 is_fat); 1316 is_fat);
1317 1317
1318 ch_info = iwl_get_channel_info(priv, priv->band, channel); 1318 ch_info = iwl_get_channel_info(priv, priv->band, channel);
@@ -1329,7 +1329,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1329 return -EINVAL; 1329 return -EINVAL;
1330 } 1330 }
1331 1331
1332 IWL_DEBUG_TXPOWER("channel %d belongs to txatten group %d\n", 1332 IWL_DEBUG_TXPOWER(priv, "channel %d belongs to txatten group %d\n",
1333 channel, txatten_grp); 1333 channel, txatten_grp);
1334 1334
1335 if (is_fat) { 1335 if (is_fat) {
@@ -1379,7 +1379,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1379 voltage_compensation = 1379 voltage_compensation =
1380 iwl4965_get_voltage_compensation(voltage, init_voltage); 1380 iwl4965_get_voltage_compensation(voltage, init_voltage);
1381 1381
1382 IWL_DEBUG_TXPOWER("curr volt %d eeprom volt %d volt comp %d\n", 1382 IWL_DEBUG_TXPOWER(priv, "curr volt %d eeprom volt %d volt comp %d\n",
1383 init_voltage, 1383 init_voltage,
1384 voltage, voltage_compensation); 1384 voltage, voltage_compensation);
1385 1385
@@ -1410,13 +1410,13 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1410 factory_gain_index[c] = measurement->gain_idx; 1410 factory_gain_index[c] = measurement->gain_idx;
1411 factory_actual_pwr[c] = measurement->actual_pow; 1411 factory_actual_pwr[c] = measurement->actual_pow;
1412 1412
1413 IWL_DEBUG_TXPOWER("chain = %d\n", c); 1413 IWL_DEBUG_TXPOWER(priv, "chain = %d\n", c);
1414 IWL_DEBUG_TXPOWER("fctry tmp %d, " 1414 IWL_DEBUG_TXPOWER(priv, "fctry tmp %d, "
1415 "curr tmp %d, comp %d steps\n", 1415 "curr tmp %d, comp %d steps\n",
1416 factory_temp, current_temp, 1416 factory_temp, current_temp,
1417 temperature_comp[c]); 1417 temperature_comp[c]);
1418 1418
1419 IWL_DEBUG_TXPOWER("fctry idx %d, fctry pwr %d\n", 1419 IWL_DEBUG_TXPOWER(priv, "fctry idx %d, fctry pwr %d\n",
1420 factory_gain_index[c], 1420 factory_gain_index[c],
1421 factory_actual_pwr[c]); 1421 factory_actual_pwr[c]);
1422 } 1422 }
@@ -1449,7 +1449,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1449 if (target_power > power_limit) 1449 if (target_power > power_limit)
1450 target_power = power_limit; 1450 target_power = power_limit;
1451 1451
1452 IWL_DEBUG_TXPOWER("rate %d sat %d reg %d usr %d tgt %d\n", 1452 IWL_DEBUG_TXPOWER(priv, "rate %d sat %d reg %d usr %d tgt %d\n",
1453 i, saturation_power - back_off_table[i], 1453 i, saturation_power - back_off_table[i],
1454 current_regulatory, user_target_power, 1454 current_regulatory, user_target_power,
1455 target_power); 1455 target_power);
@@ -1473,7 +1473,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1473 voltage_compensation + 1473 voltage_compensation +
1474 atten_value); 1474 atten_value);
1475 1475
1476/* IWL_DEBUG_TXPOWER("calculated txpower index %d\n", 1476/* IWL_DEBUG_TXPOWER(priv, "calculated txpower index %d\n",
1477 power_index); */ 1477 power_index); */
1478 1478
1479 if (power_index < get_min_power_index(i, band)) 1479 if (power_index < get_min_power_index(i, band))
@@ -1506,7 +1506,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
1506 tx_power.s.dsp_predis_atten[c] = 1506 tx_power.s.dsp_predis_atten[c] =
1507 gain_table[band][power_index].dsp; 1507 gain_table[band][power_index].dsp;
1508 1508
1509 IWL_DEBUG_TXPOWER("chain %d mimo %d index %d " 1509 IWL_DEBUG_TXPOWER(priv, "chain %d mimo %d index %d "
1510 "gain 0x%02x dsp %d\n", 1510 "gain 0x%02x dsp %d\n",
1511 c, atten_value, power_index, 1511 c, atten_value, power_index,
1512 tx_power.s.radio_tx_gain[c], 1512 tx_power.s.radio_tx_gain[c],
@@ -1581,7 +1581,7 @@ static int iwl4965_send_rxon_assoc(struct iwl_priv *priv)
1581 rxon2->ofdm_ht_dual_stream_basic_rates) && 1581 rxon2->ofdm_ht_dual_stream_basic_rates) &&
1582 (rxon1->rx_chain == rxon2->rx_chain) && 1582 (rxon1->rx_chain == rxon2->rx_chain) &&
1583 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { 1583 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
1584 IWL_DEBUG_INFO("Using current RXON_ASSOC. Not resending.\n"); 1584 IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n");
1585 return 0; 1585 return 0;
1586 } 1586 }
1587 1587
@@ -1638,7 +1638,7 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
1638 rc = iwl4965_fill_txpower_tbl(priv, band, channel, is_fat, 1638 rc = iwl4965_fill_txpower_tbl(priv, band, channel, is_fat,
1639 ctrl_chan_high, &cmd.tx_power); 1639 ctrl_chan_high, &cmd.tx_power);
1640 if (rc) { 1640 if (rc) {
1641 IWL_DEBUG_11H("error:%d fill txpower_tbl\n", rc); 1641 IWL_DEBUG_11H(priv, "error:%d fill txpower_tbl\n", rc);
1642 return rc; 1642 return rc;
1643 } 1643 }
1644 1644
@@ -1703,13 +1703,13 @@ static int iwl4965_hw_get_temperature(const struct iwl_priv *priv)
1703 1703
1704 if (test_bit(STATUS_TEMPERATURE, &priv->status) && 1704 if (test_bit(STATUS_TEMPERATURE, &priv->status) &&
1705 (priv->statistics.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)) { 1705 (priv->statistics.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)) {
1706 IWL_DEBUG_TEMP("Running FAT temperature calibration\n"); 1706 IWL_DEBUG_TEMP(priv, "Running FAT temperature calibration\n");
1707 R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[1]); 1707 R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[1]);
1708 R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[1]); 1708 R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[1]);
1709 R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[1]); 1709 R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[1]);
1710 R4 = le32_to_cpu(priv->card_alive_init.therm_r4[1]); 1710 R4 = le32_to_cpu(priv->card_alive_init.therm_r4[1]);
1711 } else { 1711 } else {
1712 IWL_DEBUG_TEMP("Running temperature calibration\n"); 1712 IWL_DEBUG_TEMP(priv, "Running temperature calibration\n");
1713 R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[0]); 1713 R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[0]);
1714 R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[0]); 1714 R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[0]);
1715 R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[0]); 1715 R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[0]);
@@ -1729,7 +1729,7 @@ static int iwl4965_hw_get_temperature(const struct iwl_priv *priv)
1729 vt = sign_extend( 1729 vt = sign_extend(
1730 le32_to_cpu(priv->statistics.general.temperature), 23); 1730 le32_to_cpu(priv->statistics.general.temperature), 23);
1731 1731
1732 IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt); 1732 IWL_DEBUG_TEMP(priv, "Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt);
1733 1733
1734 if (R3 == R1) { 1734 if (R3 == R1) {
1735 IWL_ERR(priv, "Calibration conflict R1 == R3\n"); 1735 IWL_ERR(priv, "Calibration conflict R1 == R3\n");
@@ -1742,7 +1742,7 @@ static int iwl4965_hw_get_temperature(const struct iwl_priv *priv)
1742 temperature /= (R3 - R1); 1742 temperature /= (R3 - R1);
1743 temperature = (temperature * 97) / 100 + TEMPERATURE_CALIB_KELVIN_OFFSET; 1743 temperature = (temperature * 97) / 100 + TEMPERATURE_CALIB_KELVIN_OFFSET;
1744 1744
1745 IWL_DEBUG_TEMP("Calibrated temperature: %dK, %dC\n", 1745 IWL_DEBUG_TEMP(priv, "Calibrated temperature: %dK, %dC\n",
1746 temperature, KELVIN_TO_CELSIUS(temperature)); 1746 temperature, KELVIN_TO_CELSIUS(temperature));
1747 1747
1748 return temperature; 1748 return temperature;
@@ -1765,7 +1765,7 @@ static int iwl4965_is_temp_calib_needed(struct iwl_priv *priv)
1765 int temp_diff; 1765 int temp_diff;
1766 1766
1767 if (!test_bit(STATUS_STATISTICS, &priv->status)) { 1767 if (!test_bit(STATUS_STATISTICS, &priv->status)) {
1768 IWL_DEBUG_TEMP("Temperature not updated -- no statistics.\n"); 1768 IWL_DEBUG_TEMP(priv, "Temperature not updated -- no statistics.\n");
1769 return 0; 1769 return 0;
1770 } 1770 }
1771 1771
@@ -1773,19 +1773,19 @@ static int iwl4965_is_temp_calib_needed(struct iwl_priv *priv)
1773 1773
1774 /* get absolute value */ 1774 /* get absolute value */
1775 if (temp_diff < 0) { 1775 if (temp_diff < 0) {
1776 IWL_DEBUG_POWER("Getting cooler, delta %d, \n", temp_diff); 1776 IWL_DEBUG_POWER(priv, "Getting cooler, delta %d, \n", temp_diff);
1777 temp_diff = -temp_diff; 1777 temp_diff = -temp_diff;
1778 } else if (temp_diff == 0) 1778 } else if (temp_diff == 0)
1779 IWL_DEBUG_POWER("Same temp, \n"); 1779 IWL_DEBUG_POWER(priv, "Same temp, \n");
1780 else 1780 else
1781 IWL_DEBUG_POWER("Getting warmer, delta %d, \n", temp_diff); 1781 IWL_DEBUG_POWER(priv, "Getting warmer, delta %d, \n", temp_diff);
1782 1782
1783 if (temp_diff < IWL_TEMPERATURE_THRESHOLD) { 1783 if (temp_diff < IWL_TEMPERATURE_THRESHOLD) {
1784 IWL_DEBUG_POWER("Thermal txpower calib not needed\n"); 1784 IWL_DEBUG_POWER(priv, "Thermal txpower calib not needed\n");
1785 return 0; 1785 return 0;
1786 } 1786 }
1787 1787
1788 IWL_DEBUG_POWER("Thermal txpower calib needed\n"); 1788 IWL_DEBUG_POWER(priv, "Thermal txpower calib needed\n");
1789 1789
1790 return 1; 1790 return 1;
1791} 1791}
@@ -1800,12 +1800,12 @@ static void iwl4965_temperature_calib(struct iwl_priv *priv)
1800 1800
1801 if (priv->temperature != temp) { 1801 if (priv->temperature != temp) {
1802 if (priv->temperature) 1802 if (priv->temperature)
1803 IWL_DEBUG_TEMP("Temperature changed " 1803 IWL_DEBUG_TEMP(priv, "Temperature changed "
1804 "from %dC to %dC\n", 1804 "from %dC to %dC\n",
1805 KELVIN_TO_CELSIUS(priv->temperature), 1805 KELVIN_TO_CELSIUS(priv->temperature),
1806 KELVIN_TO_CELSIUS(temp)); 1806 KELVIN_TO_CELSIUS(temp));
1807 else 1807 else
1808 IWL_DEBUG_TEMP("Temperature " 1808 IWL_DEBUG_TEMP(priv, "Temperature "
1809 "initialized to %dC\n", 1809 "initialized to %dC\n",
1810 KELVIN_TO_CELSIUS(temp)); 1810 KELVIN_TO_CELSIUS(temp));
1811 } 1811 }
@@ -2022,7 +2022,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2022 int i, sh, idx; 2022 int i, sh, idx;
2023 u16 seq; 2023 u16 seq;
2024 if (agg->wait_for_ba) 2024 if (agg->wait_for_ba)
2025 IWL_DEBUG_TX_REPLY("got tx response w/o block-ack\n"); 2025 IWL_DEBUG_TX_REPLY(priv, "got tx response w/o block-ack\n");
2026 2026
2027 agg->frame_count = tx_resp->frame_count; 2027 agg->frame_count = tx_resp->frame_count;
2028 agg->start_idx = start_idx; 2028 agg->start_idx = start_idx;
@@ -2036,7 +2036,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2036 idx = start_idx; 2036 idx = start_idx;
2037 2037
2038 /* FIXME: code repetition */ 2038 /* FIXME: code repetition */
2039 IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", 2039 IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n",
2040 agg->frame_count, agg->start_idx, idx); 2040 agg->frame_count, agg->start_idx, idx);
2041 2041
2042 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]); 2042 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
@@ -2047,9 +2047,9 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2047 iwl_hwrate_to_tx_control(priv, rate_n_flags, info); 2047 iwl_hwrate_to_tx_control(priv, rate_n_flags, info);
2048 /* FIXME: code repetition end */ 2048 /* FIXME: code repetition end */
2049 2049
2050 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", 2050 IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n",
2051 status & 0xff, tx_resp->failure_frame); 2051 status & 0xff, tx_resp->failure_frame);
2052 IWL_DEBUG_TX_REPLY("Rate Info rate_n_flags=%x\n", rate_n_flags); 2052 IWL_DEBUG_TX_REPLY(priv, "Rate Info rate_n_flags=%x\n", rate_n_flags);
2053 2053
2054 agg->wait_for_ba = 0; 2054 agg->wait_for_ba = 0;
2055 } else { 2055 } else {
@@ -2069,7 +2069,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2069 AGG_TX_STATE_ABORT_MSK)) 2069 AGG_TX_STATE_ABORT_MSK))
2070 continue; 2070 continue;
2071 2071
2072 IWL_DEBUG_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n", 2072 IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, txq_id=%d idx=%d\n",
2073 agg->frame_count, txq_id, idx); 2073 agg->frame_count, txq_id, idx);
2074 2074
2075 hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx); 2075 hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx);
@@ -2083,7 +2083,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2083 return -1; 2083 return -1;
2084 } 2084 }
2085 2085
2086 IWL_DEBUG_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n", 2086 IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n",
2087 i, idx, SEQ_TO_SN(sc)); 2087 i, idx, SEQ_TO_SN(sc));
2088 2088
2089 sh = idx - start; 2089 sh = idx - start;
@@ -2101,13 +2101,13 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
2101 sh = 0; 2101 sh = 0;
2102 } 2102 }
2103 bitmap |= 1ULL << sh; 2103 bitmap |= 1ULL << sh;
2104 IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n", 2104 IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n",
2105 start, (unsigned long long)bitmap); 2105 start, (unsigned long long)bitmap);
2106 } 2106 }
2107 2107
2108 agg->bitmap = bitmap; 2108 agg->bitmap = bitmap;
2109 agg->start_idx = start; 2109 agg->start_idx = start;
2110 IWL_DEBUG_TX_REPLY("Frames %d start_idx=%d bitmap=0x%llx\n", 2110 IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n",
2111 agg->frame_count, agg->start_idx, 2111 agg->frame_count, agg->start_idx,
2112 (unsigned long long)agg->bitmap); 2112 (unsigned long long)agg->bitmap);
2113 2113
@@ -2176,7 +2176,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2176 2176
2177 if (txq->q.read_ptr != (scd_ssn & 0xff)) { 2177 if (txq->q.read_ptr != (scd_ssn & 0xff)) {
2178 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); 2178 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
2179 IWL_DEBUG_TX_REPLY("Retry scheduler reclaim scd_ssn " 2179 IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn "
2180 "%d index %d\n", scd_ssn , index); 2180 "%d index %d\n", scd_ssn , index);
2181 freed = iwl_tx_queue_reclaim(priv, txq_id, index); 2181 freed = iwl_tx_queue_reclaim(priv, txq_id, index);
2182 priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; 2182 priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
@@ -2199,7 +2199,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2199 le32_to_cpu(tx_resp->rate_n_flags), 2199 le32_to_cpu(tx_resp->rate_n_flags),
2200 info); 2200 info);
2201 2201
2202 IWL_DEBUG_TX_REPLY("TXQ %d status %s (0x%08x) " 2202 IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) "
2203 "rate_n_flags 0x%x retries %d\n", 2203 "rate_n_flags 0x%x retries %d\n",
2204 txq_id, 2204 txq_id,
2205 iwl_get_tx_fail_reason(status), status, 2205 iwl_get_tx_fail_reason(status), status,
@@ -2247,7 +2247,7 @@ static int iwl4965_calc_rssi(struct iwl_priv *priv,
2247 if (valid_antennae & (1 << i)) 2247 if (valid_antennae & (1 << i))
2248 max_rssi = max(ncphy->rssi_info[i << 1], max_rssi); 2248 max_rssi = max(ncphy->rssi_info[i << 1], max_rssi);
2249 2249
2250 IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n", 2250 IWL_DEBUG_STATS(priv, "Rssi In A %d B %d C %d Max %d AGC dB %d\n",
2251 ncphy->rssi_info[0], ncphy->rssi_info[2], ncphy->rssi_info[4], 2251 ncphy->rssi_info[0], ncphy->rssi_info[2], ncphy->rssi_info[4],
2252 max_rssi, agc); 2252 max_rssi, agc);
2253 2253
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 89d92a8ca157..c5e9a66e2f88 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -84,7 +84,7 @@ static int iwl5000_apm_stop_master(struct iwl_priv *priv)
84 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); 84 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
85 85
86 spin_unlock_irqrestore(&priv->lock, flags); 86 spin_unlock_irqrestore(&priv->lock, flags);
87 IWL_DEBUG_INFO("stop master\n"); 87 IWL_DEBUG_INFO(priv, "stop master\n");
88 88
89 return 0; 89 return 0;
90} 90}
@@ -118,7 +118,7 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
118 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 118 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
119 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 119 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
120 if (ret < 0) { 120 if (ret < 0) {
121 IWL_DEBUG_INFO("Failed to init the card\n"); 121 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
122 return ret; 122 return ret;
123 } 123 }
124 124
@@ -186,7 +186,7 @@ static int iwl5000_apm_reset(struct iwl_priv *priv)
186 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 186 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL,
187 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 187 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
188 if (ret < 0) { 188 if (ret < 0) {
189 IWL_DEBUG_INFO("Failed to init the card\n"); 189 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
190 goto out; 190 goto out;
191 } 191 }
192 192
@@ -338,7 +338,7 @@ static void iwl5000_gain_computation(struct iwl_priv *priv,
338 data->delta_gain_code[i] |= (1 << 2); 338 data->delta_gain_code[i] |= (1 << 2);
339 } 339 }
340 340
341 IWL_DEBUG_CALIB("Delta gains: ANT_B = %d ANT_C = %d\n", 341 IWL_DEBUG_CALIB(priv, "Delta gains: ANT_B = %d ANT_C = %d\n",
342 data->delta_gain_code[1], data->delta_gain_code[2]); 342 data->delta_gain_code[1], data->delta_gain_code[2]);
343 343
344 if (!data->radio_write) { 344 if (!data->radio_write) {
@@ -387,7 +387,7 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv)
387 IWL_ERR(priv, 387 IWL_ERR(priv,
388 "Could not send REPLY_PHY_CALIBRATION_CMD\n"); 388 "Could not send REPLY_PHY_CALIBRATION_CMD\n");
389 data->state = IWL_CHAIN_NOISE_ACCUMULATE; 389 data->state = IWL_CHAIN_NOISE_ACCUMULATE;
390 IWL_DEBUG_CALIB("Run chain_noise_calibrate\n"); 390 IWL_DEBUG_CALIB(priv, "Run chain_noise_calibrate\n");
391 } 391 }
392} 392}
393 393
@@ -518,7 +518,7 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv,
518static void iwl5000_rx_calib_complete(struct iwl_priv *priv, 518static void iwl5000_rx_calib_complete(struct iwl_priv *priv,
519 struct iwl_rx_mem_buffer *rxb) 519 struct iwl_rx_mem_buffer *rxb)
520{ 520{
521 IWL_DEBUG_INFO("Init. calibration is completed, restarting fw.\n"); 521 IWL_DEBUG_INFO(priv, "Init. calibration is completed, restarting fw.\n");
522 queue_work(priv->workqueue, &priv->restart); 522 queue_work(priv->workqueue, &priv->restart);
523} 523}
524 524
@@ -586,7 +586,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
586 if (ret) 586 if (ret)
587 return ret; 587 return ret;
588 588
589 IWL_DEBUG_INFO("INST uCode section being loaded...\n"); 589 IWL_DEBUG_INFO(priv, "INST uCode section being loaded...\n");
590 ret = wait_event_interruptible_timeout(priv->wait_command_queue, 590 ret = wait_event_interruptible_timeout(priv->wait_command_queue,
591 priv->ucode_write_complete, 5 * HZ); 591 priv->ucode_write_complete, 5 * HZ);
592 if (ret == -ERESTARTSYS) { 592 if (ret == -ERESTARTSYS) {
@@ -606,7 +606,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
606 if (ret) 606 if (ret)
607 return ret; 607 return ret;
608 608
609 IWL_DEBUG_INFO("DATA uCode section being loaded...\n"); 609 IWL_DEBUG_INFO(priv, "DATA uCode section being loaded...\n");
610 610
611 ret = wait_event_interruptible_timeout(priv->wait_command_queue, 611 ret = wait_event_interruptible_timeout(priv->wait_command_queue,
612 priv->ucode_write_complete, 5 * HZ); 612 priv->ucode_write_complete, 5 * HZ);
@@ -631,20 +631,20 @@ static int iwl5000_load_ucode(struct iwl_priv *priv)
631 631
632 /* check whether init ucode should be loaded, or rather runtime ucode */ 632 /* check whether init ucode should be loaded, or rather runtime ucode */
633 if (priv->ucode_init.len && (priv->ucode_type == UCODE_NONE)) { 633 if (priv->ucode_init.len && (priv->ucode_type == UCODE_NONE)) {
634 IWL_DEBUG_INFO("Init ucode found. Loading init ucode...\n"); 634 IWL_DEBUG_INFO(priv, "Init ucode found. Loading init ucode...\n");
635 ret = iwl5000_load_given_ucode(priv, 635 ret = iwl5000_load_given_ucode(priv,
636 &priv->ucode_init, &priv->ucode_init_data); 636 &priv->ucode_init, &priv->ucode_init_data);
637 if (!ret) { 637 if (!ret) {
638 IWL_DEBUG_INFO("Init ucode load complete.\n"); 638 IWL_DEBUG_INFO(priv, "Init ucode load complete.\n");
639 priv->ucode_type = UCODE_INIT; 639 priv->ucode_type = UCODE_INIT;
640 } 640 }
641 } else { 641 } else {
642 IWL_DEBUG_INFO("Init ucode not found, or already loaded. " 642 IWL_DEBUG_INFO(priv, "Init ucode not found, or already loaded. "
643 "Loading runtime ucode...\n"); 643 "Loading runtime ucode...\n");
644 ret = iwl5000_load_given_ucode(priv, 644 ret = iwl5000_load_given_ucode(priv,
645 &priv->ucode_code, &priv->ucode_data); 645 &priv->ucode_code, &priv->ucode_data);
646 if (!ret) { 646 if (!ret) {
647 IWL_DEBUG_INFO("Runtime ucode load complete.\n"); 647 IWL_DEBUG_INFO(priv, "Runtime ucode load complete.\n");
648 priv->ucode_type = UCODE_RT; 648 priv->ucode_type = UCODE_RT;
649 } 649 }
650 } 650 }
@@ -660,7 +660,7 @@ static void iwl5000_init_alive_start(struct iwl_priv *priv)
660 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { 660 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
661 /* We had an error bringing up the hardware, so take it 661 /* We had an error bringing up the hardware, so take it
662 * all the way back down so we can try again */ 662 * all the way back down so we can try again */
663 IWL_DEBUG_INFO("Initialize Alive failed.\n"); 663 IWL_DEBUG_INFO(priv, "Initialize Alive failed.\n");
664 goto restart; 664 goto restart;
665 } 665 }
666 666
@@ -670,7 +670,7 @@ static void iwl5000_init_alive_start(struct iwl_priv *priv)
670 if (iwl_verify_ucode(priv)) { 670 if (iwl_verify_ucode(priv)) {
671 /* Runtime instruction load was bad; 671 /* Runtime instruction load was bad;
672 * take it all the way back down so we can try again */ 672 * take it all the way back down so we can try again */
673 IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n"); 673 IWL_DEBUG_INFO(priv, "Bad \"initialize\" uCode load.\n");
674 goto restart; 674 goto restart;
675 } 675 }
676 676
@@ -713,7 +713,7 @@ static void iwl5000_tx_queue_set_status(struct iwl_priv *priv,
713 713
714 txq->sched_retry = scd_retry; 714 txq->sched_retry = scd_retry;
715 715
716 IWL_DEBUG_INFO("%s %s Queue %d on AC %d\n", 716 IWL_DEBUG_INFO(priv, "%s %s Queue %d on AC %d\n",
717 active ? "Activate" : "Deactivate", 717 active ? "Activate" : "Deactivate",
718 scd_retry ? "BA" : "AC", txq_id, tx_fifo_id); 718 scd_retry ? "BA" : "AC", txq_id, tx_fifo_id);
719} 719}
@@ -1151,7 +1151,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1151 u16 seq; 1151 u16 seq;
1152 1152
1153 if (agg->wait_for_ba) 1153 if (agg->wait_for_ba)
1154 IWL_DEBUG_TX_REPLY("got tx response w/o block-ack\n"); 1154 IWL_DEBUG_TX_REPLY(priv, "got tx response w/o block-ack\n");
1155 1155
1156 agg->frame_count = tx_resp->frame_count; 1156 agg->frame_count = tx_resp->frame_count;
1157 agg->start_idx = start_idx; 1157 agg->start_idx = start_idx;
@@ -1165,7 +1165,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1165 idx = start_idx; 1165 idx = start_idx;
1166 1166
1167 /* FIXME: code repetition */ 1167 /* FIXME: code repetition */
1168 IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", 1168 IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n",
1169 agg->frame_count, agg->start_idx, idx); 1169 agg->frame_count, agg->start_idx, idx);
1170 1170
1171 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]); 1171 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
@@ -1177,9 +1177,9 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1177 1177
1178 /* FIXME: code repetition end */ 1178 /* FIXME: code repetition end */
1179 1179
1180 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", 1180 IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n",
1181 status & 0xff, tx_resp->failure_frame); 1181 status & 0xff, tx_resp->failure_frame);
1182 IWL_DEBUG_TX_REPLY("Rate Info rate_n_flags=%x\n", rate_n_flags); 1182 IWL_DEBUG_TX_REPLY(priv, "Rate Info rate_n_flags=%x\n", rate_n_flags);
1183 1183
1184 agg->wait_for_ba = 0; 1184 agg->wait_for_ba = 0;
1185 } else { 1185 } else {
@@ -1199,7 +1199,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1199 AGG_TX_STATE_ABORT_MSK)) 1199 AGG_TX_STATE_ABORT_MSK))
1200 continue; 1200 continue;
1201 1201
1202 IWL_DEBUG_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n", 1202 IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, txq_id=%d idx=%d\n",
1203 agg->frame_count, txq_id, idx); 1203 agg->frame_count, txq_id, idx);
1204 1204
1205 hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx); 1205 hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx);
@@ -1214,7 +1214,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1214 return -1; 1214 return -1;
1215 } 1215 }
1216 1216
1217 IWL_DEBUG_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n", 1217 IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n",
1218 i, idx, SEQ_TO_SN(sc)); 1218 i, idx, SEQ_TO_SN(sc));
1219 1219
1220 sh = idx - start; 1220 sh = idx - start;
@@ -1232,13 +1232,13 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
1232 sh = 0; 1232 sh = 0;
1233 } 1233 }
1234 bitmap |= 1ULL << sh; 1234 bitmap |= 1ULL << sh;
1235 IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n", 1235 IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n",
1236 start, (unsigned long long)bitmap); 1236 start, (unsigned long long)bitmap);
1237 } 1237 }
1238 1238
1239 agg->bitmap = bitmap; 1239 agg->bitmap = bitmap;
1240 agg->start_idx = start; 1240 agg->start_idx = start;
1241 IWL_DEBUG_TX_REPLY("Frames %d start_idx=%d bitmap=0x%llx\n", 1241 IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n",
1242 agg->frame_count, agg->start_idx, 1242 agg->frame_count, agg->start_idx,
1243 (unsigned long long)agg->bitmap); 1243 (unsigned long long)agg->bitmap);
1244 1244
@@ -1291,7 +1291,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
1291 1291
1292 if (txq->q.read_ptr != (scd_ssn & 0xff)) { 1292 if (txq->q.read_ptr != (scd_ssn & 0xff)) {
1293 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); 1293 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
1294 IWL_DEBUG_TX_REPLY("Retry scheduler reclaim " 1294 IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim "
1295 "scd_ssn=%d idx=%d txq=%d swq=%d\n", 1295 "scd_ssn=%d idx=%d txq=%d swq=%d\n",
1296 scd_ssn , index, txq_id, txq->swq_id); 1296 scd_ssn , index, txq_id, txq->swq_id);
1297 1297
@@ -1318,7 +1318,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
1318 le32_to_cpu(tx_resp->rate_n_flags), 1318 le32_to_cpu(tx_resp->rate_n_flags),
1319 info); 1319 info);
1320 1320
1321 IWL_DEBUG_TX_REPLY("TXQ %d status %s (0x%08x) rate_n_flags " 1321 IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags "
1322 "0x%x retries %d\n", 1322 "0x%x retries %d\n",
1323 txq_id, 1323 txq_id,
1324 iwl_get_tx_fail_reason(status), status, 1324 iwl_get_tx_fail_reason(status), status,
@@ -1389,7 +1389,7 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv)
1389 (rxon1->acquisition_data == rxon2->acquisition_data) && 1389 (rxon1->acquisition_data == rxon2->acquisition_data) &&
1390 (rxon1->rx_chain == rxon2->rx_chain) && 1390 (rxon1->rx_chain == rxon2->rx_chain) &&
1391 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { 1391 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
1392 IWL_DEBUG_INFO("Using current RXON_ASSOC. Not resending.\n"); 1392 IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n");
1393 return 0; 1393 return 0;
1394 } 1394 }
1395 1395
@@ -1465,7 +1465,7 @@ static int iwl5000_calc_rssi(struct iwl_priv *priv,
1465 max_rssi = max_t(u32, rssi_a, rssi_b); 1465 max_rssi = max_t(u32, rssi_a, rssi_b);
1466 max_rssi = max_t(u32, max_rssi, rssi_c); 1466 max_rssi = max_t(u32, max_rssi, rssi_c);
1467 1467
1468 IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n", 1468 IWL_DEBUG_STATS(priv, "Rssi In A %d B %d C %d Max %d AGC dB %d\n",
1469 rssi_a, rssi_b, rssi_c, max_rssi, agc); 1469 rssi_a, rssi_b, rssi_c, max_rssi, agc);
1470 1470
1471 /* dBm = max_rssi dB - agc dB - constant. 1471 /* dBm = max_rssi dB - agc dB - constant.
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 13039a024473..04b42c8a7705 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -360,7 +360,7 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
360 struct ieee80211_sta *sta) 360 struct ieee80211_sta *sta)
361{ 361{
362 if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) { 362 if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
363 IWL_DEBUG_HT("Starting Tx agg: STA: %pM tid: %d\n", 363 IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n",
364 sta->addr, tid); 364 sta->addr, tid);
365 ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid); 365 ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
366 } 366 }
@@ -693,7 +693,7 @@ static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask,
693 break; 693 break;
694 if (rate_mask & (1 << low)) 694 if (rate_mask & (1 << low))
695 break; 695 break;
696 IWL_DEBUG_RATE("Skipping masked lower rate: %d\n", low); 696 IWL_DEBUG_RATE(priv, "Skipping masked lower rate: %d\n", low);
697 } 697 }
698 698
699 high = index; 699 high = index;
@@ -703,7 +703,7 @@ static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask,
703 break; 703 break;
704 if (rate_mask & (1 << high)) 704 if (rate_mask & (1 << high))
705 break; 705 break;
706 IWL_DEBUG_RATE("Skipping masked higher rate: %d\n", high); 706 IWL_DEBUG_RATE(priv, "Skipping masked higher rate: %d\n", high);
707 } 707 }
708 708
709 return (high << 8) | low; 709 return (high << 8) | low;
@@ -790,7 +790,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
790 u8 active_index = 0; 790 u8 active_index = 0;
791 s32 tpt = 0; 791 s32 tpt = 0;
792 792
793 IWL_DEBUG_RATE_LIMIT("get frame ack response, update rate scale window\n"); 793 IWL_DEBUG_RATE_LIMIT(priv, "get frame ack response, update rate scale window\n");
794 794
795 if (!ieee80211_is_data(hdr->frame_control) || 795 if (!ieee80211_is_data(hdr->frame_control) ||
796 is_multicast_ether_addr(hdr->addr1)) 796 is_multicast_ether_addr(hdr->addr1))
@@ -840,7 +840,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
840 (!!(tx_rate & RATE_MCS_GF_MSK) != !!(info->status.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD)) || 840 (!!(tx_rate & RATE_MCS_GF_MSK) != !!(info->status.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD)) ||
841 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != 841 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate !=
842 hw->wiphy->bands[info->band]->bitrates[info->status.rates[0].idx].bitrate)) { 842 hw->wiphy->bands[info->band]->bitrates[info->status.rates[0].idx].bitrate)) {
843 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); 843 IWL_DEBUG_RATE(priv, "initial rate does not match 0x%x\n", tx_rate);
844 /* the last LQ command could failed so the LQ in ucode not 844 /* the last LQ command could failed so the LQ in ucode not
845 * the same in driver sync up 845 * the same in driver sync up
846 */ 846 */
@@ -971,7 +971,7 @@ out:
971static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy, 971static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy,
972 struct iwl_lq_sta *lq_sta) 972 struct iwl_lq_sta *lq_sta)
973{ 973{
974 IWL_DEBUG_RATE("we are staying in the same table\n"); 974 IWL_DEBUG_RATE(priv, "we are staying in the same table\n");
975 lq_sta->stay_in_tbl = 1; /* only place this gets set */ 975 lq_sta->stay_in_tbl = 1; /* only place this gets set */
976 if (is_legacy) { 976 if (is_legacy) {
977 lq_sta->table_count_limit = IWL_LEGACY_TABLE_COUNT; 977 lq_sta->table_count_limit = IWL_LEGACY_TABLE_COUNT;
@@ -1150,7 +1150,7 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
1150 if (priv->hw_params.tx_chains_num < 2) 1150 if (priv->hw_params.tx_chains_num < 2)
1151 return -1; 1151 return -1;
1152 1152
1153 IWL_DEBUG_RATE("LQ: try to switch to MIMO2\n"); 1153 IWL_DEBUG_RATE(priv, "LQ: try to switch to MIMO2\n");
1154 1154
1155 tbl->lq_type = LQ_MIMO2; 1155 tbl->lq_type = LQ_MIMO2;
1156 tbl->is_dup = lq_sta->is_dup; 1156 tbl->is_dup = lq_sta->is_dup;
@@ -1179,16 +1179,16 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
1179 1179
1180 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index); 1180 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index);
1181 1181
1182 IWL_DEBUG_RATE("LQ: MIMO2 best rate %d mask %X\n", rate, rate_mask); 1182 IWL_DEBUG_RATE(priv, "LQ: MIMO2 best rate %d mask %X\n", rate, rate_mask);
1183 1183
1184 if ((rate == IWL_RATE_INVALID) || !((1 << rate) & rate_mask)) { 1184 if ((rate == IWL_RATE_INVALID) || !((1 << rate) & rate_mask)) {
1185 IWL_DEBUG_RATE("Can't switch with index %d rate mask %x\n", 1185 IWL_DEBUG_RATE(priv, "Can't switch with index %d rate mask %x\n",
1186 rate, rate_mask); 1186 rate, rate_mask);
1187 return -1; 1187 return -1;
1188 } 1188 }
1189 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green); 1189 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1190 1190
1191 IWL_DEBUG_RATE("LQ: Switch to new mcs %X index is green %X\n", 1191 IWL_DEBUG_RATE(priv, "LQ: Switch to new mcs %X index is green %X\n",
1192 tbl->current_rate, is_green); 1192 tbl->current_rate, is_green);
1193 return 0; 1193 return 0;
1194} 1194}
@@ -1209,7 +1209,7 @@ static int rs_switch_to_siso(struct iwl_priv *priv,
1209 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) 1209 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
1210 return -1; 1210 return -1;
1211 1211
1212 IWL_DEBUG_RATE("LQ: try to switch to SISO\n"); 1212 IWL_DEBUG_RATE(priv, "LQ: try to switch to SISO\n");
1213 1213
1214 tbl->is_dup = lq_sta->is_dup; 1214 tbl->is_dup = lq_sta->is_dup;
1215 tbl->lq_type = LQ_SISO; 1215 tbl->lq_type = LQ_SISO;
@@ -1240,14 +1240,14 @@ static int rs_switch_to_siso(struct iwl_priv *priv,
1240 rs_set_expected_tpt_table(lq_sta, tbl); 1240 rs_set_expected_tpt_table(lq_sta, tbl);
1241 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index); 1241 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index);
1242 1242
1243 IWL_DEBUG_RATE("LQ: get best rate %d mask %X\n", rate, rate_mask); 1243 IWL_DEBUG_RATE(priv, "LQ: get best rate %d mask %X\n", rate, rate_mask);
1244 if ((rate == IWL_RATE_INVALID) || !((1 << rate) & rate_mask)) { 1244 if ((rate == IWL_RATE_INVALID) || !((1 << rate) & rate_mask)) {
1245 IWL_DEBUG_RATE("can not switch with index %d rate mask %x\n", 1245 IWL_DEBUG_RATE(priv, "can not switch with index %d rate mask %x\n",
1246 rate, rate_mask); 1246 rate, rate_mask);
1247 return -1; 1247 return -1;
1248 } 1248 }
1249 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green); 1249 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1250 IWL_DEBUG_RATE("LQ: Switch to new mcs %X index is green %X\n", 1250 IWL_DEBUG_RATE(priv, "LQ: Switch to new mcs %X index is green %X\n",
1251 tbl->current_rate, is_green); 1251 tbl->current_rate, is_green);
1252 return 0; 1252 return 0;
1253} 1253}
@@ -1276,7 +1276,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1276 switch (tbl->action) { 1276 switch (tbl->action) {
1277 case IWL_LEGACY_SWITCH_ANTENNA1: 1277 case IWL_LEGACY_SWITCH_ANTENNA1:
1278 case IWL_LEGACY_SWITCH_ANTENNA2: 1278 case IWL_LEGACY_SWITCH_ANTENNA2:
1279 IWL_DEBUG_RATE("LQ: Legacy toggle Antenna\n"); 1279 IWL_DEBUG_RATE(priv, "LQ: Legacy toggle Antenna\n");
1280 1280
1281 lq_sta->action_counter++; 1281 lq_sta->action_counter++;
1282 1282
@@ -1300,7 +1300,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1300 } 1300 }
1301 break; 1301 break;
1302 case IWL_LEGACY_SWITCH_SISO: 1302 case IWL_LEGACY_SWITCH_SISO:
1303 IWL_DEBUG_RATE("LQ: Legacy switch to SISO\n"); 1303 IWL_DEBUG_RATE(priv, "LQ: Legacy switch to SISO\n");
1304 1304
1305 /* Set up search table to try SISO */ 1305 /* Set up search table to try SISO */
1306 memcpy(search_tbl, tbl, sz); 1306 memcpy(search_tbl, tbl, sz);
@@ -1316,7 +1316,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1316 case IWL_LEGACY_SWITCH_MIMO2_AB: 1316 case IWL_LEGACY_SWITCH_MIMO2_AB:
1317 case IWL_LEGACY_SWITCH_MIMO2_AC: 1317 case IWL_LEGACY_SWITCH_MIMO2_AC:
1318 case IWL_LEGACY_SWITCH_MIMO2_BC: 1318 case IWL_LEGACY_SWITCH_MIMO2_BC:
1319 IWL_DEBUG_RATE("LQ: Legacy switch to MIMO2\n"); 1319 IWL_DEBUG_RATE(priv, "LQ: Legacy switch to MIMO2\n");
1320 1320
1321 /* Set up search table to try MIMO */ 1321 /* Set up search table to try MIMO */
1322 memcpy(search_tbl, tbl, sz); 1322 memcpy(search_tbl, tbl, sz);
@@ -1385,7 +1385,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1385 switch (tbl->action) { 1385 switch (tbl->action) {
1386 case IWL_SISO_SWITCH_ANTENNA1: 1386 case IWL_SISO_SWITCH_ANTENNA1:
1387 case IWL_SISO_SWITCH_ANTENNA2: 1387 case IWL_SISO_SWITCH_ANTENNA2:
1388 IWL_DEBUG_RATE("LQ: SISO toggle Antenna\n"); 1388 IWL_DEBUG_RATE(priv, "LQ: SISO toggle Antenna\n");
1389 1389
1390 if ((tbl->action == IWL_SISO_SWITCH_ANTENNA1 && 1390 if ((tbl->action == IWL_SISO_SWITCH_ANTENNA1 &&
1391 tx_chains_num <= 1) || 1391 tx_chains_num <= 1) ||
@@ -1404,7 +1404,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1404 case IWL_SISO_SWITCH_MIMO2_AB: 1404 case IWL_SISO_SWITCH_MIMO2_AB:
1405 case IWL_SISO_SWITCH_MIMO2_AC: 1405 case IWL_SISO_SWITCH_MIMO2_AC:
1406 case IWL_SISO_SWITCH_MIMO2_BC: 1406 case IWL_SISO_SWITCH_MIMO2_BC:
1407 IWL_DEBUG_RATE("LQ: SISO switch to MIMO2\n"); 1407 IWL_DEBUG_RATE(priv, "LQ: SISO switch to MIMO2\n");
1408 memcpy(search_tbl, tbl, sz); 1408 memcpy(search_tbl, tbl, sz);
1409 search_tbl->is_SGI = 0; 1409 search_tbl->is_SGI = 0;
1410 1410
@@ -1433,7 +1433,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1433 HT_SHORT_GI_40MHZ)) 1433 HT_SHORT_GI_40MHZ))
1434 break; 1434 break;
1435 1435
1436 IWL_DEBUG_RATE("LQ: SISO toggle SGI/NGI\n"); 1436 IWL_DEBUG_RATE(priv, "LQ: SISO toggle SGI/NGI\n");
1437 1437
1438 memcpy(search_tbl, tbl, sz); 1438 memcpy(search_tbl, tbl, sz);
1439 if (is_green) { 1439 if (is_green) {
@@ -1498,7 +1498,7 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv,
1498 switch (tbl->action) { 1498 switch (tbl->action) {
1499 case IWL_MIMO2_SWITCH_ANTENNA1: 1499 case IWL_MIMO2_SWITCH_ANTENNA1:
1500 case IWL_MIMO2_SWITCH_ANTENNA2: 1500 case IWL_MIMO2_SWITCH_ANTENNA2:
1501 IWL_DEBUG_RATE("LQ: MIMO toggle Antennas\n"); 1501 IWL_DEBUG_RATE(priv, "LQ: MIMO toggle Antennas\n");
1502 1502
1503 if (tx_chains_num <= 2) 1503 if (tx_chains_num <= 2)
1504 break; 1504 break;
@@ -1514,7 +1514,7 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv,
1514 case IWL_MIMO2_SWITCH_SISO_A: 1514 case IWL_MIMO2_SWITCH_SISO_A:
1515 case IWL_MIMO2_SWITCH_SISO_B: 1515 case IWL_MIMO2_SWITCH_SISO_B:
1516 case IWL_MIMO2_SWITCH_SISO_C: 1516 case IWL_MIMO2_SWITCH_SISO_C:
1517 IWL_DEBUG_RATE("LQ: MIMO2 switch to SISO\n"); 1517 IWL_DEBUG_RATE(priv, "LQ: MIMO2 switch to SISO\n");
1518 1518
1519 /* Set up new search table for SISO */ 1519 /* Set up new search table for SISO */
1520 memcpy(search_tbl, tbl, sz); 1520 memcpy(search_tbl, tbl, sz);
@@ -1546,7 +1546,7 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv,
1546 HT_SHORT_GI_40MHZ)) 1546 HT_SHORT_GI_40MHZ))
1547 break; 1547 break;
1548 1548
1549 IWL_DEBUG_RATE("LQ: MIMO toggle SGI/NGI\n"); 1549 IWL_DEBUG_RATE(priv, "LQ: MIMO toggle SGI/NGI\n");
1550 1550
1551 /* Set up new search table for MIMO */ 1551 /* Set up new search table for MIMO */
1552 memcpy(search_tbl, tbl, sz); 1552 memcpy(search_tbl, tbl, sz);
@@ -1629,7 +1629,7 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta)
1629 (lq_sta->total_success > lq_sta->max_success_limit) || 1629 (lq_sta->total_success > lq_sta->max_success_limit) ||
1630 ((!lq_sta->search_better_tbl) && (lq_sta->flush_timer) 1630 ((!lq_sta->search_better_tbl) && (lq_sta->flush_timer)
1631 && (flush_interval_passed))) { 1631 && (flush_interval_passed))) {
1632 IWL_DEBUG_RATE("LQ: stay is expired %d %d %d\n:", 1632 IWL_DEBUG_RATE(priv, "LQ: stay is expired %d %d %d\n:",
1633 lq_sta->total_failed, 1633 lq_sta->total_failed,
1634 lq_sta->total_success, 1634 lq_sta->total_success,
1635 flush_interval_passed); 1635 flush_interval_passed);
@@ -1652,7 +1652,7 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta)
1652 lq_sta->table_count_limit) { 1652 lq_sta->table_count_limit) {
1653 lq_sta->table_count = 0; 1653 lq_sta->table_count = 0;
1654 1654
1655 IWL_DEBUG_RATE("LQ: stay in table clear win\n"); 1655 IWL_DEBUG_RATE(priv, "LQ: stay in table clear win\n");
1656 for (i = 0; i < IWL_RATE_COUNT; i++) 1656 for (i = 0; i < IWL_RATE_COUNT; i++)
1657 rs_rate_scale_clear_window( 1657 rs_rate_scale_clear_window(
1658 &(tbl->win[i])); 1658 &(tbl->win[i]));
@@ -1701,7 +1701,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1701 s32 sr; 1701 s32 sr;
1702 u8 tid = MAX_TID_COUNT; 1702 u8 tid = MAX_TID_COUNT;
1703 1703
1704 IWL_DEBUG_RATE("rate scale calculate new rate for skb\n"); 1704 IWL_DEBUG_RATE(priv, "rate scale calculate new rate for skb\n");
1705 1705
1706 /* Send management frames and broadcast/multicast data using 1706 /* Send management frames and broadcast/multicast data using
1707 * lowest rate. */ 1707 * lowest rate. */
@@ -1733,13 +1733,13 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1733 /* current tx rate */ 1733 /* current tx rate */
1734 index = lq_sta->last_txrate_idx; 1734 index = lq_sta->last_txrate_idx;
1735 1735
1736 IWL_DEBUG_RATE("Rate scale index %d for type %d\n", index, 1736 IWL_DEBUG_RATE(priv, "Rate scale index %d for type %d\n", index,
1737 tbl->lq_type); 1737 tbl->lq_type);
1738 1738
1739 /* rates available for this association, and for modulation mode */ 1739 /* rates available for this association, and for modulation mode */
1740 rate_mask = rs_get_supported_rates(lq_sta, hdr, tbl->lq_type); 1740 rate_mask = rs_get_supported_rates(lq_sta, hdr, tbl->lq_type);
1741 1741
1742 IWL_DEBUG_RATE("mask 0x%04X \n", rate_mask); 1742 IWL_DEBUG_RATE(priv, "mask 0x%04X \n", rate_mask);
1743 1743
1744 /* mask with station rate restriction */ 1744 /* mask with station rate restriction */
1745 if (is_legacy(tbl->lq_type)) { 1745 if (is_legacy(tbl->lq_type)) {
@@ -1789,7 +1789,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1789 fail_count = window->counter - window->success_counter; 1789 fail_count = window->counter - window->success_counter;
1790 if ((fail_count < IWL_RATE_MIN_FAILURE_TH) && 1790 if ((fail_count < IWL_RATE_MIN_FAILURE_TH) &&
1791 (window->success_counter < IWL_RATE_MIN_SUCCESS_TH)) { 1791 (window->success_counter < IWL_RATE_MIN_SUCCESS_TH)) {
1792 IWL_DEBUG_RATE("LQ: still below TH. succ=%d total=%d " 1792 IWL_DEBUG_RATE(priv, "LQ: still below TH. succ=%d total=%d "
1793 "for index %d\n", 1793 "for index %d\n",
1794 window->success_counter, window->counter, index); 1794 window->success_counter, window->counter, index);
1795 1795
@@ -1817,7 +1817,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1817 * continuing to use the setup that we've been trying. */ 1817 * continuing to use the setup that we've been trying. */
1818 if (window->average_tpt > lq_sta->last_tpt) { 1818 if (window->average_tpt > lq_sta->last_tpt) {
1819 1819
1820 IWL_DEBUG_RATE("LQ: SWITCHING TO NEW TABLE " 1820 IWL_DEBUG_RATE(priv, "LQ: SWITCHING TO NEW TABLE "
1821 "suc=%d cur-tpt=%d old-tpt=%d\n", 1821 "suc=%d cur-tpt=%d old-tpt=%d\n",
1822 window->success_ratio, 1822 window->success_ratio,
1823 window->average_tpt, 1823 window->average_tpt,
@@ -1833,7 +1833,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1833 /* Else poor success; go back to mode in "active" table */ 1833 /* Else poor success; go back to mode in "active" table */
1834 } else { 1834 } else {
1835 1835
1836 IWL_DEBUG_RATE("LQ: GOING BACK TO THE OLD TABLE " 1836 IWL_DEBUG_RATE(priv, "LQ: GOING BACK TO THE OLD TABLE "
1837 "suc=%d cur-tpt=%d old-tpt=%d\n", 1837 "suc=%d cur-tpt=%d old-tpt=%d\n",
1838 window->success_ratio, 1838 window->success_ratio,
1839 window->average_tpt, 1839 window->average_tpt,
@@ -1886,7 +1886,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1886 1886
1887 /* Too many failures, decrease rate */ 1887 /* Too many failures, decrease rate */
1888 if ((sr <= IWL_RATE_DECREASE_TH) || (current_tpt == 0)) { 1888 if ((sr <= IWL_RATE_DECREASE_TH) || (current_tpt == 0)) {
1889 IWL_DEBUG_RATE("decrease rate because of low success_ratio\n"); 1889 IWL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n");
1890 scale_action = -1; 1890 scale_action = -1;
1891 1891
1892 /* No throughput measured yet for adjacent rates; try increase. */ 1892 /* No throughput measured yet for adjacent rates; try increase. */
@@ -1917,8 +1917,8 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1917 sr >= IWL_RATE_INCREASE_TH) { 1917 sr >= IWL_RATE_INCREASE_TH) {
1918 scale_action = 1; 1918 scale_action = 1;
1919 } else { 1919 } else {
1920 IWL_DEBUG_RATE 1920 IWL_DEBUG_RATE(priv,
1921 ("decrease rate because of high tpt\n"); 1921 "decrease rate because of high tpt\n");
1922 scale_action = -1; 1922 scale_action = -1;
1923 } 1923 }
1924 1924
@@ -1926,8 +1926,8 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1926 } else if (low_tpt != IWL_INVALID_VALUE) { 1926 } else if (low_tpt != IWL_INVALID_VALUE) {
1927 /* Lower rate has better throughput */ 1927 /* Lower rate has better throughput */
1928 if (low_tpt > current_tpt) { 1928 if (low_tpt > current_tpt) {
1929 IWL_DEBUG_RATE 1929 IWL_DEBUG_RATE(priv,
1930 ("decrease rate because of low tpt\n"); 1930 "decrease rate because of low tpt\n");
1931 scale_action = -1; 1931 scale_action = -1;
1932 } else if (sr >= IWL_RATE_INCREASE_TH) { 1932 } else if (sr >= IWL_RATE_INCREASE_TH) {
1933 scale_action = 1; 1933 scale_action = 1;
@@ -1964,7 +1964,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
1964 break; 1964 break;
1965 } 1965 }
1966 1966
1967 IWL_DEBUG_RATE("choose rate scale index %d action %d low %d " 1967 IWL_DEBUG_RATE(priv, "choose rate scale index %d action %d low %d "
1968 "high %d type %d\n", 1968 "high %d type %d\n",
1969 index, scale_action, low, high, tbl->lq_type); 1969 index, scale_action, low, high, tbl->lq_type);
1970 1970
@@ -2008,7 +2008,7 @@ lq_update:
2008 /* Use new "search" start rate */ 2008 /* Use new "search" start rate */
2009 index = iwl_hwrate_to_plcp_idx(tbl->current_rate); 2009 index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
2010 2010
2011 IWL_DEBUG_RATE("Switch current mcs: %X index: %d\n", 2011 IWL_DEBUG_RATE(priv, "Switch current mcs: %X index: %d\n",
2012 tbl->current_rate, index); 2012 tbl->current_rate, index);
2013 rs_fill_link_cmd(priv, lq_sta, tbl->current_rate); 2013 rs_fill_link_cmd(priv, lq_sta, tbl->current_rate);
2014 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC); 2014 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
@@ -2023,7 +2023,7 @@ lq_update:
2023 if (is_legacy(tbl1->lq_type) && !conf_is_ht(conf) && 2023 if (is_legacy(tbl1->lq_type) && !conf_is_ht(conf) &&
2024 lq_sta->action_counter >= 1) { 2024 lq_sta->action_counter >= 1) {
2025 lq_sta->action_counter = 0; 2025 lq_sta->action_counter = 0;
2026 IWL_DEBUG_RATE("LQ: STAY in legacy table\n"); 2026 IWL_DEBUG_RATE(priv, "LQ: STAY in legacy table\n");
2027 rs_set_stay_in_table(priv, 1, lq_sta); 2027 rs_set_stay_in_table(priv, 1, lq_sta);
2028 } 2028 }
2029 2029
@@ -2035,7 +2035,7 @@ lq_update:
2035 if ((lq_sta->last_tpt > IWL_AGG_TPT_THREHOLD) && 2035 if ((lq_sta->last_tpt > IWL_AGG_TPT_THREHOLD) &&
2036 (lq_sta->tx_agg_tid_en & (1 << tid)) && 2036 (lq_sta->tx_agg_tid_en & (1 << tid)) &&
2037 (tid != MAX_TID_COUNT)) { 2037 (tid != MAX_TID_COUNT)) {
2038 IWL_DEBUG_RATE("try to aggregate tid %d\n", tid); 2038 IWL_DEBUG_RATE(priv, "try to aggregate tid %d\n", tid);
2039 rs_tl_turn_on_agg(priv, tid, lq_sta, sta); 2039 rs_tl_turn_on_agg(priv, tid, lq_sta, sta);
2040 } 2040 }
2041 lq_sta->action_counter = 0; 2041 lq_sta->action_counter = 0;
@@ -2131,7 +2131,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
2131 int rate_idx; 2131 int rate_idx;
2132 u64 mask_bit = 0; 2132 u64 mask_bit = 0;
2133 2133
2134 IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); 2134 IWL_DEBUG_RATE_LIMIT(priv, "rate scale calculate new rate for skb\n");
2135 2135
2136 /* Get max rate if user set max rate */ 2136 /* Get max rate if user set max rate */
2137 if (lq_sta) { 2137 if (lq_sta) {
@@ -2167,7 +2167,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
2167 u8 sta_id = iwl_find_station(priv, hdr->addr1); 2167 u8 sta_id = iwl_find_station(priv, hdr->addr1);
2168 2168
2169 if (sta_id == IWL_INVALID_STATION) { 2169 if (sta_id == IWL_INVALID_STATION) {
2170 IWL_DEBUG_RATE("LQ: ADD station %pM\n", 2170 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n",
2171 hdr->addr1); 2171 hdr->addr1);
2172 sta_id = iwl_add_station_flags(priv, hdr->addr1, 2172 sta_id = iwl_add_station_flags(priv, hdr->addr1,
2173 0, CMD_ASYNC, NULL); 2173 0, CMD_ASYNC, NULL);
@@ -2196,7 +2196,7 @@ static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,
2196 int i, j; 2196 int i, j;
2197 2197
2198 priv = (struct iwl_priv *)priv_rate; 2198 priv = (struct iwl_priv *)priv_rate;
2199 IWL_DEBUG_RATE("create station rate scale window\n"); 2199 IWL_DEBUG_RATE(priv, "create station rate scale window\n");
2200 2200
2201 lq_sta = kzalloc(sizeof(struct iwl_lq_sta), gfp); 2201 lq_sta = kzalloc(sizeof(struct iwl_lq_sta), gfp);
2202 2202
@@ -2229,7 +2229,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2229 for (i = 0; i < IWL_RATE_COUNT; i++) 2229 for (i = 0; i < IWL_RATE_COUNT; i++)
2230 rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]); 2230 rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
2231 2231
2232 IWL_DEBUG_RATE("LQ: *** rate scale station global init ***\n"); 2232 IWL_DEBUG_RATE(priv, "LQ: *** rate scale station global init ***\n");
2233 /* TODO: what is a good starting rate for STA? About middle? Maybe not 2233 /* TODO: what is a good starting rate for STA? About middle? Maybe not
2234 * the lowest or the highest rate.. Could consider using RSSI from 2234 * the lowest or the highest rate.. Could consider using RSSI from
2235 * previous packets? Need to have IEEE 802.1X auth succeed immediately 2235 * previous packets? Need to have IEEE 802.1X auth succeed immediately
@@ -2240,10 +2240,10 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2240 u8 sta_id = iwl_find_station(priv, sta->addr); 2240 u8 sta_id = iwl_find_station(priv, sta->addr);
2241 2241
2242 /* for IBSS the call are from tasklet */ 2242 /* for IBSS the call are from tasklet */
2243 IWL_DEBUG_RATE("LQ: ADD station %pM\n", sta->addr); 2243 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n", sta->addr);
2244 2244
2245 if (sta_id == IWL_INVALID_STATION) { 2245 if (sta_id == IWL_INVALID_STATION) {
2246 IWL_DEBUG_RATE("LQ: ADD station %pM\n", sta->addr); 2246 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n", sta->addr);
2247 sta_id = iwl_add_station_flags(priv, sta->addr, 2247 sta_id = iwl_add_station_flags(priv, sta->addr,
2248 0, CMD_ASYNC, NULL); 2248 0, CMD_ASYNC, NULL);
2249 } 2249 }
@@ -2282,7 +2282,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2282 lq_sta->active_mimo3_rate &= ~((u16)0x2); 2282 lq_sta->active_mimo3_rate &= ~((u16)0x2);
2283 lq_sta->active_mimo3_rate <<= IWL_FIRST_OFDM_RATE; 2283 lq_sta->active_mimo3_rate <<= IWL_FIRST_OFDM_RATE;
2284 2284
2285 IWL_DEBUG_RATE("SISO-RATE=%X MIMO2-RATE=%X MIMO3-RATE=%X\n", 2285 IWL_DEBUG_RATE(priv, "SISO-RATE=%X MIMO2-RATE=%X MIMO3-RATE=%X\n",
2286 lq_sta->active_siso_rate, 2286 lq_sta->active_siso_rate,
2287 lq_sta->active_mimo2_rate, 2287 lq_sta->active_mimo2_rate,
2288 lq_sta->active_mimo3_rate); 2288 lq_sta->active_mimo3_rate);
@@ -2448,9 +2448,9 @@ static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta,
2448 struct iwl_lq_sta *lq_sta = priv_sta; 2448 struct iwl_lq_sta *lq_sta = priv_sta;
2449 struct iwl_priv *priv __maybe_unused = priv_r; 2449 struct iwl_priv *priv __maybe_unused = priv_r;
2450 2450
2451 IWL_DEBUG_RATE("enter\n"); 2451 IWL_DEBUG_RATE(priv, "enter\n");
2452 kfree(lq_sta); 2452 kfree(lq_sta);
2453 IWL_DEBUG_RATE("leave\n"); 2453 IWL_DEBUG_RATE(priv, "leave\n");
2454} 2454}
2455 2455
2456 2456
@@ -2475,9 +2475,9 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
2475 else 2475 else
2476 *rate_n_flags = 0x820A; 2476 *rate_n_flags = 0x820A;
2477 } 2477 }
2478 IWL_DEBUG_RATE("Fixed rate ON\n"); 2478 IWL_DEBUG_RATE(priv, "Fixed rate ON\n");
2479 } else { 2479 } else {
2480 IWL_DEBUG_RATE("Fixed rate OFF\n"); 2480 IWL_DEBUG_RATE(priv, "Fixed rate OFF\n");
2481 } 2481 }
2482} 2482}
2483 2483
@@ -2506,7 +2506,7 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
2506 lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ 2506 lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */
2507 lq_sta->active_mimo3_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ 2507 lq_sta->active_mimo3_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */
2508 2508
2509 IWL_DEBUG_RATE("sta_id %d rate 0x%X\n", 2509 IWL_DEBUG_RATE(priv, "sta_id %d rate 0x%X\n",
2510 lq_sta->lq.sta_id, lq_sta->dbg_fixed_rate); 2510 lq_sta->lq.sta_id, lq_sta->dbg_fixed_rate);
2511 2511
2512 if (lq_sta->dbg_fixed_rate) { 2512 if (lq_sta->dbg_fixed_rate) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ad6403395e43..c196abc6db7a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -147,7 +147,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
147 * we must clear the associated from the active configuration 147 * we must clear the associated from the active configuration
148 * before we apply the new config */ 148 * before we apply the new config */
149 if (iwl_is_associated(priv) && new_assoc) { 149 if (iwl_is_associated(priv) && new_assoc) {
150 IWL_DEBUG_INFO("Toggling associated bit on current RXON\n"); 150 IWL_DEBUG_INFO(priv, "Toggling associated bit on current RXON\n");
151 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 151 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
152 152
153 ret = iwl_send_cmd_pdu(priv, REPLY_RXON, 153 ret = iwl_send_cmd_pdu(priv, REPLY_RXON,
@@ -163,7 +163,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
163 } 163 }
164 } 164 }
165 165
166 IWL_DEBUG_INFO("Sending RXON\n" 166 IWL_DEBUG_INFO(priv, "Sending RXON\n"
167 "* with%s RXON_FILTER_ASSOC_MSK\n" 167 "* with%s RXON_FILTER_ASSOC_MSK\n"
168 "* channel = %d\n" 168 "* channel = %d\n"
169 "* bssid = %pM\n", 169 "* bssid = %pM\n",
@@ -254,7 +254,7 @@ static void iwl_clear_free_frames(struct iwl_priv *priv)
254{ 254{
255 struct list_head *element; 255 struct list_head *element;
256 256
257 IWL_DEBUG_INFO("%d frames on pre-allocated heap on clear.\n", 257 IWL_DEBUG_INFO(priv, "%d frames on pre-allocated heap on clear.\n",
258 priv->frames_count); 258 priv->frames_count);
259 259
260 while (!list_empty(&priv->free_frames)) { 260 while (!list_empty(&priv->free_frames)) {
@@ -538,7 +538,7 @@ static void iwl_ht_conf(struct iwl_priv *priv,
538 struct iwl_ht_info *iwl_conf = &priv->current_ht_config; 538 struct iwl_ht_info *iwl_conf = &priv->current_ht_config;
539 struct ieee80211_sta *sta; 539 struct ieee80211_sta *sta;
540 540
541 IWL_DEBUG_MAC80211("enter: \n"); 541 IWL_DEBUG_MAC80211(priv, "enter: \n");
542 542
543 if (!iwl_conf->is_ht) 543 if (!iwl_conf->is_ht)
544 return; 544 return;
@@ -598,7 +598,7 @@ static void iwl_ht_conf(struct iwl_priv *priv,
598 598
599 rcu_read_unlock(); 599 rcu_read_unlock();
600 600
601 IWL_DEBUG_MAC80211("leave\n"); 601 IWL_DEBUG_MAC80211(priv, "leave\n");
602} 602}
603 603
604/* 604/*
@@ -623,7 +623,7 @@ static void iwl_activate_qos(struct iwl_priv *priv, u8 force)
623 priv->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK; 623 priv->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
624 624
625 if (force || iwl_is_associated(priv)) { 625 if (force || iwl_is_associated(priv)) {
626 IWL_DEBUG_QOS("send QoS cmd with Qos active=%d FLAGS=0x%X\n", 626 IWL_DEBUG_QOS(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n",
627 priv->qos_data.qos_active, 627 priv->qos_data.qos_active,
628 priv->qos_data.def_qos_parm.qos_flags); 628 priv->qos_data.def_qos_parm.qos_flags);
629 629
@@ -680,7 +680,7 @@ static void iwl_setup_rxon_timing(struct iwl_priv *priv)
680 priv->rxon_timing.beacon_init_val = cpu_to_le32(interval_tm - rem); 680 priv->rxon_timing.beacon_init_val = cpu_to_le32(interval_tm - rem);
681 681
682 spin_unlock_irqrestore(&priv->lock, flags); 682 spin_unlock_irqrestore(&priv->lock, flags);
683 IWL_DEBUG_ASSOC("beacon interval %d beacon timer %d beacon tim %d\n", 683 IWL_DEBUG_ASSOC(priv, "beacon interval %d beacon timer %d beacon tim %d\n",
684 le16_to_cpu(priv->rxon_timing.beacon_interval), 684 le16_to_cpu(priv->rxon_timing.beacon_interval),
685 le32_to_cpu(priv->rxon_timing.beacon_init_val), 685 le32_to_cpu(priv->rxon_timing.beacon_init_val),
686 le16_to_cpu(priv->rxon_timing.atim_window)); 686 le16_to_cpu(priv->rxon_timing.atim_window));
@@ -701,7 +701,7 @@ static int iwl_set_mode(struct iwl_priv *priv, int mode)
701 cancel_delayed_work(&priv->scan_check); 701 cancel_delayed_work(&priv->scan_check);
702 if (iwl_scan_cancel_timeout(priv, 100)) { 702 if (iwl_scan_cancel_timeout(priv, 100)) {
703 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n"); 703 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
704 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); 704 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
705 return -EAGAIN; 705 return -EAGAIN;
706 } 706 }
707 707
@@ -724,19 +724,19 @@ static void iwl_rx_reply_alive(struct iwl_priv *priv,
724 724
725 palive = &pkt->u.alive_frame; 725 palive = &pkt->u.alive_frame;
726 726
727 IWL_DEBUG_INFO("Alive ucode status 0x%08X revision " 727 IWL_DEBUG_INFO(priv, "Alive ucode status 0x%08X revision "
728 "0x%01X 0x%01X\n", 728 "0x%01X 0x%01X\n",
729 palive->is_valid, palive->ver_type, 729 palive->is_valid, palive->ver_type,
730 palive->ver_subtype); 730 palive->ver_subtype);
731 731
732 if (palive->ver_subtype == INITIALIZE_SUBTYPE) { 732 if (palive->ver_subtype == INITIALIZE_SUBTYPE) {
733 IWL_DEBUG_INFO("Initialization Alive received.\n"); 733 IWL_DEBUG_INFO(priv, "Initialization Alive received.\n");
734 memcpy(&priv->card_alive_init, 734 memcpy(&priv->card_alive_init,
735 &pkt->u.alive_frame, 735 &pkt->u.alive_frame,
736 sizeof(struct iwl_init_alive_resp)); 736 sizeof(struct iwl_init_alive_resp));
737 pwork = &priv->init_alive_start; 737 pwork = &priv->init_alive_start;
738 } else { 738 } else {
739 IWL_DEBUG_INFO("Runtime Alive received.\n"); 739 IWL_DEBUG_INFO(priv, "Runtime Alive received.\n");
740 memcpy(&priv->card_alive, &pkt->u.alive_frame, 740 memcpy(&priv->card_alive, &pkt->u.alive_frame,
741 sizeof(struct iwl_alive_resp)); 741 sizeof(struct iwl_alive_resp));
742 pwork = &priv->alive_start; 742 pwork = &priv->alive_start;
@@ -771,7 +771,7 @@ static void iwl_rx_pm_sleep_notif(struct iwl_priv *priv,
771#ifdef CONFIG_IWLWIFI_DEBUG 771#ifdef CONFIG_IWLWIFI_DEBUG
772 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 772 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
773 struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif); 773 struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif);
774 IWL_DEBUG_RX("sleep mode: %d, src: %d\n", 774 IWL_DEBUG_RX(priv, "sleep mode: %d, src: %d\n",
775 sleep->pm_sleep_mode, sleep->pm_wakeup_src); 775 sleep->pm_sleep_mode, sleep->pm_wakeup_src);
776#endif 776#endif
777} 777}
@@ -780,7 +780,7 @@ static void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
780 struct iwl_rx_mem_buffer *rxb) 780 struct iwl_rx_mem_buffer *rxb)
781{ 781{
782 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 782 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
783 IWL_DEBUG_RADIO("Dumping %d bytes of unhandled " 783 IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
784 "notification for %s:\n", 784 "notification for %s:\n",
785 le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd)); 785 le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
786 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)); 786 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len));
@@ -844,7 +844,7 @@ static void iwl_rx_beacon_notif(struct iwl_priv *priv,
844 (struct iwl4965_beacon_notif *)pkt->u.raw; 844 (struct iwl4965_beacon_notif *)pkt->u.raw;
845 u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); 845 u8 rate = iwl_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags);
846 846
847 IWL_DEBUG_RX("beacon status %x retries %d iss %d " 847 IWL_DEBUG_RX(priv, "beacon status %x retries %d iss %d "
848 "tsf %d %d rate %d\n", 848 "tsf %d %d rate %d\n",
849 le32_to_cpu(beacon->beacon_notify_hdr.u.status) & TX_STATUS_MSK, 849 le32_to_cpu(beacon->beacon_notify_hdr.u.status) & TX_STATUS_MSK,
850 beacon->beacon_notify_hdr.failure_frame, 850 beacon->beacon_notify_hdr.failure_frame,
@@ -867,7 +867,7 @@ static void iwl_rx_card_state_notif(struct iwl_priv *priv,
867 u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); 867 u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
868 unsigned long status = priv->status; 868 unsigned long status = priv->status;
869 869
870 IWL_DEBUG_RF_KILL("Card state received: HW:%s SW:%s\n", 870 IWL_DEBUG_RF_KILL(priv, "Card state received: HW:%s SW:%s\n",
871 (flags & HW_CARD_DISABLED) ? "Kill" : "On", 871 (flags & HW_CARD_DISABLED) ? "Kill" : "On",
872 (flags & SW_CARD_DISABLED) ? "Kill" : "On"); 872 (flags & SW_CARD_DISABLED) ? "Kill" : "On");
873 873
@@ -1029,7 +1029,7 @@ void iwl_rx_handle(struct iwl_priv *priv)
1029 1029
1030 /* Rx interrupt, but nothing sent from uCode */ 1030 /* Rx interrupt, but nothing sent from uCode */
1031 if (i == r) 1031 if (i == r)
1032 IWL_DEBUG(IWL_DL_RX, "r = %d, i = %d\n", r, i); 1032 IWL_DEBUG_RX(priv, "r = %d, i = %d\n", r, i);
1033 1033
1034 if (iwl_rx_queue_space(rxq) > (RX_QUEUE_SIZE / 2)) 1034 if (iwl_rx_queue_space(rxq) > (RX_QUEUE_SIZE / 2))
1035 fill_rx = 1; 1035 fill_rx = 1;
@@ -1069,12 +1069,12 @@ void iwl_rx_handle(struct iwl_priv *priv)
1069 * handle those that need handling via function in 1069 * handle those that need handling via function in
1070 * rx_handlers table. See iwl_setup_rx_handlers() */ 1070 * rx_handlers table. See iwl_setup_rx_handlers() */
1071 if (priv->rx_handlers[pkt->hdr.cmd]) { 1071 if (priv->rx_handlers[pkt->hdr.cmd]) {
1072 IWL_DEBUG(IWL_DL_RX, "r = %d, i = %d, %s, 0x%02x\n", r, 1072 IWL_DEBUG_RX(priv, "r = %d, i = %d, %s, 0x%02x\n", r,
1073 i, get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd); 1073 i, get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
1074 priv->rx_handlers[pkt->hdr.cmd] (priv, rxb); 1074 priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
1075 } else { 1075 } else {
1076 /* No handling needed */ 1076 /* No handling needed */
1077 IWL_DEBUG(IWL_DL_RX, 1077 IWL_DEBUG_RX(priv,
1078 "r %d i %d No handler needed for %s, 0x%02x\n", 1078 "r %d i %d No handler needed for %s, 0x%02x\n",
1079 r, i, get_cmd_string(pkt->hdr.cmd), 1079 r, i, get_cmd_string(pkt->hdr.cmd),
1080 pkt->hdr.cmd); 1080 pkt->hdr.cmd);
@@ -1175,7 +1175,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1175 if (priv->debug_level & IWL_DL_ISR) { 1175 if (priv->debug_level & IWL_DL_ISR) {
1176 /* just for debug */ 1176 /* just for debug */
1177 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1177 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1178 IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 1178 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
1179 inta, inta_mask, inta_fh); 1179 inta, inta_mask, inta_fh);
1180 } 1180 }
1181#endif 1181#endif
@@ -1209,12 +1209,12 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1209 if (priv->debug_level & (IWL_DL_ISR)) { 1209 if (priv->debug_level & (IWL_DL_ISR)) {
1210 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 1210 /* NIC fires this, but we don't use it, redundant with WAKEUP */
1211 if (inta & CSR_INT_BIT_SCD) 1211 if (inta & CSR_INT_BIT_SCD)
1212 IWL_DEBUG_ISR("Scheduler finished to transmit " 1212 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
1213 "the frame/frames.\n"); 1213 "the frame/frames.\n");
1214 1214
1215 /* Alive notification via Rx interrupt will do the real work */ 1215 /* Alive notification via Rx interrupt will do the real work */
1216 if (inta & CSR_INT_BIT_ALIVE) 1216 if (inta & CSR_INT_BIT_ALIVE)
1217 IWL_DEBUG_ISR("Alive interrupt\n"); 1217 IWL_DEBUG_ISR(priv, "Alive interrupt\n");
1218 } 1218 }
1219#endif 1219#endif
1220 /* Safely ignore these bits for debug checks below */ 1220 /* Safely ignore these bits for debug checks below */
@@ -1227,7 +1227,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1227 CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)) 1227 CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
1228 hw_rf_kill = 1; 1228 hw_rf_kill = 1;
1229 1229
1230 IWL_DEBUG(IWL_DL_RF_KILL, "RF_KILL bit toggled to %s.\n", 1230 IWL_DEBUG_RF_KILL(priv, "RF_KILL bit toggled to %s.\n",
1231 hw_rf_kill ? "disable radio" : "enable radio"); 1231 hw_rf_kill ? "disable radio" : "enable radio");
1232 1232
1233 /* driver only loads ucode once setting the interface up. 1233 /* driver only loads ucode once setting the interface up.
@@ -1262,7 +1262,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1262 1262
1263 /* uCode wakes up after power-down sleep */ 1263 /* uCode wakes up after power-down sleep */
1264 if (inta & CSR_INT_BIT_WAKEUP) { 1264 if (inta & CSR_INT_BIT_WAKEUP) {
1265 IWL_DEBUG_ISR("Wakeup interrupt\n"); 1265 IWL_DEBUG_ISR(priv, "Wakeup interrupt\n");
1266 iwl_rx_queue_update_write_ptr(priv, &priv->rxq); 1266 iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
1267 iwl_txq_update_write_ptr(priv, &priv->txq[0]); 1267 iwl_txq_update_write_ptr(priv, &priv->txq[0]);
1268 iwl_txq_update_write_ptr(priv, &priv->txq[1]); 1268 iwl_txq_update_write_ptr(priv, &priv->txq[1]);
@@ -1283,7 +1283,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1283 } 1283 }
1284 1284
1285 if (inta & CSR_INT_BIT_FH_TX) { 1285 if (inta & CSR_INT_BIT_FH_TX) {
1286 IWL_DEBUG_ISR("Tx interrupt\n"); 1286 IWL_DEBUG_ISR(priv, "Tx interrupt\n");
1287 handled |= CSR_INT_BIT_FH_TX; 1287 handled |= CSR_INT_BIT_FH_TX;
1288 /* FH finished to write, send event */ 1288 /* FH finished to write, send event */
1289 priv->ucode_write_complete = 1; 1289 priv->ucode_write_complete = 1;
@@ -1309,7 +1309,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1309 inta = iwl_read32(priv, CSR_INT); 1309 inta = iwl_read32(priv, CSR_INT);
1310 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1310 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1311 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 1311 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
1312 IWL_DEBUG_ISR("End inta 0x%08x, enabled 0x%08x, fh 0x%08x, " 1312 IWL_DEBUG_ISR(priv, "End inta 0x%08x, enabled 0x%08x, fh 0x%08x, "
1313 "flags 0x%08lx\n", inta, inta_mask, inta_fh, flags); 1313 "flags 0x%08lx\n", inta, inta_mask, inta_fh, flags);
1314 } 1314 }
1315#endif 1315#endif
@@ -1341,7 +1341,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
1341 * This may be due to IRQ shared with another device, 1341 * This may be due to IRQ shared with another device,
1342 * or due to sporadic interrupts thrown from our NIC. */ 1342 * or due to sporadic interrupts thrown from our NIC. */
1343 if (!inta && !inta_fh) { 1343 if (!inta && !inta_fh) {
1344 IWL_DEBUG_ISR("Ignore interrupt, inta == 0, inta_fh == 0\n"); 1344 IWL_DEBUG_ISR(priv, "Ignore interrupt, inta == 0, inta_fh == 0\n");
1345 goto none; 1345 goto none;
1346 } 1346 }
1347 1347
@@ -1352,7 +1352,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
1352 goto unplugged; 1352 goto unplugged;
1353 } 1353 }
1354 1354
1355 IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 1355 IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
1356 inta, inta_mask, inta_fh); 1356 inta, inta_mask, inta_fh);
1357 1357
1358 inta &= ~CSR_INT_BIT_SCD; 1358 inta &= ~CSR_INT_BIT_SCD;
@@ -1434,7 +1434,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1434 "Please use API v%u instead.\n", 1434 "Please use API v%u instead.\n",
1435 buf, api_max); 1435 buf, api_max);
1436 1436
1437 IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n", 1437 IWL_DEBUG_INFO(priv, "Got firmware '%s' file (%zd bytes) from disk\n",
1438 buf, ucode_raw->size); 1438 buf, ucode_raw->size);
1439 break; 1439 break;
1440 } 1440 }
@@ -1485,17 +1485,17 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1485 IWL_UCODE_API(priv->ucode_ver), 1485 IWL_UCODE_API(priv->ucode_ver),
1486 IWL_UCODE_SERIAL(priv->ucode_ver)); 1486 IWL_UCODE_SERIAL(priv->ucode_ver));
1487 1487
1488 IWL_DEBUG_INFO("f/w package hdr ucode version raw = 0x%x\n", 1488 IWL_DEBUG_INFO(priv, "f/w package hdr ucode version raw = 0x%x\n",
1489 priv->ucode_ver); 1489 priv->ucode_ver);
1490 IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n", 1490 IWL_DEBUG_INFO(priv, "f/w package hdr runtime inst size = %u\n",
1491 inst_size); 1491 inst_size);
1492 IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n", 1492 IWL_DEBUG_INFO(priv, "f/w package hdr runtime data size = %u\n",
1493 data_size); 1493 data_size);
1494 IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n", 1494 IWL_DEBUG_INFO(priv, "f/w package hdr init inst size = %u\n",
1495 init_size); 1495 init_size);
1496 IWL_DEBUG_INFO("f/w package hdr init data size = %u\n", 1496 IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %u\n",
1497 init_data_size); 1497 init_data_size);
1498 IWL_DEBUG_INFO("f/w package hdr boot inst size = %u\n", 1498 IWL_DEBUG_INFO(priv, "f/w package hdr boot inst size = %u\n",
1499 boot_size); 1499 boot_size);
1500 1500
1501 /* Verify size of file vs. image size info in file's header */ 1501 /* Verify size of file vs. image size info in file's header */
@@ -1503,7 +1503,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1503 inst_size + data_size + init_size + 1503 inst_size + data_size + init_size +
1504 init_data_size + boot_size) { 1504 init_data_size + boot_size) {
1505 1505
1506 IWL_DEBUG_INFO("uCode file size %d too small\n", 1506 IWL_DEBUG_INFO(priv, "uCode file size %d too small\n",
1507 (int)ucode_raw->size); 1507 (int)ucode_raw->size);
1508 ret = -EINVAL; 1508 ret = -EINVAL;
1509 goto err_release; 1509 goto err_release;
@@ -1511,36 +1511,33 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1511 1511
1512 /* Verify that uCode images will fit in card's SRAM */ 1512 /* Verify that uCode images will fit in card's SRAM */
1513 if (inst_size > priv->hw_params.max_inst_size) { 1513 if (inst_size > priv->hw_params.max_inst_size) {
1514 IWL_DEBUG_INFO("uCode instr len %d too large to fit in\n", 1514 IWL_DEBUG_INFO(priv, "uCode instr len %d too large to fit in\n",
1515 inst_size); 1515 inst_size);
1516 ret = -EINVAL; 1516 ret = -EINVAL;
1517 goto err_release; 1517 goto err_release;
1518 } 1518 }
1519 1519
1520 if (data_size > priv->hw_params.max_data_size) { 1520 if (data_size > priv->hw_params.max_data_size) {
1521 IWL_DEBUG_INFO("uCode data len %d too large to fit in\n", 1521 IWL_DEBUG_INFO(priv, "uCode data len %d too large to fit in\n",
1522 data_size); 1522 data_size);
1523 ret = -EINVAL; 1523 ret = -EINVAL;
1524 goto err_release; 1524 goto err_release;
1525 } 1525 }
1526 if (init_size > priv->hw_params.max_inst_size) { 1526 if (init_size > priv->hw_params.max_inst_size) {
1527 IWL_DEBUG_INFO 1527 IWL_INFO(priv, "uCode init instr len %d too large to fit in\n",
1528 ("uCode init instr len %d too large to fit in\n", 1528 init_size);
1529 init_size);
1530 ret = -EINVAL; 1529 ret = -EINVAL;
1531 goto err_release; 1530 goto err_release;
1532 } 1531 }
1533 if (init_data_size > priv->hw_params.max_data_size) { 1532 if (init_data_size > priv->hw_params.max_data_size) {
1534 IWL_DEBUG_INFO 1533 IWL_INFO(priv, "uCode init data len %d too large to fit in\n",
1535 ("uCode init data len %d too large to fit in\n",
1536 init_data_size); 1534 init_data_size);
1537 ret = -EINVAL; 1535 ret = -EINVAL;
1538 goto err_release; 1536 goto err_release;
1539 } 1537 }
1540 if (boot_size > priv->hw_params.max_bsm_size) { 1538 if (boot_size > priv->hw_params.max_bsm_size) {
1541 IWL_DEBUG_INFO 1539 IWL_INFO(priv, "uCode boot instr len %d too large to fit in\n",
1542 ("uCode boot instr len %d too large to fit in\n", 1540 boot_size);
1543 boot_size);
1544 ret = -EINVAL; 1541 ret = -EINVAL;
1545 goto err_release; 1542 goto err_release;
1546 } 1543 }
@@ -1589,16 +1586,16 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1589 /* Runtime instructions (first block of data in file) */ 1586 /* Runtime instructions (first block of data in file) */
1590 src = &ucode->data[0]; 1587 src = &ucode->data[0];
1591 len = priv->ucode_code.len; 1588 len = priv->ucode_code.len;
1592 IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %Zd\n", len); 1589 IWL_DEBUG_INFO(priv, "Copying (but not loading) uCode instr len %Zd\n", len);
1593 memcpy(priv->ucode_code.v_addr, src, len); 1590 memcpy(priv->ucode_code.v_addr, src, len);
1594 IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n", 1591 IWL_DEBUG_INFO(priv, "uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n",
1595 priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr); 1592 priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr);
1596 1593
1597 /* Runtime data (2nd block) 1594 /* Runtime data (2nd block)
1598 * NOTE: Copy into backup buffer will be done in iwl_up() */ 1595 * NOTE: Copy into backup buffer will be done in iwl_up() */
1599 src = &ucode->data[inst_size]; 1596 src = &ucode->data[inst_size];
1600 len = priv->ucode_data.len; 1597 len = priv->ucode_data.len;
1601 IWL_DEBUG_INFO("Copying (but not loading) uCode data len %Zd\n", len); 1598 IWL_DEBUG_INFO(priv, "Copying (but not loading) uCode data len %Zd\n", len);
1602 memcpy(priv->ucode_data.v_addr, src, len); 1599 memcpy(priv->ucode_data.v_addr, src, len);
1603 memcpy(priv->ucode_data_backup.v_addr, src, len); 1600 memcpy(priv->ucode_data_backup.v_addr, src, len);
1604 1601
@@ -1606,7 +1603,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1606 if (init_size) { 1603 if (init_size) {
1607 src = &ucode->data[inst_size + data_size]; 1604 src = &ucode->data[inst_size + data_size];
1608 len = priv->ucode_init.len; 1605 len = priv->ucode_init.len;
1609 IWL_DEBUG_INFO("Copying (but not loading) init instr len %Zd\n", 1606 IWL_DEBUG_INFO(priv, "Copying (but not loading) init instr len %Zd\n",
1610 len); 1607 len);
1611 memcpy(priv->ucode_init.v_addr, src, len); 1608 memcpy(priv->ucode_init.v_addr, src, len);
1612 } 1609 }
@@ -1615,7 +1612,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1615 if (init_data_size) { 1612 if (init_data_size) {
1616 src = &ucode->data[inst_size + data_size + init_size]; 1613 src = &ucode->data[inst_size + data_size + init_size];
1617 len = priv->ucode_init_data.len; 1614 len = priv->ucode_init_data.len;
1618 IWL_DEBUG_INFO("Copying (but not loading) init data len %Zd\n", 1615 IWL_DEBUG_INFO(priv, "Copying (but not loading) init data len %Zd\n",
1619 len); 1616 len);
1620 memcpy(priv->ucode_init_data.v_addr, src, len); 1617 memcpy(priv->ucode_init_data.v_addr, src, len);
1621 } 1618 }
@@ -1623,7 +1620,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1623 /* Bootstrap instructions (5th block) */ 1620 /* Bootstrap instructions (5th block) */
1624 src = &ucode->data[inst_size + data_size + init_size + init_data_size]; 1621 src = &ucode->data[inst_size + data_size + init_size + init_data_size];
1625 len = priv->ucode_boot.len; 1622 len = priv->ucode_boot.len;
1626 IWL_DEBUG_INFO("Copying (but not loading) boot instr len %Zd\n", len); 1623 IWL_DEBUG_INFO(priv, "Copying (but not loading) boot instr len %Zd\n", len);
1627 memcpy(priv->ucode_boot.v_addr, src, len); 1624 memcpy(priv->ucode_boot.v_addr, src, len);
1628 1625
1629 /* We have our copies now, allow OS release its copies */ 1626 /* We have our copies now, allow OS release its copies */
@@ -1655,12 +1652,12 @@ static void iwl_alive_start(struct iwl_priv *priv)
1655{ 1652{
1656 int ret = 0; 1653 int ret = 0;
1657 1654
1658 IWL_DEBUG_INFO("Runtime Alive received.\n"); 1655 IWL_DEBUG_INFO(priv, "Runtime Alive received.\n");
1659 1656
1660 if (priv->card_alive.is_valid != UCODE_VALID_OK) { 1657 if (priv->card_alive.is_valid != UCODE_VALID_OK) {
1661 /* We had an error bringing up the hardware, so take it 1658 /* We had an error bringing up the hardware, so take it
1662 * all the way back down so we can try again */ 1659 * all the way back down so we can try again */
1663 IWL_DEBUG_INFO("Alive failed.\n"); 1660 IWL_DEBUG_INFO(priv, "Alive failed.\n");
1664 goto restart; 1661 goto restart;
1665 } 1662 }
1666 1663
@@ -1670,7 +1667,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
1670 if (iwl_verify_ucode(priv)) { 1667 if (iwl_verify_ucode(priv)) {
1671 /* Runtime instruction load was bad; 1668 /* Runtime instruction load was bad;
1672 * take it all the way back down so we can try again */ 1669 * take it all the way back down so we can try again */
1673 IWL_DEBUG_INFO("Bad runtime uCode load.\n"); 1670 IWL_DEBUG_INFO(priv, "Bad runtime uCode load.\n");
1674 goto restart; 1671 goto restart;
1675 } 1672 }
1676 1673
@@ -1720,7 +1717,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
1720 1717
1721 iwl_leds_register(priv); 1718 iwl_leds_register(priv);
1722 1719
1723 IWL_DEBUG_INFO("ALIVE processing complete.\n"); 1720 IWL_DEBUG_INFO(priv, "ALIVE processing complete.\n");
1724 set_bit(STATUS_READY, &priv->status); 1721 set_bit(STATUS_READY, &priv->status);
1725 wake_up_interruptible(&priv->wait_command_queue); 1722 wake_up_interruptible(&priv->wait_command_queue);
1726 1723
@@ -1754,7 +1751,7 @@ static void __iwl_down(struct iwl_priv *priv)
1754 unsigned long flags; 1751 unsigned long flags;
1755 int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status); 1752 int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status);
1756 1753
1757 IWL_DEBUG_INFO(DRV_NAME " is going down\n"); 1754 IWL_DEBUG_INFO(priv, DRV_NAME " is going down\n");
1758 1755
1759 if (!exit_pending) 1756 if (!exit_pending)
1760 set_bit(STATUS_EXIT_PENDING, &priv->status); 1757 set_bit(STATUS_EXIT_PENDING, &priv->status);
@@ -1935,7 +1932,7 @@ static int __iwl_up(struct iwl_priv *priv)
1935 /* start card; "initialize" will load runtime ucode */ 1932 /* start card; "initialize" will load runtime ucode */
1936 iwl_nic_start(priv); 1933 iwl_nic_start(priv);
1937 1934
1938 IWL_DEBUG_INFO(DRV_NAME " is coming up\n"); 1935 IWL_DEBUG_INFO(priv, DRV_NAME " is coming up\n");
1939 1936
1940 return 0; 1937 return 0;
1941 } 1938 }
@@ -2056,7 +2053,7 @@ static void iwl_post_associate(struct iwl_priv *priv)
2056 return; 2053 return;
2057 } 2054 }
2058 2055
2059 IWL_DEBUG_ASSOC("Associated as %d to: %pM\n", 2056 IWL_DEBUG_ASSOC(priv, "Associated as %d to: %pM\n",
2060 priv->assoc_id, priv->active_rxon.bssid_addr); 2057 priv->assoc_id, priv->active_rxon.bssid_addr);
2061 2058
2062 2059
@@ -2089,7 +2086,7 @@ static void iwl_post_associate(struct iwl_priv *priv)
2089 iwl_set_rxon_chain(priv); 2086 iwl_set_rxon_chain(priv);
2090 priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id); 2087 priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
2091 2088
2092 IWL_DEBUG_ASSOC("assoc id %d beacon interval %d\n", 2089 IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n",
2093 priv->assoc_id, priv->beacon_int); 2090 priv->assoc_id, priv->beacon_int);
2094 2091
2095 if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 2092 if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
@@ -2162,7 +2159,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2162 struct iwl_priv *priv = hw->priv; 2159 struct iwl_priv *priv = hw->priv;
2163 int ret; 2160 int ret;
2164 2161
2165 IWL_DEBUG_MAC80211("enter\n"); 2162 IWL_DEBUG_MAC80211(priv, "enter\n");
2166 2163
2167 /* we should be verifying the device is ready to be opened */ 2164 /* we should be verifying the device is ready to be opened */
2168 mutex_lock(&priv->mutex); 2165 mutex_lock(&priv->mutex);
@@ -2192,7 +2189,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2192 if (iwl_is_rfkill(priv)) 2189 if (iwl_is_rfkill(priv))
2193 goto out; 2190 goto out;
2194 2191
2195 IWL_DEBUG_INFO("Start UP work done.\n"); 2192 IWL_DEBUG_INFO(priv, "Start UP work done.\n");
2196 2193
2197 if (test_bit(STATUS_IN_SUSPEND, &priv->status)) 2194 if (test_bit(STATUS_IN_SUSPEND, &priv->status))
2198 return 0; 2195 return 0;
@@ -2212,7 +2209,7 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2212 2209
2213out: 2210out:
2214 priv->is_open = 1; 2211 priv->is_open = 1;
2215 IWL_DEBUG_MAC80211("leave\n"); 2212 IWL_DEBUG_MAC80211(priv, "leave\n");
2216 return 0; 2213 return 0;
2217} 2214}
2218 2215
@@ -2220,10 +2217,10 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
2220{ 2217{
2221 struct iwl_priv *priv = hw->priv; 2218 struct iwl_priv *priv = hw->priv;
2222 2219
2223 IWL_DEBUG_MAC80211("enter\n"); 2220 IWL_DEBUG_MAC80211(priv, "enter\n");
2224 2221
2225 if (!priv->is_open) { 2222 if (!priv->is_open) {
2226 IWL_DEBUG_MAC80211("leave - skip\n"); 2223 IWL_DEBUG_MAC80211(priv, "leave - skip\n");
2227 return; 2224 return;
2228 } 2225 }
2229 2226
@@ -2246,22 +2243,22 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
2246 iwl_write32(priv, CSR_INT, 0xFFFFFFFF); 2243 iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
2247 iwl_enable_interrupts(priv); 2244 iwl_enable_interrupts(priv);
2248 2245
2249 IWL_DEBUG_MAC80211("leave\n"); 2246 IWL_DEBUG_MAC80211(priv, "leave\n");
2250} 2247}
2251 2248
2252static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 2249static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2253{ 2250{
2254 struct iwl_priv *priv = hw->priv; 2251 struct iwl_priv *priv = hw->priv;
2255 2252
2256 IWL_DEBUG_MACDUMP("enter\n"); 2253 IWL_DEBUG_MACDUMP(priv, "enter\n");
2257 2254
2258 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 2255 IWL_DEBUG_TX(priv, "dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
2259 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 2256 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
2260 2257
2261 if (iwl_tx_skb(priv, skb)) 2258 if (iwl_tx_skb(priv, skb))
2262 dev_kfree_skb_any(skb); 2259 dev_kfree_skb_any(skb);
2263 2260
2264 IWL_DEBUG_MACDUMP("leave\n"); 2261 IWL_DEBUG_MACDUMP(priv, "leave\n");
2265 return NETDEV_TX_OK; 2262 return NETDEV_TX_OK;
2266} 2263}
2267 2264
@@ -2271,10 +2268,10 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
2271 struct iwl_priv *priv = hw->priv; 2268 struct iwl_priv *priv = hw->priv;
2272 unsigned long flags; 2269 unsigned long flags;
2273 2270
2274 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); 2271 IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);
2275 2272
2276 if (priv->vif) { 2273 if (priv->vif) {
2277 IWL_DEBUG_MAC80211("leave - vif != NULL\n"); 2274 IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
2278 return -EOPNOTSUPP; 2275 return -EOPNOTSUPP;
2279 } 2276 }
2280 2277
@@ -2287,7 +2284,7 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
2287 mutex_lock(&priv->mutex); 2284 mutex_lock(&priv->mutex);
2288 2285
2289 if (conf->mac_addr) { 2286 if (conf->mac_addr) {
2290 IWL_DEBUG_MAC80211("Set %pM\n", conf->mac_addr); 2287 IWL_DEBUG_MAC80211(priv, "Set %pM\n", conf->mac_addr);
2291 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 2288 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
2292 } 2289 }
2293 2290
@@ -2297,7 +2294,7 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
2297 2294
2298 mutex_unlock(&priv->mutex); 2295 mutex_unlock(&priv->mutex);
2299 2296
2300 IWL_DEBUG_MAC80211("leave\n"); 2297 IWL_DEBUG_MAC80211(priv, "leave\n");
2301 return 0; 2298 return 0;
2302} 2299}
2303 2300
@@ -2318,12 +2315,12 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2318 u16 channel; 2315 u16 channel;
2319 2316
2320 mutex_lock(&priv->mutex); 2317 mutex_lock(&priv->mutex);
2321 IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel->hw_value); 2318 IWL_DEBUG_MAC80211(priv, "enter to channel %d\n", conf->channel->hw_value);
2322 2319
2323 priv->current_ht_config.is_ht = conf_is_ht(conf); 2320 priv->current_ht_config.is_ht = conf_is_ht(conf);
2324 2321
2325 if (conf->radio_enabled && iwl_radio_kill_sw_enable_radio(priv)) { 2322 if (conf->radio_enabled && iwl_radio_kill_sw_enable_radio(priv)) {
2326 IWL_DEBUG_MAC80211("leave - RF-KILL - waiting for uCode\n"); 2323 IWL_DEBUG_MAC80211(priv, "leave - RF-KILL - waiting for uCode\n");
2327 goto out; 2324 goto out;
2328 } 2325 }
2329 2326
@@ -2331,14 +2328,14 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2331 iwl_radio_kill_sw_disable_radio(priv); 2328 iwl_radio_kill_sw_disable_radio(priv);
2332 2329
2333 if (!iwl_is_ready(priv)) { 2330 if (!iwl_is_ready(priv)) {
2334 IWL_DEBUG_MAC80211("leave - not ready\n"); 2331 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
2335 ret = -EIO; 2332 ret = -EIO;
2336 goto out; 2333 goto out;
2337 } 2334 }
2338 2335
2339 if (unlikely(!priv->cfg->mod_params->disable_hw_scan && 2336 if (unlikely(!priv->cfg->mod_params->disable_hw_scan &&
2340 test_bit(STATUS_SCANNING, &priv->status))) { 2337 test_bit(STATUS_SCANNING, &priv->status))) {
2341 IWL_DEBUG_MAC80211("leave - scanning\n"); 2338 IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
2342 mutex_unlock(&priv->mutex); 2339 mutex_unlock(&priv->mutex);
2343 return 0; 2340 return 0;
2344 } 2341 }
@@ -2346,7 +2343,7 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2346 channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 2343 channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
2347 ch_info = iwl_get_channel_info(priv, conf->channel->band, channel); 2344 ch_info = iwl_get_channel_info(priv, conf->channel->band, channel);
2348 if (!is_channel_valid(ch_info)) { 2345 if (!is_channel_valid(ch_info)) {
2349 IWL_DEBUG_MAC80211("leave - invalid channel\n"); 2346 IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
2350 ret = -EINVAL; 2347 ret = -EINVAL;
2351 goto out; 2348 goto out;
2352 } 2349 }
@@ -2391,12 +2388,12 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2391#endif 2388#endif
2392 2389
2393 if (!conf->radio_enabled) { 2390 if (!conf->radio_enabled) {
2394 IWL_DEBUG_MAC80211("leave - radio disabled\n"); 2391 IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n");
2395 goto out; 2392 goto out;
2396 } 2393 }
2397 2394
2398 if (iwl_is_rfkill(priv)) { 2395 if (iwl_is_rfkill(priv)) {
2399 IWL_DEBUG_MAC80211("leave - RF kill\n"); 2396 IWL_DEBUG_MAC80211(priv, "leave - RF kill\n");
2400 ret = -EIO; 2397 ret = -EIO;
2401 goto out; 2398 goto out;
2402 } 2399 }
@@ -2406,9 +2403,9 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2406 else 2403 else
2407 ret = iwl_power_set_user_mode(priv, IWL_POWER_MODE_CAM); 2404 ret = iwl_power_set_user_mode(priv, IWL_POWER_MODE_CAM);
2408 if (ret) 2405 if (ret)
2409 IWL_DEBUG_MAC80211("Error setting power level\n"); 2406 IWL_DEBUG_MAC80211(priv, "Error setting power level\n");
2410 2407
2411 IWL_DEBUG_MAC80211("TX Power old=%d new=%d\n", 2408 IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
2412 priv->tx_power_user_lmt, conf->power_level); 2409 priv->tx_power_user_lmt, conf->power_level);
2413 2410
2414 iwl_set_tx_power(priv, conf->power_level, false); 2411 iwl_set_tx_power(priv, conf->power_level, false);
@@ -2422,9 +2419,9 @@ static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2422 &priv->staging_rxon, sizeof(priv->staging_rxon))) 2419 &priv->staging_rxon, sizeof(priv->staging_rxon)))
2423 iwl_commit_rxon(priv); 2420 iwl_commit_rxon(priv);
2424 else 2421 else
2425 IWL_DEBUG_INFO("No re-sending same RXON configuration.\n"); 2422 IWL_DEBUG_INFO(priv, "No re-sending same RXON configuration.\n");
2426 2423
2427 IWL_DEBUG_MAC80211("leave\n"); 2424 IWL_DEBUG_MAC80211(priv, "leave\n");
2428 2425
2429out: 2426out:
2430 mutex_unlock(&priv->mutex); 2427 mutex_unlock(&priv->mutex);
@@ -2505,7 +2502,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
2505 return -EIO; 2502 return -EIO;
2506 2503
2507 if (priv->vif != vif) { 2504 if (priv->vif != vif) {
2508 IWL_DEBUG_MAC80211("leave - priv->vif != vif\n"); 2505 IWL_DEBUG_MAC80211(priv, "leave - priv->vif != vif\n");
2509 return 0; 2506 return 0;
2510 } 2507 }
2511 2508
@@ -2527,7 +2524,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
2527 mutex_lock(&priv->mutex); 2524 mutex_lock(&priv->mutex);
2528 2525
2529 if (conf->bssid) 2526 if (conf->bssid)
2530 IWL_DEBUG_MAC80211("bssid: %pM\n", conf->bssid); 2527 IWL_DEBUG_MAC80211(priv, "bssid: %pM\n", conf->bssid);
2531 2528
2532/* 2529/*
2533 * very dubious code was here; the probe filtering flag is never set: 2530 * very dubious code was here; the probe filtering flag is never set:
@@ -2540,7 +2537,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
2540 if (!conf->bssid) { 2537 if (!conf->bssid) {
2541 conf->bssid = priv->mac_addr; 2538 conf->bssid = priv->mac_addr;
2542 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 2539 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
2543 IWL_DEBUG_MAC80211("bssid was set to: %pM\n", 2540 IWL_DEBUG_MAC80211(priv, "bssid was set to: %pM\n",
2544 conf->bssid); 2541 conf->bssid);
2545 } 2542 }
2546 if (priv->ibss_beacon) 2543 if (priv->ibss_beacon)
@@ -2559,7 +2556,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
2559 if (iwl_scan_cancel_timeout(priv, 100)) { 2556 if (iwl_scan_cancel_timeout(priv, 100)) {
2560 IWL_WARN(priv, "Aborted scan still in progress " 2557 IWL_WARN(priv, "Aborted scan still in progress "
2561 "after 100ms\n"); 2558 "after 100ms\n");
2562 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); 2559 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
2563 mutex_unlock(&priv->mutex); 2560 mutex_unlock(&priv->mutex);
2564 return -EAGAIN; 2561 return -EAGAIN;
2565 } 2562 }
@@ -2587,7 +2584,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw,
2587 } 2584 }
2588 2585
2589 done: 2586 done:
2590 IWL_DEBUG_MAC80211("leave\n"); 2587 IWL_DEBUG_MAC80211(priv, "leave\n");
2591 mutex_unlock(&priv->mutex); 2588 mutex_unlock(&priv->mutex);
2592 2589
2593 return 0; 2590 return 0;
@@ -2598,7 +2595,7 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
2598{ 2595{
2599 struct iwl_priv *priv = hw->priv; 2596 struct iwl_priv *priv = hw->priv;
2600 2597
2601 IWL_DEBUG_MAC80211("enter\n"); 2598 IWL_DEBUG_MAC80211(priv, "enter\n");
2602 2599
2603 mutex_lock(&priv->mutex); 2600 mutex_lock(&priv->mutex);
2604 2601
@@ -2613,7 +2610,7 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
2613 } 2610 }
2614 mutex_unlock(&priv->mutex); 2611 mutex_unlock(&priv->mutex);
2615 2612
2616 IWL_DEBUG_MAC80211("leave\n"); 2613 IWL_DEBUG_MAC80211(priv, "leave\n");
2617 2614
2618} 2615}
2619 2616
@@ -2625,10 +2622,10 @@ static void iwl_bss_info_changed(struct ieee80211_hw *hw,
2625{ 2622{
2626 struct iwl_priv *priv = hw->priv; 2623 struct iwl_priv *priv = hw->priv;
2627 2624
2628 IWL_DEBUG_MAC80211("changes = 0x%X\n", changes); 2625 IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes);
2629 2626
2630 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 2627 if (changes & BSS_CHANGED_ERP_PREAMBLE) {
2631 IWL_DEBUG_MAC80211("ERP_PREAMBLE %d\n", 2628 IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n",
2632 bss_conf->use_short_preamble); 2629 bss_conf->use_short_preamble);
2633 if (bss_conf->use_short_preamble) 2630 if (bss_conf->use_short_preamble)
2634 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; 2631 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
@@ -2637,7 +2634,7 @@ static void iwl_bss_info_changed(struct ieee80211_hw *hw,
2637 } 2634 }
2638 2635
2639 if (changes & BSS_CHANGED_ERP_CTS_PROT) { 2636 if (changes & BSS_CHANGED_ERP_CTS_PROT) {
2640 IWL_DEBUG_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot); 2637 IWL_DEBUG_MAC80211(priv, "ERP_CTS %d\n", bss_conf->use_cts_prot);
2641 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ)) 2638 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
2642 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; 2639 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
2643 else 2640 else
@@ -2650,7 +2647,7 @@ static void iwl_bss_info_changed(struct ieee80211_hw *hw,
2650 } 2647 }
2651 2648
2652 if (changes & BSS_CHANGED_ASSOC) { 2649 if (changes & BSS_CHANGED_ASSOC) {
2653 IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc); 2650 IWL_DEBUG_MAC80211(priv, "ASSOC %d\n", bss_conf->assoc);
2654 /* This should never happen as this function should 2651 /* This should never happen as this function should
2655 * never be called from interrupt context. */ 2652 * never be called from interrupt context. */
2656 if (WARN_ON_ONCE(in_interrupt())) 2653 if (WARN_ON_ONCE(in_interrupt()))
@@ -2672,10 +2669,10 @@ static void iwl_bss_info_changed(struct ieee80211_hw *hw,
2672 mutex_unlock(&priv->mutex); 2669 mutex_unlock(&priv->mutex);
2673 } else { 2670 } else {
2674 priv->assoc_id = 0; 2671 priv->assoc_id = 0;
2675 IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc); 2672 IWL_DEBUG_MAC80211(priv, "DISASSOC %d\n", bss_conf->assoc);
2676 } 2673 }
2677 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) { 2674 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
2678 IWL_DEBUG_MAC80211("Associated Changes %d\n", changes); 2675 IWL_DEBUG_MAC80211(priv, "Associated Changes %d\n", changes);
2679 iwl_send_rxon_assoc(priv); 2676 iwl_send_rxon_assoc(priv);
2680 } 2677 }
2681 2678
@@ -2687,14 +2684,14 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
2687 struct iwl_priv *priv = hw->priv; 2684 struct iwl_priv *priv = hw->priv;
2688 int ret; 2685 int ret;
2689 2686
2690 IWL_DEBUG_MAC80211("enter\n"); 2687 IWL_DEBUG_MAC80211(priv, "enter\n");
2691 2688
2692 mutex_lock(&priv->mutex); 2689 mutex_lock(&priv->mutex);
2693 spin_lock_irqsave(&priv->lock, flags); 2690 spin_lock_irqsave(&priv->lock, flags);
2694 2691
2695 if (!iwl_is_ready_rf(priv)) { 2692 if (!iwl_is_ready_rf(priv)) {
2696 ret = -EIO; 2693 ret = -EIO;
2697 IWL_DEBUG_MAC80211("leave - not ready or exit pending\n"); 2694 IWL_DEBUG_MAC80211(priv, "leave - not ready or exit pending\n");
2698 goto out_unlock; 2695 goto out_unlock;
2699 } 2696 }
2700 2697
@@ -2704,7 +2701,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
2704 */ 2701 */
2705 if (priv->next_scan_jiffies && 2702 if (priv->next_scan_jiffies &&
2706 time_after(priv->next_scan_jiffies, jiffies)) { 2703 time_after(priv->next_scan_jiffies, jiffies)) {
2707 IWL_DEBUG_SCAN("scan rejected: within next scan period\n"); 2704 IWL_DEBUG_SCAN(priv, "scan rejected: within next scan period\n");
2708 queue_work(priv->workqueue, &priv->scan_completed); 2705 queue_work(priv->workqueue, &priv->scan_completed);
2709 ret = 0; 2706 ret = 0;
2710 goto out_unlock; 2707 goto out_unlock;
@@ -2713,7 +2710,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
2713 /* if we just finished scan ask for delay */ 2710 /* if we just finished scan ask for delay */
2714 if (iwl_is_associated(priv) && priv->last_scan_jiffies && 2711 if (iwl_is_associated(priv) && priv->last_scan_jiffies &&
2715 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) { 2712 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) {
2716 IWL_DEBUG_SCAN("scan rejected: within previous scan period\n"); 2713 IWL_DEBUG_SCAN(priv, "scan rejected: within previous scan period\n");
2717 queue_work(priv->workqueue, &priv->scan_completed); 2714 queue_work(priv->workqueue, &priv->scan_completed);
2718 ret = 0; 2715 ret = 0;
2719 goto out_unlock; 2716 goto out_unlock;
@@ -2729,7 +2726,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
2729 2726
2730 ret = iwl_scan_initiate(priv); 2727 ret = iwl_scan_initiate(priv);
2731 2728
2732 IWL_DEBUG_MAC80211("leave\n"); 2729 IWL_DEBUG_MAC80211(priv, "leave\n");
2733 2730
2734out_unlock: 2731out_unlock:
2735 spin_unlock_irqrestore(&priv->lock, flags); 2732 spin_unlock_irqrestore(&priv->lock, flags);
@@ -2744,11 +2741,11 @@ static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw,
2744{ 2741{
2745 2742
2746 struct iwl_priv *priv = hw->priv; 2743 struct iwl_priv *priv = hw->priv;
2747 IWL_DEBUG_MAC80211("enter\n"); 2744 IWL_DEBUG_MAC80211(priv, "enter\n");
2748 2745
2749 iwl_update_tkip_key(priv, keyconf, addr, iv32, phase1key); 2746 iwl_update_tkip_key(priv, keyconf, addr, iv32, phase1key);
2750 2747
2751 IWL_DEBUG_MAC80211("leave\n"); 2748 IWL_DEBUG_MAC80211(priv, "leave\n");
2752} 2749}
2753 2750
2754static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2751static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -2762,16 +2759,16 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2762 u8 sta_id; 2759 u8 sta_id;
2763 bool is_default_wep_key = false; 2760 bool is_default_wep_key = false;
2764 2761
2765 IWL_DEBUG_MAC80211("enter\n"); 2762 IWL_DEBUG_MAC80211(priv, "enter\n");
2766 2763
2767 if (priv->hw_params.sw_crypto) { 2764 if (priv->hw_params.sw_crypto) {
2768 IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); 2765 IWL_DEBUG_MAC80211(priv, "leave - hwcrypto disabled\n");
2769 return -EOPNOTSUPP; 2766 return -EOPNOTSUPP;
2770 } 2767 }
2771 addr = sta ? sta->addr : iwl_bcast_addr; 2768 addr = sta ? sta->addr : iwl_bcast_addr;
2772 sta_id = iwl_find_station(priv, addr); 2769 sta_id = iwl_find_station(priv, addr);
2773 if (sta_id == IWL_INVALID_STATION) { 2770 if (sta_id == IWL_INVALID_STATION) {
2774 IWL_DEBUG_MAC80211("leave - %pM not in station map.\n", 2771 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
2775 addr); 2772 addr);
2776 return -EINVAL; 2773 return -EINVAL;
2777 2774
@@ -2801,7 +2798,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2801 else 2798 else
2802 ret = iwl_set_dynamic_key(priv, key, sta_id); 2799 ret = iwl_set_dynamic_key(priv, key, sta_id);
2803 2800
2804 IWL_DEBUG_MAC80211("enable hwcrypto key\n"); 2801 IWL_DEBUG_MAC80211(priv, "enable hwcrypto key\n");
2805 break; 2802 break;
2806 case DISABLE_KEY: 2803 case DISABLE_KEY:
2807 if (is_default_wep_key) 2804 if (is_default_wep_key)
@@ -2809,13 +2806,13 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2809 else 2806 else
2810 ret = iwl_remove_dynamic_key(priv, key, sta_id); 2807 ret = iwl_remove_dynamic_key(priv, key, sta_id);
2811 2808
2812 IWL_DEBUG_MAC80211("disable hwcrypto key\n"); 2809 IWL_DEBUG_MAC80211(priv, "disable hwcrypto key\n");
2813 break; 2810 break;
2814 default: 2811 default:
2815 ret = -EINVAL; 2812 ret = -EINVAL;
2816 } 2813 }
2817 2814
2818 IWL_DEBUG_MAC80211("leave\n"); 2815 IWL_DEBUG_MAC80211(priv, "leave\n");
2819 2816
2820 return ret; 2817 return ret;
2821} 2818}
@@ -2827,15 +2824,15 @@ static int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
2827 unsigned long flags; 2824 unsigned long flags;
2828 int q; 2825 int q;
2829 2826
2830 IWL_DEBUG_MAC80211("enter\n"); 2827 IWL_DEBUG_MAC80211(priv, "enter\n");
2831 2828
2832 if (!iwl_is_ready_rf(priv)) { 2829 if (!iwl_is_ready_rf(priv)) {
2833 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 2830 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
2834 return -EIO; 2831 return -EIO;
2835 } 2832 }
2836 2833
2837 if (queue >= AC_NUM) { 2834 if (queue >= AC_NUM) {
2838 IWL_DEBUG_MAC80211("leave - queue >= AC_NUM %d\n", queue); 2835 IWL_DEBUG_MAC80211(priv, "leave - queue >= AC_NUM %d\n", queue);
2839 return 0; 2836 return 0;
2840 } 2837 }
2841 2838
@@ -2859,7 +2856,7 @@ static int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
2859 2856
2860 spin_unlock_irqrestore(&priv->lock, flags); 2857 spin_unlock_irqrestore(&priv->lock, flags);
2861 2858
2862 IWL_DEBUG_MAC80211("leave\n"); 2859 IWL_DEBUG_MAC80211(priv, "leave\n");
2863 return 0; 2860 return 0;
2864} 2861}
2865 2862
@@ -2869,7 +2866,7 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
2869{ 2866{
2870 struct iwl_priv *priv = hw->priv; 2867 struct iwl_priv *priv = hw->priv;
2871 2868
2872 IWL_DEBUG_HT("A-MPDU action on addr %pM tid %d\n", 2869 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
2873 sta->addr, tid); 2870 sta->addr, tid);
2874 2871
2875 if (!(priv->cfg->sku & IWL_SKU_N)) 2872 if (!(priv->cfg->sku & IWL_SKU_N))
@@ -2877,19 +2874,19 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
2877 2874
2878 switch (action) { 2875 switch (action) {
2879 case IEEE80211_AMPDU_RX_START: 2876 case IEEE80211_AMPDU_RX_START:
2880 IWL_DEBUG_HT("start Rx\n"); 2877 IWL_DEBUG_HT(priv, "start Rx\n");
2881 return iwl_sta_rx_agg_start(priv, sta->addr, tid, *ssn); 2878 return iwl_sta_rx_agg_start(priv, sta->addr, tid, *ssn);
2882 case IEEE80211_AMPDU_RX_STOP: 2879 case IEEE80211_AMPDU_RX_STOP:
2883 IWL_DEBUG_HT("stop Rx\n"); 2880 IWL_DEBUG_HT(priv, "stop Rx\n");
2884 return iwl_sta_rx_agg_stop(priv, sta->addr, tid); 2881 return iwl_sta_rx_agg_stop(priv, sta->addr, tid);
2885 case IEEE80211_AMPDU_TX_START: 2882 case IEEE80211_AMPDU_TX_START:
2886 IWL_DEBUG_HT("start Tx\n"); 2883 IWL_DEBUG_HT(priv, "start Tx\n");
2887 return iwl_tx_agg_start(priv, sta->addr, tid, ssn); 2884 return iwl_tx_agg_start(priv, sta->addr, tid, ssn);
2888 case IEEE80211_AMPDU_TX_STOP: 2885 case IEEE80211_AMPDU_TX_STOP:
2889 IWL_DEBUG_HT("stop Tx\n"); 2886 IWL_DEBUG_HT(priv, "stop Tx\n");
2890 return iwl_tx_agg_stop(priv, sta->addr, tid); 2887 return iwl_tx_agg_stop(priv, sta->addr, tid);
2891 default: 2888 default:
2892 IWL_DEBUG_HT("unknown\n"); 2889 IWL_DEBUG_HT(priv, "unknown\n");
2893 return -EINVAL; 2890 return -EINVAL;
2894 break; 2891 break;
2895 } 2892 }
@@ -2905,10 +2902,10 @@ static int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
2905 struct iwl_queue *q; 2902 struct iwl_queue *q;
2906 unsigned long flags; 2903 unsigned long flags;
2907 2904
2908 IWL_DEBUG_MAC80211("enter\n"); 2905 IWL_DEBUG_MAC80211(priv, "enter\n");
2909 2906
2910 if (!iwl_is_ready_rf(priv)) { 2907 if (!iwl_is_ready_rf(priv)) {
2911 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 2908 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
2912 return -EIO; 2909 return -EIO;
2913 } 2910 }
2914 2911
@@ -2926,7 +2923,7 @@ static int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
2926 } 2923 }
2927 spin_unlock_irqrestore(&priv->lock, flags); 2924 spin_unlock_irqrestore(&priv->lock, flags);
2928 2925
2929 IWL_DEBUG_MAC80211("leave\n"); 2926 IWL_DEBUG_MAC80211(priv, "leave\n");
2930 2927
2931 return 0; 2928 return 0;
2932} 2929}
@@ -2937,8 +2934,8 @@ static int iwl_mac_get_stats(struct ieee80211_hw *hw,
2937 struct iwl_priv *priv = hw->priv; 2934 struct iwl_priv *priv = hw->priv;
2938 2935
2939 priv = hw->priv; 2936 priv = hw->priv;
2940 IWL_DEBUG_MAC80211("enter\n"); 2937 IWL_DEBUG_MAC80211(priv, "enter\n");
2941 IWL_DEBUG_MAC80211("leave\n"); 2938 IWL_DEBUG_MAC80211(priv, "leave\n");
2942 2939
2943 return 0; 2940 return 0;
2944} 2941}
@@ -2949,7 +2946,7 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
2949 unsigned long flags; 2946 unsigned long flags;
2950 2947
2951 mutex_lock(&priv->mutex); 2948 mutex_lock(&priv->mutex);
2952 IWL_DEBUG_MAC80211("enter\n"); 2949 IWL_DEBUG_MAC80211(priv, "enter\n");
2953 2950
2954 spin_lock_irqsave(&priv->lock, flags); 2951 spin_lock_irqsave(&priv->lock, flags);
2955 memset(&priv->current_ht_config, 0, sizeof(struct iwl_ht_info)); 2952 memset(&priv->current_ht_config, 0, sizeof(struct iwl_ht_info));
@@ -2976,7 +2973,7 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
2976 spin_unlock_irqrestore(&priv->lock, flags); 2973 spin_unlock_irqrestore(&priv->lock, flags);
2977 2974
2978 if (!iwl_is_ready_rf(priv)) { 2975 if (!iwl_is_ready_rf(priv)) {
2979 IWL_DEBUG_MAC80211("leave - not ready\n"); 2976 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
2980 mutex_unlock(&priv->mutex); 2977 mutex_unlock(&priv->mutex);
2981 return; 2978 return;
2982 } 2979 }
@@ -3005,7 +3002,7 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
3005 IEEE80211_CHAN_RADAR)) 3002 IEEE80211_CHAN_RADAR))
3006 iwl_power_disable_management(priv, 3000); 3003 iwl_power_disable_management(priv, 3000);
3007 3004
3008 IWL_DEBUG_MAC80211("leave - not in IBSS\n"); 3005 IWL_DEBUG_MAC80211(priv, "leave - not in IBSS\n");
3009 mutex_unlock(&priv->mutex); 3006 mutex_unlock(&priv->mutex);
3010 return; 3007 return;
3011 } 3008 }
@@ -3014,7 +3011,7 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
3014 3011
3015 mutex_unlock(&priv->mutex); 3012 mutex_unlock(&priv->mutex);
3016 3013
3017 IWL_DEBUG_MAC80211("leave\n"); 3014 IWL_DEBUG_MAC80211(priv, "leave\n");
3018} 3015}
3019 3016
3020static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) 3017static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
@@ -3023,15 +3020,15 @@ static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3023 unsigned long flags; 3020 unsigned long flags;
3024 __le64 timestamp; 3021 __le64 timestamp;
3025 3022
3026 IWL_DEBUG_MAC80211("enter\n"); 3023 IWL_DEBUG_MAC80211(priv, "enter\n");
3027 3024
3028 if (!iwl_is_ready_rf(priv)) { 3025 if (!iwl_is_ready_rf(priv)) {
3029 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 3026 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
3030 return -EIO; 3027 return -EIO;
3031 } 3028 }
3032 3029
3033 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { 3030 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
3034 IWL_DEBUG_MAC80211("leave - not IBSS\n"); 3031 IWL_DEBUG_MAC80211(priv, "leave - not IBSS\n");
3035 return -EIO; 3032 return -EIO;
3036 } 3033 }
3037 3034
@@ -3046,7 +3043,7 @@ static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3046 timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; 3043 timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
3047 priv->timestamp = le64_to_cpu(timestamp); 3044 priv->timestamp = le64_to_cpu(timestamp);
3048 3045
3049 IWL_DEBUG_MAC80211("leave\n"); 3046 IWL_DEBUG_MAC80211(priv, "leave\n");
3050 spin_unlock_irqrestore(&priv->lock, flags); 3047 spin_unlock_irqrestore(&priv->lock, flags);
3051 3048
3052 iwl_reset_qos(priv); 3049 iwl_reset_qos(priv);
@@ -3204,7 +3201,7 @@ static ssize_t store_flags(struct device *d,
3204 if (iwl_scan_cancel_timeout(priv, 100)) 3201 if (iwl_scan_cancel_timeout(priv, 100))
3205 IWL_WARN(priv, "Could not cancel scan.\n"); 3202 IWL_WARN(priv, "Could not cancel scan.\n");
3206 else { 3203 else {
3207 IWL_DEBUG_INFO("Commit rxon.flags = 0x%04X\n", flags); 3204 IWL_DEBUG_INFO(priv, "Commit rxon.flags = 0x%04X\n", flags);
3208 priv->staging_rxon.flags = cpu_to_le32(flags); 3205 priv->staging_rxon.flags = cpu_to_le32(flags);
3209 iwl_commit_rxon(priv); 3206 iwl_commit_rxon(priv);
3210 } 3207 }
@@ -3243,7 +3240,7 @@ static ssize_t store_filter_flags(struct device *d,
3243 if (iwl_scan_cancel_timeout(priv, 100)) 3240 if (iwl_scan_cancel_timeout(priv, 100))
3244 IWL_WARN(priv, "Could not cancel scan.\n"); 3241 IWL_WARN(priv, "Could not cancel scan.\n");
3245 else { 3242 else {
3246 IWL_DEBUG_INFO("Committing rxon.filter_flags = " 3243 IWL_DEBUG_INFO(priv, "Committing rxon.filter_flags = "
3247 "0x%04X\n", filter_flags); 3244 "0x%04X\n", filter_flags);
3248 priv->staging_rxon.filter_flags = 3245 priv->staging_rxon.filter_flags =
3249 cpu_to_le32(filter_flags); 3246 cpu_to_le32(filter_flags);
@@ -3280,7 +3277,7 @@ static ssize_t store_power_level(struct device *d,
3280 3277
3281 ret = iwl_power_set_user_mode(priv, mode); 3278 ret = iwl_power_set_user_mode(priv, mode);
3282 if (ret) { 3279 if (ret) {
3283 IWL_DEBUG_MAC80211("failed setting power mode.\n"); 3280 IWL_DEBUG_MAC80211(priv, "failed setting power mode.\n");
3284 goto out; 3281 goto out;
3285 } 3282 }
3286 ret = count; 3283 ret = count;
@@ -3481,7 +3478,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3481 3478
3482 SET_IEEE80211_DEV(hw, &pdev->dev); 3479 SET_IEEE80211_DEV(hw, &pdev->dev);
3483 3480
3484 IWL_DEBUG_INFO("*** LOAD DRIVER ***\n"); 3481 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
3485 priv->cfg = cfg; 3482 priv->cfg = cfg;
3486 priv->pci_dev = pdev; 3483 priv->pci_dev = pdev;
3487 3484
@@ -3530,9 +3527,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3530 goto out_pci_release_regions; 3527 goto out_pci_release_regions;
3531 } 3528 }
3532 3529
3533 IWL_DEBUG_INFO("pci_resource_len = 0x%08llx\n", 3530 IWL_DEBUG_INFO(priv, "pci_resource_len = 0x%08llx\n",
3534 (unsigned long long) pci_resource_len(pdev, 0)); 3531 (unsigned long long) pci_resource_len(pdev, 0));
3535 IWL_DEBUG_INFO("pci_resource_base = %p\n", priv->hw_base); 3532 IWL_DEBUG_INFO(priv, "pci_resource_base = %p\n", priv->hw_base);
3536 3533
3537 iwl_hw_detect(priv); 3534 iwl_hw_detect(priv);
3538 IWL_INFO(priv, "Detected Intel Wireless WiFi Link %s REV=0x%X\n", 3535 IWL_INFO(priv, "Detected Intel Wireless WiFi Link %s REV=0x%X\n",
@@ -3545,7 +3542,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3545 /* amp init */ 3542 /* amp init */
3546 err = priv->cfg->ops->lib->apm_ops.init(priv); 3543 err = priv->cfg->ops->lib->apm_ops.init(priv);
3547 if (err < 0) { 3544 if (err < 0) {
3548 IWL_DEBUG_INFO("Failed to init APMG\n"); 3545 IWL_DEBUG_INFO(priv, "Failed to init APMG\n");
3549 goto out_iounmap; 3546 goto out_iounmap;
3550 } 3547 }
3551 /***************** 3548 /*****************
@@ -3563,7 +3560,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3563 3560
3564 /* extract MAC Address */ 3561 /* extract MAC Address */
3565 iwl_eeprom_get_mac(priv, priv->mac_addr); 3562 iwl_eeprom_get_mac(priv, priv->mac_addr);
3566 IWL_DEBUG_INFO("MAC address: %pM\n", priv->mac_addr); 3563 IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->mac_addr);
3567 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr); 3564 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
3568 3565
3569 /************************ 3566 /************************
@@ -3590,7 +3587,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3590 /* Disable radio (SW RF KILL) via parameter when loading driver */ 3587 /* Disable radio (SW RF KILL) via parameter when loading driver */
3591 if (priv->cfg->mod_params->disable) { 3588 if (priv->cfg->mod_params->disable) {
3592 set_bit(STATUS_RF_KILL_SW, &priv->status); 3589 set_bit(STATUS_RF_KILL_SW, &priv->status);
3593 IWL_DEBUG_INFO("Radio disabled.\n"); 3590 IWL_DEBUG_INFO(priv, "Radio disabled.\n");
3594 } 3591 }
3595 3592
3596 /******************** 3593 /********************
@@ -3684,7 +3681,7 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
3684 if (!priv) 3681 if (!priv)
3685 return; 3682 return;
3686 3683
3687 IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); 3684 IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
3688 3685
3689 iwl_dbgfs_unregister(priv); 3686 iwl_dbgfs_unregister(priv);
3690 sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group); 3687 sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index 8e5e6663be35..d06c57764e11 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -202,7 +202,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
202 val = data->nrg_silence_rssi[i]; 202 val = data->nrg_silence_rssi[i];
203 silence_ref = max(silence_ref, val); 203 silence_ref = max(silence_ref, val);
204 } 204 }
205 IWL_DEBUG_CALIB("silence a %u, b %u, c %u, 20-bcn max %u\n", 205 IWL_DEBUG_CALIB(priv, "silence a %u, b %u, c %u, 20-bcn max %u\n",
206 silence_rssi_a, silence_rssi_b, silence_rssi_c, 206 silence_rssi_a, silence_rssi_b, silence_rssi_c,
207 silence_ref); 207 silence_ref);
208 208
@@ -226,7 +226,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
226 max_nrg_cck = (u32) max(max_nrg_cck, (data->nrg_value[i])); 226 max_nrg_cck = (u32) max(max_nrg_cck, (data->nrg_value[i]));
227 max_nrg_cck += 6; 227 max_nrg_cck += 6;
228 228
229 IWL_DEBUG_CALIB("rx energy a %u, b %u, c %u, 10-bcn max/min %u\n", 229 IWL_DEBUG_CALIB(priv, "rx energy a %u, b %u, c %u, 10-bcn max/min %u\n",
230 rx_info->beacon_energy_a, rx_info->beacon_energy_b, 230 rx_info->beacon_energy_a, rx_info->beacon_energy_b,
231 rx_info->beacon_energy_c, max_nrg_cck - 6); 231 rx_info->beacon_energy_c, max_nrg_cck - 6);
232 232
@@ -236,15 +236,15 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
236 data->num_in_cck_no_fa++; 236 data->num_in_cck_no_fa++;
237 else 237 else
238 data->num_in_cck_no_fa = 0; 238 data->num_in_cck_no_fa = 0;
239 IWL_DEBUG_CALIB("consecutive bcns with few false alarms = %u\n", 239 IWL_DEBUG_CALIB(priv, "consecutive bcns with few false alarms = %u\n",
240 data->num_in_cck_no_fa); 240 data->num_in_cck_no_fa);
241 241
242 /* If we got too many false alarms this time, reduce sensitivity */ 242 /* If we got too many false alarms this time, reduce sensitivity */
243 if ((false_alarms > max_false_alarms) && 243 if ((false_alarms > max_false_alarms) &&
244 (data->auto_corr_cck > AUTO_CORR_MAX_TH_CCK)) { 244 (data->auto_corr_cck > AUTO_CORR_MAX_TH_CCK)) {
245 IWL_DEBUG_CALIB("norm FA %u > max FA %u\n", 245 IWL_DEBUG_CALIB(priv, "norm FA %u > max FA %u\n",
246 false_alarms, max_false_alarms); 246 false_alarms, max_false_alarms);
247 IWL_DEBUG_CALIB("... reducing sensitivity\n"); 247 IWL_DEBUG_CALIB(priv, "... reducing sensitivity\n");
248 data->nrg_curr_state = IWL_FA_TOO_MANY; 248 data->nrg_curr_state = IWL_FA_TOO_MANY;
249 /* Store for "fewer than desired" on later beacon */ 249 /* Store for "fewer than desired" on later beacon */
250 data->nrg_silence_ref = silence_ref; 250 data->nrg_silence_ref = silence_ref;
@@ -266,7 +266,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
266 data->nrg_auto_corr_silence_diff = (s32)data->nrg_silence_ref - 266 data->nrg_auto_corr_silence_diff = (s32)data->nrg_silence_ref -
267 (s32)silence_ref; 267 (s32)silence_ref;
268 268
269 IWL_DEBUG_CALIB("norm FA %u < min FA %u, silence diff %d\n", 269 IWL_DEBUG_CALIB(priv, "norm FA %u < min FA %u, silence diff %d\n",
270 false_alarms, min_false_alarms, 270 false_alarms, min_false_alarms,
271 data->nrg_auto_corr_silence_diff); 271 data->nrg_auto_corr_silence_diff);
272 272
@@ -280,17 +280,17 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
280 ((data->nrg_auto_corr_silence_diff > NRG_DIFF) || 280 ((data->nrg_auto_corr_silence_diff > NRG_DIFF) ||
281 (data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA))) { 281 (data->num_in_cck_no_fa > MAX_NUMBER_CCK_NO_FA))) {
282 282
283 IWL_DEBUG_CALIB("... increasing sensitivity\n"); 283 IWL_DEBUG_CALIB(priv, "... increasing sensitivity\n");
284 /* Increase nrg value to increase sensitivity */ 284 /* Increase nrg value to increase sensitivity */
285 val = data->nrg_th_cck + NRG_STEP_CCK; 285 val = data->nrg_th_cck + NRG_STEP_CCK;
286 data->nrg_th_cck = min((u32)ranges->min_nrg_cck, val); 286 data->nrg_th_cck = min((u32)ranges->min_nrg_cck, val);
287 } else { 287 } else {
288 IWL_DEBUG_CALIB("... but not changing sensitivity\n"); 288 IWL_DEBUG_CALIB(priv, "... but not changing sensitivity\n");
289 } 289 }
290 290
291 /* Else we got a healthy number of false alarms, keep status quo */ 291 /* Else we got a healthy number of false alarms, keep status quo */
292 } else { 292 } else {
293 IWL_DEBUG_CALIB(" FA in safe zone\n"); 293 IWL_DEBUG_CALIB(priv, " FA in safe zone\n");
294 data->nrg_curr_state = IWL_FA_GOOD_RANGE; 294 data->nrg_curr_state = IWL_FA_GOOD_RANGE;
295 295
296 /* Store for use in "fewer than desired" with later beacon */ 296 /* Store for use in "fewer than desired" with later beacon */
@@ -300,7 +300,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
300 * give it some extra margin by reducing sensitivity again 300 * give it some extra margin by reducing sensitivity again
301 * (but don't go below measured energy of desired Rx) */ 301 * (but don't go below measured energy of desired Rx) */
302 if (IWL_FA_TOO_MANY == data->nrg_prev_state) { 302 if (IWL_FA_TOO_MANY == data->nrg_prev_state) {
303 IWL_DEBUG_CALIB("... increasing margin\n"); 303 IWL_DEBUG_CALIB(priv, "... increasing margin\n");
304 if (data->nrg_th_cck > (max_nrg_cck + NRG_MARGIN)) 304 if (data->nrg_th_cck > (max_nrg_cck + NRG_MARGIN))
305 data->nrg_th_cck -= NRG_MARGIN; 305 data->nrg_th_cck -= NRG_MARGIN;
306 else 306 else
@@ -314,7 +314,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
314 * Lower value is higher energy, so we use max()! 314 * Lower value is higher energy, so we use max()!
315 */ 315 */
316 data->nrg_th_cck = max(max_nrg_cck, data->nrg_th_cck); 316 data->nrg_th_cck = max(max_nrg_cck, data->nrg_th_cck);
317 IWL_DEBUG_CALIB("new nrg_th_cck %u\n", data->nrg_th_cck); 317 IWL_DEBUG_CALIB(priv, "new nrg_th_cck %u\n", data->nrg_th_cck);
318 318
319 data->nrg_prev_state = data->nrg_curr_state; 319 data->nrg_prev_state = data->nrg_curr_state;
320 320
@@ -367,7 +367,7 @@ static int iwl_sens_auto_corr_ofdm(struct iwl_priv *priv,
367 /* If we got too many false alarms this time, reduce sensitivity */ 367 /* If we got too many false alarms this time, reduce sensitivity */
368 if (false_alarms > max_false_alarms) { 368 if (false_alarms > max_false_alarms) {
369 369
370 IWL_DEBUG_CALIB("norm FA %u > max FA %u)\n", 370 IWL_DEBUG_CALIB(priv, "norm FA %u > max FA %u)\n",
371 false_alarms, max_false_alarms); 371 false_alarms, max_false_alarms);
372 372
373 val = data->auto_corr_ofdm + AUTO_CORR_STEP_OFDM; 373 val = data->auto_corr_ofdm + AUTO_CORR_STEP_OFDM;
@@ -390,7 +390,7 @@ static int iwl_sens_auto_corr_ofdm(struct iwl_priv *priv,
390 /* Else if we got fewer than desired, increase sensitivity */ 390 /* Else if we got fewer than desired, increase sensitivity */
391 else if (false_alarms < min_false_alarms) { 391 else if (false_alarms < min_false_alarms) {
392 392
393 IWL_DEBUG_CALIB("norm FA %u < min FA %u\n", 393 IWL_DEBUG_CALIB(priv, "norm FA %u < min FA %u\n",
394 false_alarms, min_false_alarms); 394 false_alarms, min_false_alarms);
395 395
396 val = data->auto_corr_ofdm - AUTO_CORR_STEP_OFDM; 396 val = data->auto_corr_ofdm - AUTO_CORR_STEP_OFDM;
@@ -409,7 +409,7 @@ static int iwl_sens_auto_corr_ofdm(struct iwl_priv *priv,
409 data->auto_corr_ofdm_mrc_x1 = 409 data->auto_corr_ofdm_mrc_x1 =
410 max((u32)ranges->auto_corr_min_ofdm_mrc_x1, val); 410 max((u32)ranges->auto_corr_min_ofdm_mrc_x1, val);
411 } else { 411 } else {
412 IWL_DEBUG_CALIB("min FA %u < norm FA %u < max FA %u OK\n", 412 IWL_DEBUG_CALIB(priv, "min FA %u < norm FA %u < max FA %u OK\n",
413 min_false_alarms, false_alarms, max_false_alarms); 413 min_false_alarms, false_alarms, max_false_alarms);
414 } 414 }
415 return 0; 415 return 0;
@@ -458,12 +458,12 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)
458 cmd.table[HD_OFDM_ENERGY_TH_IN_INDEX] = 458 cmd.table[HD_OFDM_ENERGY_TH_IN_INDEX] =
459 __constant_cpu_to_le16(62); 459 __constant_cpu_to_le16(62);
460 460
461 IWL_DEBUG_CALIB("ofdm: ac %u mrc %u x1 %u mrc_x1 %u thresh %u\n", 461 IWL_DEBUG_CALIB(priv, "ofdm: ac %u mrc %u x1 %u mrc_x1 %u thresh %u\n",
462 data->auto_corr_ofdm, data->auto_corr_ofdm_mrc, 462 data->auto_corr_ofdm, data->auto_corr_ofdm_mrc,
463 data->auto_corr_ofdm_x1, data->auto_corr_ofdm_mrc_x1, 463 data->auto_corr_ofdm_x1, data->auto_corr_ofdm_mrc_x1,
464 data->nrg_th_ofdm); 464 data->nrg_th_ofdm);
465 465
466 IWL_DEBUG_CALIB("cck: ac %u mrc %u thresh %u\n", 466 IWL_DEBUG_CALIB(priv, "cck: ac %u mrc %u thresh %u\n",
467 data->auto_corr_cck, data->auto_corr_cck_mrc, 467 data->auto_corr_cck, data->auto_corr_cck_mrc,
468 data->nrg_th_cck); 468 data->nrg_th_cck);
469 469
@@ -473,7 +473,7 @@ static int iwl_sensitivity_write(struct iwl_priv *priv)
473 /* Don't send command to uCode if nothing has changed */ 473 /* Don't send command to uCode if nothing has changed */
474 if (!memcmp(&cmd.table[0], &(priv->sensitivity_tbl[0]), 474 if (!memcmp(&cmd.table[0], &(priv->sensitivity_tbl[0]),
475 sizeof(u16)*HD_TABLE_SIZE)) { 475 sizeof(u16)*HD_TABLE_SIZE)) {
476 IWL_DEBUG_CALIB("No change in SENSITIVITY_CMD\n"); 476 IWL_DEBUG_CALIB(priv, "No change in SENSITIVITY_CMD\n");
477 return 0; 477 return 0;
478 } 478 }
479 479
@@ -498,7 +498,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
498 if (priv->disable_sens_cal) 498 if (priv->disable_sens_cal)
499 return; 499 return;
500 500
501 IWL_DEBUG_CALIB("Start iwl_init_sensitivity\n"); 501 IWL_DEBUG_CALIB(priv, "Start iwl_init_sensitivity\n");
502 502
503 /* Clear driver's sensitivity algo data */ 503 /* Clear driver's sensitivity algo data */
504 data = &(priv->sensitivity_data); 504 data = &(priv->sensitivity_data);
@@ -536,7 +536,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
536 data->last_fa_cnt_cck = 0; 536 data->last_fa_cnt_cck = 0;
537 537
538 ret |= iwl_sensitivity_write(priv); 538 ret |= iwl_sensitivity_write(priv);
539 IWL_DEBUG_CALIB("<<return 0x%X\n", ret); 539 IWL_DEBUG_CALIB(priv, "<<return 0x%X\n", ret);
540} 540}
541EXPORT_SYMBOL(iwl_init_sensitivity); 541EXPORT_SYMBOL(iwl_init_sensitivity);
542 542
@@ -562,13 +562,13 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
562 data = &(priv->sensitivity_data); 562 data = &(priv->sensitivity_data);
563 563
564 if (!iwl_is_associated(priv)) { 564 if (!iwl_is_associated(priv)) {
565 IWL_DEBUG_CALIB("<< - not associated\n"); 565 IWL_DEBUG_CALIB(priv, "<< - not associated\n");
566 return; 566 return;
567 } 567 }
568 568
569 spin_lock_irqsave(&priv->lock, flags); 569 spin_lock_irqsave(&priv->lock, flags);
570 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { 570 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
571 IWL_DEBUG_CALIB("<< invalid data.\n"); 571 IWL_DEBUG_CALIB(priv, "<< invalid data.\n");
572 spin_unlock_irqrestore(&priv->lock, flags); 572 spin_unlock_irqrestore(&priv->lock, flags);
573 return; 573 return;
574 } 574 }
@@ -595,10 +595,10 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
595 595
596 spin_unlock_irqrestore(&priv->lock, flags); 596 spin_unlock_irqrestore(&priv->lock, flags);
597 597
598 IWL_DEBUG_CALIB("rx_enable_time = %u usecs\n", rx_enable_time); 598 IWL_DEBUG_CALIB(priv, "rx_enable_time = %u usecs\n", rx_enable_time);
599 599
600 if (!rx_enable_time) { 600 if (!rx_enable_time) {
601 IWL_DEBUG_CALIB("<< RX Enable Time == 0! \n"); 601 IWL_DEBUG_CALIB(priv, "<< RX Enable Time == 0! \n");
602 return; 602 return;
603 } 603 }
604 604
@@ -637,7 +637,7 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
637 norm_fa_ofdm = fa_ofdm + bad_plcp_ofdm; 637 norm_fa_ofdm = fa_ofdm + bad_plcp_ofdm;
638 norm_fa_cck = fa_cck + bad_plcp_cck; 638 norm_fa_cck = fa_cck + bad_plcp_cck;
639 639
640 IWL_DEBUG_CALIB("cck: fa %u badp %u ofdm: fa %u badp %u\n", fa_cck, 640 IWL_DEBUG_CALIB(priv, "cck: fa %u badp %u ofdm: fa %u badp %u\n", fa_cck,
641 bad_plcp_cck, fa_ofdm, bad_plcp_ofdm); 641 bad_plcp_cck, fa_ofdm, bad_plcp_ofdm);
642 642
643 iwl_sens_auto_corr_ofdm(priv, norm_fa_ofdm, rx_enable_time); 643 iwl_sens_auto_corr_ofdm(priv, norm_fa_ofdm, rx_enable_time);
@@ -690,13 +690,13 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
690 * then we're done forever. */ 690 * then we're done forever. */
691 if (data->state != IWL_CHAIN_NOISE_ACCUMULATE) { 691 if (data->state != IWL_CHAIN_NOISE_ACCUMULATE) {
692 if (data->state == IWL_CHAIN_NOISE_ALIVE) 692 if (data->state == IWL_CHAIN_NOISE_ALIVE)
693 IWL_DEBUG_CALIB("Wait for noise calib reset\n"); 693 IWL_DEBUG_CALIB(priv, "Wait for noise calib reset\n");
694 return; 694 return;
695 } 695 }
696 696
697 spin_lock_irqsave(&priv->lock, flags); 697 spin_lock_irqsave(&priv->lock, flags);
698 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { 698 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
699 IWL_DEBUG_CALIB(" << Interference data unavailable\n"); 699 IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n");
700 spin_unlock_irqrestore(&priv->lock, flags); 700 spin_unlock_irqrestore(&priv->lock, flags);
701 return; 701 return;
702 } 702 }
@@ -709,7 +709,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
709 /* Make sure we accumulate data for just the associated channel 709 /* Make sure we accumulate data for just the associated channel
710 * (even if scanning). */ 710 * (even if scanning). */
711 if ((rxon_chnum != stat_chnum) || (rxon_band24 != stat_band24)) { 711 if ((rxon_chnum != stat_chnum) || (rxon_band24 != stat_band24)) {
712 IWL_DEBUG_CALIB("Stats not from chan=%d, band24=%d\n", 712 IWL_DEBUG_CALIB(priv, "Stats not from chan=%d, band24=%d\n",
713 rxon_chnum, rxon_band24); 713 rxon_chnum, rxon_band24);
714 spin_unlock_irqrestore(&priv->lock, flags); 714 spin_unlock_irqrestore(&priv->lock, flags);
715 return; 715 return;
@@ -739,11 +739,11 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
739 data->chain_signal_b = (chain_sig_b + data->chain_signal_b); 739 data->chain_signal_b = (chain_sig_b + data->chain_signal_b);
740 data->chain_signal_c = (chain_sig_c + data->chain_signal_c); 740 data->chain_signal_c = (chain_sig_c + data->chain_signal_c);
741 741
742 IWL_DEBUG_CALIB("chan=%d, band24=%d, beacon=%d\n", 742 IWL_DEBUG_CALIB(priv, "chan=%d, band24=%d, beacon=%d\n",
743 rxon_chnum, rxon_band24, data->beacon_count); 743 rxon_chnum, rxon_band24, data->beacon_count);
744 IWL_DEBUG_CALIB("chain_sig: a %d b %d c %d\n", 744 IWL_DEBUG_CALIB(priv, "chain_sig: a %d b %d c %d\n",
745 chain_sig_a, chain_sig_b, chain_sig_c); 745 chain_sig_a, chain_sig_b, chain_sig_c);
746 IWL_DEBUG_CALIB("chain_noise: a %d b %d c %d\n", 746 IWL_DEBUG_CALIB(priv, "chain_noise: a %d b %d c %d\n",
747 chain_noise_a, chain_noise_b, chain_noise_c); 747 chain_noise_a, chain_noise_b, chain_noise_c);
748 748
749 /* If this is the 20th beacon, determine: 749 /* If this is the 20th beacon, determine:
@@ -773,9 +773,9 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
773 active_chains = (1 << max_average_sig_antenna_i); 773 active_chains = (1 << max_average_sig_antenna_i);
774 } 774 }
775 775
776 IWL_DEBUG_CALIB("average_sig: a %d b %d c %d\n", 776 IWL_DEBUG_CALIB(priv, "average_sig: a %d b %d c %d\n",
777 average_sig[0], average_sig[1], average_sig[2]); 777 average_sig[0], average_sig[1], average_sig[2]);
778 IWL_DEBUG_CALIB("max_average_sig = %d, antenna %d\n", 778 IWL_DEBUG_CALIB(priv, "max_average_sig = %d, antenna %d\n",
779 max_average_sig, max_average_sig_antenna_i); 779 max_average_sig, max_average_sig_antenna_i);
780 780
781 /* Compare signal strengths for all 3 receivers. */ 781 /* Compare signal strengths for all 3 receivers. */
@@ -789,7 +789,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
789 data->disconn_array[i] = 1; 789 data->disconn_array[i] = 1;
790 else 790 else
791 active_chains |= (1 << i); 791 active_chains |= (1 << i);
792 IWL_DEBUG_CALIB("i = %d rssiDelta = %d " 792 IWL_DEBUG_CALIB(priv, "i = %d rssiDelta = %d "
793 "disconn_array[i] = %d\n", 793 "disconn_array[i] = %d\n",
794 i, rssi_delta, data->disconn_array[i]); 794 i, rssi_delta, data->disconn_array[i]);
795 } 795 }
@@ -813,7 +813,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
813 * disconnected connect it anyway */ 813 * disconnected connect it anyway */
814 data->disconn_array[i] = 0; 814 data->disconn_array[i] = 0;
815 active_chains |= ant_msk; 815 active_chains |= ant_msk;
816 IWL_DEBUG_CALIB("All Tx chains are disconnected W/A - " 816 IWL_DEBUG_CALIB(priv, "All Tx chains are disconnected W/A - "
817 "declare %d as connected\n", i); 817 "declare %d as connected\n", i);
818 break; 818 break;
819 } 819 }
@@ -821,7 +821,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
821 821
822 /* Save for use within RXON, TX, SCAN commands, etc. */ 822 /* Save for use within RXON, TX, SCAN commands, etc. */
823 priv->chain_noise_data.active_chains = active_chains; 823 priv->chain_noise_data.active_chains = active_chains;
824 IWL_DEBUG_CALIB("active_chains (bitwise) = 0x%x\n", 824 IWL_DEBUG_CALIB(priv, "active_chains (bitwise) = 0x%x\n",
825 active_chains); 825 active_chains);
826 826
827 /* Analyze noise for rx balance */ 827 /* Analyze noise for rx balance */
@@ -839,11 +839,11 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
839 } 839 }
840 } 840 }
841 841
842 IWL_DEBUG_CALIB("average_noise: a %d b %d c %d\n", 842 IWL_DEBUG_CALIB(priv, "average_noise: a %d b %d c %d\n",
843 average_noise[0], average_noise[1], 843 average_noise[0], average_noise[1],
844 average_noise[2]); 844 average_noise[2]);
845 845
846 IWL_DEBUG_CALIB("min_average_noise = %d, antenna %d\n", 846 IWL_DEBUG_CALIB(priv, "min_average_noise = %d, antenna %d\n",
847 min_average_noise, min_average_noise_antenna_i); 847 min_average_noise, min_average_noise_antenna_i);
848 848
849 priv->cfg->ops->utils->gain_computation(priv, average_noise, 849 priv->cfg->ops->utils->gain_computation(priv, average_noise,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 4f2b88c59c71..5f92cfbe9267 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -323,7 +323,7 @@ void iwl_reset_qos(struct iwl_priv *priv)
323 priv->qos_data.def_qos_parm.ac[i].reserved1 = 0; 323 priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
324 } 324 }
325 } 325 }
326 IWL_DEBUG_QOS("set QoS to default \n"); 326 IWL_DEBUG_QOS(priv, "set QoS to default \n");
327 327
328 spin_unlock_irqrestore(&priv->lock, flags); 328 spin_unlock_irqrestore(&priv->lock, flags);
329} 329}
@@ -419,7 +419,7 @@ int iwlcore_init_geos(struct iwl_priv *priv)
419 419
420 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates || 420 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
421 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) { 421 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
422 IWL_DEBUG_INFO("Geography modes already initialized.\n"); 422 IWL_DEBUG_INFO(priv, "Geography modes already initialized.\n");
423 set_bit(STATUS_GEO_CONFIGURED, &priv->status); 423 set_bit(STATUS_GEO_CONFIGURED, &priv->status);
424 return 0; 424 return 0;
425 } 425 }
@@ -501,7 +501,7 @@ int iwlcore_init_geos(struct iwl_priv *priv)
501 /* Save flags for reg domain usage */ 501 /* Save flags for reg domain usage */
502 geo_ch->orig_flags = geo_ch->flags; 502 geo_ch->orig_flags = geo_ch->flags;
503 503
504 IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0x%X\n", 504 IWL_DEBUG_INFO(priv, "Channel %d Freq=%d[%sGHz] %s flag=0x%X\n",
505 ch->channel, geo_ch->center_freq, 505 ch->channel, geo_ch->center_freq,
506 is_channel_a_band(ch) ? "5.2" : "2.4", 506 is_channel_a_band(ch) ? "5.2" : "2.4",
507 geo_ch->flags & IEEE80211_CHAN_DISABLED ? 507 geo_ch->flags & IEEE80211_CHAN_DISABLED ?
@@ -790,7 +790,7 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
790 790
791 iwl_set_rxon_chain(priv); 791 iwl_set_rxon_chain(priv);
792 792
793 IWL_DEBUG_ASSOC("supported HT rate 0x%X 0x%X 0x%X " 793 IWL_DEBUG_ASSOC(priv, "supported HT rate 0x%X 0x%X 0x%X "
794 "rxon flags 0x%X operation mode :0x%X " 794 "rxon flags 0x%X operation mode :0x%X "
795 "extension channel offset 0x%x\n", 795 "extension channel offset 0x%x\n",
796 ht_info->mcs.rx_mask[0], 796 ht_info->mcs.rx_mask[0],
@@ -936,7 +936,7 @@ void iwl_set_rxon_chain(struct iwl_priv *priv)
936 else 936 else
937 priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; 937 priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK;
938 938
939 IWL_DEBUG_ASSOC("rx_chain=0x%X active=%d idle=%d\n", 939 IWL_DEBUG_ASSOC(priv, "rx_chain=0x%X active=%d idle=%d\n",
940 priv->staging_rxon.rx_chain, 940 priv->staging_rxon.rx_chain,
941 active_rx_cnt, idle_rx_cnt); 941 active_rx_cnt, idle_rx_cnt);
942 942
@@ -961,7 +961,7 @@ int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch)
961 u16 channel = ieee80211_frequency_to_channel(ch->center_freq); 961 u16 channel = ieee80211_frequency_to_channel(ch->center_freq);
962 962
963 if (!iwl_get_channel_info(priv, band, channel)) { 963 if (!iwl_get_channel_info(priv, band, channel)) {
964 IWL_DEBUG_INFO("Could not set channel to %d [%d]\n", 964 IWL_DEBUG_INFO(priv, "Could not set channel to %d [%d]\n",
965 channel, band); 965 channel, band);
966 return -EINVAL; 966 return -EINVAL;
967 } 967 }
@@ -978,7 +978,7 @@ int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch)
978 978
979 priv->band = band; 979 priv->band = band;
980 980
981 IWL_DEBUG_INFO("Staging channel set to %d [%d]\n", channel, band); 981 IWL_DEBUG_INFO(priv, "Staging channel set to %d [%d]\n", channel, band);
982 982
983 return 0; 983 return 0;
984} 984}
@@ -1108,7 +1108,7 @@ void iwl_set_rate(struct iwl_priv *priv)
1108 priv->active_rate |= (1 << rate->hw_value); 1108 priv->active_rate |= (1 << rate->hw_value);
1109 } 1109 }
1110 1110
1111 IWL_DEBUG_RATE("Set active_rate = %0x, active_rate_basic = %0x\n", 1111 IWL_DEBUG_RATE(priv, "Set active_rate = %0x, active_rate_basic = %0x\n",
1112 priv->active_rate, priv->active_rate_basic); 1112 priv->active_rate, priv->active_rate_basic);
1113 1113
1114 /* 1114 /*
@@ -1140,7 +1140,7 @@ void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
1140 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 1140 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
1141 struct iwl_rxon_cmd *rxon = (void *)&priv->active_rxon; 1141 struct iwl_rxon_cmd *rxon = (void *)&priv->active_rxon;
1142 struct iwl_csa_notification *csa = &(pkt->u.csa_notif); 1142 struct iwl_csa_notification *csa = &(pkt->u.csa_notif);
1143 IWL_DEBUG_11H("CSA notif: channel %d, status %d\n", 1143 IWL_DEBUG_11H(priv, "CSA notif: channel %d, status %d\n",
1144 le16_to_cpu(csa->channel), le32_to_cpu(csa->status)); 1144 le16_to_cpu(csa->channel), le32_to_cpu(csa->status));
1145 rxon->channel = csa->channel; 1145 rxon->channel = csa->channel;
1146 priv->staging_rxon.channel = csa->channel; 1146 priv->staging_rxon.channel = csa->channel;
@@ -1152,19 +1152,19 @@ static void iwl_print_rx_config_cmd(struct iwl_priv *priv)
1152{ 1152{
1153 struct iwl_rxon_cmd *rxon = &priv->staging_rxon; 1153 struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
1154 1154
1155 IWL_DEBUG_RADIO("RX CONFIG:\n"); 1155 IWL_DEBUG_RADIO(priv, "RX CONFIG:\n");
1156 iwl_print_hex_dump(priv, IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); 1156 iwl_print_hex_dump(priv, IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
1157 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); 1157 IWL_DEBUG_RADIO(priv, "u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
1158 IWL_DEBUG_RADIO("u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags)); 1158 IWL_DEBUG_RADIO(priv, "u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags));
1159 IWL_DEBUG_RADIO("u32 filter_flags: 0x%08x\n", 1159 IWL_DEBUG_RADIO(priv, "u32 filter_flags: 0x%08x\n",
1160 le32_to_cpu(rxon->filter_flags)); 1160 le32_to_cpu(rxon->filter_flags));
1161 IWL_DEBUG_RADIO("u8 dev_type: 0x%x\n", rxon->dev_type); 1161 IWL_DEBUG_RADIO(priv, "u8 dev_type: 0x%x\n", rxon->dev_type);
1162 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n", 1162 IWL_DEBUG_RADIO(priv, "u8 ofdm_basic_rates: 0x%02x\n",
1163 rxon->ofdm_basic_rates); 1163 rxon->ofdm_basic_rates);
1164 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates); 1164 IWL_DEBUG_RADIO(priv, "u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
1165 IWL_DEBUG_RADIO("u8[6] node_addr: %pM\n", rxon->node_addr); 1165 IWL_DEBUG_RADIO(priv, "u8[6] node_addr: %pM\n", rxon->node_addr);
1166 IWL_DEBUG_RADIO("u8[6] bssid_addr: %pM\n", rxon->bssid_addr); 1166 IWL_DEBUG_RADIO(priv, "u8[6] bssid_addr: %pM\n", rxon->bssid_addr);
1167 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id)); 1167 IWL_DEBUG_RADIO(priv, "u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
1168} 1168}
1169#endif 1169#endif
1170 1170
@@ -1194,7 +1194,7 @@ void iwl_irq_handle_error(struct iwl_priv *priv)
1194 clear_bit(STATUS_READY, &priv->status); 1194 clear_bit(STATUS_READY, &priv->status);
1195 1195
1196 if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) { 1196 if (!test_bit(STATUS_EXIT_PENDING, &priv->status)) {
1197 IWL_DEBUG(IWL_DL_FW_ERRORS, 1197 IWL_DEBUG(priv, IWL_DL_FW_ERRORS,
1198 "Restarting adapter due to uCode error.\n"); 1198 "Restarting adapter due to uCode error.\n");
1199 1199
1200 if (iwl_is_associated(priv)) { 1200 if (iwl_is_associated(priv)) {
@@ -1216,7 +1216,7 @@ void iwl_configure_filter(struct ieee80211_hw *hw,
1216 struct iwl_priv *priv = hw->priv; 1216 struct iwl_priv *priv = hw->priv;
1217 __le32 *filter_flags = &priv->staging_rxon.filter_flags; 1217 __le32 *filter_flags = &priv->staging_rxon.filter_flags;
1218 1218
1219 IWL_DEBUG_MAC80211("Enter: changed: 0x%x, total: 0x%x\n", 1219 IWL_DEBUG_MAC80211(priv, "Enter: changed: 0x%x, total: 0x%x\n",
1220 changed_flags, *total_flags); 1220 changed_flags, *total_flags);
1221 1221
1222 if (changed_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) { 1222 if (changed_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) {
@@ -1429,13 +1429,13 @@ void iwl_disable_interrupts(struct iwl_priv *priv)
1429 * from uCode or flow handler (Rx/Tx DMA) */ 1429 * from uCode or flow handler (Rx/Tx DMA) */
1430 iwl_write32(priv, CSR_INT, 0xffffffff); 1430 iwl_write32(priv, CSR_INT, 0xffffffff);
1431 iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff); 1431 iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff);
1432 IWL_DEBUG_ISR("Disabled interrupts\n"); 1432 IWL_DEBUG_ISR(priv, "Disabled interrupts\n");
1433} 1433}
1434EXPORT_SYMBOL(iwl_disable_interrupts); 1434EXPORT_SYMBOL(iwl_disable_interrupts);
1435 1435
1436void iwl_enable_interrupts(struct iwl_priv *priv) 1436void iwl_enable_interrupts(struct iwl_priv *priv)
1437{ 1437{
1438 IWL_DEBUG_ISR("Enabling interrupts\n"); 1438 IWL_DEBUG_ISR(priv, "Enabling interrupts\n");
1439 set_bit(STATUS_INT_ENABLED, &priv->status); 1439 set_bit(STATUS_INT_ENABLED, &priv->status);
1440 iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK); 1440 iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK);
1441} 1441}
@@ -1481,7 +1481,7 @@ static int iwlcore_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32
1481 u32 errcnt = 0; 1481 u32 errcnt = 0;
1482 u32 i; 1482 u32 i;
1483 1483
1484 IWL_DEBUG_INFO("ucode inst image size is %u\n", len); 1484 IWL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len);
1485 1485
1486 ret = iwl_grab_nic_access(priv); 1486 ret = iwl_grab_nic_access(priv);
1487 if (ret) 1487 if (ret)
@@ -1519,7 +1519,7 @@ static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 *image,
1519 int ret = 0; 1519 int ret = 0;
1520 u32 errcnt; 1520 u32 errcnt;
1521 1521
1522 IWL_DEBUG_INFO("ucode inst image size is %u\n", len); 1522 IWL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len);
1523 1523
1524 ret = iwl_grab_nic_access(priv); 1524 ret = iwl_grab_nic_access(priv);
1525 if (ret) 1525 if (ret)
@@ -1548,8 +1548,8 @@ static int iwl_verify_inst_full(struct iwl_priv *priv, __le32 *image,
1548 iwl_release_nic_access(priv); 1548 iwl_release_nic_access(priv);
1549 1549
1550 if (!errcnt) 1550 if (!errcnt)
1551 IWL_DEBUG_INFO 1551 IWL_DEBUG_INFO(priv,
1552 ("ucode image in INSTRUCTION memory is good\n"); 1552 "ucode image in INSTRUCTION memory is good\n");
1553 1553
1554 return ret; 1554 return ret;
1555} 1555}
@@ -1569,7 +1569,7 @@ int iwl_verify_ucode(struct iwl_priv *priv)
1569 len = priv->ucode_boot.len; 1569 len = priv->ucode_boot.len;
1570 ret = iwlcore_verify_inst_sparse(priv, image, len); 1570 ret = iwlcore_verify_inst_sparse(priv, image, len);
1571 if (!ret) { 1571 if (!ret) {
1572 IWL_DEBUG_INFO("Bootstrap uCode is good in inst SRAM\n"); 1572 IWL_DEBUG_INFO(priv, "Bootstrap uCode is good in inst SRAM\n");
1573 return 0; 1573 return 0;
1574 } 1574 }
1575 1575
@@ -1578,7 +1578,7 @@ int iwl_verify_ucode(struct iwl_priv *priv)
1578 len = priv->ucode_init.len; 1578 len = priv->ucode_init.len;
1579 ret = iwlcore_verify_inst_sparse(priv, image, len); 1579 ret = iwlcore_verify_inst_sparse(priv, image, len);
1580 if (!ret) { 1580 if (!ret) {
1581 IWL_DEBUG_INFO("Initialize uCode is good in inst SRAM\n"); 1581 IWL_DEBUG_INFO(priv, "Initialize uCode is good in inst SRAM\n");
1582 return 0; 1582 return 0;
1583 } 1583 }
1584 1584
@@ -1587,7 +1587,7 @@ int iwl_verify_ucode(struct iwl_priv *priv)
1587 len = priv->ucode_code.len; 1587 len = priv->ucode_code.len;
1588 ret = iwlcore_verify_inst_sparse(priv, image, len); 1588 ret = iwlcore_verify_inst_sparse(priv, image, len);
1589 if (!ret) { 1589 if (!ret) {
1590 IWL_DEBUG_INFO("Runtime uCode is good in inst SRAM\n"); 1590 IWL_DEBUG_INFO(priv, "Runtime uCode is good in inst SRAM\n");
1591 return 0; 1591 return 0;
1592 } 1592 }
1593 1593
@@ -1827,7 +1827,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1827 if (ret) 1827 if (ret)
1828 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n"); 1828 IWL_ERR(priv, "REPLY_CT_KILL_CONFIG_CMD failed\n");
1829 else 1829 else
1830 IWL_DEBUG_INFO("REPLY_CT_KILL_CONFIG_CMD succeeded, " 1830 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD succeeded, "
1831 "critical temperature is %d\n", 1831 "critical temperature is %d\n",
1832 cmd.critical_temperature_R); 1832 cmd.critical_temperature_R);
1833} 1833}
@@ -1864,7 +1864,7 @@ void iwl_radio_kill_sw_disable_radio(struct iwl_priv *priv)
1864 if (test_bit(STATUS_RF_KILL_SW, &priv->status)) 1864 if (test_bit(STATUS_RF_KILL_SW, &priv->status))
1865 return; 1865 return;
1866 1866
1867 IWL_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO OFF\n"); 1867 IWL_DEBUG_RF_KILL(priv, "Manual SW RF KILL set to: RADIO OFF\n");
1868 1868
1869 iwl_scan_cancel(priv); 1869 iwl_scan_cancel(priv);
1870 /* FIXME: This is a workaround for AP */ 1870 /* FIXME: This is a workaround for AP */
@@ -1893,7 +1893,7 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
1893 if (!test_bit(STATUS_RF_KILL_SW, &priv->status)) 1893 if (!test_bit(STATUS_RF_KILL_SW, &priv->status))
1894 return 0; 1894 return 0;
1895 1895
1896 IWL_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO ON\n"); 1896 IWL_DEBUG_RF_KILL(priv, "Manual SW RF KILL set to: RADIO ON\n");
1897 1897
1898 spin_lock_irqsave(&priv->lock, flags); 1898 spin_lock_irqsave(&priv->lock, flags);
1899 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); 1899 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
@@ -1918,7 +1918,7 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
1918 spin_unlock_irqrestore(&priv->lock, flags); 1918 spin_unlock_irqrestore(&priv->lock, flags);
1919 1919
1920 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) { 1920 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
1921 IWL_DEBUG_RF_KILL("Can not turn radio back on - " 1921 IWL_DEBUG_RF_KILL(priv, "Can not turn radio back on - "
1922 "disabled by HW switch\n"); 1922 "disabled by HW switch\n");
1923 return 0; 1923 return 0;
1924 } 1924 }
@@ -1953,7 +1953,7 @@ void iwl_bg_rf_kill(struct work_struct *work)
1953 mutex_lock(&priv->mutex); 1953 mutex_lock(&priv->mutex);
1954 1954
1955 if (!iwl_is_rfkill(priv)) { 1955 if (!iwl_is_rfkill(priv)) {
1956 IWL_DEBUG(IWL_DL_RF_KILL, 1956 IWL_DEBUG_RF_KILL(priv,
1957 "HW and/or SW RF Kill no longer active, restarting " 1957 "HW and/or SW RF Kill no longer active, restarting "
1958 "device\n"); 1958 "device\n");
1959 if (!test_bit(STATUS_EXIT_PENDING, &priv->status) && 1959 if (!test_bit(STATUS_EXIT_PENDING, &priv->status) &&
@@ -1965,7 +1965,7 @@ void iwl_bg_rf_kill(struct work_struct *work)
1965 ieee80211_stop_queues(priv->hw); 1965 ieee80211_stop_queues(priv->hw);
1966 1966
1967 if (!test_bit(STATUS_RF_KILL_HW, &priv->status)) 1967 if (!test_bit(STATUS_RF_KILL_HW, &priv->status))
1968 IWL_DEBUG_RF_KILL("Can not turn radio back on - " 1968 IWL_DEBUG_RF_KILL(priv, "Can not turn radio back on - "
1969 "disabled by SW switch\n"); 1969 "disabled by SW switch\n");
1970 else 1970 else
1971 IWL_WARN(priv, "Radio Frequency Kill Switch is On:\n" 1971 IWL_WARN(priv, "Radio Frequency Kill Switch is On:\n"
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 7192d3249caf..65d1a7f2db9e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -37,18 +37,20 @@ struct iwl_priv;
37#define IWL_CRIT(p, f, a...) dev_crit(&((p)->pci_dev->dev), f, ## a) 37#define IWL_CRIT(p, f, a...) dev_crit(&((p)->pci_dev->dev), f, ## a)
38 38
39#ifdef CONFIG_IWLWIFI_DEBUG 39#ifdef CONFIG_IWLWIFI_DEBUG
40#define IWL_DEBUG(level, fmt, args...) \ 40#define IWL_DEBUG(__priv, level, fmt, args...) \
41do { \ 41do { \
42 if (priv->debug_level & (level)) \ 42 if (__priv->debug_level & (level)) \
43 dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ 43 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \
44 in_interrupt() ? 'I' : 'U', __func__ , ## args); \ 44 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
45 __func__ , ## args); \
45} while (0) 46} while (0)
46 47
47#define IWL_DEBUG_LIMIT(level, fmt, args...) \ 48#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) \
48do { \ 49do { \
49 if ((priv->debug_level & (level)) && net_ratelimit()) \ 50 if ((__priv->debug_level & (level)) && net_ratelimit()) \
50 dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ 51 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \
51 in_interrupt() ? 'I' : 'U', __func__ , ## args); \ 52 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
53 __func__ , ## args); \
52} while (0) 54} while (0)
53 55
54#define iwl_print_hex_dump(priv, level, p, len) \ 56#define iwl_print_hex_dump(priv, level, p, len) \
@@ -88,8 +90,8 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv);
88#endif 90#endif
89 91
90#else 92#else
91#define IWL_DEBUG(level, fmt, args...) 93#define IWL_DEBUG(__priv, level, fmt, args...)
92#define IWL_DEBUG_LIMIT(level, fmt, args...) 94#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
93static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level, 95static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
94 void *p, u32 len) 96 void *p, u32 len)
95{} 97{}
@@ -169,42 +171,45 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)
169#define IWL_DL_TX_REPLY (1 << 30) 171#define IWL_DL_TX_REPLY (1 << 30)
170#define IWL_DL_QOS (1 << 31) 172#define IWL_DL_QOS (1 << 31)
171 173
172#define IWL_DEBUG_INFO(f, a...) IWL_DEBUG(IWL_DL_INFO, f, ## a) 174#define IWL_DEBUG_INFO(p, f, a...) IWL_DEBUG(p, IWL_DL_INFO, f, ## a)
173#define IWL_DEBUG_MAC80211(f, a...) IWL_DEBUG(IWL_DL_MAC80211, f, ## a) 175#define IWL_DEBUG_MAC80211(p, f, a...) IWL_DEBUG(p, IWL_DL_MAC80211, f, ## a)
174#define IWL_DEBUG_MACDUMP(f, a...) IWL_DEBUG(IWL_DL_MACDUMP, f, ## a) 176#define IWL_DEBUG_MACDUMP(p, f, a...) IWL_DEBUG(p, IWL_DL_MACDUMP, f, ## a)
175#define IWL_DEBUG_TEMP(f, a...) IWL_DEBUG(IWL_DL_TEMP, f, ## a) 177#define IWL_DEBUG_TEMP(p, f, a...) IWL_DEBUG(p, IWL_DL_TEMP, f, ## a)
176#define IWL_DEBUG_SCAN(f, a...) IWL_DEBUG(IWL_DL_SCAN, f, ## a) 178#define IWL_DEBUG_SCAN(p, f, a...) IWL_DEBUG(p, IWL_DL_SCAN, f, ## a)
177#define IWL_DEBUG_RX(f, a...) IWL_DEBUG(IWL_DL_RX, f, ## a) 179#define IWL_DEBUG_RX(p, f, a...) IWL_DEBUG(p, IWL_DL_RX, f, ## a)
178#define IWL_DEBUG_TX(f, a...) IWL_DEBUG(IWL_DL_TX, f, ## a) 180#define IWL_DEBUG_TX(p, f, a...) IWL_DEBUG(p, IWL_DL_TX, f, ## a)
179#define IWL_DEBUG_ISR(f, a...) IWL_DEBUG(IWL_DL_ISR, f, ## a) 181#define IWL_DEBUG_ISR(p, f, a...) IWL_DEBUG(p, IWL_DL_ISR, f, ## a)
180#define IWL_DEBUG_LED(f, a...) IWL_DEBUG(IWL_DL_LED, f, ## a) 182#define IWL_DEBUG_LED(p, f, a...) IWL_DEBUG(p, IWL_DL_LED, f, ## a)
181#define IWL_DEBUG_WEP(f, a...) IWL_DEBUG(IWL_DL_WEP, f, ## a) 183#define IWL_DEBUG_WEP(p, f, a...) IWL_DEBUG(p, IWL_DL_WEP, f, ## a)
182#define IWL_DEBUG_HC(f, a...) IWL_DEBUG(IWL_DL_HCMD, f, ## a) 184#define IWL_DEBUG_HC(p, f, a...) IWL_DEBUG(p, IWL_DL_HCMD, f, ## a)
183#define IWL_DEBUG_HC_DUMP(f, a...) IWL_DEBUG(IWL_DL_HCMD_DUMP, f, ## a) 185#define IWL_DEBUG_HC_DUMP(p, f, a...) IWL_DEBUG(p, IWL_DL_HCMD_DUMP, f, ## a)
184#define IWL_DEBUG_CALIB(f, a...) IWL_DEBUG(IWL_DL_CALIB, f, ## a) 186#define IWL_DEBUG_CALIB(p, f, a...) IWL_DEBUG(p, IWL_DL_CALIB, f, ## a)
185#define IWL_DEBUG_FW(f, a...) IWL_DEBUG(IWL_DL_FW, f, ## a) 187#define IWL_DEBUG_FW(p, f, a...) IWL_DEBUG(p, IWL_DL_FW, f, ## a)
186#define IWL_DEBUG_RF_KILL(f, a...) IWL_DEBUG(IWL_DL_RF_KILL, f, ## a) 188#define IWL_DEBUG_RF_KILL(p, f, a...) IWL_DEBUG(p, IWL_DL_RF_KILL, f, ## a)
187#define IWL_DEBUG_DROP(f, a...) IWL_DEBUG(IWL_DL_DROP, f, ## a) 189#define IWL_DEBUG_DROP(p, f, a...) IWL_DEBUG(p, IWL_DL_DROP, f, ## a)
188#define IWL_DEBUG_DROP_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_DROP, f, ## a) 190#define IWL_DEBUG_DROP_LIMIT(p, f, a...) \
189#define IWL_DEBUG_AP(f, a...) IWL_DEBUG(IWL_DL_AP, f, ## a) 191 IWL_DEBUG_LIMIT(p, IWL_DL_DROP, f, ## a)
190#define IWL_DEBUG_TXPOWER(f, a...) IWL_DEBUG(IWL_DL_TXPOWER, f, ## a) 192#define IWL_DEBUG_AP(p, f, a...) IWL_DEBUG(p, IWL_DL_AP, f, ## a)
191#define IWL_DEBUG_IO(f, a...) IWL_DEBUG(IWL_DL_IO, f, ## a) 193#define IWL_DEBUG_TXPOWER(p, f, a...) IWL_DEBUG(p, IWL_DL_TXPOWER, f, ## a)
192#define IWL_DEBUG_RATE(f, a...) IWL_DEBUG(IWL_DL_RATE, f, ## a) 194#define IWL_DEBUG_IO(p, f, a...) IWL_DEBUG(p, IWL_DL_IO, f, ## a)
193#define IWL_DEBUG_RATE_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_RATE, f, ## a) 195#define IWL_DEBUG_RATE(p, f, a...) IWL_DEBUG(p, IWL_DL_RATE, f, ## a)
194#define IWL_DEBUG_NOTIF(f, a...) IWL_DEBUG(IWL_DL_NOTIF, f, ## a) 196#define IWL_DEBUG_RATE_LIMIT(p, f, a...) \
195#define IWL_DEBUG_ASSOC(f, a...) \ 197 IWL_DEBUG_LIMIT(p, IWL_DL_RATE, f, ## a)
196 IWL_DEBUG(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) 198#define IWL_DEBUG_NOTIF(p, f, a...) IWL_DEBUG(p, IWL_DL_NOTIF, f, ## a)
197#define IWL_DEBUG_ASSOC_LIMIT(f, a...) \ 199#define IWL_DEBUG_ASSOC(p, f, a...) \
198 IWL_DEBUG_LIMIT(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) 200 IWL_DEBUG(p, IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
199#define IWL_DEBUG_HT(f, a...) IWL_DEBUG(IWL_DL_HT, f, ## a) 201#define IWL_DEBUG_ASSOC_LIMIT(p, f, a...) \
200#define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a) 202 IWL_DEBUG_LIMIT(p, IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
201#define IWL_DEBUG_STATS_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_STATS, f, ## a) 203#define IWL_DEBUG_HT(p, f, a...) IWL_DEBUG(p, IWL_DL_HT, f, ## a)
202#define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a) 204#define IWL_DEBUG_STATS(p, f, a...) IWL_DEBUG(p, IWL_DL_STATS, f, ## a)
203#define IWL_DEBUG_TX_REPLY_LIMIT(f, a...) \ 205#define IWL_DEBUG_STATS_LIMIT(p, f, a...) \
204 IWL_DEBUG_LIMIT(IWL_DL_TX_REPLY, f, ## a) 206 IWL_DEBUG_LIMIT(p, IWL_DL_STATS, f, ## a)
205#define IWL_DEBUG_QOS(f, a...) IWL_DEBUG(IWL_DL_QOS, f, ## a) 207#define IWL_DEBUG_TX_REPLY(p, f, a...) IWL_DEBUG(p, IWL_DL_TX_REPLY, f, ## a)
206#define IWL_DEBUG_RADIO(f, a...) IWL_DEBUG(IWL_DL_RADIO, f, ## a) 208#define IWL_DEBUG_TX_REPLY_LIMIT(p, f, a...) \
207#define IWL_DEBUG_POWER(f, a...) IWL_DEBUG(IWL_DL_POWER, f, ## a) 209 IWL_DEBUG_LIMIT(p, IWL_DL_TX_REPLY, f, ## a)
208#define IWL_DEBUG_11H(f, a...) IWL_DEBUG(IWL_DL_11H, f, ## a) 210#define IWL_DEBUG_QOS(p, f, a...) IWL_DEBUG(p, IWL_DL_QOS, f, ## a)
211#define IWL_DEBUG_RADIO(p, f, a...) IWL_DEBUG(p, IWL_DL_RADIO, f, ## a)
212#define IWL_DEBUG_POWER(p, f, a...) IWL_DEBUG(p, IWL_DL_POWER, f, ## a)
213#define IWL_DEBUG_11H(p, f, a...) IWL_DEBUG(p, IWL_DL_11H, f, ## a)
209 214
210#endif 215#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index eaa658f9e54c..d1d1d9bcfeae 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -173,7 +173,7 @@ int iwlcore_eeprom_acquire_semaphore(struct iwl_priv *priv)
173 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM, 173 CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM,
174 EEPROM_SEM_TIMEOUT); 174 EEPROM_SEM_TIMEOUT);
175 if (ret >= 0) { 175 if (ret >= 0) {
176 IWL_DEBUG_IO("Acquired semaphore after %d tries.\n", 176 IWL_DEBUG_IO(priv, "Acquired semaphore after %d tries.\n",
177 count+1); 177 count+1);
178 return ret; 178 return ret;
179 } 179 }
@@ -390,7 +390,7 @@ static int iwl_set_fat_chan_info(struct iwl_priv *priv,
390 if (!is_channel_valid(ch_info)) 390 if (!is_channel_valid(ch_info))
391 return -1; 391 return -1;
392 392
393 IWL_DEBUG_INFO("FAT Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):" 393 IWL_DEBUG_INFO(priv, "FAT Ch. %d [%sGHz] %s%s%s%s%s(0x%02x %ddBm):"
394 " Ad-Hoc %ssupported\n", 394 " Ad-Hoc %ssupported\n",
395 ch_info->channel, 395 ch_info->channel,
396 is_channel_a_band(ch_info) ? 396 is_channel_a_band(ch_info) ?
@@ -432,11 +432,11 @@ int iwl_init_channel_map(struct iwl_priv *priv)
432 struct iwl_channel_info *ch_info; 432 struct iwl_channel_info *ch_info;
433 433
434 if (priv->channel_count) { 434 if (priv->channel_count) {
435 IWL_DEBUG_INFO("Channel map already initialized.\n"); 435 IWL_DEBUG_INFO(priv, "Channel map already initialized.\n");
436 return 0; 436 return 0;
437 } 437 }
438 438
439 IWL_DEBUG_INFO("Initializing regulatory info from EEPROM\n"); 439 IWL_DEBUG_INFO(priv, "Initializing regulatory info from EEPROM\n");
440 440
441 priv->channel_count = 441 priv->channel_count =
442 ARRAY_SIZE(iwl_eeprom_band_1) + 442 ARRAY_SIZE(iwl_eeprom_band_1) +
@@ -445,7 +445,7 @@ int iwl_init_channel_map(struct iwl_priv *priv)
445 ARRAY_SIZE(iwl_eeprom_band_4) + 445 ARRAY_SIZE(iwl_eeprom_band_4) +
446 ARRAY_SIZE(iwl_eeprom_band_5); 446 ARRAY_SIZE(iwl_eeprom_band_5);
447 447
448 IWL_DEBUG_INFO("Parsing data for %d channels.\n", priv->channel_count); 448 IWL_DEBUG_INFO(priv, "Parsing data for %d channels.\n", priv->channel_count);
449 449
450 priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) * 450 priv->channel_info = kzalloc(sizeof(struct iwl_channel_info) *
451 priv->channel_count, GFP_KERNEL); 451 priv->channel_count, GFP_KERNEL);
@@ -485,7 +485,7 @@ int iwl_init_channel_map(struct iwl_priv *priv)
485 IEEE80211_CHAN_NO_FAT_BELOW); 485 IEEE80211_CHAN_NO_FAT_BELOW);
486 486
487 if (!(is_channel_valid(ch_info))) { 487 if (!(is_channel_valid(ch_info))) {
488 IWL_DEBUG_INFO("Ch. %d Flags %x [%sGHz] - " 488 IWL_DEBUG_INFO(priv, "Ch. %d Flags %x [%sGHz] - "
489 "No traffic\n", 489 "No traffic\n",
490 ch_info->channel, 490 ch_info->channel,
491 ch_info->flags, 491 ch_info->flags,
@@ -501,7 +501,7 @@ int iwl_init_channel_map(struct iwl_priv *priv)
501 ch_info->scan_power = eeprom_ch_info[ch].max_power_avg; 501 ch_info->scan_power = eeprom_ch_info[ch].max_power_avg;
502 ch_info->min_power = 0; 502 ch_info->min_power = 0;
503 503
504 IWL_DEBUG_INFO("Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x %ddBm):" 504 IWL_DEBUG_INFO(priv, "Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x %ddBm):"
505 " Ad-Hoc %ssupported\n", 505 " Ad-Hoc %ssupported\n",
506 ch_info->channel, 506 ch_info->channel,
507 is_channel_a_band(ch_info) ? 507 is_channel_a_band(ch_info) ?
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index 65ae2af61c8d..17d61ac8ed61 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -125,11 +125,11 @@ static int iwl_generic_cmd_callback(struct iwl_priv *priv,
125 switch (cmd->hdr.cmd) { 125 switch (cmd->hdr.cmd) {
126 case REPLY_TX_LINK_QUALITY_CMD: 126 case REPLY_TX_LINK_QUALITY_CMD:
127 case SENSITIVITY_CMD: 127 case SENSITIVITY_CMD:
128 IWL_DEBUG_HC_DUMP("back from %s (0x%08X)\n", 128 IWL_DEBUG_HC_DUMP(priv, "back from %s (0x%08X)\n",
129 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); 129 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
130 break; 130 break;
131 default: 131 default:
132 IWL_DEBUG_HC("back from %s (0x%08X)\n", 132 IWL_DEBUG_HC(priv, "back from %s (0x%08X)\n",
133 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); 133 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
134 } 134 }
135#endif 135#endif
@@ -211,13 +211,13 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
211 } 211 }
212 212
213 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) { 213 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
214 IWL_DEBUG_INFO("Command %s aborted: RF KILL Switch\n", 214 IWL_DEBUG_INFO(priv, "Command %s aborted: RF KILL Switch\n",
215 get_cmd_string(cmd->id)); 215 get_cmd_string(cmd->id));
216 ret = -ECANCELED; 216 ret = -ECANCELED;
217 goto fail; 217 goto fail;
218 } 218 }
219 if (test_bit(STATUS_FW_ERROR, &priv->status)) { 219 if (test_bit(STATUS_FW_ERROR, &priv->status)) {
220 IWL_DEBUG_INFO("Command %s failed: FW Error\n", 220 IWL_DEBUG_INFO(priv, "Command %s failed: FW Error\n",
221 get_cmd_string(cmd->id)); 221 get_cmd_string(cmd->id));
222 ret = -EIO; 222 ret = -EIO;
223 goto fail; 223 goto fail;
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h
index 7341a2da8431..c7b8e5bb4e42 100644
--- a/drivers/net/wireless/iwlwifi/iwl-io.h
+++ b/drivers/net/wireless/iwlwifi/iwl-io.h
@@ -66,7 +66,7 @@
66static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *priv, 66static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *priv,
67 u32 ofs, u32 val) 67 u32 ofs, u32 val)
68{ 68{
69 IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l); 69 IWL_DEBUG_IO(priv, "write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l);
70 _iwl_write32(priv, ofs, val); 70 _iwl_write32(priv, ofs, val);
71} 71}
72#define iwl_write32(priv, ofs, val) \ 72#define iwl_write32(priv, ofs, val) \
@@ -79,7 +79,7 @@ static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *priv,
79#ifdef CONFIG_IWLWIFI_DEBUG 79#ifdef CONFIG_IWLWIFI_DEBUG
80static inline u32 __iwl_read32(char *f, u32 l, struct iwl_priv *priv, u32 ofs) 80static inline u32 __iwl_read32(char *f, u32 l, struct iwl_priv *priv, u32 ofs)
81{ 81{
82 IWL_DEBUG_IO("read_direct32(0x%08X) - %s %d\n", ofs, f, l); 82 IWL_DEBUG_IO(priv, "read_direct32(0x%08X) - %s %d\n", ofs, f, l);
83 return _iwl_read32(priv, ofs); 83 return _iwl_read32(priv, ofs);
84} 84}
85#define iwl_read32(priv, ofs) __iwl_read32(__FILE__, __LINE__, priv, ofs) 85#define iwl_read32(priv, ofs) __iwl_read32(__FILE__, __LINE__, priv, ofs)
@@ -108,7 +108,7 @@ static inline int __iwl_poll_bit(const char *f, u32 l,
108 u32 bits, u32 mask, int timeout) 108 u32 bits, u32 mask, int timeout)
109{ 109{
110 int ret = _iwl_poll_bit(priv, addr, bits, mask, timeout); 110 int ret = _iwl_poll_bit(priv, addr, bits, mask, timeout);
111 IWL_DEBUG_IO("poll_bit(0x%08X, 0x%08X, 0x%08X) - %s- %s %d\n", 111 IWL_DEBUG_IO(priv, "poll_bit(0x%08X, 0x%08X, 0x%08X) - %s- %s %d\n",
112 addr, bits, mask, 112 addr, bits, mask,
113 unlikely(ret == -ETIMEDOUT) ? "timeout" : "", f, l); 113 unlikely(ret == -ETIMEDOUT) ? "timeout" : "", f, l);
114 return ret; 114 return ret;
@@ -128,7 +128,7 @@ static inline void __iwl_set_bit(const char *f, u32 l,
128 struct iwl_priv *priv, u32 reg, u32 mask) 128 struct iwl_priv *priv, u32 reg, u32 mask)
129{ 129{
130 u32 val = _iwl_read32(priv, reg) | mask; 130 u32 val = _iwl_read32(priv, reg) | mask;
131 IWL_DEBUG_IO("set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val); 131 IWL_DEBUG_IO(priv, "set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
132 _iwl_write32(priv, reg, val); 132 _iwl_write32(priv, reg, val);
133} 133}
134#define iwl_set_bit(p, r, m) __iwl_set_bit(__FILE__, __LINE__, p, r, m) 134#define iwl_set_bit(p, r, m) __iwl_set_bit(__FILE__, __LINE__, p, r, m)
@@ -145,7 +145,7 @@ static inline void __iwl_clear_bit(const char *f, u32 l,
145 struct iwl_priv *priv, u32 reg, u32 mask) 145 struct iwl_priv *priv, u32 reg, u32 mask)
146{ 146{
147 u32 val = _iwl_read32(priv, reg) & ~mask; 147 u32 val = _iwl_read32(priv, reg) & ~mask;
148 IWL_DEBUG_IO("clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val); 148 IWL_DEBUG_IO(priv, "clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
149 _iwl_write32(priv, reg, val); 149 _iwl_write32(priv, reg, val);
150} 150}
151#define iwl_clear_bit(p, r, m) __iwl_clear_bit(__FILE__, __LINE__, p, r, m) 151#define iwl_clear_bit(p, r, m) __iwl_clear_bit(__FILE__, __LINE__, p, r, m)
@@ -184,7 +184,7 @@ static inline int __iwl_grab_nic_access(const char *f, u32 l,
184 if (atomic_read(&priv->restrict_refcnt)) 184 if (atomic_read(&priv->restrict_refcnt))
185 IWL_ERR(priv, "Grabbing access while already held %s %d.\n", f, l); 185 IWL_ERR(priv, "Grabbing access while already held %s %d.\n", f, l);
186 186
187 IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l); 187 IWL_DEBUG_IO(priv, "grabbing nic access - %s %d\n", f, l);
188 return _iwl_grab_nic_access(priv); 188 return _iwl_grab_nic_access(priv);
189} 189}
190#define iwl_grab_nic_access(priv) \ 190#define iwl_grab_nic_access(priv) \
@@ -209,7 +209,7 @@ static inline void __iwl_release_nic_access(const char *f, u32 l,
209 if (atomic_read(&priv->restrict_refcnt) <= 0) 209 if (atomic_read(&priv->restrict_refcnt) <= 0)
210 IWL_ERR(priv, "Release unheld nic access at line %s %d.\n", f, l); 210 IWL_ERR(priv, "Release unheld nic access at line %s %d.\n", f, l);
211 211
212 IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l); 212 IWL_DEBUG_IO(priv, "releasing nic access - %s %d\n", f, l);
213 _iwl_release_nic_access(priv); 213 _iwl_release_nic_access(priv);
214} 214}
215#define iwl_release_nic_access(priv) \ 215#define iwl_release_nic_access(priv) \
@@ -230,7 +230,7 @@ static inline u32 __iwl_read_direct32(const char *f, u32 l,
230 u32 value = _iwl_read_direct32(priv, reg); 230 u32 value = _iwl_read_direct32(priv, reg);
231 if (!atomic_read(&priv->restrict_refcnt)) 231 if (!atomic_read(&priv->restrict_refcnt))
232 IWL_ERR(priv, "Nic access not held from %s %d\n", f, l); 232 IWL_ERR(priv, "Nic access not held from %s %d\n", f, l);
233 IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value, 233 IWL_DEBUG_IO(priv, "read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value,
234 f, l); 234 f, l);
235 return value; 235 return value;
236} 236}
@@ -284,10 +284,10 @@ static inline int __iwl_poll_direct_bit(const char *f, u32 l,
284 int ret = _iwl_poll_direct_bit(priv, addr, mask, timeout); 284 int ret = _iwl_poll_direct_bit(priv, addr, mask, timeout);
285 285
286 if (unlikely(ret == -ETIMEDOUT)) 286 if (unlikely(ret == -ETIMEDOUT))
287 IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - " 287 IWL_DEBUG_IO(priv, "poll_direct_bit(0x%08X, 0x%08X) - "
288 "timedout - %s %d\n", addr, mask, f, l); 288 "timedout - %s %d\n", addr, mask, f, l);
289 else 289 else
290 IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) = 0x%08X " 290 IWL_DEBUG_IO(priv, "poll_direct_bit(0x%08X, 0x%08X) = 0x%08X "
291 "- %s %d\n", addr, mask, ret, f, l); 291 "- %s %d\n", addr, mask, ret, f, l);
292 return ret; 292 return ret;
293} 293}
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index 501cffeff5f2..63d669ec20c6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -123,7 +123,7 @@ static int iwl4965_led_pattern(struct iwl_priv *priv, int led_id,
123/* Set led register off */ 123/* Set led register off */
124static int iwl4965_led_on_reg(struct iwl_priv *priv, int led_id) 124static int iwl4965_led_on_reg(struct iwl_priv *priv, int led_id)
125{ 125{
126 IWL_DEBUG_LED("led on %d\n", led_id); 126 IWL_DEBUG_LED(priv, "led on %d\n", led_id);
127 iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON); 127 iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
128 return 0; 128 return 0;
129} 129}
@@ -150,7 +150,7 @@ int iwl4965_led_off(struct iwl_priv *priv, int led_id)
150 .off = 0, 150 .off = 0,
151 .interval = IWL_DEF_LED_INTRVL 151 .interval = IWL_DEF_LED_INTRVL
152 }; 152 };
153 IWL_DEBUG_LED("led off %d\n", led_id); 153 IWL_DEBUG_LED(priv, "led off %d\n", led_id);
154 return iwl_send_led_cmd(priv, &led_cmd); 154 return iwl_send_led_cmd(priv, &led_cmd);
155} 155}
156#endif 156#endif
@@ -159,7 +159,7 @@ int iwl4965_led_off(struct iwl_priv *priv, int led_id)
159/* Set led register off */ 159/* Set led register off */
160static int iwl4965_led_off_reg(struct iwl_priv *priv, int led_id) 160static int iwl4965_led_off_reg(struct iwl_priv *priv, int led_id)
161{ 161{
162 IWL_DEBUG_LED("LED Reg off\n"); 162 IWL_DEBUG_LED(priv, "LED Reg off\n");
163 iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF); 163 iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF);
164 return 0; 164 return 0;
165} 165}
@@ -169,7 +169,7 @@ static int iwl4965_led_off_reg(struct iwl_priv *priv, int led_id)
169 */ 169 */
170static int iwl_led_associate(struct iwl_priv *priv, int led_id) 170static int iwl_led_associate(struct iwl_priv *priv, int led_id)
171{ 171{
172 IWL_DEBUG_LED("Associated\n"); 172 IWL_DEBUG_LED(priv, "Associated\n");
173 priv->allow_blinking = 1; 173 priv->allow_blinking = 1;
174 return iwl4965_led_on_reg(priv, led_id); 174 return iwl4965_led_on_reg(priv, led_id);
175} 175}
@@ -213,7 +213,7 @@ static void iwl_led_brightness_set(struct led_classdev *led_cdev,
213 return; 213 return;
214 214
215 215
216 IWL_DEBUG_LED("Led type = %s brightness = %d\n", 216 IWL_DEBUG_LED(priv, "Led type = %s brightness = %d\n",
217 led_type_str[led->type], brightness); 217 led_type_str[led->type], brightness);
218 switch (brightness) { 218 switch (brightness) {
219 case LED_FULL: 219 case LED_FULL:
@@ -280,7 +280,7 @@ static int iwl_get_blink_rate(struct iwl_priv *priv)
280 if (tpt < 0) /* wraparound */ 280 if (tpt < 0) /* wraparound */
281 tpt = -tpt; 281 tpt = -tpt;
282 282
283 IWL_DEBUG_LED("tpt %lld current_tpt %llu\n", 283 IWL_DEBUG_LED(priv, "tpt %lld current_tpt %llu\n",
284 (long long)tpt, 284 (long long)tpt,
285 (unsigned long long)current_tpt); 285 (unsigned long long)current_tpt);
286 priv->led_tpt = current_tpt; 286 priv->led_tpt = current_tpt;
@@ -292,7 +292,7 @@ static int iwl_get_blink_rate(struct iwl_priv *priv)
292 if (tpt > (blink_tbl[i].tpt * IWL_1MB_RATE)) 292 if (tpt > (blink_tbl[i].tpt * IWL_1MB_RATE))
293 break; 293 break;
294 294
295 IWL_DEBUG_LED("LED BLINK IDX=%d\n", i); 295 IWL_DEBUG_LED(priv, "LED BLINK IDX=%d\n", i);
296 return i; 296 return i;
297} 297}
298 298
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index a4634595c59f..abe0d2966a56 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -149,7 +149,7 @@ static void iwl_power_init_handle(struct iwl_priv *priv)
149 int i; 149 int i;
150 u16 pci_pm; 150 u16 pci_pm;
151 151
152 IWL_DEBUG_POWER("Initialize power \n"); 152 IWL_DEBUG_POWER(priv, "Initialize power \n");
153 153
154 pow_data = &priv->power_data; 154 pow_data = &priv->power_data;
155 155
@@ -161,7 +161,7 @@ static void iwl_power_init_handle(struct iwl_priv *priv)
161 161
162 pci_read_config_word(priv->pci_dev, PCI_CFG_LINK_CTRL, &pci_pm); 162 pci_read_config_word(priv->pci_dev, PCI_CFG_LINK_CTRL, &pci_pm);
163 163
164 IWL_DEBUG_POWER("adjust power command flags\n"); 164 IWL_DEBUG_POWER(priv, "adjust power command flags\n");
165 165
166 for (i = 0; i < IWL_POWER_MAX; i++) { 166 for (i = 0; i < IWL_POWER_MAX; i++) {
167 cmd = &pow_data->pwr_range_0[i].cmd; 167 cmd = &pow_data->pwr_range_0[i].cmd;
@@ -185,7 +185,7 @@ static int iwl_update_power_cmd(struct iwl_priv *priv,
185 bool skip; 185 bool skip;
186 186
187 if (mode > IWL_POWER_INDEX_5) { 187 if (mode > IWL_POWER_INDEX_5) {
188 IWL_DEBUG_POWER("Error invalid power mode \n"); 188 IWL_DEBUG_POWER(priv, "Error invalid power mode \n");
189 return -EINVAL; 189 return -EINVAL;
190 } 190 }
191 191
@@ -225,10 +225,10 @@ static int iwl_update_power_cmd(struct iwl_priv *priv,
225 if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep) 225 if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep)
226 cmd->sleep_interval[i] = cpu_to_le32(max_sleep); 226 cmd->sleep_interval[i] = cpu_to_le32(max_sleep);
227 227
228 IWL_DEBUG_POWER("Flags value = 0x%08X\n", cmd->flags); 228 IWL_DEBUG_POWER(priv, "Flags value = 0x%08X\n", cmd->flags);
229 IWL_DEBUG_POWER("Tx timeout = %u\n", le32_to_cpu(cmd->tx_data_timeout)); 229 IWL_DEBUG_POWER(priv, "Tx timeout = %u\n", le32_to_cpu(cmd->tx_data_timeout));
230 IWL_DEBUG_POWER("Rx timeout = %u\n", le32_to_cpu(cmd->rx_data_timeout)); 230 IWL_DEBUG_POWER(priv, "Rx timeout = %u\n", le32_to_cpu(cmd->rx_data_timeout));
231 IWL_DEBUG_POWER("Sleep interval vector = { %d , %d , %d , %d , %d }\n", 231 IWL_DEBUG_POWER(priv, "Sleep interval vector = { %d , %d , %d , %d , %d }\n",
232 le32_to_cpu(cmd->sleep_interval[0]), 232 le32_to_cpu(cmd->sleep_interval[0]),
233 le32_to_cpu(cmd->sleep_interval[1]), 233 le32_to_cpu(cmd->sleep_interval[1]),
234 le32_to_cpu(cmd->sleep_interval[2]), 234 le32_to_cpu(cmd->sleep_interval[2]),
@@ -302,7 +302,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
302 if (priv->cfg->ops->lib->update_chain_flags && update_chains) 302 if (priv->cfg->ops->lib->update_chain_flags && update_chains)
303 priv->cfg->ops->lib->update_chain_flags(priv); 303 priv->cfg->ops->lib->update_chain_flags(priv);
304 else 304 else
305 IWL_DEBUG_POWER("Cannot update the power, chain noise " 305 IWL_DEBUG_POWER(priv, "Cannot update the power, chain noise "
306 "calibration running: %d\n", 306 "calibration running: %d\n",
307 priv->chain_noise_data.state); 307 priv->chain_noise_data.state);
308 if (!ret) 308 if (!ret)
@@ -423,7 +423,7 @@ static void iwl_bg_set_power_save(struct work_struct *work)
423{ 423{
424 struct iwl_priv *priv = container_of(work, 424 struct iwl_priv *priv = container_of(work,
425 struct iwl_priv, set_power_save.work); 425 struct iwl_priv, set_power_save.work);
426 IWL_DEBUG(IWL_DL_STATE, "update power\n"); 426 IWL_DEBUG_POWER(priv, "update power\n");
427 427
428 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 428 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
429 return; 429 return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
index f67d7be10748..2ad9faf1508a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
@@ -47,7 +47,7 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
47 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 47 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
48 return 0; 48 return 0;
49 49
50 IWL_DEBUG_RF_KILL("we received soft RFKILL set to state %d\n", state); 50 IWL_DEBUG_RF_KILL(priv, "we received soft RFKILL set to state %d\n", state);
51 mutex_lock(&priv->mutex); 51 mutex_lock(&priv->mutex);
52 52
53 switch (state) { 53 switch (state) {
@@ -79,7 +79,7 @@ int iwl_rfkill_init(struct iwl_priv *priv)
79 79
80 BUG_ON(device == NULL); 80 BUG_ON(device == NULL);
81 81
82 IWL_DEBUG_RF_KILL("Initializing RFKILL.\n"); 82 IWL_DEBUG_RF_KILL(priv, "Initializing RFKILL.\n");
83 priv->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN); 83 priv->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN);
84 if (!priv->rfkill) { 84 if (!priv->rfkill) {
85 IWL_ERR(priv, "Unable to allocate RFKILL device.\n"); 85 IWL_ERR(priv, "Unable to allocate RFKILL device.\n");
@@ -102,7 +102,7 @@ int iwl_rfkill_init(struct iwl_priv *priv)
102 goto free_rfkill; 102 goto free_rfkill;
103 } 103 }
104 104
105 IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n"); 105 IWL_DEBUG_RF_KILL(priv, "RFKILL initialization complete.\n");
106 return ret; 106 return ret;
107 107
108free_rfkill: 108free_rfkill:
@@ -111,7 +111,7 @@ free_rfkill:
111 priv->rfkill = NULL; 111 priv->rfkill = NULL;
112 112
113error: 113error:
114 IWL_DEBUG_RF_KILL("RFKILL initialization complete.\n"); 114 IWL_DEBUG_RF_KILL(priv, "RFKILL initialization complete.\n");
115 return ret; 115 return ret;
116} 116}
117EXPORT_SYMBOL(iwl_rfkill_init); 117EXPORT_SYMBOL(iwl_rfkill_init);
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index c8865d0b9067..8f65908f66f1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -494,7 +494,7 @@ void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
494 494
495 missed_beacon = &pkt->u.missed_beacon; 495 missed_beacon = &pkt->u.missed_beacon;
496 if (le32_to_cpu(missed_beacon->consequtive_missed_beacons) > 5) { 496 if (le32_to_cpu(missed_beacon->consequtive_missed_beacons) > 5) {
497 IWL_DEBUG_CALIB("missed bcn cnsq %d totl %d rcd %d expctd %d\n", 497 IWL_DEBUG_CALIB(priv, "missed bcn cnsq %d totl %d rcd %d expctd %d\n",
498 le32_to_cpu(missed_beacon->consequtive_missed_beacons), 498 le32_to_cpu(missed_beacon->consequtive_missed_beacons),
499 le32_to_cpu(missed_beacon->total_missed_becons), 499 le32_to_cpu(missed_beacon->total_missed_becons),
500 le32_to_cpu(missed_beacon->num_recvd_beacons), 500 le32_to_cpu(missed_beacon->num_recvd_beacons),
@@ -541,7 +541,7 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv)
541 else 541 else
542 priv->last_rx_noise = IWL_NOISE_MEAS_NOT_AVAILABLE; 542 priv->last_rx_noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
543 543
544 IWL_DEBUG_CALIB("inband silence a %u, b %u, c %u, dBm %d\n", 544 IWL_DEBUG_CALIB(priv, "inband silence a %u, b %u, c %u, dBm %d\n",
545 bcn_silence_a, bcn_silence_b, bcn_silence_c, 545 bcn_silence_a, bcn_silence_b, bcn_silence_c,
546 priv->last_rx_noise); 546 priv->last_rx_noise);
547} 547}
@@ -554,7 +554,7 @@ void iwl_rx_statistics(struct iwl_priv *priv,
554 int change; 554 int change;
555 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 555 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
556 556
557 IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n", 557 IWL_DEBUG_RX(priv, "Statistics notification received (%d vs %d).\n",
558 (int)sizeof(priv->statistics), pkt->len); 558 (int)sizeof(priv->statistics), pkt->len);
559 559
560 change = ((priv->statistics.general.temperature != 560 change = ((priv->statistics.general.temperature !=
@@ -741,13 +741,13 @@ static void iwl_dbg_report_frame(struct iwl_priv *priv,
741 * MAC addresses show just the last byte (for brevity), 741 * MAC addresses show just the last byte (for brevity),
742 * but you can hack it to show more, if you'd like to. */ 742 * but you can hack it to show more, if you'd like to. */
743 if (dataframe) 743 if (dataframe)
744 IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " 744 IWL_DEBUG_RX(priv, "%s: mhd=0x%04x, dst=0x%02x, "
745 "len=%u, rssi=%d, chnl=%d, rate=%u, \n", 745 "len=%u, rssi=%d, chnl=%d, rate=%u, \n",
746 title, le16_to_cpu(fc), header->addr1[5], 746 title, le16_to_cpu(fc), header->addr1[5],
747 length, rssi, channel, bitrate); 747 length, rssi, channel, bitrate);
748 else { 748 else {
749 /* src/dst addresses assume managed mode */ 749 /* src/dst addresses assume managed mode */
750 IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, src=0x%02x, " 750 IWL_DEBUG_RX(priv, "%s: 0x%04x, dst=0x%02x, src=0x%02x, "
751 "len=%u, rssi=%d, tim=%lu usec, " 751 "len=%u, rssi=%d, tim=%lu usec, "
752 "phy=0x%02x, chnl=%d\n", 752 "phy=0x%02x, chnl=%d\n",
753 title, le16_to_cpu(fc), header->addr1[5], 753 title, le16_to_cpu(fc), header->addr1[5],
@@ -785,7 +785,7 @@ int iwl_set_decrypted_flag(struct iwl_priv *priv,
785 if (!(fc & IEEE80211_FCTL_PROTECTED)) 785 if (!(fc & IEEE80211_FCTL_PROTECTED))
786 return 0; 786 return 0;
787 787
788 IWL_DEBUG_RX("decrypt_res:0x%x\n", decrypt_res); 788 IWL_DEBUG_RX(priv, "decrypt_res:0x%x\n", decrypt_res);
789 switch (decrypt_res & RX_RES_STATUS_SEC_TYPE_MSK) { 789 switch (decrypt_res & RX_RES_STATUS_SEC_TYPE_MSK) {
790 case RX_RES_STATUS_SEC_TYPE_TKIP: 790 case RX_RES_STATUS_SEC_TYPE_TKIP:
791 /* The uCode has got a bad phase 1 Key, pushes the packet. 791 /* The uCode has got a bad phase 1 Key, pushes the packet.
@@ -799,13 +799,13 @@ int iwl_set_decrypted_flag(struct iwl_priv *priv,
799 RX_RES_STATUS_BAD_ICV_MIC) { 799 RX_RES_STATUS_BAD_ICV_MIC) {
800 /* bad ICV, the packet is destroyed since the 800 /* bad ICV, the packet is destroyed since the
801 * decryption is inplace, drop it */ 801 * decryption is inplace, drop it */
802 IWL_DEBUG_RX("Packet destroyed\n"); 802 IWL_DEBUG_RX(priv, "Packet destroyed\n");
803 return -1; 803 return -1;
804 } 804 }
805 case RX_RES_STATUS_SEC_TYPE_CCMP: 805 case RX_RES_STATUS_SEC_TYPE_CCMP:
806 if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) == 806 if ((decrypt_res & RX_RES_STATUS_DECRYPT_TYPE_MSK) ==
807 RX_RES_STATUS_DECRYPT_OK) { 807 RX_RES_STATUS_DECRYPT_OK) {
808 IWL_DEBUG_RX("hw decrypt successfully!!!\n"); 808 IWL_DEBUG_RX(priv, "hw decrypt successfully!!!\n");
809 stats->flag |= RX_FLAG_DECRYPTED; 809 stats->flag |= RX_FLAG_DECRYPTED;
810 } 810 }
811 break; 811 break;
@@ -870,7 +870,7 @@ static u32 iwl_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
870 break; 870 break;
871 }; 871 };
872 872
873 IWL_DEBUG_RX("decrypt_in:0x%x decrypt_out = 0x%x\n", 873 IWL_DEBUG_RX(priv, "decrypt_in:0x%x decrypt_out = 0x%x\n",
874 decrypt_in, decrypt_out); 874 decrypt_in, decrypt_out);
875 875
876 return decrypt_out; 876 return decrypt_out;
@@ -934,8 +934,8 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
934 934
935 /* We only process data packets if the interface is open */ 935 /* We only process data packets if the interface is open */
936 if (unlikely(!priv->is_open)) { 936 if (unlikely(!priv->is_open)) {
937 IWL_DEBUG_DROP_LIMIT 937 IWL_DEBUG_DROP_LIMIT(priv,
938 ("Dropping packet while interface is not open.\n"); 938 "Dropping packet while interface is not open.\n");
939 return; 939 return;
940 } 940 }
941 941
@@ -1007,7 +1007,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1007 /*rx_status.flag |= RX_FLAG_TSFT;*/ 1007 /*rx_status.flag |= RX_FLAG_TSFT;*/
1008 1008
1009 if ((unlikely(rx_start->cfg_phy_cnt > 20))) { 1009 if ((unlikely(rx_start->cfg_phy_cnt > 20))) {
1010 IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", 1010 IWL_DEBUG_DROP(priv, "dsp size out of range [0,20]: %d/n",
1011 rx_start->cfg_phy_cnt); 1011 rx_start->cfg_phy_cnt);
1012 return; 1012 return;
1013 } 1013 }
@@ -1045,7 +1045,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1045 1045
1046 if (!(*rx_end & RX_RES_STATUS_NO_CRC32_ERROR) || 1046 if (!(*rx_end & RX_RES_STATUS_NO_CRC32_ERROR) ||
1047 !(*rx_end & RX_RES_STATUS_NO_RXE_OVERFLOW)) { 1047 !(*rx_end & RX_RES_STATUS_NO_RXE_OVERFLOW)) {
1048 IWL_DEBUG_RX("Bad CRC or FIFO: 0x%08X.\n", 1048 IWL_DEBUG_RX(priv, "Bad CRC or FIFO: 0x%08X.\n",
1049 le32_to_cpu(*rx_end)); 1049 le32_to_cpu(*rx_end));
1050 return; 1050 return;
1051 } 1051 }
@@ -1078,7 +1078,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1078 if (unlikely(priv->debug_level & IWL_DL_RX)) 1078 if (unlikely(priv->debug_level & IWL_DL_RX))
1079 iwl_dbg_report_frame(priv, rx_start, len, header, 1); 1079 iwl_dbg_report_frame(priv, rx_start, len, header, 1);
1080#endif 1080#endif
1081 IWL_DEBUG_STATS_LIMIT("Rssi %d, noise %d, qual %d, TSF %llu\n", 1081 IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, qual %d, TSF %llu\n",
1082 rx_status.signal, rx_status.noise, rx_status.signal, 1082 rx_status.signal, rx_status.noise, rx_status.signal,
1083 (unsigned long long)rx_status.mactime); 1083 (unsigned long long)rx_status.mactime);
1084 1084
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index c282d1d294e6..22bad3ce7d6a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -70,12 +70,12 @@ int iwl_scan_cancel(struct iwl_priv *priv)
70 70
71 if (test_bit(STATUS_SCANNING, &priv->status)) { 71 if (test_bit(STATUS_SCANNING, &priv->status)) {
72 if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 72 if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
73 IWL_DEBUG_SCAN("Queuing scan abort.\n"); 73 IWL_DEBUG_SCAN(priv, "Queuing scan abort.\n");
74 set_bit(STATUS_SCAN_ABORTING, &priv->status); 74 set_bit(STATUS_SCAN_ABORTING, &priv->status);
75 queue_work(priv->workqueue, &priv->abort_scan); 75 queue_work(priv->workqueue, &priv->abort_scan);
76 76
77 } else 77 } else
78 IWL_DEBUG_SCAN("Scan abort already in progress.\n"); 78 IWL_DEBUG_SCAN(priv, "Scan abort already in progress.\n");
79 79
80 return test_bit(STATUS_SCANNING, &priv->status); 80 return test_bit(STATUS_SCANNING, &priv->status);
81 } 81 }
@@ -140,7 +140,7 @@ int iwl_send_scan_abort(struct iwl_priv *priv)
140 * can occur if we send the scan abort before we 140 * can occur if we send the scan abort before we
141 * the microcode has notified us that a scan is 141 * the microcode has notified us that a scan is
142 * completed. */ 142 * completed. */
143 IWL_DEBUG_INFO("SCAN_ABORT returned %d.\n", res->u.status); 143 IWL_DEBUG_INFO(priv, "SCAN_ABORT returned %d.\n", res->u.status);
144 clear_bit(STATUS_SCAN_ABORTING, &priv->status); 144 clear_bit(STATUS_SCAN_ABORTING, &priv->status);
145 clear_bit(STATUS_SCAN_HW, &priv->status); 145 clear_bit(STATUS_SCAN_HW, &priv->status);
146 } 146 }
@@ -161,7 +161,7 @@ static void iwl_rx_reply_scan(struct iwl_priv *priv,
161 struct iwl_scanreq_notification *notif = 161 struct iwl_scanreq_notification *notif =
162 (struct iwl_scanreq_notification *)pkt->u.raw; 162 (struct iwl_scanreq_notification *)pkt->u.raw;
163 163
164 IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status); 164 IWL_DEBUG_RX(priv, "Scan request status = 0x%x\n", notif->status);
165#endif 165#endif
166} 166}
167 167
@@ -173,7 +173,7 @@ static void iwl_rx_scan_start_notif(struct iwl_priv *priv,
173 struct iwl_scanstart_notification *notif = 173 struct iwl_scanstart_notification *notif =
174 (struct iwl_scanstart_notification *)pkt->u.raw; 174 (struct iwl_scanstart_notification *)pkt->u.raw;
175 priv->scan_start_tsf = le32_to_cpu(notif->tsf_low); 175 priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
176 IWL_DEBUG_SCAN("Scan start: " 176 IWL_DEBUG_SCAN(priv, "Scan start: "
177 "%d [802.11%s] " 177 "%d [802.11%s] "
178 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n", 178 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
179 notif->channel, 179 notif->channel,
@@ -192,7 +192,7 @@ static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
192 struct iwl_scanresults_notification *notif = 192 struct iwl_scanresults_notification *notif =
193 (struct iwl_scanresults_notification *)pkt->u.raw; 193 (struct iwl_scanresults_notification *)pkt->u.raw;
194 194
195 IWL_DEBUG_SCAN("Scan ch.res: " 195 IWL_DEBUG_SCAN(priv, "Scan ch.res: "
196 "%d [802.11%s] " 196 "%d [802.11%s] "
197 "(TSF: 0x%08X:%08X) - %d " 197 "(TSF: 0x%08X:%08X) - %d "
198 "elapsed=%lu usec (%dms since last)\n", 198 "elapsed=%lu usec (%dms since last)\n",
@@ -218,7 +218,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
218 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 218 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
219 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw; 219 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
220 220
221 IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", 221 IWL_DEBUG_SCAN(priv, "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
222 scan_notif->scanned_channels, 222 scan_notif->scanned_channels,
223 scan_notif->tsf_low, 223 scan_notif->tsf_low,
224 scan_notif->tsf_high, scan_notif->status); 224 scan_notif->tsf_high, scan_notif->status);
@@ -230,7 +230,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
230 /* The scan completion notification came in, so kill that timer... */ 230 /* The scan completion notification came in, so kill that timer... */
231 cancel_delayed_work(&priv->scan_check); 231 cancel_delayed_work(&priv->scan_check);
232 232
233 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", 233 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n",
234 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? 234 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
235 "2.4" : "5.2", 235 "2.4" : "5.2",
236 jiffies_to_msecs(elapsed_jiffies 236 jiffies_to_msecs(elapsed_jiffies
@@ -248,7 +248,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
248 * then we reset the scan state machine and terminate, 248 * then we reset the scan state machine and terminate,
249 * re-queuing another scan if one has been requested */ 249 * re-queuing another scan if one has been requested */
250 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 250 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
251 IWL_DEBUG_INFO("Aborted scan completed.\n"); 251 IWL_DEBUG_INFO(priv, "Aborted scan completed.\n");
252 clear_bit(STATUS_SCAN_ABORTING, &priv->status); 252 clear_bit(STATUS_SCAN_ABORTING, &priv->status);
253 } else { 253 } else {
254 /* If there are more bands on this scan pass reschedule */ 254 /* If there are more bands on this scan pass reschedule */
@@ -258,11 +258,11 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
258 258
259 priv->last_scan_jiffies = jiffies; 259 priv->last_scan_jiffies = jiffies;
260 priv->next_scan_jiffies = 0; 260 priv->next_scan_jiffies = 0;
261 IWL_DEBUG_INFO("Setting scan to off\n"); 261 IWL_DEBUG_INFO(priv, "Setting scan to off\n");
262 262
263 clear_bit(STATUS_SCANNING, &priv->status); 263 clear_bit(STATUS_SCANNING, &priv->status);
264 264
265 IWL_DEBUG_INFO("Scan took %dms\n", 265 IWL_DEBUG_INFO(priv, "Scan took %dms\n",
266 jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies))); 266 jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies)));
267 267
268 queue_work(priv->workqueue, &priv->scan_completed); 268 queue_work(priv->workqueue, &priv->scan_completed);
@@ -355,7 +355,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
355 355
356 ch_info = iwl_get_channel_info(priv, band, channel); 356 ch_info = iwl_get_channel_info(priv, band, channel);
357 if (!is_channel_valid(ch_info)) { 357 if (!is_channel_valid(ch_info)) {
358 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n", 358 IWL_DEBUG_SCAN(priv, "Channel %d is INVALID for this band.\n",
359 channel); 359 channel);
360 continue; 360 continue;
361 } 361 }
@@ -384,7 +384,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
384 else 384 else
385 scan_ch->tx_gain = ((1 << 5) | (5 << 3)); 385 scan_ch->tx_gain = ((1 << 5) | (5 << 3));
386 386
387 IWL_DEBUG_SCAN("Scanning ch=%d prob=0x%X [%s %d]\n", 387 IWL_DEBUG_SCAN(priv, "Scanning ch=%d prob=0x%X [%s %d]\n",
388 channel, le32_to_cpu(scan_ch->type), 388 channel, le32_to_cpu(scan_ch->type),
389 (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ? 389 (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ?
390 "ACTIVE" : "PASSIVE", 390 "ACTIVE" : "PASSIVE",
@@ -395,7 +395,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
395 added++; 395 added++;
396 } 396 }
397 397
398 IWL_DEBUG_SCAN("total channels to scan %d \n", added); 398 IWL_DEBUG_SCAN(priv, "total channels to scan %d \n", added);
399 return added; 399 return added;
400} 400}
401 401
@@ -411,21 +411,21 @@ void iwl_init_scan_params(struct iwl_priv *priv)
411int iwl_scan_initiate(struct iwl_priv *priv) 411int iwl_scan_initiate(struct iwl_priv *priv)
412{ 412{
413 if (!iwl_is_ready_rf(priv)) { 413 if (!iwl_is_ready_rf(priv)) {
414 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 414 IWL_DEBUG_SCAN(priv, "Aborting scan due to not ready.\n");
415 return -EIO; 415 return -EIO;
416 } 416 }
417 417
418 if (test_bit(STATUS_SCANNING, &priv->status)) { 418 if (test_bit(STATUS_SCANNING, &priv->status)) {
419 IWL_DEBUG_SCAN("Scan already in progress.\n"); 419 IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
420 return -EAGAIN; 420 return -EAGAIN;
421 } 421 }
422 422
423 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 423 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
424 IWL_DEBUG_SCAN("Scan request while abort pending\n"); 424 IWL_DEBUG_SCAN(priv, "Scan request while abort pending\n");
425 return -EAGAIN; 425 return -EAGAIN;
426 } 426 }
427 427
428 IWL_DEBUG_INFO("Starting scan...\n"); 428 IWL_DEBUG_INFO(priv, "Starting scan...\n");
429 if (priv->cfg->sku & IWL_SKU_G) 429 if (priv->cfg->sku & IWL_SKU_G)
430 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ); 430 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);
431 if (priv->cfg->sku & IWL_SKU_A) 431 if (priv->cfg->sku & IWL_SKU_A)
@@ -453,7 +453,7 @@ void iwl_bg_scan_check(struct work_struct *data)
453 mutex_lock(&priv->mutex); 453 mutex_lock(&priv->mutex);
454 if (test_bit(STATUS_SCANNING, &priv->status) || 454 if (test_bit(STATUS_SCANNING, &priv->status) ||
455 test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 455 test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
456 IWL_DEBUG(IWL_DL_SCAN, "Scan completion watchdog resetting " 456 IWL_DEBUG_SCAN(priv, "Scan completion watchdog resetting "
457 "adapter (%dms)\n", 457 "adapter (%dms)\n",
458 jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG)); 458 jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
459 459
@@ -657,34 +657,34 @@ static void iwl_bg_request_scan(struct work_struct *data)
657 /* This should never be called or scheduled if there is currently 657 /* This should never be called or scheduled if there is currently
658 * a scan active in the hardware. */ 658 * a scan active in the hardware. */
659 if (test_bit(STATUS_SCAN_HW, &priv->status)) { 659 if (test_bit(STATUS_SCAN_HW, &priv->status)) {
660 IWL_DEBUG_INFO("Multiple concurrent scan requests in parallel. " 660 IWL_DEBUG_INFO(priv, "Multiple concurrent scan requests in parallel. "
661 "Ignoring second request.\n"); 661 "Ignoring second request.\n");
662 ret = -EIO; 662 ret = -EIO;
663 goto done; 663 goto done;
664 } 664 }
665 665
666 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) { 666 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
667 IWL_DEBUG_SCAN("Aborting scan due to device shutdown\n"); 667 IWL_DEBUG_SCAN(priv, "Aborting scan due to device shutdown\n");
668 goto done; 668 goto done;
669 } 669 }
670 670
671 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 671 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
672 IWL_DEBUG_HC("Scan request while abort pending. Queuing.\n"); 672 IWL_DEBUG_HC(priv, "Scan request while abort pending. Queuing.\n");
673 goto done; 673 goto done;
674 } 674 }
675 675
676 if (iwl_is_rfkill(priv)) { 676 if (iwl_is_rfkill(priv)) {
677 IWL_DEBUG_HC("Aborting scan due to RF Kill activation\n"); 677 IWL_DEBUG_HC(priv, "Aborting scan due to RF Kill activation\n");
678 goto done; 678 goto done;
679 } 679 }
680 680
681 if (!test_bit(STATUS_READY, &priv->status)) { 681 if (!test_bit(STATUS_READY, &priv->status)) {
682 IWL_DEBUG_HC("Scan request while uninitialized. Queuing.\n"); 682 IWL_DEBUG_HC(priv, "Scan request while uninitialized. Queuing.\n");
683 goto done; 683 goto done;
684 } 684 }
685 685
686 if (!priv->scan_bands) { 686 if (!priv->scan_bands) {
687 IWL_DEBUG_HC("Aborting scan due to no requested bands\n"); 687 IWL_DEBUG_HC(priv, "Aborting scan due to no requested bands\n");
688 goto done; 688 goto done;
689 } 689 }
690 690
@@ -709,7 +709,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
709 u32 scan_suspend_time = 100; 709 u32 scan_suspend_time = 100;
710 unsigned long flags; 710 unsigned long flags;
711 711
712 IWL_DEBUG_INFO("Scanning while associated...\n"); 712 IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
713 713
714 spin_lock_irqsave(&priv->lock, flags); 714 spin_lock_irqsave(&priv->lock, flags);
715 interval = priv->beacon_int; 715 interval = priv->beacon_int;
@@ -724,13 +724,13 @@ static void iwl_bg_request_scan(struct work_struct *data)
724 scan_suspend_time = (extra | 724 scan_suspend_time = (extra |
725 ((suspend_time % interval) * 1024)); 725 ((suspend_time % interval) * 1024));
726 scan->suspend_time = cpu_to_le32(scan_suspend_time); 726 scan->suspend_time = cpu_to_le32(scan_suspend_time);
727 IWL_DEBUG_SCAN("suspend_time 0x%X beacon interval %d\n", 727 IWL_DEBUG_SCAN(priv, "suspend_time 0x%X beacon interval %d\n",
728 scan_suspend_time, interval); 728 scan_suspend_time, interval);
729 } 729 }
730 730
731 /* We should add the ability for user to lock to PASSIVE ONLY */ 731 /* We should add the ability for user to lock to PASSIVE ONLY */
732 if (priv->one_direct_scan) { 732 if (priv->one_direct_scan) {
733 IWL_DEBUG_SCAN("Start direct scan for '%s'\n", 733 IWL_DEBUG_SCAN(priv, "Start direct scan for '%s'\n",
734 print_ssid(ssid, priv->direct_ssid, 734 print_ssid(ssid, priv->direct_ssid,
735 priv->direct_ssid_len)); 735 priv->direct_ssid_len));
736 scan->direct_scan[0].id = WLAN_EID_SSID; 736 scan->direct_scan[0].id = WLAN_EID_SSID;
@@ -739,7 +739,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
739 priv->direct_ssid, priv->direct_ssid_len); 739 priv->direct_ssid, priv->direct_ssid_len);
740 n_probes++; 740 n_probes++;
741 } else { 741 } else {
742 IWL_DEBUG_SCAN("Start indirect scan.\n"); 742 IWL_DEBUG_SCAN(priv, "Start indirect scan.\n");
743 } 743 }
744 744
745 scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; 745 scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
@@ -801,7 +801,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
801 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 801 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
802 802
803 if (scan->channel_count == 0) { 803 if (scan->channel_count == 0) {
804 IWL_DEBUG_SCAN("channel count %d\n", scan->channel_count); 804 IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count);
805 goto done; 805 goto done;
806 } 806 }
807 807
@@ -855,7 +855,7 @@ void iwl_bg_scan_completed(struct work_struct *work)
855 struct iwl_priv *priv = 855 struct iwl_priv *priv =
856 container_of(work, struct iwl_priv, scan_completed); 856 container_of(work, struct iwl_priv, scan_completed);
857 857
858 IWL_DEBUG_SCAN("SCAN complete scan\n"); 858 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");
859 859
860 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 860 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
861 return; 861 return;
diff --git a/drivers/net/wireless/iwlwifi/iwl-spectrum.c b/drivers/net/wireless/iwlwifi/iwl-spectrum.c
index aba1ef22fc61..022bcf115731 100644
--- a/drivers/net/wireless/iwlwifi/iwl-spectrum.c
+++ b/drivers/net/wireless/iwlwifi/iwl-spectrum.c
@@ -154,9 +154,9 @@ static int iwl_get_measurement(struct iwl_priv *priv,
154 switch (spectrum_resp_status) { 154 switch (spectrum_resp_status) {
155 case 0: /* Command will be handled */ 155 case 0: /* Command will be handled */
156 if (res->u.spectrum.id != 0xff) { 156 if (res->u.spectrum.id != 0xff) {
157 IWL_DEBUG_INFO 157 IWL_DEBUG_INFO(priv,
158 ("Replaced existing measurement: %d\n", 158 "Replaced existing measurement: %d\n",
159 res->u.spectrum.id); 159 res->u.spectrum.id);
160 priv->measurement_status &= ~MEASUREMENT_READY; 160 priv->measurement_status &= ~MEASUREMENT_READY;
161 } 161 }
162 priv->measurement_status |= MEASUREMENT_ACTIVE; 162 priv->measurement_status |= MEASUREMENT_ACTIVE;
@@ -181,7 +181,7 @@ static void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv,
181 struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif); 181 struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif);
182 182
183 if (!report->state) { 183 if (!report->state) {
184 IWL_DEBUG(IWL_DL_11H, 184 IWL_DEBUG_11H(priv,
185 "Spectrum Measure Notification: Start\n"); 185 "Spectrum Measure Notification: Start\n");
186 return; 186 return;
187 } 187 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 20dc84152d4f..1fae3a6bd8d5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -60,7 +60,7 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr)
60 goto out; 60 goto out;
61 } 61 }
62 62
63 IWL_DEBUG_ASSOC_LIMIT("can not find STA %pM total %d\n", 63 IWL_DEBUG_ASSOC_LIMIT(priv, "can not find STA %pM total %d\n",
64 addr, priv->num_stations); 64 addr, priv->num_stations);
65 65
66 out: 66 out:
@@ -92,7 +92,7 @@ static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
92 sta_id); 92 sta_id);
93 93
94 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE; 94 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE;
95 IWL_DEBUG_ASSOC("Added STA to Ucode: %pM\n", 95 IWL_DEBUG_ASSOC(priv, "Added STA to Ucode: %pM\n",
96 priv->stations[sta_id].sta.sta.addr); 96 priv->stations[sta_id].sta.sta.addr);
97 97
98 spin_unlock_irqrestore(&priv->sta_lock, flags); 98 spin_unlock_irqrestore(&priv->sta_lock, flags);
@@ -123,7 +123,7 @@ static int iwl_add_sta_callback(struct iwl_priv *priv,
123 iwl_sta_ucode_activate(priv, sta_id); 123 iwl_sta_ucode_activate(priv, sta_id);
124 /* fall through */ 124 /* fall through */
125 default: 125 default:
126 IWL_DEBUG_HC("Received REPLY_ADD_STA:(0x%08X)\n", 126 IWL_DEBUG_HC(priv, "Received REPLY_ADD_STA:(0x%08X)\n",
127 res->u.add_sta.status); 127 res->u.add_sta.status);
128 break; 128 break;
129 } 129 }
@@ -166,7 +166,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,
166 switch (res->u.add_sta.status) { 166 switch (res->u.add_sta.status) {
167 case ADD_STA_SUCCESS_MSK: 167 case ADD_STA_SUCCESS_MSK:
168 iwl_sta_ucode_activate(priv, sta->sta.sta_id); 168 iwl_sta_ucode_activate(priv, sta->sta.sta_id);
169 IWL_DEBUG_INFO("REPLY_ADD_STA PASSED\n"); 169 IWL_DEBUG_INFO(priv, "REPLY_ADD_STA PASSED\n");
170 break; 170 break;
171 default: 171 default:
172 ret = -EIO; 172 ret = -EIO;
@@ -272,7 +272,7 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
272 272
273 station = &priv->stations[sta_id]; 273 station = &priv->stations[sta_id];
274 station->used = IWL_STA_DRIVER_ACTIVE; 274 station->used = IWL_STA_DRIVER_ACTIVE;
275 IWL_DEBUG_ASSOC("Add STA to driver ID %d: %pM\n", 275 IWL_DEBUG_ASSOC(priv, "Add STA to driver ID %d: %pM\n",
276 sta_id, addr); 276 sta_id, addr);
277 priv->num_stations++; 277 priv->num_stations++;
278 278
@@ -304,7 +304,7 @@ static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr)
304 304
305 BUG_ON(sta_id == IWL_INVALID_STATION); 305 BUG_ON(sta_id == IWL_INVALID_STATION);
306 306
307 IWL_DEBUG_ASSOC("Removed STA from Ucode: %pM\n", addr); 307 IWL_DEBUG_ASSOC(priv, "Removed STA from Ucode: %pM\n", addr);
308 308
309 spin_lock_irqsave(&priv->sta_lock, flags); 309 spin_lock_irqsave(&priv->sta_lock, flags);
310 310
@@ -390,7 +390,7 @@ static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,
390 switch (res->u.rem_sta.status) { 390 switch (res->u.rem_sta.status) {
391 case REM_STA_SUCCESS_MSK: 391 case REM_STA_SUCCESS_MSK:
392 iwl_sta_ucode_deactivate(priv, addr); 392 iwl_sta_ucode_deactivate(priv, addr);
393 IWL_DEBUG_ASSOC("REPLY_REMOVE_STA PASSED\n"); 393 IWL_DEBUG_ASSOC(priv, "REPLY_REMOVE_STA PASSED\n");
394 break; 394 break;
395 default: 395 default:
396 ret = -EIO; 396 ret = -EIO;
@@ -432,7 +432,7 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
432 if (unlikely(sta_id == IWL_INVALID_STATION)) 432 if (unlikely(sta_id == IWL_INVALID_STATION))
433 goto out; 433 goto out;
434 434
435 IWL_DEBUG_ASSOC("Removing STA from driver:%d %pM\n", 435 IWL_DEBUG_ASSOC(priv, "Removing STA from driver:%d %pM\n",
436 sta_id, addr); 436 sta_id, addr);
437 437
438 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) { 438 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) {
@@ -560,7 +560,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
560 priv->default_wep_key--; 560 priv->default_wep_key--;
561 memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0])); 561 memset(&priv->wep_keys[keyconf->keyidx], 0, sizeof(priv->wep_keys[0]));
562 ret = iwl_send_static_wepkey_cmd(priv, 1); 562 ret = iwl_send_static_wepkey_cmd(priv, 1);
563 IWL_DEBUG_WEP("Remove default WEP key: idx=%d ret=%d\n", 563 IWL_DEBUG_WEP(priv, "Remove default WEP key: idx=%d ret=%d\n",
564 keyconf->keyidx, ret); 564 keyconf->keyidx, ret);
565 spin_unlock_irqrestore(&priv->sta_lock, flags); 565 spin_unlock_irqrestore(&priv->sta_lock, flags);
566 566
@@ -576,7 +576,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
576 576
577 if (keyconf->keylen != WEP_KEY_LEN_128 && 577 if (keyconf->keylen != WEP_KEY_LEN_128 &&
578 keyconf->keylen != WEP_KEY_LEN_64) { 578 keyconf->keylen != WEP_KEY_LEN_64) {
579 IWL_DEBUG_WEP("Bad WEP key length %d\n", keyconf->keylen); 579 IWL_DEBUG_WEP(priv, "Bad WEP key length %d\n", keyconf->keylen);
580 return -EINVAL; 580 return -EINVAL;
581 } 581 }
582 582
@@ -596,7 +596,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
596 keyconf->keylen); 596 keyconf->keylen);
597 597
598 ret = iwl_send_static_wepkey_cmd(priv, 0); 598 ret = iwl_send_static_wepkey_cmd(priv, 0);
599 IWL_DEBUG_WEP("Set default WEP key: len=%d idx=%d ret=%d\n", 599 IWL_DEBUG_WEP(priv, "Set default WEP key: len=%d idx=%d ret=%d\n",
600 keyconf->keylen, keyconf->keyidx, ret); 600 keyconf->keylen, keyconf->keyidx, ret);
601 spin_unlock_irqrestore(&priv->sta_lock, flags); 601 spin_unlock_irqrestore(&priv->sta_lock, flags);
602 602
@@ -752,7 +752,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
752 752
753 sta_id = iwl_find_station(priv, addr); 753 sta_id = iwl_find_station(priv, addr);
754 if (sta_id == IWL_INVALID_STATION) { 754 if (sta_id == IWL_INVALID_STATION) {
755 IWL_DEBUG_MAC80211("leave - %pM not in station map.\n", 755 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
756 addr); 756 addr);
757 return; 757 return;
758 } 758 }
@@ -804,7 +804,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
804 key_flags = le16_to_cpu(priv->stations[sta_id].sta.key.key_flags); 804 key_flags = le16_to_cpu(priv->stations[sta_id].sta.key.key_flags);
805 keyidx = (key_flags >> STA_KEY_FLG_KEYID_POS) & 0x3; 805 keyidx = (key_flags >> STA_KEY_FLG_KEYID_POS) & 0x3;
806 806
807 IWL_DEBUG_WEP("Remove dynamic key: idx=%d sta=%d\n", 807 IWL_DEBUG_WEP(priv, "Remove dynamic key: idx=%d sta=%d\n",
808 keyconf->keyidx, sta_id); 808 keyconf->keyidx, sta_id);
809 809
810 if (keyconf->keyidx != keyidx) { 810 if (keyconf->keyidx != keyidx) {
@@ -868,7 +868,7 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,
868 ret = -EINVAL; 868 ret = -EINVAL;
869 } 869 }
870 870
871 IWL_DEBUG_WEP("Set dynamic key: alg= %d len=%d idx=%d sta=%d ret=%d\n", 871 IWL_DEBUG_WEP(priv, "Set dynamic key: alg= %d len=%d idx=%d sta=%d ret=%d\n",
872 keyconf->alg, keyconf->keylen, keyconf->keyidx, 872 keyconf->alg, keyconf->keylen, keyconf->keyidx,
873 sta_id, ret); 873 sta_id, ret);
874 874
@@ -881,13 +881,13 @@ static void iwl_dump_lq_cmd(struct iwl_priv *priv,
881 struct iwl_link_quality_cmd *lq) 881 struct iwl_link_quality_cmd *lq)
882{ 882{
883 int i; 883 int i;
884 IWL_DEBUG_RATE("lq station id 0x%x\n", lq->sta_id); 884 IWL_DEBUG_RATE(priv, "lq station id 0x%x\n", lq->sta_id);
885 IWL_DEBUG_RATE("lq ant 0x%X 0x%X\n", 885 IWL_DEBUG_RATE(priv, "lq ant 0x%X 0x%X\n",
886 lq->general_params.single_stream_ant_msk, 886 lq->general_params.single_stream_ant_msk,
887 lq->general_params.dual_stream_ant_msk); 887 lq->general_params.dual_stream_ant_msk);
888 888
889 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) 889 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
890 IWL_DEBUG_RATE("lq index %d 0x%X\n", 890 IWL_DEBUG_RATE(priv, "lq index %d 0x%X\n",
891 i, lq->rs_table[i].rate_n_flags); 891 i, lq->rs_table[i].rate_n_flags);
892} 892}
893#else 893#else
@@ -1064,7 +1064,7 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
1064 if (sta_id != IWL_INVALID_STATION) 1064 if (sta_id != IWL_INVALID_STATION)
1065 return sta_id; 1065 return sta_id;
1066 1066
1067 IWL_DEBUG_DROP("Station %pM not in station map. " 1067 IWL_DEBUG_DROP(priv, "Station %pM not in station map. "
1068 "Defaulting to broadcast...\n", 1068 "Defaulting to broadcast...\n",
1069 hdr->addr1); 1069 hdr->addr1);
1070 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 1070 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 7d2b6e11f73e..7c74b259873f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -96,7 +96,7 @@ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
96 reg = iwl_read32(priv, CSR_UCODE_DRV_GP1); 96 reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
97 97
98 if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { 98 if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
99 IWL_DEBUG_INFO("Requesting wakeup, GP1 = 0x%x\n", reg); 99 IWL_DEBUG_INFO(priv, "Requesting wakeup, GP1 = 0x%x\n", reg);
100 iwl_set_bit(priv, CSR_GP_CNTRL, 100 iwl_set_bit(priv, CSR_GP_CNTRL,
101 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 101 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
102 return ret; 102 return ret;
@@ -638,14 +638,14 @@ static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv,
638 memcpy(tx_cmd->key, keyconf->key, keyconf->keylen); 638 memcpy(tx_cmd->key, keyconf->key, keyconf->keylen);
639 if (info->flags & IEEE80211_TX_CTL_AMPDU) 639 if (info->flags & IEEE80211_TX_CTL_AMPDU)
640 tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK; 640 tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK;
641 IWL_DEBUG_TX("tx_cmd with AES hwcrypto\n"); 641 IWL_DEBUG_TX(priv, "tx_cmd with AES hwcrypto\n");
642 break; 642 break;
643 643
644 case ALG_TKIP: 644 case ALG_TKIP:
645 tx_cmd->sec_ctl = TX_CMD_SEC_TKIP; 645 tx_cmd->sec_ctl = TX_CMD_SEC_TKIP;
646 ieee80211_get_tkip_key(keyconf, skb_frag, 646 ieee80211_get_tkip_key(keyconf, skb_frag,
647 IEEE80211_TKIP_P2_KEY, tx_cmd->key); 647 IEEE80211_TKIP_P2_KEY, tx_cmd->key);
648 IWL_DEBUG_TX("tx_cmd with tkip hwcrypto\n"); 648 IWL_DEBUG_TX(priv, "tx_cmd with tkip hwcrypto\n");
649 break; 649 break;
650 650
651 case ALG_WEP: 651 case ALG_WEP:
@@ -657,7 +657,7 @@ static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv,
657 657
658 memcpy(&tx_cmd->key[3], keyconf->key, keyconf->keylen); 658 memcpy(&tx_cmd->key[3], keyconf->key, keyconf->keylen);
659 659
660 IWL_DEBUG_TX("Configuring packet for WEP encryption " 660 IWL_DEBUG_TX(priv, "Configuring packet for WEP encryption "
661 "with key %d\n", keyconf->keyidx); 661 "with key %d\n", keyconf->keyidx);
662 break; 662 break;
663 663
@@ -703,7 +703,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
703 703
704 spin_lock_irqsave(&priv->lock, flags); 704 spin_lock_irqsave(&priv->lock, flags);
705 if (iwl_is_rfkill(priv)) { 705 if (iwl_is_rfkill(priv)) {
706 IWL_DEBUG_DROP("Dropping - RF KILL\n"); 706 IWL_DEBUG_DROP(priv, "Dropping - RF KILL\n");
707 goto drop_unlock; 707 goto drop_unlock;
708 } 708 }
709 709
@@ -717,11 +717,11 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
717 717
718#ifdef CONFIG_IWLWIFI_DEBUG 718#ifdef CONFIG_IWLWIFI_DEBUG
719 if (ieee80211_is_auth(fc)) 719 if (ieee80211_is_auth(fc))
720 IWL_DEBUG_TX("Sending AUTH frame\n"); 720 IWL_DEBUG_TX(priv, "Sending AUTH frame\n");
721 else if (ieee80211_is_assoc_req(fc)) 721 else if (ieee80211_is_assoc_req(fc))
722 IWL_DEBUG_TX("Sending ASSOC frame\n"); 722 IWL_DEBUG_TX(priv, "Sending ASSOC frame\n");
723 else if (ieee80211_is_reassoc_req(fc)) 723 else if (ieee80211_is_reassoc_req(fc))
724 IWL_DEBUG_TX("Sending REASSOC frame\n"); 724 IWL_DEBUG_TX(priv, "Sending REASSOC frame\n");
725#endif 725#endif
726 726
727 /* drop all data frame if we are not associated */ 727 /* drop all data frame if we are not associated */
@@ -731,7 +731,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
731 (!iwl_is_associated(priv) || 731 (!iwl_is_associated(priv) ||
732 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) || 732 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) ||
733 !priv->assoc_station_added)) { 733 !priv->assoc_station_added)) {
734 IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n"); 734 IWL_DEBUG_DROP(priv, "Dropping - !iwl_is_associated\n");
735 goto drop_unlock; 735 goto drop_unlock;
736 } 736 }
737 737
@@ -742,12 +742,12 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
742 /* Find (or create) index into station table for destination station */ 742 /* Find (or create) index into station table for destination station */
743 sta_id = iwl_get_sta_id(priv, hdr); 743 sta_id = iwl_get_sta_id(priv, hdr);
744 if (sta_id == IWL_INVALID_STATION) { 744 if (sta_id == IWL_INVALID_STATION) {
745 IWL_DEBUG_DROP("Dropping - INVALID STATION: %pM\n", 745 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
746 hdr->addr1); 746 hdr->addr1);
747 goto drop; 747 goto drop;
748 } 748 }
749 749
750 IWL_DEBUG_TX("station Id %d\n", sta_id); 750 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
751 751
752 swq_id = skb_get_queue_mapping(skb); 752 swq_id = skb_get_queue_mapping(skb);
753 txq_id = swq_id; 753 txq_id = swq_id;
@@ -938,7 +938,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
938 !(cmd->meta.flags & CMD_SIZE_HUGE)); 938 !(cmd->meta.flags & CMD_SIZE_HUGE));
939 939
940 if (iwl_is_rfkill(priv)) { 940 if (iwl_is_rfkill(priv)) {
941 IWL_DEBUG_INFO("Not sending command - RF KILL"); 941 IWL_DEBUG_INFO(priv, "Not sending command - RF KILL");
942 return -EIO; 942 return -EIO;
943 } 943 }
944 944
@@ -981,7 +981,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
981 switch (out_cmd->hdr.cmd) { 981 switch (out_cmd->hdr.cmd) {
982 case REPLY_TX_LINK_QUALITY_CMD: 982 case REPLY_TX_LINK_QUALITY_CMD:
983 case SENSITIVITY_CMD: 983 case SENSITIVITY_CMD:
984 IWL_DEBUG_HC_DUMP("Sending command %s (#%x), seq: 0x%04X, " 984 IWL_DEBUG_HC_DUMP(priv, "Sending command %s (#%x), seq: 0x%04X, "
985 "%d bytes at %d[%d]:%d\n", 985 "%d bytes at %d[%d]:%d\n",
986 get_cmd_string(out_cmd->hdr.cmd), 986 get_cmd_string(out_cmd->hdr.cmd),
987 out_cmd->hdr.cmd, 987 out_cmd->hdr.cmd,
@@ -989,7 +989,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
989 q->write_ptr, idx, IWL_CMD_QUEUE_NUM); 989 q->write_ptr, idx, IWL_CMD_QUEUE_NUM);
990 break; 990 break;
991 default: 991 default:
992 IWL_DEBUG_HC("Sending command %s (#%x), seq: 0x%04X, " 992 IWL_DEBUG_HC(priv, "Sending command %s (#%x), seq: 0x%04X, "
993 "%d bytes at %d[%d]:%d\n", 993 "%d bytes at %d[%d]:%d\n",
994 get_cmd_string(out_cmd->hdr.cmd), 994 get_cmd_string(out_cmd->hdr.cmd),
995 out_cmd->hdr.cmd, 995 out_cmd->hdr.cmd,
@@ -1194,7 +1194,7 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn)
1194 tid_data->agg.state = IWL_AGG_ON; 1194 tid_data->agg.state = IWL_AGG_ON;
1195 ieee80211_start_tx_ba_cb_irqsafe(priv->hw, ra, tid); 1195 ieee80211_start_tx_ba_cb_irqsafe(priv->hw, ra, tid);
1196 } else { 1196 } else {
1197 IWL_DEBUG_HT("HW queue is NOT empty: %d packets in HW queue\n", 1197 IWL_DEBUG_HT(priv, "HW queue is NOT empty: %d packets in HW queue\n",
1198 tid_data->tfds_in_queue); 1198 tid_data->tfds_in_queue);
1199 tid_data->agg.state = IWL_EMPTYING_HW_QUEUE_ADDBA; 1199 tid_data->agg.state = IWL_EMPTYING_HW_QUEUE_ADDBA;
1200 } 1200 }
@@ -1235,13 +1235,13 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
1235 1235
1236 /* The queue is not empty */ 1236 /* The queue is not empty */
1237 if (write_ptr != read_ptr) { 1237 if (write_ptr != read_ptr) {
1238 IWL_DEBUG_HT("Stopping a non empty AGG HW QUEUE\n"); 1238 IWL_DEBUG_HT(priv, "Stopping a non empty AGG HW QUEUE\n");
1239 priv->stations[sta_id].tid[tid].agg.state = 1239 priv->stations[sta_id].tid[tid].agg.state =
1240 IWL_EMPTYING_HW_QUEUE_DELBA; 1240 IWL_EMPTYING_HW_QUEUE_DELBA;
1241 return 0; 1241 return 0;
1242 } 1242 }
1243 1243
1244 IWL_DEBUG_HT("HW queue is empty\n"); 1244 IWL_DEBUG_HT(priv, "HW queue is empty\n");
1245 priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF; 1245 priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF;
1246 1246
1247 spin_lock_irqsave(&priv->lock, flags); 1247 spin_lock_irqsave(&priv->lock, flags);
@@ -1272,7 +1272,7 @@ int iwl_txq_check_empty(struct iwl_priv *priv, int sta_id, u8 tid, int txq_id)
1272 (q->read_ptr == q->write_ptr)) { 1272 (q->read_ptr == q->write_ptr)) {
1273 u16 ssn = SEQ_TO_SN(tid_data->seq_number); 1273 u16 ssn = SEQ_TO_SN(tid_data->seq_number);
1274 int tx_fifo = default_tid_to_tx_fifo[tid]; 1274 int tx_fifo = default_tid_to_tx_fifo[tid];
1275 IWL_DEBUG_HT("HW queue empty: continue DELBA flow\n"); 1275 IWL_DEBUG_HT(priv, "HW queue empty: continue DELBA flow\n");
1276 priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, 1276 priv->cfg->ops->lib->txq_agg_disable(priv, txq_id,
1277 ssn, tx_fifo); 1277 ssn, tx_fifo);
1278 tid_data->agg.state = IWL_AGG_OFF; 1278 tid_data->agg.state = IWL_AGG_OFF;
@@ -1282,7 +1282,7 @@ int iwl_txq_check_empty(struct iwl_priv *priv, int sta_id, u8 tid, int txq_id)
1282 case IWL_EMPTYING_HW_QUEUE_ADDBA: 1282 case IWL_EMPTYING_HW_QUEUE_ADDBA:
1283 /* We are reclaiming the last packet of the queue */ 1283 /* We are reclaiming the last packet of the queue */
1284 if (tid_data->tfds_in_queue == 0) { 1284 if (tid_data->tfds_in_queue == 0) {
1285 IWL_DEBUG_HT("HW queue empty: continue ADDBA flow\n"); 1285 IWL_DEBUG_HT(priv, "HW queue empty: continue ADDBA flow\n");
1286 tid_data->agg.state = IWL_AGG_ON; 1286 tid_data->agg.state = IWL_AGG_ON;
1287 ieee80211_start_tx_ba_cb_irqsafe(priv->hw, addr, tid); 1287 ieee80211_start_tx_ba_cb_irqsafe(priv->hw, addr, tid);
1288 } 1288 }
@@ -1317,7 +1317,7 @@ static int iwl_tx_status_reply_compressed_ba(struct iwl_priv *priv,
1317 1317
1318 /* Mark that the expected block-ack response arrived */ 1318 /* Mark that the expected block-ack response arrived */
1319 agg->wait_for_ba = 0; 1319 agg->wait_for_ba = 0;
1320 IWL_DEBUG_TX_REPLY("BA %d %d\n", agg->start_idx, ba_resp->seq_ctl); 1320 IWL_DEBUG_TX_REPLY(priv, "BA %d %d\n", agg->start_idx, ba_resp->seq_ctl);
1321 1321
1322 /* Calculate shift to align block-ack bits with our Tx window bits */ 1322 /* Calculate shift to align block-ack bits with our Tx window bits */
1323 sh = agg->start_idx - SEQ_TO_INDEX(seq_ctl >> 4); 1323 sh = agg->start_idx - SEQ_TO_INDEX(seq_ctl >> 4);
@@ -1328,7 +1328,7 @@ static int iwl_tx_status_reply_compressed_ba(struct iwl_priv *priv,
1328 bitmap = le64_to_cpu(ba_resp->bitmap) >> sh; 1328 bitmap = le64_to_cpu(ba_resp->bitmap) >> sh;
1329 1329
1330 if (agg->frame_count > (64 - sh)) { 1330 if (agg->frame_count > (64 - sh)) {
1331 IWL_DEBUG_TX_REPLY("more frames than bitmap size"); 1331 IWL_DEBUG_TX_REPLY(priv, "more frames than bitmap size");
1332 return -1; 1332 return -1;
1333 } 1333 }
1334 1334
@@ -1341,7 +1341,7 @@ static int iwl_tx_status_reply_compressed_ba(struct iwl_priv *priv,
1341 for (i = 0; i < agg->frame_count ; i++) { 1341 for (i = 0; i < agg->frame_count ; i++) {
1342 ack = bitmap & (1ULL << i); 1342 ack = bitmap & (1ULL << i);
1343 successes += !!ack; 1343 successes += !!ack;
1344 IWL_DEBUG_TX_REPLY("%s ON i=%d idx=%d raw=%d\n", 1344 IWL_DEBUG_TX_REPLY(priv, "%s ON i=%d idx=%d raw=%d\n",
1345 ack ? "ACK" : "NACK", i, (agg->start_idx + i) & 0xff, 1345 ack ? "ACK" : "NACK", i, (agg->start_idx + i) & 0xff,
1346 agg->start_idx + i); 1346 agg->start_idx + i);
1347 } 1347 }
@@ -1354,7 +1354,7 @@ static int iwl_tx_status_reply_compressed_ba(struct iwl_priv *priv,
1354 info->status.ampdu_ack_len = agg->frame_count; 1354 info->status.ampdu_ack_len = agg->frame_count;
1355 iwl_hwrate_to_tx_control(priv, agg->rate_n_flags, info); 1355 iwl_hwrate_to_tx_control(priv, agg->rate_n_flags, info);
1356 1356
1357 IWL_DEBUG_TX_REPLY("Bitmap %llx\n", (unsigned long long)bitmap); 1357 IWL_DEBUG_TX_REPLY(priv, "Bitmap %llx\n", (unsigned long long)bitmap);
1358 1358
1359 return 0; 1359 return 0;
1360} 1360}
@@ -1399,19 +1399,19 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
1399 1399
1400 /* TODO: Need to get this copy more safely - now good for debug */ 1400 /* TODO: Need to get this copy more safely - now good for debug */
1401 1401
1402 IWL_DEBUG_TX_REPLY("REPLY_COMPRESSED_BA [%d] Received from %pM, " 1402 IWL_DEBUG_TX_REPLY(priv, "REPLY_COMPRESSED_BA [%d] Received from %pM, "
1403 "sta_id = %d\n", 1403 "sta_id = %d\n",
1404 agg->wait_for_ba, 1404 agg->wait_for_ba,
1405 (u8 *) &ba_resp->sta_addr_lo32, 1405 (u8 *) &ba_resp->sta_addr_lo32,
1406 ba_resp->sta_id); 1406 ba_resp->sta_id);
1407 IWL_DEBUG_TX_REPLY("TID = %d, SeqCtl = %d, bitmap = 0x%llx, scd_flow = " 1407 IWL_DEBUG_TX_REPLY(priv, "TID = %d, SeqCtl = %d, bitmap = 0x%llx, scd_flow = "
1408 "%d, scd_ssn = %d\n", 1408 "%d, scd_ssn = %d\n",
1409 ba_resp->tid, 1409 ba_resp->tid,
1410 ba_resp->seq_ctl, 1410 ba_resp->seq_ctl,
1411 (unsigned long long)le64_to_cpu(ba_resp->bitmap), 1411 (unsigned long long)le64_to_cpu(ba_resp->bitmap),
1412 ba_resp->scd_flow, 1412 ba_resp->scd_flow,
1413 ba_resp->scd_ssn); 1413 ba_resp->scd_ssn);
1414 IWL_DEBUG_TX_REPLY("DAT start_idx = %d, bitmap = 0x%llx \n", 1414 IWL_DEBUG_TX_REPLY(priv, "DAT start_idx = %d, bitmap = 0x%llx \n",
1415 agg->start_idx, 1415 agg->start_idx,
1416 (unsigned long long)agg->bitmap); 1416 (unsigned long long)agg->bitmap);
1417 1417
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 346a3018d8a5..ac337177fdb3 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -203,7 +203,7 @@ u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flag
203 return index; 203 return index;
204 } 204 }
205 205
206 IWL_DEBUG_ASSOC("Add STA ID %d: %pM\n", index, addr); 206 IWL_DEBUG_ASSOC(priv, "Add STA ID %d: %pM\n", index, addr);
207 station = &priv->stations_39[index]; 207 station = &priv->stations_39[index];
208 station->used = 1; 208 station->used = 1;
209 priv->num_stations++; 209 priv->num_stations++;
@@ -251,7 +251,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
251 (rxon1->filter_flags == rxon2->filter_flags) && 251 (rxon1->filter_flags == rxon2->filter_flags) &&
252 (rxon1->cck_basic_rates == rxon2->cck_basic_rates) && 252 (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
253 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { 253 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
254 IWL_DEBUG_INFO("Using current RXON_ASSOC. Not resending.\n"); 254 IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n");
255 return 0; 255 return 0;
256 } 256 }
257 257
@@ -368,7 +368,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
368 * before we apply the new config */ 368 * before we apply the new config */
369 if (iwl_is_associated(priv) && 369 if (iwl_is_associated(priv) &&
370 (staging_rxon->filter_flags & RXON_FILTER_ASSOC_MSK)) { 370 (staging_rxon->filter_flags & RXON_FILTER_ASSOC_MSK)) {
371 IWL_DEBUG_INFO("Toggling associated bit on current RXON\n"); 371 IWL_DEBUG_INFO(priv, "Toggling associated bit on current RXON\n");
372 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 372 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
373 373
374 /* 374 /*
@@ -391,7 +391,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
391 } 391 }
392 } 392 }
393 393
394 IWL_DEBUG_INFO("Sending RXON\n" 394 IWL_DEBUG_INFO(priv, "Sending RXON\n"
395 "* with%s RXON_FILTER_ASSOC_MSK\n" 395 "* with%s RXON_FILTER_ASSOC_MSK\n"
396 "* channel = %d\n" 396 "* channel = %d\n"
397 "* bssid = %pM\n", 397 "* bssid = %pM\n",
@@ -489,7 +489,7 @@ static int iwl3945_update_sta_key_info(struct iwl_priv *priv,
489 489
490 spin_unlock_irqrestore(&priv->sta_lock, flags); 490 spin_unlock_irqrestore(&priv->sta_lock, flags);
491 491
492 IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n"); 492 IWL_DEBUG_INFO(priv, "hwcrypto: modify ucode station key info\n");
493 iwl_send_add_sta(priv, 493 iwl_send_add_sta(priv,
494 (struct iwl_addsta_cmd *)&priv->stations_39[sta_id].sta, 0); 494 (struct iwl_addsta_cmd *)&priv->stations_39[sta_id].sta, 0);
495 return 0; 495 return 0;
@@ -508,7 +508,7 @@ static int iwl3945_clear_sta_key_info(struct iwl_priv *priv, u8 sta_id)
508 priv->stations_39[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 508 priv->stations_39[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
509 spin_unlock_irqrestore(&priv->sta_lock, flags); 509 spin_unlock_irqrestore(&priv->sta_lock, flags);
510 510
511 IWL_DEBUG_INFO("hwcrypto: clear ucode station key info\n"); 511 IWL_DEBUG_INFO(priv, "hwcrypto: clear ucode station key info\n");
512 iwl_send_add_sta(priv, 512 iwl_send_add_sta(priv,
513 (struct iwl_addsta_cmd *)&priv->stations_39[sta_id].sta, 0); 513 (struct iwl_addsta_cmd *)&priv->stations_39[sta_id].sta, 0);
514 return 0; 514 return 0;
@@ -518,7 +518,7 @@ static void iwl3945_clear_free_frames(struct iwl_priv *priv)
518{ 518{
519 struct list_head *element; 519 struct list_head *element;
520 520
521 IWL_DEBUG_INFO("%d frames on pre-allocated heap on clear.\n", 521 IWL_DEBUG_INFO(priv, "%d frames on pre-allocated heap on clear.\n",
522 priv->frames_count); 522 priv->frames_count);
523 523
524 while (!list_empty(&priv->free_frames)) { 524 while (!list_empty(&priv->free_frames)) {
@@ -648,7 +648,7 @@ static void iwl3945_activate_qos(struct iwl_priv *priv, u8 force)
648 spin_unlock_irqrestore(&priv->lock, flags); 648 spin_unlock_irqrestore(&priv->lock, flags);
649 649
650 if (force || iwl_is_associated(priv)) { 650 if (force || iwl_is_associated(priv)) {
651 IWL_DEBUG_QOS("send QoS cmd with QoS active %d \n", 651 IWL_DEBUG_QOS(priv, "send QoS cmd with QoS active %d \n",
652 priv->qos_data.qos_active); 652 priv->qos_data.qos_active);
653 653
654 iwl3945_send_qos_params_command(priv, 654 iwl3945_send_qos_params_command(priv,
@@ -690,7 +690,7 @@ int iwl3945_power_init_handle(struct iwl_priv *priv)
690 int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_MAX; 690 int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_MAX;
691 u16 pci_pm; 691 u16 pci_pm;
692 692
693 IWL_DEBUG_POWER("Initialize power \n"); 693 IWL_DEBUG_POWER(priv, "Initialize power \n");
694 694
695 pow_data = &priv->power_data; 695 pow_data = &priv->power_data;
696 696
@@ -707,7 +707,7 @@ int iwl3945_power_init_handle(struct iwl_priv *priv)
707 else { 707 else {
708 struct iwl_powertable_cmd *cmd; 708 struct iwl_powertable_cmd *cmd;
709 709
710 IWL_DEBUG_POWER("adjust power command flags\n"); 710 IWL_DEBUG_POWER(priv, "adjust power command flags\n");
711 711
712 for (i = 0; i < IWL_POWER_MAX; i++) { 712 for (i = 0; i < IWL_POWER_MAX; i++) {
713 cmd = &pow_data->pwr_range_0[i].cmd; 713 cmd = &pow_data->pwr_range_0[i].cmd;
@@ -732,7 +732,7 @@ static int iwl3945_update_power_cmd(struct iwl_priv *priv,
732 bool skip; 732 bool skip;
733 733
734 if (mode > IWL_POWER_INDEX_5) { 734 if (mode > IWL_POWER_INDEX_5) {
735 IWL_DEBUG_POWER("Error invalid power mode \n"); 735 IWL_DEBUG_POWER(priv, "Error invalid power mode \n");
736 return -EINVAL; 736 return -EINVAL;
737 } 737 }
738 pow_data = &priv->power_data; 738 pow_data = &priv->power_data;
@@ -765,10 +765,10 @@ static int iwl3945_update_power_cmd(struct iwl_priv *priv,
765 if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep) 765 if (le32_to_cpu(cmd->sleep_interval[i]) > max_sleep)
766 cmd->sleep_interval[i] = cpu_to_le32(max_sleep); 766 cmd->sleep_interval[i] = cpu_to_le32(max_sleep);
767 767
768 IWL_DEBUG_POWER("Flags value = 0x%08X\n", cmd->flags); 768 IWL_DEBUG_POWER(priv, "Flags value = 0x%08X\n", cmd->flags);
769 IWL_DEBUG_POWER("Tx timeout = %u\n", le32_to_cpu(cmd->tx_data_timeout)); 769 IWL_DEBUG_POWER(priv, "Tx timeout = %u\n", le32_to_cpu(cmd->tx_data_timeout));
770 IWL_DEBUG_POWER("Rx timeout = %u\n", le32_to_cpu(cmd->rx_data_timeout)); 770 IWL_DEBUG_POWER(priv, "Rx timeout = %u\n", le32_to_cpu(cmd->rx_data_timeout));
771 IWL_DEBUG_POWER("Sleep interval vector = { %d , %d , %d , %d , %d }\n", 771 IWL_DEBUG_POWER(priv, "Sleep interval vector = { %d , %d , %d , %d , %d }\n",
772 le32_to_cpu(cmd->sleep_interval[0]), 772 le32_to_cpu(cmd->sleep_interval[0]),
773 le32_to_cpu(cmd->sleep_interval[1]), 773 le32_to_cpu(cmd->sleep_interval[1]),
774 le32_to_cpu(cmd->sleep_interval[2]), 774 le32_to_cpu(cmd->sleep_interval[2]),
@@ -875,8 +875,8 @@ static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
875 priv->rxon_timing.beacon_init_val = 875 priv->rxon_timing.beacon_init_val =
876 cpu_to_le32((u32) ((u64) interval_tm_unit - result)); 876 cpu_to_le32((u32) ((u64) interval_tm_unit - result));
877 877
878 IWL_DEBUG_ASSOC 878 IWL_DEBUG_ASSOC(priv,
879 ("beacon interval %d beacon timer %d beacon tim %d\n", 879 "beacon interval %d beacon timer %d beacon tim %d\n",
880 le16_to_cpu(priv->rxon_timing.beacon_interval), 880 le16_to_cpu(priv->rxon_timing.beacon_interval),
881 le32_to_cpu(priv->rxon_timing.beacon_init_val), 881 le32_to_cpu(priv->rxon_timing.beacon_init_val),
882 le16_to_cpu(priv->rxon_timing.atim_window)); 882 le16_to_cpu(priv->rxon_timing.atim_window));
@@ -885,22 +885,22 @@ static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
885static int iwl3945_scan_initiate(struct iwl_priv *priv) 885static int iwl3945_scan_initiate(struct iwl_priv *priv)
886{ 886{
887 if (!iwl_is_ready_rf(priv)) { 887 if (!iwl_is_ready_rf(priv)) {
888 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 888 IWL_DEBUG_SCAN(priv, "Aborting scan due to not ready.\n");
889 return -EIO; 889 return -EIO;
890 } 890 }
891 891
892 if (test_bit(STATUS_SCANNING, &priv->status)) { 892 if (test_bit(STATUS_SCANNING, &priv->status)) {
893 IWL_DEBUG_SCAN("Scan already in progress.\n"); 893 IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
894 return -EAGAIN; 894 return -EAGAIN;
895 } 895 }
896 896
897 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 897 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
898 IWL_DEBUG_SCAN("Scan request while abort pending. " 898 IWL_DEBUG_SCAN(priv, "Scan request while abort pending. "
899 "Queuing.\n"); 899 "Queuing.\n");
900 return -EAGAIN; 900 return -EAGAIN;
901 } 901 }
902 902
903 IWL_DEBUG_INFO("Starting scan...\n"); 903 IWL_DEBUG_INFO(priv, "Starting scan...\n");
904 if (priv->cfg->sku & IWL_SKU_G) 904 if (priv->cfg->sku & IWL_SKU_G)
905 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ); 905 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);
906 if (priv->cfg->sku & IWL_SKU_A) 906 if (priv->cfg->sku & IWL_SKU_A)
@@ -941,7 +941,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
941 cancel_delayed_work(&priv->scan_check); 941 cancel_delayed_work(&priv->scan_check);
942 if (iwl_scan_cancel_timeout(priv, 100)) { 942 if (iwl_scan_cancel_timeout(priv, 100)) {
943 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n"); 943 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
944 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); 944 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
945 return -EAGAIN; 945 return -EAGAIN;
946 } 946 }
947 947
@@ -964,7 +964,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
964 case ALG_CCMP: 964 case ALG_CCMP:
965 tx->sec_ctl = TX_CMD_SEC_CCM; 965 tx->sec_ctl = TX_CMD_SEC_CCM;
966 memcpy(tx->key, keyinfo->key, keyinfo->keylen); 966 memcpy(tx->key, keyinfo->key, keyinfo->keylen);
967 IWL_DEBUG_TX("tx_cmd with AES hwcrypto\n"); 967 IWL_DEBUG_TX(priv, "tx_cmd with AES hwcrypto\n");
968 break; 968 break;
969 969
970 case ALG_TKIP: 970 case ALG_TKIP:
@@ -988,7 +988,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
988 988
989 memcpy(&tx->key[3], keyinfo->key, keyinfo->keylen); 989 memcpy(&tx->key[3], keyinfo->key, keyinfo->keylen);
990 990
991 IWL_DEBUG_TX("Configuring packet for WEP encryption " 991 IWL_DEBUG_TX(priv, "Configuring packet for WEP encryption "
992 "with key %d\n", info->control.hw_key->hw_key_idx); 992 "with key %d\n", info->control.hw_key->hw_key_idx);
993 break; 993 break;
994 994
@@ -1105,7 +1105,7 @@ static int iwl3945_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
1105 if (sta_id != IWL_INVALID_STATION) 1105 if (sta_id != IWL_INVALID_STATION)
1106 return sta_id; 1106 return sta_id;
1107 1107
1108 IWL_DEBUG_DROP("Station %pM not in station map. " 1108 IWL_DEBUG_DROP(priv, "Station %pM not in station map. "
1109 "Defaulting to broadcast...\n", 1109 "Defaulting to broadcast...\n",
1110 hdr->addr1); 1110 hdr->addr1);
1111 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 1111 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
@@ -1151,7 +1151,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
1151 1151
1152 spin_lock_irqsave(&priv->lock, flags); 1152 spin_lock_irqsave(&priv->lock, flags);
1153 if (iwl_is_rfkill(priv)) { 1153 if (iwl_is_rfkill(priv)) {
1154 IWL_DEBUG_DROP("Dropping - RF KILL\n"); 1154 IWL_DEBUG_DROP(priv, "Dropping - RF KILL\n");
1155 goto drop_unlock; 1155 goto drop_unlock;
1156 } 1156 }
1157 1157
@@ -1167,11 +1167,11 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
1167 1167
1168#ifdef CONFIG_IWLWIFI_DEBUG 1168#ifdef CONFIG_IWLWIFI_DEBUG
1169 if (ieee80211_is_auth(fc)) 1169 if (ieee80211_is_auth(fc))
1170 IWL_DEBUG_TX("Sending AUTH frame\n"); 1170 IWL_DEBUG_TX(priv, "Sending AUTH frame\n");
1171 else if (ieee80211_is_assoc_req(fc)) 1171 else if (ieee80211_is_assoc_req(fc))
1172 IWL_DEBUG_TX("Sending ASSOC frame\n"); 1172 IWL_DEBUG_TX(priv, "Sending ASSOC frame\n");
1173 else if (ieee80211_is_reassoc_req(fc)) 1173 else if (ieee80211_is_reassoc_req(fc))
1174 IWL_DEBUG_TX("Sending REASSOC frame\n"); 1174 IWL_DEBUG_TX(priv, "Sending REASSOC frame\n");
1175#endif 1175#endif
1176 1176
1177 /* drop all data frame if we are not associated */ 1177 /* drop all data frame if we are not associated */
@@ -1179,7 +1179,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
1179 (priv->iw_mode != NL80211_IFTYPE_MONITOR) && /* packet injection */ 1179 (priv->iw_mode != NL80211_IFTYPE_MONITOR) && /* packet injection */
1180 (!iwl_is_associated(priv) || 1180 (!iwl_is_associated(priv) ||
1181 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) { 1181 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) {
1182 IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n"); 1182 IWL_DEBUG_DROP(priv, "Dropping - !iwl_is_associated\n");
1183 goto drop_unlock; 1183 goto drop_unlock;
1184 } 1184 }
1185 1185
@@ -1190,12 +1190,12 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
1190 /* Find (or create) index into station table for destination station */ 1190 /* Find (or create) index into station table for destination station */
1191 sta_id = iwl3945_get_sta_id(priv, hdr); 1191 sta_id = iwl3945_get_sta_id(priv, hdr);
1192 if (sta_id == IWL_INVALID_STATION) { 1192 if (sta_id == IWL_INVALID_STATION) {
1193 IWL_DEBUG_DROP("Dropping - INVALID STATION: %pM\n", 1193 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
1194 hdr->addr1); 1194 hdr->addr1);
1195 goto drop; 1195 goto drop;
1196 } 1196 }
1197 1197
1198 IWL_DEBUG_RATE("station Id %d\n", sta_id); 1198 IWL_DEBUG_RATE(priv, "station Id %d\n", sta_id);
1199 1199
1200 if (ieee80211_is_data_qos(fc)) { 1200 if (ieee80211_is_data_qos(fc)) {
1201 qc = ieee80211_get_qos_ctl(hdr); 1201 qc = ieee80211_get_qos_ctl(hdr);
@@ -1351,7 +1351,7 @@ static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
1351 if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status)) 1351 if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status))
1352 return; 1352 return;
1353 1353
1354 IWL_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO %s\n", 1354 IWL_DEBUG_RF_KILL(priv, "Manual SW RF KILL set to: RADIO %s\n",
1355 disable_radio ? "OFF" : "ON"); 1355 disable_radio ? "OFF" : "ON");
1356 1356
1357 if (disable_radio) { 1357 if (disable_radio) {
@@ -1384,7 +1384,7 @@ static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
1384 spin_unlock_irqrestore(&priv->lock, flags); 1384 spin_unlock_irqrestore(&priv->lock, flags);
1385 1385
1386 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) { 1386 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
1387 IWL_DEBUG_RF_KILL("Can not turn radio back on - " 1387 IWL_DEBUG_RF_KILL(priv, "Can not turn radio back on - "
1388 "disabled by HW switch\n"); 1388 "disabled by HW switch\n");
1389 return; 1389 return;
1390 } 1390 }
@@ -1507,7 +1507,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv,
1507 switch (spectrum_resp_status) { 1507 switch (spectrum_resp_status) {
1508 case 0: /* Command will be handled */ 1508 case 0: /* Command will be handled */
1509 if (res->u.spectrum.id != 0xff) { 1509 if (res->u.spectrum.id != 0xff) {
1510 IWL_DEBUG_INFO("Replaced existing measurement: %d\n", 1510 IWL_DEBUG_INFO(priv, "Replaced existing measurement: %d\n",
1511 res->u.spectrum.id); 1511 res->u.spectrum.id);
1512 priv->measurement_status &= ~MEASUREMENT_READY; 1512 priv->measurement_status &= ~MEASUREMENT_READY;
1513 } 1513 }
@@ -1535,18 +1535,18 @@ static void iwl3945_rx_reply_alive(struct iwl_priv *priv,
1535 1535
1536 palive = &pkt->u.alive_frame; 1536 palive = &pkt->u.alive_frame;
1537 1537
1538 IWL_DEBUG_INFO("Alive ucode status 0x%08X revision " 1538 IWL_DEBUG_INFO(priv, "Alive ucode status 0x%08X revision "
1539 "0x%01X 0x%01X\n", 1539 "0x%01X 0x%01X\n",
1540 palive->is_valid, palive->ver_type, 1540 palive->is_valid, palive->ver_type,
1541 palive->ver_subtype); 1541 palive->ver_subtype);
1542 1542
1543 if (palive->ver_subtype == INITIALIZE_SUBTYPE) { 1543 if (palive->ver_subtype == INITIALIZE_SUBTYPE) {
1544 IWL_DEBUG_INFO("Initialization Alive received.\n"); 1544 IWL_DEBUG_INFO(priv, "Initialization Alive received.\n");
1545 memcpy(&priv->card_alive_init, &pkt->u.alive_frame, 1545 memcpy(&priv->card_alive_init, &pkt->u.alive_frame,
1546 sizeof(struct iwl_alive_resp)); 1546 sizeof(struct iwl_alive_resp));
1547 pwork = &priv->init_alive_start; 1547 pwork = &priv->init_alive_start;
1548 } else { 1548 } else {
1549 IWL_DEBUG_INFO("Runtime Alive received.\n"); 1549 IWL_DEBUG_INFO(priv, "Runtime Alive received.\n");
1550 memcpy(&priv->card_alive, &pkt->u.alive_frame, 1550 memcpy(&priv->card_alive, &pkt->u.alive_frame,
1551 sizeof(struct iwl_alive_resp)); 1551 sizeof(struct iwl_alive_resp));
1552 pwork = &priv->alive_start; 1552 pwork = &priv->alive_start;
@@ -1569,7 +1569,7 @@ static void iwl3945_rx_reply_add_sta(struct iwl_priv *priv,
1569 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 1569 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1570#endif 1570#endif
1571 1571
1572 IWL_DEBUG_RX("Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status); 1572 IWL_DEBUG_RX(priv, "Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status);
1573 return; 1573 return;
1574} 1574}
1575 1575
@@ -1595,7 +1595,7 @@ static void iwl3945_rx_spectrum_measure_notif(struct iwl_priv *priv,
1595 struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif); 1595 struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif);
1596 1596
1597 if (!report->state) { 1597 if (!report->state) {
1598 IWL_DEBUG(IWL_DL_11H | IWL_DL_INFO, 1598 IWL_DEBUG(priv, IWL_DL_11H | IWL_DL_INFO,
1599 "Spectrum Measure Notification: Start\n"); 1599 "Spectrum Measure Notification: Start\n");
1600 return; 1600 return;
1601 } 1601 }
@@ -1611,7 +1611,7 @@ static void iwl3945_rx_pm_sleep_notif(struct iwl_priv *priv,
1611#ifdef CONFIG_IWLWIFI_DEBUG 1611#ifdef CONFIG_IWLWIFI_DEBUG
1612 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 1612 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1613 struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif); 1613 struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif);
1614 IWL_DEBUG_RX("sleep mode: %d, src: %d\n", 1614 IWL_DEBUG_RX(priv, "sleep mode: %d, src: %d\n",
1615 sleep->pm_sleep_mode, sleep->pm_wakeup_src); 1615 sleep->pm_sleep_mode, sleep->pm_wakeup_src);
1616#endif 1616#endif
1617} 1617}
@@ -1620,7 +1620,7 @@ static void iwl3945_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
1620 struct iwl_rx_mem_buffer *rxb) 1620 struct iwl_rx_mem_buffer *rxb)
1621{ 1621{
1622 struct iwl_rx_packet *pkt = (void *)rxb->skb->data; 1622 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1623 IWL_DEBUG_RADIO("Dumping %d bytes of unhandled " 1623 IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
1624 "notification for %s:\n", 1624 "notification for %s:\n",
1625 le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd)); 1625 le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
1626 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, 1626 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw,
@@ -1660,7 +1660,7 @@ static void iwl3945_rx_beacon_notif(struct iwl_priv *priv,
1660 struct iwl3945_beacon_notif *beacon = &(pkt->u.beacon_status); 1660 struct iwl3945_beacon_notif *beacon = &(pkt->u.beacon_status);
1661 u8 rate = beacon->beacon_notify_hdr.rate; 1661 u8 rate = beacon->beacon_notify_hdr.rate;
1662 1662
1663 IWL_DEBUG_RX("beacon status %x retries %d iss %d " 1663 IWL_DEBUG_RX(priv, "beacon status %x retries %d iss %d "
1664 "tsf %d %d rate %d\n", 1664 "tsf %d %d rate %d\n",
1665 le32_to_cpu(beacon->beacon_notify_hdr.status) & TX_STATUS_MSK, 1665 le32_to_cpu(beacon->beacon_notify_hdr.status) & TX_STATUS_MSK,
1666 beacon->beacon_notify_hdr.failure_frame, 1666 beacon->beacon_notify_hdr.failure_frame,
@@ -1683,7 +1683,7 @@ static void iwl3945_rx_reply_scan(struct iwl_priv *priv,
1683 struct iwl_scanreq_notification *notif = 1683 struct iwl_scanreq_notification *notif =
1684 (struct iwl_scanreq_notification *)pkt->u.raw; 1684 (struct iwl_scanreq_notification *)pkt->u.raw;
1685 1685
1686 IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status); 1686 IWL_DEBUG_RX(priv, "Scan request status = 0x%x\n", notif->status);
1687#endif 1687#endif
1688} 1688}
1689 1689
@@ -1695,7 +1695,7 @@ static void iwl3945_rx_scan_start_notif(struct iwl_priv *priv,
1695 struct iwl_scanstart_notification *notif = 1695 struct iwl_scanstart_notification *notif =
1696 (struct iwl_scanstart_notification *)pkt->u.raw; 1696 (struct iwl_scanstart_notification *)pkt->u.raw;
1697 priv->scan_start_tsf = le32_to_cpu(notif->tsf_low); 1697 priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
1698 IWL_DEBUG_SCAN("Scan start: " 1698 IWL_DEBUG_SCAN(priv, "Scan start: "
1699 "%d [802.11%s] " 1699 "%d [802.11%s] "
1700 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n", 1700 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
1701 notif->channel, 1701 notif->channel,
@@ -1714,7 +1714,7 @@ static void iwl3945_rx_scan_results_notif(struct iwl_priv *priv,
1714 (struct iwl_scanresults_notification *)pkt->u.raw; 1714 (struct iwl_scanresults_notification *)pkt->u.raw;
1715#endif 1715#endif
1716 1716
1717 IWL_DEBUG_SCAN("Scan ch.res: " 1717 IWL_DEBUG_SCAN(priv, "Scan ch.res: "
1718 "%d [802.11%s] " 1718 "%d [802.11%s] "
1719 "(TSF: 0x%08X:%08X) - %d " 1719 "(TSF: 0x%08X:%08X) - %d "
1720 "elapsed=%lu usec (%dms since last)\n", 1720 "elapsed=%lu usec (%dms since last)\n",
@@ -1740,7 +1740,7 @@ static void iwl3945_rx_scan_complete_notif(struct iwl_priv *priv,
1740 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw; 1740 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
1741#endif 1741#endif
1742 1742
1743 IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", 1743 IWL_DEBUG_SCAN(priv, "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
1744 scan_notif->scanned_channels, 1744 scan_notif->scanned_channels,
1745 scan_notif->tsf_low, 1745 scan_notif->tsf_low,
1746 scan_notif->tsf_high, scan_notif->status); 1746 scan_notif->tsf_high, scan_notif->status);
@@ -1751,7 +1751,7 @@ static void iwl3945_rx_scan_complete_notif(struct iwl_priv *priv,
1751 /* The scan completion notification came in, so kill that timer... */ 1751 /* The scan completion notification came in, so kill that timer... */
1752 cancel_delayed_work(&priv->scan_check); 1752 cancel_delayed_work(&priv->scan_check);
1753 1753
1754 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", 1754 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n",
1755 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? 1755 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
1756 "2.4" : "5.2", 1756 "2.4" : "5.2",
1757 jiffies_to_msecs(elapsed_jiffies 1757 jiffies_to_msecs(elapsed_jiffies
@@ -1769,7 +1769,7 @@ static void iwl3945_rx_scan_complete_notif(struct iwl_priv *priv,
1769 * then we reset the scan state machine and terminate, 1769 * then we reset the scan state machine and terminate,
1770 * re-queuing another scan if one has been requested */ 1770 * re-queuing another scan if one has been requested */
1771 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 1771 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
1772 IWL_DEBUG_INFO("Aborted scan completed.\n"); 1772 IWL_DEBUG_INFO(priv, "Aborted scan completed.\n");
1773 clear_bit(STATUS_SCAN_ABORTING, &priv->status); 1773 clear_bit(STATUS_SCAN_ABORTING, &priv->status);
1774 } else { 1774 } else {
1775 /* If there are more bands on this scan pass reschedule */ 1775 /* If there are more bands on this scan pass reschedule */
@@ -1779,11 +1779,11 @@ static void iwl3945_rx_scan_complete_notif(struct iwl_priv *priv,
1779 1779
1780 priv->last_scan_jiffies = jiffies; 1780 priv->last_scan_jiffies = jiffies;
1781 priv->next_scan_jiffies = 0; 1781 priv->next_scan_jiffies = 0;
1782 IWL_DEBUG_INFO("Setting scan to off\n"); 1782 IWL_DEBUG_INFO(priv, "Setting scan to off\n");
1783 1783
1784 clear_bit(STATUS_SCANNING, &priv->status); 1784 clear_bit(STATUS_SCANNING, &priv->status);
1785 1785
1786 IWL_DEBUG_INFO("Scan took %dms\n", 1786 IWL_DEBUG_INFO(priv, "Scan took %dms\n",
1787 jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies))); 1787 jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies)));
1788 1788
1789 queue_work(priv->workqueue, &priv->scan_completed); 1789 queue_work(priv->workqueue, &priv->scan_completed);
@@ -1804,7 +1804,7 @@ static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
1804 u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags); 1804 u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
1805 unsigned long status = priv->status; 1805 unsigned long status = priv->status;
1806 1806
1807 IWL_DEBUG_RF_KILL("Card state received: HW:%s SW:%s\n", 1807 IWL_DEBUG_RF_KILL(priv, "Card state received: HW:%s SW:%s\n",
1808 (flags & HW_CARD_DISABLED) ? "Kill" : "On", 1808 (flags & HW_CARD_DISABLED) ? "Kill" : "On",
1809 (flags & SW_CARD_DISABLED) ? "Kill" : "On"); 1809 (flags & SW_CARD_DISABLED) ? "Kill" : "On");
1810 1810
@@ -2265,7 +2265,7 @@ static void iwl3945_rx_handle(struct iwl_priv *priv)
2265 fill_rx = 1; 2265 fill_rx = 1;
2266 /* Rx interrupt, but nothing sent from uCode */ 2266 /* Rx interrupt, but nothing sent from uCode */
2267 if (i == r) 2267 if (i == r)
2268 IWL_DEBUG(IWL_DL_RX | IWL_DL_ISR, "r = %d, i = %d\n", r, i); 2268 IWL_DEBUG(priv, IWL_DL_RX | IWL_DL_ISR, "r = %d, i = %d\n", r, i);
2269 2269
2270 while (i != r) { 2270 while (i != r) {
2271 rxb = rxq->queue[i]; 2271 rxb = rxq->queue[i];
@@ -2296,13 +2296,13 @@ static void iwl3945_rx_handle(struct iwl_priv *priv)
2296 * handle those that need handling via function in 2296 * handle those that need handling via function in
2297 * rx_handlers table. See iwl3945_setup_rx_handlers() */ 2297 * rx_handlers table. See iwl3945_setup_rx_handlers() */
2298 if (priv->rx_handlers[pkt->hdr.cmd]) { 2298 if (priv->rx_handlers[pkt->hdr.cmd]) {
2299 IWL_DEBUG(IWL_DL_HCMD | IWL_DL_RX | IWL_DL_ISR, 2299 IWL_DEBUG(priv, IWL_DL_HCMD | IWL_DL_RX | IWL_DL_ISR,
2300 "r = %d, i = %d, %s, 0x%02x\n", r, i, 2300 "r = %d, i = %d, %s, 0x%02x\n", r, i,
2301 get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd); 2301 get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
2302 priv->rx_handlers[pkt->hdr.cmd] (priv, rxb); 2302 priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
2303 } else { 2303 } else {
2304 /* No handling needed */ 2304 /* No handling needed */
2305 IWL_DEBUG(IWL_DL_HCMD | IWL_DL_RX | IWL_DL_ISR, 2305 IWL_DEBUG(priv, IWL_DL_HCMD | IWL_DL_RX | IWL_DL_ISR,
2306 "r %d i %d No handler needed for %s, 0x%02x\n", 2306 "r %d i %d No handler needed for %s, 0x%02x\n",
2307 r, i, get_cmd_string(pkt->hdr.cmd), 2307 r, i, get_cmd_string(pkt->hdr.cmd),
2308 pkt->hdr.cmd); 2308 pkt->hdr.cmd);
@@ -2353,7 +2353,7 @@ static void iwl3945_rx_handle(struct iwl_priv *priv)
2353 2353
2354static void iwl3945_enable_interrupts(struct iwl_priv *priv) 2354static void iwl3945_enable_interrupts(struct iwl_priv *priv)
2355{ 2355{
2356 IWL_DEBUG_ISR("Enabling interrupts\n"); 2356 IWL_DEBUG_ISR(priv, "Enabling interrupts\n");
2357 set_bit(STATUS_INT_ENABLED, &priv->status); 2357 set_bit(STATUS_INT_ENABLED, &priv->status);
2358 iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK); 2358 iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK);
2359} 2359}
@@ -2379,7 +2379,7 @@ static inline void iwl3945_disable_interrupts(struct iwl_priv *priv)
2379 * from uCode or flow handler (Rx/Tx DMA) */ 2379 * from uCode or flow handler (Rx/Tx DMA) */
2380 iwl_write32(priv, CSR_INT, 0xffffffff); 2380 iwl_write32(priv, CSR_INT, 0xffffffff);
2381 iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff); 2381 iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff);
2382 IWL_DEBUG_ISR("Disabled interrupts\n"); 2382 IWL_DEBUG_ISR(priv, "Disabled interrupts\n");
2383} 2383}
2384 2384
2385static const char *desc_lookup(int i) 2385static const char *desc_lookup(int i)
@@ -2604,7 +2604,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
2604 if (priv->debug_level & IWL_DL_ISR) { 2604 if (priv->debug_level & IWL_DL_ISR) {
2605 /* just for debug */ 2605 /* just for debug */
2606 inta_mask = iwl_read32(priv, CSR_INT_MASK); 2606 inta_mask = iwl_read32(priv, CSR_INT_MASK);
2607 IWL_DEBUG_ISR("inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 2607 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
2608 inta, inta_mask, inta_fh); 2608 inta, inta_mask, inta_fh);
2609 } 2609 }
2610#endif 2610#endif
@@ -2638,12 +2638,12 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
2638 if (priv->debug_level & (IWL_DL_ISR)) { 2638 if (priv->debug_level & (IWL_DL_ISR)) {
2639 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 2639 /* NIC fires this, but we don't use it, redundant with WAKEUP */
2640 if (inta & CSR_INT_BIT_SCD) 2640 if (inta & CSR_INT_BIT_SCD)
2641 IWL_DEBUG_ISR("Scheduler finished to transmit " 2641 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
2642 "the frame/frames.\n"); 2642 "the frame/frames.\n");
2643 2643
2644 /* Alive notification via Rx interrupt will do the real work */ 2644 /* Alive notification via Rx interrupt will do the real work */
2645 if (inta & CSR_INT_BIT_ALIVE) 2645 if (inta & CSR_INT_BIT_ALIVE)
2646 IWL_DEBUG_ISR("Alive interrupt\n"); 2646 IWL_DEBUG_ISR(priv, "Alive interrupt\n");
2647 } 2647 }
2648#endif 2648#endif
2649 /* Safely ignore these bits for debug checks below */ 2649 /* Safely ignore these bits for debug checks below */
@@ -2659,7 +2659,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
2659 2659
2660 /* uCode wakes up after power-down sleep */ 2660 /* uCode wakes up after power-down sleep */
2661 if (inta & CSR_INT_BIT_WAKEUP) { 2661 if (inta & CSR_INT_BIT_WAKEUP) {
2662 IWL_DEBUG_ISR("Wakeup interrupt\n"); 2662 IWL_DEBUG_ISR(priv, "Wakeup interrupt\n");
2663 iwl_rx_queue_update_write_ptr(priv, &priv->rxq); 2663 iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
2664 iwl_txq_update_write_ptr(priv, &priv->txq[0]); 2664 iwl_txq_update_write_ptr(priv, &priv->txq[0]);
2665 iwl_txq_update_write_ptr(priv, &priv->txq[1]); 2665 iwl_txq_update_write_ptr(priv, &priv->txq[1]);
@@ -2680,7 +2680,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
2680 } 2680 }
2681 2681
2682 if (inta & CSR_INT_BIT_FH_TX) { 2682 if (inta & CSR_INT_BIT_FH_TX) {
2683 IWL_DEBUG_ISR("Tx interrupt\n"); 2683 IWL_DEBUG_ISR(priv, "Tx interrupt\n");
2684 2684
2685 iwl_write32(priv, CSR_FH_INT_STATUS, (1 << 6)); 2685 iwl_write32(priv, CSR_FH_INT_STATUS, (1 << 6));
2686 if (!iwl_grab_nic_access(priv)) { 2686 if (!iwl_grab_nic_access(priv)) {
@@ -2710,7 +2710,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
2710 inta = iwl_read32(priv, CSR_INT); 2710 inta = iwl_read32(priv, CSR_INT);
2711 inta_mask = iwl_read32(priv, CSR_INT_MASK); 2711 inta_mask = iwl_read32(priv, CSR_INT_MASK);
2712 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 2712 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
2713 IWL_DEBUG_ISR("End inta 0x%08x, enabled 0x%08x, fh 0x%08x, " 2713 IWL_DEBUG_ISR(priv, "End inta 0x%08x, enabled 0x%08x, fh 0x%08x, "
2714 "flags 0x%08lx\n", inta, inta_mask, inta_fh, flags); 2714 "flags 0x%08lx\n", inta, inta_mask, inta_fh, flags);
2715 } 2715 }
2716#endif 2716#endif
@@ -2742,7 +2742,7 @@ static irqreturn_t iwl3945_isr(int irq, void *data)
2742 * This may be due to IRQ shared with another device, 2742 * This may be due to IRQ shared with another device,
2743 * or due to sporadic interrupts thrown from our NIC. */ 2743 * or due to sporadic interrupts thrown from our NIC. */
2744 if (!inta && !inta_fh) { 2744 if (!inta && !inta_fh) {
2745 IWL_DEBUG_ISR("Ignore interrupt, inta == 0, inta_fh == 0\n"); 2745 IWL_DEBUG_ISR(priv, "Ignore interrupt, inta == 0, inta_fh == 0\n");
2746 goto none; 2746 goto none;
2747 } 2747 }
2748 2748
@@ -2752,7 +2752,7 @@ static irqreturn_t iwl3945_isr(int irq, void *data)
2752 goto unplugged; 2752 goto unplugged;
2753 } 2753 }
2754 2754
2755 IWL_DEBUG_ISR("ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 2755 IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
2756 inta, inta_mask, inta_fh); 2756 inta, inta_mask, inta_fh);
2757 2757
2758 inta &= ~CSR_INT_BIT_SCD; 2758 inta &= ~CSR_INT_BIT_SCD;
@@ -2806,7 +2806,7 @@ static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
2806 2806
2807 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel); 2807 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel);
2808 if (!is_channel_valid(ch_info)) { 2808 if (!is_channel_valid(ch_info)) {
2809 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n", 2809 IWL_DEBUG_SCAN(priv, "Channel %d is INVALID for this band.\n",
2810 scan_ch->channel); 2810 scan_ch->channel);
2811 continue; 2811 continue;
2812 } 2812 }
@@ -2854,7 +2854,7 @@ static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
2854 */ 2854 */
2855 } 2855 }
2856 2856
2857 IWL_DEBUG_SCAN("Scanning %d [%s %d]\n", 2857 IWL_DEBUG_SCAN(priv, "Scanning %d [%s %d]\n",
2858 scan_ch->channel, 2858 scan_ch->channel,
2859 (scan_ch->type & 1) ? "ACTIVE" : "PASSIVE", 2859 (scan_ch->type & 1) ? "ACTIVE" : "PASSIVE",
2860 (scan_ch->type & 1) ? 2860 (scan_ch->type & 1) ?
@@ -2864,7 +2864,7 @@ static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
2864 added++; 2864 added++;
2865 } 2865 }
2866 2866
2867 IWL_DEBUG_SCAN("total channels to scan %d \n", added); 2867 IWL_DEBUG_SCAN(priv, "total channels to scan %d \n", added);
2868 return added; 2868 return added;
2869} 2869}
2870 2870
@@ -2915,7 +2915,7 @@ static int iwl3945_verify_inst_full(struct iwl_priv *priv, __le32 *image, u32 le
2915 int rc = 0; 2915 int rc = 0;
2916 u32 errcnt; 2916 u32 errcnt;
2917 2917
2918 IWL_DEBUG_INFO("ucode inst image size is %u\n", len); 2918 IWL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len);
2919 2919
2920 rc = iwl_grab_nic_access(priv); 2920 rc = iwl_grab_nic_access(priv);
2921 if (rc) 2921 if (rc)
@@ -2944,7 +2944,8 @@ static int iwl3945_verify_inst_full(struct iwl_priv *priv, __le32 *image, u32 le
2944 iwl_release_nic_access(priv); 2944 iwl_release_nic_access(priv);
2945 2945
2946 if (!errcnt) 2946 if (!errcnt)
2947 IWL_DEBUG_INFO("ucode image in INSTRUCTION memory is good\n"); 2947 IWL_DEBUG_INFO(priv,
2948 "ucode image in INSTRUCTION memory is good\n");
2948 2949
2949 return rc; 2950 return rc;
2950} 2951}
@@ -2962,7 +2963,7 @@ static int iwl3945_verify_inst_sparse(struct iwl_priv *priv, __le32 *image, u32
2962 u32 errcnt = 0; 2963 u32 errcnt = 0;
2963 u32 i; 2964 u32 i;
2964 2965
2965 IWL_DEBUG_INFO("ucode inst image size is %u\n", len); 2966 IWL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len);
2966 2967
2967 rc = iwl_grab_nic_access(priv); 2968 rc = iwl_grab_nic_access(priv);
2968 if (rc) 2969 if (rc)
@@ -3009,7 +3010,7 @@ static int iwl3945_verify_ucode(struct iwl_priv *priv)
3009 len = priv->ucode_boot.len; 3010 len = priv->ucode_boot.len;
3010 rc = iwl3945_verify_inst_sparse(priv, image, len); 3011 rc = iwl3945_verify_inst_sparse(priv, image, len);
3011 if (rc == 0) { 3012 if (rc == 0) {
3012 IWL_DEBUG_INFO("Bootstrap uCode is good in inst SRAM\n"); 3013 IWL_DEBUG_INFO(priv, "Bootstrap uCode is good in inst SRAM\n");
3013 return 0; 3014 return 0;
3014 } 3015 }
3015 3016
@@ -3018,7 +3019,7 @@ static int iwl3945_verify_ucode(struct iwl_priv *priv)
3018 len = priv->ucode_init.len; 3019 len = priv->ucode_init.len;
3019 rc = iwl3945_verify_inst_sparse(priv, image, len); 3020 rc = iwl3945_verify_inst_sparse(priv, image, len);
3020 if (rc == 0) { 3021 if (rc == 0) {
3021 IWL_DEBUG_INFO("Initialize uCode is good in inst SRAM\n"); 3022 IWL_DEBUG_INFO(priv, "Initialize uCode is good in inst SRAM\n");
3022 return 0; 3023 return 0;
3023 } 3024 }
3024 3025
@@ -3027,7 +3028,7 @@ static int iwl3945_verify_ucode(struct iwl_priv *priv)
3027 len = priv->ucode_code.len; 3028 len = priv->ucode_code.len;
3028 rc = iwl3945_verify_inst_sparse(priv, image, len); 3029 rc = iwl3945_verify_inst_sparse(priv, image, len);
3029 if (rc == 0) { 3030 if (rc == 0) {
3030 IWL_DEBUG_INFO("Runtime uCode is good in inst SRAM\n"); 3031 IWL_DEBUG_INFO(priv, "Runtime uCode is good in inst SRAM\n");
3031 return 0; 3032 return 0;
3032 } 3033 }
3033 3034
@@ -3086,7 +3087,8 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
3086 "which is deprecated. " 3087 "which is deprecated. "
3087 " Please use API v%u instead.\n", 3088 " Please use API v%u instead.\n",
3088 buf, api_max); 3089 buf, api_max);
3089 IWL_DEBUG_INFO("Got firmware '%s' file (%zd bytes) from disk\n", 3090 IWL_DEBUG_INFO(priv, "Got firmware '%s' file "
3091 "(%zd bytes) from disk\n",
3090 buf, ucode_raw->size); 3092 buf, ucode_raw->size);
3091 break; 3093 break;
3092 } 3094 }
@@ -3137,13 +3139,18 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
3137 IWL_UCODE_API(priv->ucode_ver), 3139 IWL_UCODE_API(priv->ucode_ver),
3138 IWL_UCODE_SERIAL(priv->ucode_ver)); 3140 IWL_UCODE_SERIAL(priv->ucode_ver));
3139 3141
3140 IWL_DEBUG_INFO("f/w package hdr ucode version raw = 0x%x\n", 3142 IWL_DEBUG_INFO(priv, "f/w package hdr ucode version raw = 0x%x\n",
3141 priv->ucode_ver); 3143 priv->ucode_ver);
3142 IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n", inst_size); 3144 IWL_DEBUG_INFO(priv, "f/w package hdr runtime inst size = %u\n",
3143 IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n", data_size); 3145 inst_size);
3144 IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n", init_size); 3146 IWL_DEBUG_INFO(priv, "f/w package hdr runtime data size = %u\n",
3145 IWL_DEBUG_INFO("f/w package hdr init data size = %u\n", init_data_size); 3147 data_size);
3146 IWL_DEBUG_INFO("f/w package hdr boot inst size = %u\n", boot_size); 3148 IWL_DEBUG_INFO(priv, "f/w package hdr init inst size = %u\n",
3149 init_size);
3150 IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %u\n",
3151 init_data_size);
3152 IWL_DEBUG_INFO(priv, "f/w package hdr boot inst size = %u\n",
3153 boot_size);
3147 3154
3148 3155
3149 /* Verify size of file vs. image size info in file's header */ 3156 /* Verify size of file vs. image size info in file's header */
@@ -3151,40 +3158,43 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
3151 inst_size + data_size + init_size + 3158 inst_size + data_size + init_size +
3152 init_data_size + boot_size) { 3159 init_data_size + boot_size) {
3153 3160
3154 IWL_DEBUG_INFO("uCode file size %d too small\n", 3161 IWL_DEBUG_INFO(priv, "uCode file size %zd too small\n",
3155 (int)ucode_raw->size); 3162 ucode_raw->size);
3156 ret = -EINVAL; 3163 ret = -EINVAL;
3157 goto err_release; 3164 goto err_release;
3158 } 3165 }
3159 3166
3160 /* Verify that uCode images will fit in card's SRAM */ 3167 /* Verify that uCode images will fit in card's SRAM */
3161 if (inst_size > IWL39_MAX_INST_SIZE) { 3168 if (inst_size > IWL39_MAX_INST_SIZE) {
3162 IWL_DEBUG_INFO("uCode instr len %d too large to fit in\n", 3169 IWL_DEBUG_INFO(priv, "uCode instr len %d too large to fit in\n",
3163 inst_size); 3170 inst_size);
3164 ret = -EINVAL; 3171 ret = -EINVAL;
3165 goto err_release; 3172 goto err_release;
3166 } 3173 }
3167 3174
3168 if (data_size > IWL39_MAX_DATA_SIZE) { 3175 if (data_size > IWL39_MAX_DATA_SIZE) {
3169 IWL_DEBUG_INFO("uCode data len %d too large to fit in\n", 3176 IWL_DEBUG_INFO(priv, "uCode data len %d too large to fit in\n",
3170 data_size); 3177 data_size);
3171 ret = -EINVAL; 3178 ret = -EINVAL;
3172 goto err_release; 3179 goto err_release;
3173 } 3180 }
3174 if (init_size > IWL39_MAX_INST_SIZE) { 3181 if (init_size > IWL39_MAX_INST_SIZE) {
3175 IWL_DEBUG_INFO("uCode init instr len %d too large to fit in\n", 3182 IWL_DEBUG_INFO(priv,
3183 "uCode init instr len %d too large to fit in\n",
3176 init_size); 3184 init_size);
3177 ret = -EINVAL; 3185 ret = -EINVAL;
3178 goto err_release; 3186 goto err_release;
3179 } 3187 }
3180 if (init_data_size > IWL39_MAX_DATA_SIZE) { 3188 if (init_data_size > IWL39_MAX_DATA_SIZE) {
3181 IWL_DEBUG_INFO("uCode init data len %d too large to fit in\n", 3189 IWL_DEBUG_INFO(priv,
3190 "uCode init data len %d too large to fit in\n",
3182 init_data_size); 3191 init_data_size);
3183 ret = -EINVAL; 3192 ret = -EINVAL;
3184 goto err_release; 3193 goto err_release;
3185 } 3194 }
3186 if (boot_size > IWL39_MAX_BSM_SIZE) { 3195 if (boot_size > IWL39_MAX_BSM_SIZE) {
3187 IWL_DEBUG_INFO("uCode boot instr len %d too large to fit in\n", 3196 IWL_DEBUG_INFO(priv,
3197 "uCode boot instr len %d too large to fit in\n",
3188 boot_size); 3198 boot_size);
3189 ret = -EINVAL; 3199 ret = -EINVAL;
3190 goto err_release; 3200 goto err_release;
@@ -3234,16 +3244,18 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
3234 /* Runtime instructions (first block of data in file) */ 3244 /* Runtime instructions (first block of data in file) */
3235 src = &ucode->data[0]; 3245 src = &ucode->data[0];
3236 len = priv->ucode_code.len; 3246 len = priv->ucode_code.len;
3237 IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %Zd\n", len); 3247 IWL_DEBUG_INFO(priv,
3248 "Copying (but not loading) uCode instr len %zd\n", len);
3238 memcpy(priv->ucode_code.v_addr, src, len); 3249 memcpy(priv->ucode_code.v_addr, src, len);
3239 IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n", 3250 IWL_DEBUG_INFO(priv, "uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n",
3240 priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr); 3251 priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr);
3241 3252
3242 /* Runtime data (2nd block) 3253 /* Runtime data (2nd block)
3243 * NOTE: Copy into backup buffer will be done in iwl3945_up() */ 3254 * NOTE: Copy into backup buffer will be done in iwl3945_up() */
3244 src = &ucode->data[inst_size]; 3255 src = &ucode->data[inst_size];
3245 len = priv->ucode_data.len; 3256 len = priv->ucode_data.len;
3246 IWL_DEBUG_INFO("Copying (but not loading) uCode data len %Zd\n", len); 3257 IWL_DEBUG_INFO(priv,
3258 "Copying (but not loading) uCode data len %zd\n", len);
3247 memcpy(priv->ucode_data.v_addr, src, len); 3259 memcpy(priv->ucode_data.v_addr, src, len);
3248 memcpy(priv->ucode_data_backup.v_addr, src, len); 3260 memcpy(priv->ucode_data_backup.v_addr, src, len);
3249 3261
@@ -3251,8 +3263,8 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
3251 if (init_size) { 3263 if (init_size) {
3252 src = &ucode->data[inst_size + data_size]; 3264 src = &ucode->data[inst_size + data_size];
3253 len = priv->ucode_init.len; 3265 len = priv->ucode_init.len;
3254 IWL_DEBUG_INFO("Copying (but not loading) init instr len %Zd\n", 3266 IWL_DEBUG_INFO(priv,
3255 len); 3267 "Copying (but not loading) init instr len %zd\n", len);
3256 memcpy(priv->ucode_init.v_addr, src, len); 3268 memcpy(priv->ucode_init.v_addr, src, len);
3257 } 3269 }
3258 3270
@@ -3260,16 +3272,16 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
3260 if (init_data_size) { 3272 if (init_data_size) {
3261 src = &ucode->data[inst_size + data_size + init_size]; 3273 src = &ucode->data[inst_size + data_size + init_size];
3262 len = priv->ucode_init_data.len; 3274 len = priv->ucode_init_data.len;
3263 IWL_DEBUG_INFO("Copying (but not loading) init data len %d\n", 3275 IWL_DEBUG_INFO(priv,
3264 (int)len); 3276 "Copying (but not loading) init data len %zd\n", len);
3265 memcpy(priv->ucode_init_data.v_addr, src, len); 3277 memcpy(priv->ucode_init_data.v_addr, src, len);
3266 } 3278 }
3267 3279
3268 /* Bootstrap instructions (5th block) */ 3280 /* Bootstrap instructions (5th block) */
3269 src = &ucode->data[inst_size + data_size + init_size + init_data_size]; 3281 src = &ucode->data[inst_size + data_size + init_size + init_data_size];
3270 len = priv->ucode_boot.len; 3282 len = priv->ucode_boot.len;
3271 IWL_DEBUG_INFO("Copying (but not loading) boot instr len %d\n", 3283 IWL_DEBUG_INFO(priv,
3272 (int)len); 3284 "Copying (but not loading) boot instr len %zd\n", len);
3273 memcpy(priv->ucode_boot.v_addr, src, len); 3285 memcpy(priv->ucode_boot.v_addr, src, len);
3274 3286
3275 /* We have our copies now, allow OS release its copies */ 3287 /* We have our copies now, allow OS release its copies */
@@ -3331,7 +3343,7 @@ static int iwl3945_set_ucode_ptrs(struct iwl_priv *priv)
3331 3343
3332 spin_unlock_irqrestore(&priv->lock, flags); 3344 spin_unlock_irqrestore(&priv->lock, flags);
3333 3345
3334 IWL_DEBUG_INFO("Runtime uCode pointers are set.\n"); 3346 IWL_DEBUG_INFO(priv, "Runtime uCode pointers are set.\n");
3335 3347
3336 return rc; 3348 return rc;
3337} 3349}
@@ -3349,7 +3361,7 @@ static void iwl3945_init_alive_start(struct iwl_priv *priv)
3349 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { 3361 if (priv->card_alive_init.is_valid != UCODE_VALID_OK) {
3350 /* We had an error bringing up the hardware, so take it 3362 /* We had an error bringing up the hardware, so take it
3351 * all the way back down so we can try again */ 3363 * all the way back down so we can try again */
3352 IWL_DEBUG_INFO("Initialize Alive failed.\n"); 3364 IWL_DEBUG_INFO(priv, "Initialize Alive failed.\n");
3353 goto restart; 3365 goto restart;
3354 } 3366 }
3355 3367
@@ -3359,18 +3371,18 @@ static void iwl3945_init_alive_start(struct iwl_priv *priv)
3359 if (iwl3945_verify_ucode(priv)) { 3371 if (iwl3945_verify_ucode(priv)) {
3360 /* Runtime instruction load was bad; 3372 /* Runtime instruction load was bad;
3361 * take it all the way back down so we can try again */ 3373 * take it all the way back down so we can try again */
3362 IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n"); 3374 IWL_DEBUG_INFO(priv, "Bad \"initialize\" uCode load.\n");
3363 goto restart; 3375 goto restart;
3364 } 3376 }
3365 3377
3366 /* Send pointers to protocol/runtime uCode image ... init code will 3378 /* Send pointers to protocol/runtime uCode image ... init code will
3367 * load and launch runtime uCode, which will send us another "Alive" 3379 * load and launch runtime uCode, which will send us another "Alive"
3368 * notification. */ 3380 * notification. */
3369 IWL_DEBUG_INFO("Initialization Alive received.\n"); 3381 IWL_DEBUG_INFO(priv, "Initialization Alive received.\n");
3370 if (iwl3945_set_ucode_ptrs(priv)) { 3382 if (iwl3945_set_ucode_ptrs(priv)) {
3371 /* Runtime instruction load won't happen; 3383 /* Runtime instruction load won't happen;
3372 * take it all the way back down so we can try again */ 3384 * take it all the way back down so we can try again */
3373 IWL_DEBUG_INFO("Couldn't set up uCode pointers.\n"); 3385 IWL_DEBUG_INFO(priv, "Couldn't set up uCode pointers.\n");
3374 goto restart; 3386 goto restart;
3375 } 3387 }
3376 return; 3388 return;
@@ -3395,12 +3407,12 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
3395 int thermal_spin = 0; 3407 int thermal_spin = 0;
3396 u32 rfkill; 3408 u32 rfkill;
3397 3409
3398 IWL_DEBUG_INFO("Runtime Alive received.\n"); 3410 IWL_DEBUG_INFO(priv, "Runtime Alive received.\n");
3399 3411
3400 if (priv->card_alive.is_valid != UCODE_VALID_OK) { 3412 if (priv->card_alive.is_valid != UCODE_VALID_OK) {
3401 /* We had an error bringing up the hardware, so take it 3413 /* We had an error bringing up the hardware, so take it
3402 * all the way back down so we can try again */ 3414 * all the way back down so we can try again */
3403 IWL_DEBUG_INFO("Alive failed.\n"); 3415 IWL_DEBUG_INFO(priv, "Alive failed.\n");
3404 goto restart; 3416 goto restart;
3405 } 3417 }
3406 3418
@@ -3410,7 +3422,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
3410 if (iwl3945_verify_ucode(priv)) { 3422 if (iwl3945_verify_ucode(priv)) {
3411 /* Runtime instruction load was bad; 3423 /* Runtime instruction load was bad;
3412 * take it all the way back down so we can try again */ 3424 * take it all the way back down so we can try again */
3413 IWL_DEBUG_INFO("Bad runtime uCode load.\n"); 3425 IWL_DEBUG_INFO(priv, "Bad runtime uCode load.\n");
3414 goto restart; 3426 goto restart;
3415 } 3427 }
3416 3428
@@ -3423,7 +3435,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
3423 } 3435 }
3424 3436
3425 rfkill = iwl_read_prph(priv, APMG_RFKILL_REG); 3437 rfkill = iwl_read_prph(priv, APMG_RFKILL_REG);
3426 IWL_DEBUG_INFO("RFKILL status: 0x%x\n", rfkill); 3438 IWL_DEBUG_INFO(priv, "RFKILL status: 0x%x\n", rfkill);
3427 iwl_release_nic_access(priv); 3439 iwl_release_nic_access(priv);
3428 3440
3429 if (rfkill & 0x1) { 3441 if (rfkill & 0x1) {
@@ -3436,7 +3448,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
3436 } 3448 }
3437 3449
3438 if (thermal_spin) 3450 if (thermal_spin)
3439 IWL_DEBUG_INFO("Thermal calibration took %dus\n", 3451 IWL_DEBUG_INFO(priv, "Thermal calibration took %dus\n",
3440 thermal_spin * 10); 3452 thermal_spin * 10);
3441 } else 3453 } else
3442 set_bit(STATUS_RF_KILL_HW, &priv->status); 3454 set_bit(STATUS_RF_KILL_HW, &priv->status);
@@ -3479,7 +3491,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
3479 3491
3480 iwl3945_led_register(priv); 3492 iwl3945_led_register(priv);
3481 3493
3482 IWL_DEBUG_INFO("ALIVE processing complete.\n"); 3494 IWL_DEBUG_INFO(priv, "ALIVE processing complete.\n");
3483 set_bit(STATUS_READY, &priv->status); 3495 set_bit(STATUS_READY, &priv->status);
3484 wake_up_interruptible(&priv->wait_command_queue); 3496 wake_up_interruptible(&priv->wait_command_queue);
3485 3497
@@ -3508,7 +3520,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
3508 int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status); 3520 int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status);
3509 struct ieee80211_conf *conf = NULL; 3521 struct ieee80211_conf *conf = NULL;
3510 3522
3511 IWL_DEBUG_INFO(DRV_NAME " is going down\n"); 3523 IWL_DEBUG_INFO(priv, DRV_NAME " is going down\n");
3512 3524
3513 conf = ieee80211_get_hw_conf(priv->hw); 3525 conf = ieee80211_get_hw_conf(priv->hw);
3514 3526
@@ -3695,7 +3707,7 @@ static int __iwl3945_up(struct iwl_priv *priv)
3695 /* start card; "initialize" will load runtime ucode */ 3707 /* start card; "initialize" will load runtime ucode */
3696 iwl3945_nic_start(priv); 3708 iwl3945_nic_start(priv);
3697 3709
3698 IWL_DEBUG_INFO(DRV_NAME " is coming up\n"); 3710 IWL_DEBUG_INFO(priv, DRV_NAME " is coming up\n");
3699 3711
3700 return 0; 3712 return 0;
3701 } 3713 }
@@ -3796,34 +3808,36 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3796 /* This should never be called or scheduled if there is currently 3808 /* This should never be called or scheduled if there is currently
3797 * a scan active in the hardware. */ 3809 * a scan active in the hardware. */
3798 if (test_bit(STATUS_SCAN_HW, &priv->status)) { 3810 if (test_bit(STATUS_SCAN_HW, &priv->status)) {
3799 IWL_DEBUG_INFO("Multiple concurrent scan requests in parallel. " 3811 IWL_DEBUG_INFO(priv, "Multiple concurrent scan requests "
3800 "Ignoring second request.\n"); 3812 "Ignoring second request.\n");
3801 rc = -EIO; 3813 rc = -EIO;
3802 goto done; 3814 goto done;
3803 } 3815 }
3804 3816
3805 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) { 3817 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
3806 IWL_DEBUG_SCAN("Aborting scan due to device shutdown\n"); 3818 IWL_DEBUG_SCAN(priv, "Aborting scan due to device shutdown\n");
3807 goto done; 3819 goto done;
3808 } 3820 }
3809 3821
3810 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 3822 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
3811 IWL_DEBUG_HC("Scan request while abort pending. Queuing.\n"); 3823 IWL_DEBUG_HC(priv,
3824 "Scan request while abort pending. Queuing.\n");
3812 goto done; 3825 goto done;
3813 } 3826 }
3814 3827
3815 if (iwl_is_rfkill(priv)) { 3828 if (iwl_is_rfkill(priv)) {
3816 IWL_DEBUG_HC("Aborting scan due to RF Kill activation\n"); 3829 IWL_DEBUG_HC(priv, "Aborting scan due to RF Kill activation\n");
3817 goto done; 3830 goto done;
3818 } 3831 }
3819 3832
3820 if (!test_bit(STATUS_READY, &priv->status)) { 3833 if (!test_bit(STATUS_READY, &priv->status)) {
3821 IWL_DEBUG_HC("Scan request while uninitialized. Queuing.\n"); 3834 IWL_DEBUG_HC(priv,
3835 "Scan request while uninitialized. Queuing.\n");
3822 goto done; 3836 goto done;
3823 } 3837 }
3824 3838
3825 if (!priv->scan_bands) { 3839 if (!priv->scan_bands) {
3826 IWL_DEBUG_HC("Aborting scan due to no requested bands\n"); 3840 IWL_DEBUG_HC(priv, "Aborting scan due to no requested bands\n");
3827 goto done; 3841 goto done;
3828 } 3842 }
3829 3843
@@ -3848,7 +3862,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3848 u32 scan_suspend_time = 100; 3862 u32 scan_suspend_time = 100;
3849 unsigned long flags; 3863 unsigned long flags;
3850 3864
3851 IWL_DEBUG_INFO("Scanning while associated...\n"); 3865 IWL_DEBUG_INFO(priv, "Scanning while associated...\n");
3852 3866
3853 spin_lock_irqsave(&priv->lock, flags); 3867 spin_lock_irqsave(&priv->lock, flags);
3854 interval = priv->beacon_int; 3868 interval = priv->beacon_int;
@@ -3870,15 +3884,14 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3870 (extra | ((suspend_time % interval) * 1024)); 3884 (extra | ((suspend_time % interval) * 1024));
3871 3885
3872 scan->suspend_time = cpu_to_le32(scan_suspend_time); 3886 scan->suspend_time = cpu_to_le32(scan_suspend_time);
3873 IWL_DEBUG_SCAN("suspend_time 0x%X beacon interval %d\n", 3887 IWL_DEBUG_SCAN(priv, "suspend_time 0x%X beacon interval %d\n",
3874 scan_suspend_time, interval); 3888 scan_suspend_time, interval);
3875 } 3889 }
3876 3890
3877 /* We should add the ability for user to lock to PASSIVE ONLY */ 3891 /* We should add the ability for user to lock to PASSIVE ONLY */
3878 if (priv->one_direct_scan) { 3892 if (priv->one_direct_scan) {
3879 IWL_DEBUG_SCAN 3893 IWL_DEBUG_SCAN(priv, "Kicking off one direct scan for '%s'\n",
3880 ("Kicking off one direct scan for '%s'\n", 3894 print_ssid(ssid, priv->direct_ssid,
3881 print_ssid(ssid, priv->direct_ssid,
3882 priv->direct_ssid_len)); 3895 priv->direct_ssid_len));
3883 scan->direct_scan[0].id = WLAN_EID_SSID; 3896 scan->direct_scan[0].id = WLAN_EID_SSID;
3884 scan->direct_scan[0].len = priv->direct_ssid_len; 3897 scan->direct_scan[0].len = priv->direct_ssid_len;
@@ -3886,7 +3899,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3886 priv->direct_ssid, priv->direct_ssid_len); 3899 priv->direct_ssid, priv->direct_ssid_len);
3887 n_probes++; 3900 n_probes++;
3888 } else 3901 } else
3889 IWL_DEBUG_SCAN("Kicking off one indirect scan.\n"); 3902 IWL_DEBUG_SCAN(priv, "Kicking off one indirect scan.\n");
3890 3903
3891 /* We don't build a direct scan probe request; the uCode will do 3904 /* We don't build a direct scan probe request; the uCode will do
3892 * that based on the direct_mask added to each channel entry */ 3905 * that based on the direct_mask added to each channel entry */
@@ -3927,7 +3940,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3927 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 3940 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
3928 3941
3929 if (scan->channel_count == 0) { 3942 if (scan->channel_count == 0) {
3930 IWL_DEBUG_SCAN("channel count %d\n", scan->channel_count); 3943 IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count);
3931 goto done; 3944 goto done;
3932 } 3945 }
3933 3946
@@ -4011,7 +4024,7 @@ static void iwl3945_post_associate(struct iwl_priv *priv)
4011 } 4024 }
4012 4025
4013 4026
4014 IWL_DEBUG_ASSOC("Associated as %d to: %pM\n", 4027 IWL_DEBUG_ASSOC(priv, "Associated as %d to: %pM\n",
4015 priv->assoc_id, priv->active_rxon.bssid_addr); 4028 priv->assoc_id, priv->active_rxon.bssid_addr);
4016 4029
4017 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 4030 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
@@ -4039,7 +4052,7 @@ static void iwl3945_post_associate(struct iwl_priv *priv)
4039 4052
4040 priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id); 4053 priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
4041 4054
4042 IWL_DEBUG_ASSOC("assoc id %d beacon interval %d\n", 4055 IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n",
4043 priv->assoc_id, priv->beacon_int); 4056 priv->assoc_id, priv->beacon_int);
4044 4057
4045 if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 4058 if (priv->assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE)
@@ -4105,7 +4118,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
4105 struct iwl_priv *priv = hw->priv; 4118 struct iwl_priv *priv = hw->priv;
4106 int ret; 4119 int ret;
4107 4120
4108 IWL_DEBUG_MAC80211("enter\n"); 4121 IWL_DEBUG_MAC80211(priv, "enter\n");
4109 4122
4110 /* we should be verifying the device is ready to be opened */ 4123 /* we should be verifying the device is ready to be opened */
4111 mutex_lock(&priv->mutex); 4124 mutex_lock(&priv->mutex);
@@ -4132,7 +4145,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
4132 if (ret) 4145 if (ret)
4133 goto out_release_irq; 4146 goto out_release_irq;
4134 4147
4135 IWL_DEBUG_INFO("Start UP work.\n"); 4148 IWL_DEBUG_INFO(priv, "Start UP work.\n");
4136 4149
4137 if (test_bit(STATUS_IN_SUSPEND, &priv->status)) 4150 if (test_bit(STATUS_IN_SUSPEND, &priv->status))
4138 return 0; 4151 return 0;
@@ -4157,12 +4170,12 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
4157 cancel_delayed_work(&priv->rfkill_poll); 4170 cancel_delayed_work(&priv->rfkill_poll);
4158 4171
4159 priv->is_open = 1; 4172 priv->is_open = 1;
4160 IWL_DEBUG_MAC80211("leave\n"); 4173 IWL_DEBUG_MAC80211(priv, "leave\n");
4161 return 0; 4174 return 0;
4162 4175
4163out_release_irq: 4176out_release_irq:
4164 priv->is_open = 0; 4177 priv->is_open = 0;
4165 IWL_DEBUG_MAC80211("leave - failed\n"); 4178 IWL_DEBUG_MAC80211(priv, "leave - failed\n");
4166 return ret; 4179 return ret;
4167} 4180}
4168 4181
@@ -4170,10 +4183,10 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
4170{ 4183{
4171 struct iwl_priv *priv = hw->priv; 4184 struct iwl_priv *priv = hw->priv;
4172 4185
4173 IWL_DEBUG_MAC80211("enter\n"); 4186 IWL_DEBUG_MAC80211(priv, "enter\n");
4174 4187
4175 if (!priv->is_open) { 4188 if (!priv->is_open) {
4176 IWL_DEBUG_MAC80211("leave - skip\n"); 4189 IWL_DEBUG_MAC80211(priv, "leave - skip\n");
4177 return; 4190 return;
4178 } 4191 }
4179 4192
@@ -4196,22 +4209,22 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
4196 queue_delayed_work(priv->workqueue, &priv->rfkill_poll, 4209 queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
4197 round_jiffies_relative(2 * HZ)); 4210 round_jiffies_relative(2 * HZ));
4198 4211
4199 IWL_DEBUG_MAC80211("leave\n"); 4212 IWL_DEBUG_MAC80211(priv, "leave\n");
4200} 4213}
4201 4214
4202static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 4215static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
4203{ 4216{
4204 struct iwl_priv *priv = hw->priv; 4217 struct iwl_priv *priv = hw->priv;
4205 4218
4206 IWL_DEBUG_MAC80211("enter\n"); 4219 IWL_DEBUG_MAC80211(priv, "enter\n");
4207 4220
4208 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 4221 IWL_DEBUG_TX(priv, "dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
4209 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 4222 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
4210 4223
4211 if (iwl3945_tx_skb(priv, skb)) 4224 if (iwl3945_tx_skb(priv, skb))
4212 dev_kfree_skb_any(skb); 4225 dev_kfree_skb_any(skb);
4213 4226
4214 IWL_DEBUG_MAC80211("leave\n"); 4227 IWL_DEBUG_MAC80211(priv, "leave\n");
4215 return NETDEV_TX_OK; 4228 return NETDEV_TX_OK;
4216} 4229}
4217 4230
@@ -4221,10 +4234,10 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
4221 struct iwl_priv *priv = hw->priv; 4234 struct iwl_priv *priv = hw->priv;
4222 unsigned long flags; 4235 unsigned long flags;
4223 4236
4224 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); 4237 IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);
4225 4238
4226 if (priv->vif) { 4239 if (priv->vif) {
4227 IWL_DEBUG_MAC80211("leave - vif != NULL\n"); 4240 IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
4228 return -EOPNOTSUPP; 4241 return -EOPNOTSUPP;
4229 } 4242 }
4230 4243
@@ -4237,7 +4250,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
4237 mutex_lock(&priv->mutex); 4250 mutex_lock(&priv->mutex);
4238 4251
4239 if (conf->mac_addr) { 4252 if (conf->mac_addr) {
4240 IWL_DEBUG_MAC80211("Set: %pM\n", conf->mac_addr); 4253 IWL_DEBUG_MAC80211(priv, "Set: %pM\n", conf->mac_addr);
4241 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 4254 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
4242 } 4255 }
4243 4256
@@ -4246,7 +4259,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
4246 4259
4247 mutex_unlock(&priv->mutex); 4260 mutex_unlock(&priv->mutex);
4248 4261
4249 IWL_DEBUG_MAC80211("leave\n"); 4262 IWL_DEBUG_MAC80211(priv, "leave\n");
4250 return 0; 4263 return 0;
4251} 4264}
4252 4265
@@ -4266,17 +4279,18 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
4266 int ret = 0; 4279 int ret = 0;
4267 4280
4268 mutex_lock(&priv->mutex); 4281 mutex_lock(&priv->mutex);
4269 IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel->hw_value); 4282 IWL_DEBUG_MAC80211(priv, "enter to channel %d\n",
4283 conf->channel->hw_value);
4270 4284
4271 if (!iwl_is_ready(priv)) { 4285 if (!iwl_is_ready(priv)) {
4272 IWL_DEBUG_MAC80211("leave - not ready\n"); 4286 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
4273 ret = -EIO; 4287 ret = -EIO;
4274 goto out; 4288 goto out;
4275 } 4289 }
4276 4290
4277 if (unlikely(!iwl3945_mod_params.disable_hw_scan && 4291 if (unlikely(!iwl3945_mod_params.disable_hw_scan &&
4278 test_bit(STATUS_SCANNING, &priv->status))) { 4292 test_bit(STATUS_SCANNING, &priv->status))) {
4279 IWL_DEBUG_MAC80211("leave - scanning\n"); 4293 IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
4280 set_bit(STATUS_CONF_PENDING, &priv->status); 4294 set_bit(STATUS_CONF_PENDING, &priv->status);
4281 mutex_unlock(&priv->mutex); 4295 mutex_unlock(&priv->mutex);
4282 return 0; 4296 return 0;
@@ -4287,9 +4301,10 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
4287 ch_info = iwl_get_channel_info(priv, conf->channel->band, 4301 ch_info = iwl_get_channel_info(priv, conf->channel->band,
4288 conf->channel->hw_value); 4302 conf->channel->hw_value);
4289 if (!is_channel_valid(ch_info)) { 4303 if (!is_channel_valid(ch_info)) {
4290 IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this band.\n", 4304 IWL_DEBUG_SCAN(priv,
4291 conf->channel->hw_value, conf->channel->band); 4305 "Channel %d [%d] is INVALID for this band.\n",
4292 IWL_DEBUG_MAC80211("leave - invalid channel\n"); 4306 conf->channel->hw_value, conf->channel->band);
4307 IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
4293 spin_unlock_irqrestore(&priv->lock, flags); 4308 spin_unlock_irqrestore(&priv->lock, flags);
4294 ret = -EINVAL; 4309 ret = -EINVAL;
4295 goto out; 4310 goto out;
@@ -4316,12 +4331,12 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
4316 iwl3945_radio_kill_sw(priv, !conf->radio_enabled); 4331 iwl3945_radio_kill_sw(priv, !conf->radio_enabled);
4317 4332
4318 if (!conf->radio_enabled) { 4333 if (!conf->radio_enabled) {
4319 IWL_DEBUG_MAC80211("leave - radio disabled\n"); 4334 IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n");
4320 goto out; 4335 goto out;
4321 } 4336 }
4322 4337
4323 if (iwl_is_rfkill(priv)) { 4338 if (iwl_is_rfkill(priv)) {
4324 IWL_DEBUG_MAC80211("leave - RF kill\n"); 4339 IWL_DEBUG_MAC80211(priv, "leave - RF kill\n");
4325 ret = -EIO; 4340 ret = -EIO;
4326 goto out; 4341 goto out;
4327 } 4342 }
@@ -4332,9 +4347,9 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
4332 &priv->staging_rxon, sizeof(priv->staging_rxon))) 4347 &priv->staging_rxon, sizeof(priv->staging_rxon)))
4333 iwl3945_commit_rxon(priv); 4348 iwl3945_commit_rxon(priv);
4334 else 4349 else
4335 IWL_DEBUG_INFO("No re-sending same RXON configuration.\n"); 4350 IWL_DEBUG_INFO(priv, "Not re-sending same RXON configuration\n");
4336 4351
4337 IWL_DEBUG_MAC80211("leave\n"); 4352 IWL_DEBUG_MAC80211(priv, "leave\n");
4338 4353
4339out: 4354out:
4340 clear_bit(STATUS_CONF_PENDING, &priv->status); 4355 clear_bit(STATUS_CONF_PENDING, &priv->status);
@@ -4411,7 +4426,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
4411 return -EIO; 4426 return -EIO;
4412 4427
4413 if (priv->vif != vif) { 4428 if (priv->vif != vif) {
4414 IWL_DEBUG_MAC80211("leave - priv->vif != vif\n"); 4429 IWL_DEBUG_MAC80211(priv, "leave - priv->vif != vif\n");
4415 return 0; 4430 return 0;
4416 } 4431 }
4417 4432
@@ -4434,7 +4449,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
4434 mutex_lock(&priv->mutex); 4449 mutex_lock(&priv->mutex);
4435 4450
4436 if (conf->bssid) 4451 if (conf->bssid)
4437 IWL_DEBUG_MAC80211("bssid: %pM\n", conf->bssid); 4452 IWL_DEBUG_MAC80211(priv, "bssid: %pM\n", conf->bssid);
4438 4453
4439/* 4454/*
4440 * very dubious code was here; the probe filtering flag is never set: 4455 * very dubious code was here; the probe filtering flag is never set:
@@ -4447,7 +4462,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
4447 if (!conf->bssid) { 4462 if (!conf->bssid) {
4448 conf->bssid = priv->mac_addr; 4463 conf->bssid = priv->mac_addr;
4449 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 4464 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
4450 IWL_DEBUG_MAC80211("bssid was set to: %pM\n", 4465 IWL_DEBUG_MAC80211(priv, "bssid was set to: %pM\n",
4451 conf->bssid); 4466 conf->bssid);
4452 } 4467 }
4453 if (priv->ibss_beacon) 4468 if (priv->ibss_beacon)
@@ -4466,7 +4481,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
4466 if (iwl_scan_cancel_timeout(priv, 100)) { 4481 if (iwl_scan_cancel_timeout(priv, 100)) {
4467 IWL_WARN(priv, "Aborted scan still in progress " 4482 IWL_WARN(priv, "Aborted scan still in progress "
4468 "after 100ms\n"); 4483 "after 100ms\n");
4469 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); 4484 IWL_DEBUG_MAC80211(priv, "leaving:scan abort failed\n");
4470 mutex_unlock(&priv->mutex); 4485 mutex_unlock(&priv->mutex);
4471 return -EAGAIN; 4486 return -EAGAIN;
4472 } 4487 }
@@ -4494,7 +4509,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
4494 } 4509 }
4495 4510
4496 done: 4511 done:
4497 IWL_DEBUG_MAC80211("leave\n"); 4512 IWL_DEBUG_MAC80211(priv, "leave\n");
4498 mutex_unlock(&priv->mutex); 4513 mutex_unlock(&priv->mutex);
4499 4514
4500 return 0; 4515 return 0;
@@ -4505,7 +4520,7 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
4505{ 4520{
4506 struct iwl_priv *priv = hw->priv; 4521 struct iwl_priv *priv = hw->priv;
4507 4522
4508 IWL_DEBUG_MAC80211("enter\n"); 4523 IWL_DEBUG_MAC80211(priv, "enter\n");
4509 4524
4510 mutex_lock(&priv->mutex); 4525 mutex_lock(&priv->mutex);
4511 4526
@@ -4520,7 +4535,7 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
4520 } 4535 }
4521 mutex_unlock(&priv->mutex); 4536 mutex_unlock(&priv->mutex);
4522 4537
4523 IWL_DEBUG_MAC80211("leave\n"); 4538 IWL_DEBUG_MAC80211(priv, "leave\n");
4524} 4539}
4525 4540
4526#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) 4541#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
@@ -4532,10 +4547,10 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
4532{ 4547{
4533 struct iwl_priv *priv = hw->priv; 4548 struct iwl_priv *priv = hw->priv;
4534 4549
4535 IWL_DEBUG_MAC80211("changes = 0x%X\n", changes); 4550 IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes);
4536 4551
4537 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 4552 if (changes & BSS_CHANGED_ERP_PREAMBLE) {
4538 IWL_DEBUG_MAC80211("ERP_PREAMBLE %d\n", 4553 IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n",
4539 bss_conf->use_short_preamble); 4554 bss_conf->use_short_preamble);
4540 if (bss_conf->use_short_preamble) 4555 if (bss_conf->use_short_preamble)
4541 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; 4556 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
@@ -4545,7 +4560,8 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
4545 } 4560 }
4546 4561
4547 if (changes & BSS_CHANGED_ERP_CTS_PROT) { 4562 if (changes & BSS_CHANGED_ERP_CTS_PROT) {
4548 IWL_DEBUG_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot); 4563 IWL_DEBUG_MAC80211(priv, "ERP_CTS %d\n",
4564 bss_conf->use_cts_prot);
4549 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ)) 4565 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
4550 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; 4566 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
4551 else 4567 else
@@ -4553,7 +4569,7 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
4553 } 4569 }
4554 4570
4555 if (changes & BSS_CHANGED_ASSOC) { 4571 if (changes & BSS_CHANGED_ASSOC) {
4556 IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc); 4572 IWL_DEBUG_MAC80211(priv, "ASSOC %d\n", bss_conf->assoc);
4557 /* This should never happen as this function should 4573 /* This should never happen as this function should
4558 * never be called from interrupt context. */ 4574 * never be called from interrupt context. */
4559 if (WARN_ON_ONCE(in_interrupt())) 4575 if (WARN_ON_ONCE(in_interrupt()))
@@ -4571,10 +4587,12 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
4571 mutex_unlock(&priv->mutex); 4587 mutex_unlock(&priv->mutex);
4572 } else { 4588 } else {
4573 priv->assoc_id = 0; 4589 priv->assoc_id = 0;
4574 IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc); 4590 IWL_DEBUG_MAC80211(priv,
4591 "DISASSOC %d\n", bss_conf->assoc);
4575 } 4592 }
4576 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) { 4593 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
4577 IWL_DEBUG_MAC80211("Associated Changes %d\n", changes); 4594 IWL_DEBUG_MAC80211(priv,
4595 "Associated Changes %d\n", changes);
4578 iwl3945_send_rxon_assoc(priv); 4596 iwl3945_send_rxon_assoc(priv);
4579 } 4597 }
4580 4598
@@ -4587,14 +4605,14 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
4587 struct iwl_priv *priv = hw->priv; 4605 struct iwl_priv *priv = hw->priv;
4588 DECLARE_SSID_BUF(ssid_buf); 4606 DECLARE_SSID_BUF(ssid_buf);
4589 4607
4590 IWL_DEBUG_MAC80211("enter\n"); 4608 IWL_DEBUG_MAC80211(priv, "enter\n");
4591 4609
4592 mutex_lock(&priv->mutex); 4610 mutex_lock(&priv->mutex);
4593 spin_lock_irqsave(&priv->lock, flags); 4611 spin_lock_irqsave(&priv->lock, flags);
4594 4612
4595 if (!iwl_is_ready_rf(priv)) { 4613 if (!iwl_is_ready_rf(priv)) {
4596 rc = -EIO; 4614 rc = -EIO;
4597 IWL_DEBUG_MAC80211("leave - not ready or exit pending\n"); 4615 IWL_DEBUG_MAC80211(priv, "leave - not ready or exit pending\n");
4598 goto out_unlock; 4616 goto out_unlock;
4599 } 4617 }
4600 4618
@@ -4612,8 +4630,8 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
4612 goto out_unlock; 4630 goto out_unlock;
4613 } 4631 }
4614 if (len) { 4632 if (len) {
4615 IWL_DEBUG_SCAN("direct scan for %s [%d]\n ", 4633 IWL_DEBUG_SCAN(priv, "direct scan for %s [%zd]\n ",
4616 print_ssid(ssid_buf, ssid, len), (int)len); 4634 print_ssid(ssid_buf, ssid, len), len);
4617 4635
4618 priv->one_direct_scan = 1; 4636 priv->one_direct_scan = 1;
4619 priv->direct_ssid_len = (u8) 4637 priv->direct_ssid_len = (u8)
@@ -4624,7 +4642,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
4624 4642
4625 rc = iwl3945_scan_initiate(priv); 4643 rc = iwl3945_scan_initiate(priv);
4626 4644
4627 IWL_DEBUG_MAC80211("leave\n"); 4645 IWL_DEBUG_MAC80211(priv, "leave\n");
4628 4646
4629out_unlock: 4647out_unlock:
4630 spin_unlock_irqrestore(&priv->lock, flags); 4648 spin_unlock_irqrestore(&priv->lock, flags);
@@ -4643,17 +4661,17 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
4643 int ret; 4661 int ret;
4644 u8 sta_id; 4662 u8 sta_id;
4645 4663
4646 IWL_DEBUG_MAC80211("enter\n"); 4664 IWL_DEBUG_MAC80211(priv, "enter\n");
4647 4665
4648 if (iwl3945_mod_params.sw_crypto) { 4666 if (iwl3945_mod_params.sw_crypto) {
4649 IWL_DEBUG_MAC80211("leave - hwcrypto disabled\n"); 4667 IWL_DEBUG_MAC80211(priv, "leave - hwcrypto disabled\n");
4650 return -EOPNOTSUPP; 4668 return -EOPNOTSUPP;
4651 } 4669 }
4652 4670
4653 addr = sta ? sta->addr : iwl_bcast_addr; 4671 addr = sta ? sta->addr : iwl_bcast_addr;
4654 sta_id = iwl3945_hw_find_station(priv, addr); 4672 sta_id = iwl3945_hw_find_station(priv, addr);
4655 if (sta_id == IWL_INVALID_STATION) { 4673 if (sta_id == IWL_INVALID_STATION) {
4656 IWL_DEBUG_MAC80211("leave - %pM not in station map.\n", 4674 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
4657 addr); 4675 addr);
4658 return -EINVAL; 4676 return -EINVAL;
4659 } 4677 }
@@ -4669,7 +4687,8 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
4669 iwl_set_rxon_hwcrypto(priv, 1); 4687 iwl_set_rxon_hwcrypto(priv, 1);
4670 iwl3945_commit_rxon(priv); 4688 iwl3945_commit_rxon(priv);
4671 key->hw_key_idx = sta_id; 4689 key->hw_key_idx = sta_id;
4672 IWL_DEBUG_MAC80211("set_key success, using hwcrypto\n"); 4690 IWL_DEBUG_MAC80211(priv,
4691 "set_key success, using hwcrypto\n");
4673 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 4692 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
4674 } 4693 }
4675 break; 4694 break;
@@ -4678,14 +4697,14 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
4678 if (!ret) { 4697 if (!ret) {
4679 iwl_set_rxon_hwcrypto(priv, 0); 4698 iwl_set_rxon_hwcrypto(priv, 0);
4680 iwl3945_commit_rxon(priv); 4699 iwl3945_commit_rxon(priv);
4681 IWL_DEBUG_MAC80211("disable hwcrypto key\n"); 4700 IWL_DEBUG_MAC80211(priv, "disable hwcrypto key\n");
4682 } 4701 }
4683 break; 4702 break;
4684 default: 4703 default:
4685 ret = -EINVAL; 4704 ret = -EINVAL;
4686 } 4705 }
4687 4706
4688 IWL_DEBUG_MAC80211("leave\n"); 4707 IWL_DEBUG_MAC80211(priv, "leave\n");
4689 mutex_unlock(&priv->mutex); 4708 mutex_unlock(&priv->mutex);
4690 4709
4691 return ret; 4710 return ret;
@@ -4698,15 +4717,15 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
4698 unsigned long flags; 4717 unsigned long flags;
4699 int q; 4718 int q;
4700 4719
4701 IWL_DEBUG_MAC80211("enter\n"); 4720 IWL_DEBUG_MAC80211(priv, "enter\n");
4702 4721
4703 if (!iwl_is_ready_rf(priv)) { 4722 if (!iwl_is_ready_rf(priv)) {
4704 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 4723 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
4705 return -EIO; 4724 return -EIO;
4706 } 4725 }
4707 4726
4708 if (queue >= AC_NUM) { 4727 if (queue >= AC_NUM) {
4709 IWL_DEBUG_MAC80211("leave - queue >= AC_NUM %d\n", queue); 4728 IWL_DEBUG_MAC80211(priv, "leave - queue >= AC_NUM %d\n", queue);
4710 return 0; 4729 return 0;
4711 } 4730 }
4712 4731
@@ -4733,7 +4752,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
4733 4752
4734 mutex_unlock(&priv->mutex); 4753 mutex_unlock(&priv->mutex);
4735 4754
4736 IWL_DEBUG_MAC80211("leave\n"); 4755 IWL_DEBUG_MAC80211(priv, "leave\n");
4737 return 0; 4756 return 0;
4738} 4757}
4739 4758
@@ -4746,10 +4765,10 @@ static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
4746 struct iwl_queue *q; 4765 struct iwl_queue *q;
4747 unsigned long flags; 4766 unsigned long flags;
4748 4767
4749 IWL_DEBUG_MAC80211("enter\n"); 4768 IWL_DEBUG_MAC80211(priv, "enter\n");
4750 4769
4751 if (!iwl_is_ready_rf(priv)) { 4770 if (!iwl_is_ready_rf(priv)) {
4752 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 4771 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
4753 return -EIO; 4772 return -EIO;
4754 } 4773 }
4755 4774
@@ -4767,7 +4786,7 @@ static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
4767 } 4786 }
4768 spin_unlock_irqrestore(&priv->lock, flags); 4787 spin_unlock_irqrestore(&priv->lock, flags);
4769 4788
4770 IWL_DEBUG_MAC80211("leave\n"); 4789 IWL_DEBUG_MAC80211(priv, "leave\n");
4771 4790
4772 return 0; 4791 return 0;
4773} 4792}
@@ -4778,7 +4797,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
4778 unsigned long flags; 4797 unsigned long flags;
4779 4798
4780 mutex_lock(&priv->mutex); 4799 mutex_lock(&priv->mutex);
4781 IWL_DEBUG_MAC80211("enter\n"); 4800 IWL_DEBUG_MAC80211(priv, "enter\n");
4782 4801
4783 iwl_reset_qos(priv); 4802 iwl_reset_qos(priv);
4784 4803
@@ -4800,7 +4819,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
4800 spin_unlock_irqrestore(&priv->lock, flags); 4819 spin_unlock_irqrestore(&priv->lock, flags);
4801 4820
4802 if (!iwl_is_ready_rf(priv)) { 4821 if (!iwl_is_ready_rf(priv)) {
4803 IWL_DEBUG_MAC80211("leave - not ready\n"); 4822 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
4804 mutex_unlock(&priv->mutex); 4823 mutex_unlock(&priv->mutex);
4805 return; 4824 return;
4806 } 4825 }
@@ -4817,7 +4836,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
4817 /* Per mac80211.h: This is only used in IBSS mode... */ 4836 /* Per mac80211.h: This is only used in IBSS mode... */
4818 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { 4837 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
4819 4838
4820 IWL_DEBUG_MAC80211("leave - not in IBSS\n"); 4839 IWL_DEBUG_MAC80211(priv, "leave - not in IBSS\n");
4821 mutex_unlock(&priv->mutex); 4840 mutex_unlock(&priv->mutex);
4822 return; 4841 return;
4823 } 4842 }
@@ -4826,7 +4845,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
4826 4845
4827 mutex_unlock(&priv->mutex); 4846 mutex_unlock(&priv->mutex);
4828 4847
4829 IWL_DEBUG_MAC80211("leave\n"); 4848 IWL_DEBUG_MAC80211(priv, "leave\n");
4830 4849
4831} 4850}
4832 4851
@@ -4835,15 +4854,15 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
4835 struct iwl_priv *priv = hw->priv; 4854 struct iwl_priv *priv = hw->priv;
4836 unsigned long flags; 4855 unsigned long flags;
4837 4856
4838 IWL_DEBUG_MAC80211("enter\n"); 4857 IWL_DEBUG_MAC80211(priv, "enter\n");
4839 4858
4840 if (!iwl_is_ready_rf(priv)) { 4859 if (!iwl_is_ready_rf(priv)) {
4841 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 4860 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
4842 return -EIO; 4861 return -EIO;
4843 } 4862 }
4844 4863
4845 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { 4864 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
4846 IWL_DEBUG_MAC80211("leave - not IBSS\n"); 4865 IWL_DEBUG_MAC80211(priv, "leave - not IBSS\n");
4847 return -EIO; 4866 return -EIO;
4848 } 4867 }
4849 4868
@@ -4856,7 +4875,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
4856 4875
4857 priv->assoc_id = 0; 4876 priv->assoc_id = 0;
4858 4877
4859 IWL_DEBUG_MAC80211("leave\n"); 4878 IWL_DEBUG_MAC80211(priv, "leave\n");
4860 spin_unlock_irqrestore(&priv->lock, flags); 4879 spin_unlock_irqrestore(&priv->lock, flags);
4861 4880
4862 iwl_reset_qos(priv); 4881 iwl_reset_qos(priv);
@@ -4971,7 +4990,7 @@ static ssize_t store_flags(struct device *d,
4971 if (iwl_scan_cancel_timeout(priv, 100)) 4990 if (iwl_scan_cancel_timeout(priv, 100))
4972 IWL_WARN(priv, "Could not cancel scan.\n"); 4991 IWL_WARN(priv, "Could not cancel scan.\n");
4973 else { 4992 else {
4974 IWL_DEBUG_INFO("Committing rxon.flags = 0x%04X\n", 4993 IWL_DEBUG_INFO(priv, "Committing rxon.flags = 0x%04X\n",
4975 flags); 4994 flags);
4976 priv->staging_rxon.flags = cpu_to_le32(flags); 4995 priv->staging_rxon.flags = cpu_to_le32(flags);
4977 iwl3945_commit_rxon(priv); 4996 iwl3945_commit_rxon(priv);
@@ -5006,7 +5025,7 @@ static ssize_t store_filter_flags(struct device *d,
5006 if (iwl_scan_cancel_timeout(priv, 100)) 5025 if (iwl_scan_cancel_timeout(priv, 100))
5007 IWL_WARN(priv, "Could not cancel scan.\n"); 5026 IWL_WARN(priv, "Could not cancel scan.\n");
5008 else { 5027 else {
5009 IWL_DEBUG_INFO("Committing rxon.filter_flags = " 5028 IWL_DEBUG_INFO(priv, "Committing rxon.filter_flags = "
5010 "0x%04X\n", filter_flags); 5029 "0x%04X\n", filter_flags);
5011 priv->staging_rxon.filter_flags = 5030 priv->staging_rxon.filter_flags =
5012 cpu_to_le32(filter_flags); 5031 cpu_to_le32(filter_flags);
@@ -5083,7 +5102,7 @@ static ssize_t store_measurement(struct device *d,
5083 type = simple_strtoul(p + 1, NULL, 0); 5102 type = simple_strtoul(p + 1, NULL, 0);
5084 } 5103 }
5085 5104
5086 IWL_DEBUG_INFO("Invoking measurement of type %d on " 5105 IWL_DEBUG_INFO(priv, "Invoking measurement of type %d on "
5087 "channel %d (for '%s')\n", type, params.channel, buf); 5106 "channel %d (for '%s')\n", type, params.channel, buf);
5088 iwl3945_get_measurement(priv, &params, type); 5107 iwl3945_get_measurement(priv, &params, type);
5089 5108
@@ -5142,7 +5161,7 @@ static ssize_t store_power_level(struct device *d,
5142 if (mode != priv->power_mode) { 5161 if (mode != priv->power_mode) {
5143 rc = iwl3945_send_power_mode(priv, IWL_POWER_LEVEL(mode)); 5162 rc = iwl3945_send_power_mode(priv, IWL_POWER_LEVEL(mode));
5144 if (rc) { 5163 if (rc) {
5145 IWL_DEBUG_MAC80211("failed setting power mode.\n"); 5164 IWL_DEBUG_MAC80211(priv, "failed setting power mode\n");
5146 goto out; 5165 goto out;
5147 } 5166 }
5148 priv->power_mode = mode; 5167 priv->power_mode = mode;
@@ -5277,15 +5296,15 @@ static ssize_t store_antenna(struct device *d,
5277 return 0; 5296 return 0;
5278 5297
5279 if (sscanf(buf, "%1i", &ant) != 1) { 5298 if (sscanf(buf, "%1i", &ant) != 1) {
5280 IWL_DEBUG_INFO("not in hex or decimal form.\n"); 5299 IWL_DEBUG_INFO(priv, "not in hex or decimal form.\n");
5281 return count; 5300 return count;
5282 } 5301 }
5283 5302
5284 if ((ant >= 0) && (ant <= 2)) { 5303 if ((ant >= 0) && (ant <= 2)) {
5285 IWL_DEBUG_INFO("Setting antenna select to %d.\n", ant); 5304 IWL_DEBUG_INFO(priv, "Setting antenna select to %d.\n", ant);
5286 iwl3945_mod_params.antenna = (enum iwl3945_antenna)ant; 5305 iwl3945_mod_params.antenna = (enum iwl3945_antenna)ant;
5287 } else 5306 } else
5288 IWL_DEBUG_INFO("Bad antenna select value %d.\n", ant); 5307 IWL_DEBUG_INFO(priv, "Bad antenna select value %d.\n", ant);
5289 5308
5290 5309
5291 return count; 5310 return count;
@@ -5532,12 +5551,12 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5532 * "the hard way", rather than using device's scan. 5551 * "the hard way", rather than using device's scan.
5533 */ 5552 */
5534 if (iwl3945_mod_params.disable_hw_scan) { 5553 if (iwl3945_mod_params.disable_hw_scan) {
5535 IWL_DEBUG_INFO("Disabling hw_scan\n"); 5554 IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
5536 iwl3945_hw_ops.hw_scan = NULL; 5555 iwl3945_hw_ops.hw_scan = NULL;
5537 } 5556 }
5538 5557
5539 5558
5540 IWL_DEBUG_INFO("*** LOAD DRIVER ***\n"); 5559 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
5541 priv->cfg = cfg; 5560 priv->cfg = cfg;
5542 priv->pci_dev = pdev; 5561 priv->pci_dev = pdev;
5543 5562
@@ -5593,9 +5612,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5593 goto out_pci_release_regions; 5612 goto out_pci_release_regions;
5594 } 5613 }
5595 5614
5596 IWL_DEBUG_INFO("pci_resource_len = 0x%08llx\n", 5615 IWL_DEBUG_INFO(priv, "pci_resource_len = 0x%08llx\n",
5597 (unsigned long long) pci_resource_len(pdev, 0)); 5616 (unsigned long long) pci_resource_len(pdev, 0));
5598 IWL_DEBUG_INFO("pci_resource_base = %p\n", priv->hw_base); 5617 IWL_DEBUG_INFO(priv, "pci_resource_base = %p\n", priv->hw_base);
5599 5618
5600 /* We disable the RETRY_TIMEOUT register (0x41) to keep 5619 /* We disable the RETRY_TIMEOUT register (0x41) to keep
5601 * PCI Tx retries from interfering with C3 CPU state */ 5620 * PCI Tx retries from interfering with C3 CPU state */
@@ -5604,7 +5623,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5604 /* amp init */ 5623 /* amp init */
5605 err = priv->cfg->ops->lib->apm_ops.init(priv); 5624 err = priv->cfg->ops->lib->apm_ops.init(priv);
5606 if (err < 0) { 5625 if (err < 0) {
5607 IWL_DEBUG_INFO("Failed to init APMG\n"); 5626 IWL_DEBUG_INFO(priv, "Failed to init APMG\n");
5608 goto out_iounmap; 5627 goto out_iounmap;
5609 } 5628 }
5610 5629
@@ -5621,7 +5640,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5621 /* MAC Address location in EEPROM same for 3945/4965 */ 5640 /* MAC Address location in EEPROM same for 3945/4965 */
5622 eeprom = (struct iwl3945_eeprom *)priv->eeprom; 5641 eeprom = (struct iwl3945_eeprom *)priv->eeprom;
5623 memcpy(priv->mac_addr, eeprom->mac_address, ETH_ALEN); 5642 memcpy(priv->mac_addr, eeprom->mac_address, ETH_ALEN);
5624 IWL_DEBUG_INFO("MAC address: %pM\n", priv->mac_addr); 5643 IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->mac_addr);
5625 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr); 5644 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
5626 5645
5627 /*********************** 5646 /***********************
@@ -5654,7 +5673,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
5654 /* Disable radio (SW RF KILL) via parameter when loading driver */ 5673 /* Disable radio (SW RF KILL) via parameter when loading driver */
5655 if (iwl3945_mod_params.disable) { 5674 if (iwl3945_mod_params.disable) {
5656 set_bit(STATUS_RF_KILL_SW, &priv->status); 5675 set_bit(STATUS_RF_KILL_SW, &priv->status);
5657 IWL_DEBUG_INFO("Radio disabled.\n"); 5676 IWL_DEBUG_INFO(priv, "Radio disabled.\n");
5658 } 5677 }
5659 5678
5660 5679
@@ -5743,7 +5762,7 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
5743 if (!priv) 5762 if (!priv)
5744 return; 5763 return;
5745 5764
5746 IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); 5765 IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
5747 5766
5748 set_bit(STATUS_EXIT_PENDING, &priv->status); 5767 set_bit(STATUS_EXIT_PENDING, &priv->status);
5749 5768