aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
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/iwl-scan.c
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/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c62
1 files changed, 31 insertions, 31 deletions
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;