1 Subject: mac80211: clean up ieee80211_hw_config errors
3 Warn when ieee80211_hw_config returns an error, it shouldn't
4 happen; remove a number of printks that would happen in such
5 a case and one printk that is user-triggerable.
7 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
9 net/mac80211/cfg.c | 3 +--
10 net/mac80211/main.c | 8 +++++++-
11 net/mac80211/scan.c | 16 +++-------------
12 net/mac80211/util.c | 5 +----
13 net/mac80211/wext.c | 6 +-----
14 5 files changed, 13 insertions(+), 25 deletions(-)
16 --- everything.orig/net/mac80211/cfg.c 2008-10-07 20:06:42.000000000 +0200
17 +++ everything/net/mac80211/cfg.c 2008-10-07 20:06:43.000000000 +0200
18 @@ -396,8 +396,7 @@ static int ieee80211_config_beacon(struc
20 if (params->interval) {
21 sdata->local->hw.conf.beacon_int = params->interval;
22 - if (ieee80211_hw_config(sdata->local))
24 + ieee80211_hw_config(sdata->local);
26 * We updated some parameter so if below bails out
28 --- everything.orig/net/mac80211/main.c 2008-10-07 20:06:41.000000000 +0200
29 +++ everything/net/mac80211/main.c 2008-10-07 20:06:43.000000000 +0200
30 @@ -222,8 +222,14 @@ int ieee80211_hw_config(struct ieee80211
31 wiphy_name(local->hw.wiphy), chan->center_freq);
34 - if (local->open_count)
35 + if (local->open_count) {
36 ret = local->ops->config(local_to_hw(local), &local->hw.conf);
38 + * HW reconfiguration should never fail, the driver has told
39 + * us what it can support so it should live up to that promise.
46 --- everything.orig/net/mac80211/scan.c 2008-10-07 20:05:27.000000000 +0200
47 +++ everything/net/mac80211/scan.c 2008-10-07 20:06:43.000000000 +0200
48 @@ -447,18 +447,12 @@ void ieee80211_scan_completed(struct iee
50 if (local->hw_scanning) {
51 local->hw_scanning = false;
52 - if (ieee80211_hw_config(local))
53 - printk(KERN_DEBUG "%s: failed to restore operational "
54 - "channel after scan\n", wiphy_name(local->hw.wiphy));
56 + ieee80211_hw_config(local);
60 local->sw_scanning = false;
61 - if (ieee80211_hw_config(local))
62 - printk(KERN_DEBUG "%s: failed to restore operational "
63 - "channel after scan\n", wiphy_name(local->hw.wiphy));
65 + ieee80211_hw_config(local);
67 netif_tx_lock_bh(local->mdev);
68 netif_addr_lock(local->mdev);
69 @@ -545,12 +539,8 @@ void ieee80211_scan_work(struct work_str
72 local->scan_channel = chan;
73 - if (ieee80211_hw_config(local)) {
74 - printk(KERN_DEBUG "%s: failed to set freq to "
75 - "%d MHz for scan\n", wiphy_name(local->hw.wiphy),
77 + if (ieee80211_hw_config(local))
82 /* advance state machine to next channel/band */
83 --- everything.orig/net/mac80211/util.c 2008-10-07 20:05:27.000000000 +0200
84 +++ everything/net/mac80211/util.c 2008-10-07 20:06:43.000000000 +0200
85 @@ -638,11 +638,8 @@ int ieee80211_set_freq(struct ieee80211_
87 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
88 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
89 - chan->flags & IEEE80211_CHAN_NO_IBSS) {
90 - printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
91 - "%d MHz\n", sdata->dev->name, chan->center_freq);
92 + chan->flags & IEEE80211_CHAN_NO_IBSS)
95 local->oper_channel = chan;
97 if (local->sw_scanning || local->hw_scanning)
98 --- everything.orig/net/mac80211/wext.c 2008-10-07 20:05:27.000000000 +0200
99 +++ everything/net/mac80211/wext.c 2008-10-07 20:06:43.000000000 +0200
100 @@ -689,12 +689,8 @@ static int ieee80211_ioctl_siwtxpower(st
101 ieee80211_led_radio(local, local->hw.conf.radio_enabled);
104 - if (need_reconfig) {
106 ieee80211_hw_config(local);
107 - /* The return value of hw_config is not of big interest here,
108 - * as it doesn't say that it failed because of _this_ config
109 - * change or something else. Ignore it. */