diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-10-07 06:04:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 18:06:00 -0400 |
commit | d73782fdde76554016abf73b46f843b29f520848 (patch) | |
tree | 9b57321ce60ba336dfea63501b1d23d21c700817 /net | |
parent | 3db594380b8452eda4d88b12844077809607caaa (diff) |
mac80211: clean up ieee80211_hw_config errors
Warn when ieee80211_hw_config returns an error, it shouldn't
happen; remove a number of printks that would happen in such
a case and one printk that is user-triggerable.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/cfg.c | 3 | ||||
-rw-r--r-- | net/mac80211/main.c | 8 | ||||
-rw-r--r-- | net/mac80211/scan.c | 16 | ||||
-rw-r--r-- | net/mac80211/util.c | 5 | ||||
-rw-r--r-- | net/mac80211/wext.c | 6 |
5 files changed, 13 insertions, 25 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8dc5e46cea68..cf3fd5d60665 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -394,8 +394,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
394 | */ | 394 | */ |
395 | if (params->interval) { | 395 | if (params->interval) { |
396 | sdata->local->hw.conf.beacon_int = params->interval; | 396 | sdata->local->hw.conf.beacon_int = params->interval; |
397 | if (ieee80211_hw_config(sdata->local)) | 397 | ieee80211_hw_config(sdata->local); |
398 | return -EINVAL; | ||
399 | /* | 398 | /* |
400 | * We updated some parameter so if below bails out | 399 | * We updated some parameter so if below bails out |
401 | * it's not an error. | 400 | * it's not an error. |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index ff39d893a113..2ff26d03cd50 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -222,8 +222,14 @@ int ieee80211_hw_config(struct ieee80211_local *local) | |||
222 | wiphy_name(local->hw.wiphy), chan->center_freq); | 222 | wiphy_name(local->hw.wiphy), chan->center_freq); |
223 | #endif | 223 | #endif |
224 | 224 | ||
225 | if (local->open_count) | 225 | if (local->open_count) { |
226 | ret = local->ops->config(local_to_hw(local), &local->hw.conf); | 226 | ret = local->ops->config(local_to_hw(local), &local->hw.conf); |
227 | /* | ||
228 | * HW reconfiguration should never fail, the driver has told | ||
229 | * us what it can support so it should live up to that promise. | ||
230 | */ | ||
231 | WARN_ON(ret); | ||
232 | } | ||
227 | 233 | ||
228 | return ret; | 234 | return ret; |
229 | } | 235 | } |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 416bb41099f3..0989b1c062e3 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -448,18 +448,12 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
448 | 448 | ||
449 | if (local->hw_scanning) { | 449 | if (local->hw_scanning) { |
450 | local->hw_scanning = false; | 450 | local->hw_scanning = false; |
451 | if (ieee80211_hw_config(local)) | 451 | ieee80211_hw_config(local); |
452 | printk(KERN_DEBUG "%s: failed to restore operational " | ||
453 | "channel after scan\n", wiphy_name(local->hw.wiphy)); | ||
454 | |||
455 | goto done; | 452 | goto done; |
456 | } | 453 | } |
457 | 454 | ||
458 | local->sw_scanning = false; | 455 | local->sw_scanning = false; |
459 | if (ieee80211_hw_config(local)) | 456 | ieee80211_hw_config(local); |
460 | printk(KERN_DEBUG "%s: failed to restore operational " | ||
461 | "channel after scan\n", wiphy_name(local->hw.wiphy)); | ||
462 | |||
463 | 457 | ||
464 | netif_tx_lock_bh(local->mdev); | 458 | netif_tx_lock_bh(local->mdev); |
465 | netif_addr_lock(local->mdev); | 459 | netif_addr_lock(local->mdev); |
@@ -546,12 +540,8 @@ void ieee80211_scan_work(struct work_struct *work) | |||
546 | 540 | ||
547 | if (!skip) { | 541 | if (!skip) { |
548 | local->scan_channel = chan; | 542 | local->scan_channel = chan; |
549 | if (ieee80211_hw_config(local)) { | 543 | if (ieee80211_hw_config(local)) |
550 | printk(KERN_DEBUG "%s: failed to set freq to " | ||
551 | "%d MHz for scan\n", wiphy_name(local->hw.wiphy), | ||
552 | chan->center_freq); | ||
553 | skip = 1; | 544 | skip = 1; |
554 | } | ||
555 | } | 545 | } |
556 | 546 | ||
557 | /* advance state machine to next channel/band */ | 547 | /* advance state machine to next channel/band */ |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index cee4884b9d06..1b605457017e 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -638,11 +638,8 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz) | |||
638 | 638 | ||
639 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { | 639 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { |
640 | if (sdata->vif.type == NL80211_IFTYPE_ADHOC && | 640 | if (sdata->vif.type == NL80211_IFTYPE_ADHOC && |
641 | chan->flags & IEEE80211_CHAN_NO_IBSS) { | 641 | chan->flags & IEEE80211_CHAN_NO_IBSS) |
642 | printk(KERN_DEBUG "%s: IBSS not allowed on frequency " | ||
643 | "%d MHz\n", sdata->dev->name, chan->center_freq); | ||
644 | return ret; | 642 | return ret; |
645 | } | ||
646 | local->oper_channel = chan; | 643 | local->oper_channel = chan; |
647 | 644 | ||
648 | if (local->sw_scanning || local->hw_scanning) | 645 | if (local->sw_scanning || local->hw_scanning) |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 742f811ca416..29c41040c8c9 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -689,12 +689,8 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev, | |||
689 | ieee80211_led_radio(local, local->hw.conf.radio_enabled); | 689 | ieee80211_led_radio(local, local->hw.conf.radio_enabled); |
690 | } | 690 | } |
691 | 691 | ||
692 | if (need_reconfig) { | 692 | if (need_reconfig) |
693 | ieee80211_hw_config(local); | 693 | ieee80211_hw_config(local); |
694 | /* The return value of hw_config is not of big interest here, | ||
695 | * as it doesn't say that it failed because of _this_ config | ||
696 | * change or something else. Ignore it. */ | ||
697 | } | ||
698 | 694 | ||
699 | return 0; | 695 | return 0; |
700 | } | 696 | } |