aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-scan.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-scan.c b/drivers/net/wireless/iwlegacy/iwl-scan.c
index 5a967d2b15d1..c534dcef4a71 100644
--- a/drivers/net/wireless/iwlegacy/iwl-scan.c
+++ b/drivers/net/wireless/iwlegacy/iwl-scan.c
@@ -85,7 +85,7 @@ static int il_send_scan_abort(struct il_priv *il)
85 * can occur if we send the scan abort before we 85 * can occur if we send the scan abort before we
86 * the microcode has notified us that a scan is 86 * the microcode has notified us that a scan is
87 * completed. */ 87 * completed. */
88 IL_DEBUG_SCAN(il, "SCAN_ABORT ret %d.\n", pkt->u.status); 88 D_SCAN("SCAN_ABORT ret %d.\n", pkt->u.status);
89 ret = -EIO; 89 ret = -EIO;
90 } 90 }
91 91
@@ -97,7 +97,7 @@ static void il_complete_scan(struct il_priv *il, bool aborted)
97{ 97{
98 /* check if scan was requested from mac80211 */ 98 /* check if scan was requested from mac80211 */
99 if (il->scan_request) { 99 if (il->scan_request) {
100 IL_DEBUG_SCAN(il, "Complete scan in mac80211\n"); 100 D_SCAN("Complete scan in mac80211\n");
101 ieee80211_scan_completed(il->hw, aborted); 101 ieee80211_scan_completed(il->hw, aborted);
102 } 102 }
103 103
@@ -110,11 +110,11 @@ void il_force_scan_end(struct il_priv *il)
110 lockdep_assert_held(&il->mutex); 110 lockdep_assert_held(&il->mutex);
111 111
112 if (!test_bit(STATUS_SCANNING, &il->status)) { 112 if (!test_bit(STATUS_SCANNING, &il->status)) {
113 IL_DEBUG_SCAN(il, "Forcing scan end while not scanning\n"); 113 D_SCAN("Forcing scan end while not scanning\n");
114 return; 114 return;
115 } 115 }
116 116
117 IL_DEBUG_SCAN(il, "Forcing scan end\n"); 117 D_SCAN("Forcing scan end\n");
118 clear_bit(STATUS_SCANNING, &il->status); 118 clear_bit(STATUS_SCANNING, &il->status);
119 clear_bit(STATUS_SCAN_HW, &il->status); 119 clear_bit(STATUS_SCAN_HW, &il->status);
120 clear_bit(STATUS_SCAN_ABORTING, &il->status); 120 clear_bit(STATUS_SCAN_ABORTING, &il->status);
@@ -128,21 +128,21 @@ static void il_do_scan_abort(struct il_priv *il)
128 lockdep_assert_held(&il->mutex); 128 lockdep_assert_held(&il->mutex);
129 129
130 if (!test_bit(STATUS_SCANNING, &il->status)) { 130 if (!test_bit(STATUS_SCANNING, &il->status)) {
131 IL_DEBUG_SCAN(il, "Not performing scan to abort\n"); 131 D_SCAN("Not performing scan to abort\n");
132 return; 132 return;
133 } 133 }
134 134
135 if (test_and_set_bit(STATUS_SCAN_ABORTING, &il->status)) { 135 if (test_and_set_bit(STATUS_SCAN_ABORTING, &il->status)) {
136 IL_DEBUG_SCAN(il, "Scan abort in progress\n"); 136 D_SCAN("Scan abort in progress\n");
137 return; 137 return;
138 } 138 }
139 139
140 ret = il_send_scan_abort(il); 140 ret = il_send_scan_abort(il);
141 if (ret) { 141 if (ret) {
142 IL_DEBUG_SCAN(il, "Send scan abort failed %d\n", ret); 142 D_SCAN("Send scan abort failed %d\n", ret);
143 il_force_scan_end(il); 143 il_force_scan_end(il);
144 } else 144 } else
145 IL_DEBUG_SCAN(il, "Successfully send scan abort\n"); 145 D_SCAN("Successfully send scan abort\n");
146} 146}
147 147
148/** 148/**
@@ -150,7 +150,7 @@ static void il_do_scan_abort(struct il_priv *il)
150 */ 150 */
151int il_scan_cancel(struct il_priv *il) 151int il_scan_cancel(struct il_priv *il)
152{ 152{
153 IL_DEBUG_SCAN(il, "Queuing abort scan\n"); 153 D_SCAN("Queuing abort scan\n");
154 queue_work(il->workqueue, &il->abort_scan); 154 queue_work(il->workqueue, &il->abort_scan);
155 return 0; 155 return 0;
156} 156}
@@ -167,7 +167,7 @@ int il_scan_cancel_timeout(struct il_priv *il, unsigned long ms)
167 167
168 lockdep_assert_held(&il->mutex); 168 lockdep_assert_held(&il->mutex);
169 169
170 IL_DEBUG_SCAN(il, "Scan cancel timeout\n"); 170 D_SCAN("Scan cancel timeout\n");
171 171
172 il_do_scan_abort(il); 172 il_do_scan_abort(il);
173 173
@@ -190,7 +190,7 @@ static void il_rx_reply_scan(struct il_priv *il,
190 struct il_scanreq_notification *notif = 190 struct il_scanreq_notification *notif =
191 (struct il_scanreq_notification *)pkt->u.raw; 191 (struct il_scanreq_notification *)pkt->u.raw;
192 192
193 IL_DEBUG_SCAN(il, "Scan request status = 0x%x\n", notif->status); 193 D_SCAN("Scan request status = 0x%x\n", notif->status);
194#endif 194#endif
195} 195}
196 196
@@ -202,7 +202,7 @@ static void il_rx_scan_start_notif(struct il_priv *il,
202 struct il_scanstart_notification *notif = 202 struct il_scanstart_notification *notif =
203 (struct il_scanstart_notification *)pkt->u.raw; 203 (struct il_scanstart_notification *)pkt->u.raw;
204 il->scan_start_tsf = le32_to_cpu(notif->tsf_low); 204 il->scan_start_tsf = le32_to_cpu(notif->tsf_low);
205 IL_DEBUG_SCAN(il, "Scan start: " 205 D_SCAN("Scan start: "
206 "%d [802.11%s] " 206 "%d [802.11%s] "
207 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n", 207 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
208 notif->channel, 208 notif->channel,
@@ -221,7 +221,7 @@ static void il_rx_scan_results_notif(struct il_priv *il,
221 struct il_scanresults_notification *notif = 221 struct il_scanresults_notification *notif =
222 (struct il_scanresults_notification *)pkt->u.raw; 222 (struct il_scanresults_notification *)pkt->u.raw;
223 223
224 IL_DEBUG_SCAN(il, "Scan ch.res: " 224 D_SCAN("Scan ch.res: "
225 "%d [802.11%s] " 225 "%d [802.11%s] "
226 "(TSF: 0x%08X:%08X) - %d " 226 "(TSF: 0x%08X:%08X) - %d "
227 "elapsed=%lu usec\n", 227 "elapsed=%lu usec\n",
@@ -244,7 +244,7 @@ static void il_rx_scan_complete_notif(struct il_priv *il,
244 struct il_scancomplete_notification *scan_notif = (void *)pkt->u.raw; 244 struct il_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
245#endif 245#endif
246 246
247 IL_DEBUG_SCAN(il, 247 D_SCAN(
248 "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", 248 "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
249 scan_notif->scanned_channels, 249 scan_notif->scanned_channels,
250 scan_notif->tsf_low, 250 scan_notif->tsf_low,
@@ -253,7 +253,7 @@ static void il_rx_scan_complete_notif(struct il_priv *il,
253 /* The HW is no longer scanning */ 253 /* The HW is no longer scanning */
254 clear_bit(STATUS_SCAN_HW, &il->status); 254 clear_bit(STATUS_SCAN_HW, &il->status);
255 255
256 IL_DEBUG_SCAN(il, "Scan on %sGHz took %dms\n", 256 D_SCAN("Scan on %sGHz took %dms\n",
257 (il->scan_band == IEEE80211_BAND_2GHZ) ? "2.4" : "5.2", 257 (il->scan_band == IEEE80211_BAND_2GHZ) ? "2.4" : "5.2",
258 jiffies_to_msecs(jiffies - il->scan_start)); 258 jiffies_to_msecs(jiffies - il->scan_start));
259 259
@@ -346,17 +346,17 @@ static int il_scan_initiate(struct il_priv *il,
346 } 346 }
347 347
348 if (test_bit(STATUS_SCAN_HW, &il->status)) { 348 if (test_bit(STATUS_SCAN_HW, &il->status)) {
349 IL_DEBUG_SCAN(il, 349 D_SCAN(
350 "Multiple concurrent scan requests in parallel.\n"); 350 "Multiple concurrent scan requests in parallel.\n");
351 return -EBUSY; 351 return -EBUSY;
352 } 352 }
353 353
354 if (test_bit(STATUS_SCAN_ABORTING, &il->status)) { 354 if (test_bit(STATUS_SCAN_ABORTING, &il->status)) {
355 IL_DEBUG_SCAN(il, "Scan request while abort pending.\n"); 355 D_SCAN("Scan request while abort pending.\n");
356 return -EBUSY; 356 return -EBUSY;
357 } 357 }
358 358
359 IL_DEBUG_SCAN(il, "Starting scan...\n"); 359 D_SCAN("Starting scan...\n");
360 360
361 set_bit(STATUS_SCANNING, &il->status); 361 set_bit(STATUS_SCANNING, &il->status);
362 il->scan_start = jiffies; 362 il->scan_start = jiffies;
@@ -380,7 +380,7 @@ int il_mac_hw_scan(struct ieee80211_hw *hw,
380 struct il_priv *il = hw->priv; 380 struct il_priv *il = hw->priv;
381 int ret; 381 int ret;
382 382
383 IL_DEBUG_MAC80211(il, "enter\n"); 383 D_MAC80211("enter\n");
384 384
385 if (req->n_channels == 0) 385 if (req->n_channels == 0)
386 return -EINVAL; 386 return -EINVAL;
@@ -388,7 +388,7 @@ int il_mac_hw_scan(struct ieee80211_hw *hw,
388 mutex_lock(&il->mutex); 388 mutex_lock(&il->mutex);
389 389
390 if (test_bit(STATUS_SCANNING, &il->status)) { 390 if (test_bit(STATUS_SCANNING, &il->status)) {
391 IL_DEBUG_SCAN(il, "Scan already in progress.\n"); 391 D_SCAN("Scan already in progress.\n");
392 ret = -EAGAIN; 392 ret = -EAGAIN;
393 goto out_unlock; 393 goto out_unlock;
394 } 394 }
@@ -400,7 +400,7 @@ int il_mac_hw_scan(struct ieee80211_hw *hw,
400 400
401 ret = il_scan_initiate(il, vif); 401 ret = il_scan_initiate(il, vif);
402 402
403 IL_DEBUG_MAC80211(il, "leave\n"); 403 D_MAC80211("leave\n");
404 404
405out_unlock: 405out_unlock:
406 mutex_unlock(&il->mutex); 406 mutex_unlock(&il->mutex);
@@ -414,7 +414,7 @@ static void il_bg_scan_check(struct work_struct *data)
414 struct il_priv *il = 414 struct il_priv *il =
415 container_of(data, struct il_priv, scan_check.work); 415 container_of(data, struct il_priv, scan_check.work);
416 416
417 IL_DEBUG_SCAN(il, "Scan check work\n"); 417 D_SCAN("Scan check work\n");
418 418
419 /* Since we are here firmware does not finish scan and 419 /* Since we are here firmware does not finish scan and
420 * most likely is in bad shape, so we don't bother to 420 * most likely is in bad shape, so we don't bother to
@@ -477,7 +477,7 @@ static void il_bg_abort_scan(struct work_struct *work)
477{ 477{
478 struct il_priv *il = container_of(work, struct il_priv, abort_scan); 478 struct il_priv *il = container_of(work, struct il_priv, abort_scan);
479 479
480 IL_DEBUG_SCAN(il, "Abort scan work\n"); 480 D_SCAN("Abort scan work\n");
481 481
482 /* We keep scan_check work queued in case when firmware will not 482 /* We keep scan_check work queued in case when firmware will not
483 * report back scan completed notification */ 483 * report back scan completed notification */
@@ -492,7 +492,7 @@ static void il_bg_scan_completed(struct work_struct *work)
492 container_of(work, struct il_priv, scan_completed); 492 container_of(work, struct il_priv, scan_completed);
493 bool aborted; 493 bool aborted;
494 494
495 IL_DEBUG_SCAN(il, "Completed scan.\n"); 495 D_SCAN("Completed scan.\n");
496 496
497 cancel_delayed_work(&il->scan_check); 497 cancel_delayed_work(&il->scan_check);
498 498
@@ -500,10 +500,10 @@ static void il_bg_scan_completed(struct work_struct *work)
500 500
501 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &il->status); 501 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &il->status);
502 if (aborted) 502 if (aborted)
503 IL_DEBUG_SCAN(il, "Aborted scan completed.\n"); 503 D_SCAN("Aborted scan completed.\n");
504 504
505 if (!test_and_clear_bit(STATUS_SCANNING, &il->status)) { 505 if (!test_and_clear_bit(STATUS_SCANNING, &il->status)) {
506 IL_DEBUG_SCAN(il, "Scan already completed.\n"); 506 D_SCAN("Scan already completed.\n");
507 goto out_settings; 507 goto out_settings;
508 } 508 }
509 509