diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 03006c66a20e..af70229144b3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -380,50 +380,53 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
380 | } | 380 | } |
381 | 381 | ||
382 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_2GHZ); | 382 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_2GHZ); |
383 | channels = supp_band->channels; | 383 | if (supp_band) { |
384 | channels = supp_band->channels; | ||
384 | 385 | ||
385 | pos += scnprintf(buf + pos, bufsz - pos, | ||
386 | "Displaying %d channels in 2.4GHz band 802.11bg):\n", | ||
387 | supp_band->n_channels); | ||
388 | |||
389 | for (i = 0; i < supp_band->n_channels; i++) | ||
390 | pos += scnprintf(buf + pos, bufsz - pos, | 386 | pos += scnprintf(buf + pos, bufsz - pos, |
391 | "%d: %ddBm: BSS%s%s, %s.\n", | 387 | "Displaying %d channels in 2.4GHz band 802.11bg):\n", |
392 | ieee80211_frequency_to_channel( | 388 | supp_band->n_channels); |
393 | channels[i].center_freq), | ||
394 | channels[i].max_power, | ||
395 | channels[i].flags & IEEE80211_CHAN_RADAR ? | ||
396 | " (IEEE 802.11h required)" : "", | ||
397 | ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) | ||
398 | || (channels[i].flags & | ||
399 | IEEE80211_CHAN_RADAR)) ? "" : | ||
400 | ", IBSS", | ||
401 | channels[i].flags & | ||
402 | IEEE80211_CHAN_PASSIVE_SCAN ? | ||
403 | "passive only" : "active/passive"); | ||
404 | 389 | ||
390 | for (i = 0; i < supp_band->n_channels; i++) | ||
391 | pos += scnprintf(buf + pos, bufsz - pos, | ||
392 | "%d: %ddBm: BSS%s%s, %s.\n", | ||
393 | ieee80211_frequency_to_channel( | ||
394 | channels[i].center_freq), | ||
395 | channels[i].max_power, | ||
396 | channels[i].flags & IEEE80211_CHAN_RADAR ? | ||
397 | " (IEEE 802.11h required)" : "", | ||
398 | ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) | ||
399 | || (channels[i].flags & | ||
400 | IEEE80211_CHAN_RADAR)) ? "" : | ||
401 | ", IBSS", | ||
402 | channels[i].flags & | ||
403 | IEEE80211_CHAN_PASSIVE_SCAN ? | ||
404 | "passive only" : "active/passive"); | ||
405 | } | ||
405 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ); | 406 | supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ); |
406 | channels = supp_band->channels; | 407 | if (supp_band) { |
408 | channels = supp_band->channels; | ||
407 | 409 | ||
408 | pos += scnprintf(buf + pos, bufsz - pos, | ||
409 | "Displaying %d channels in 5.2GHz band (802.11a)\n", | ||
410 | supp_band->n_channels); | ||
411 | |||
412 | for (i = 0; i < supp_band->n_channels; i++) | ||
413 | pos += scnprintf(buf + pos, bufsz - pos, | 410 | pos += scnprintf(buf + pos, bufsz - pos, |
414 | "%d: %ddBm: BSS%s%s, %s.\n", | 411 | "Displaying %d channels in 5.2GHz band (802.11a)\n", |
415 | ieee80211_frequency_to_channel( | 412 | supp_band->n_channels); |
416 | channels[i].center_freq), | 413 | |
417 | channels[i].max_power, | 414 | for (i = 0; i < supp_band->n_channels; i++) |
418 | channels[i].flags & IEEE80211_CHAN_RADAR ? | 415 | pos += scnprintf(buf + pos, bufsz - pos, |
419 | " (IEEE 802.11h required)" : "", | 416 | "%d: %ddBm: BSS%s%s, %s.\n", |
420 | ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) | 417 | ieee80211_frequency_to_channel( |
421 | || (channels[i].flags & | 418 | channels[i].center_freq), |
422 | IEEE80211_CHAN_RADAR)) ? "" : | 419 | channels[i].max_power, |
423 | ", IBSS", | 420 | channels[i].flags & IEEE80211_CHAN_RADAR ? |
424 | channels[i].flags & | 421 | " (IEEE 802.11h required)" : "", |
425 | IEEE80211_CHAN_PASSIVE_SCAN ? | 422 | ((channels[i].flags & IEEE80211_CHAN_NO_IBSS) |
426 | "passive only" : "active/passive"); | 423 | || (channels[i].flags & |
424 | IEEE80211_CHAN_RADAR)) ? "" : | ||
425 | ", IBSS", | ||
426 | channels[i].flags & | ||
427 | IEEE80211_CHAN_PASSIVE_SCAN ? | ||
428 | "passive only" : "active/passive"); | ||
429 | } | ||
427 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 430 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); |
428 | kfree(buf); | 431 | kfree(buf); |
429 | return ret; | 432 | return ret; |