f18569b93692e0cfcab7d7df915a63afa6a49564
[openwrt.git] / package / mac80211 / patches / 412-mac80211-warn-ieee80211_hw_config-failure.patch
1 Subject: mac80211: clean up ieee80211_hw_config errors
2
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.
6
7 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
8 ---
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(-)
15
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
19 */
20 if (params->interval) {
21 sdata->local->hw.conf.beacon_int = params->interval;
22 - if (ieee80211_hw_config(sdata->local))
23 - return -EINVAL;
24 + ieee80211_hw_config(sdata->local);
25 /*
26 * We updated some parameter so if below bails out
27 * it's not an error.
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);
32 #endif
33
34 - if (local->open_count)
35 + if (local->open_count) {
36 ret = local->ops->config(local_to_hw(local), &local->hw.conf);
37 + /*
38 + * HW reconfiguration should never fail, the driver has told
39 + * us what it can support so it should live up to that promise.
40 + */
41 + WARN_ON(ret);
42 + }
43
44 return ret;
45 }
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
49
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));
55 -
56 + ieee80211_hw_config(local);
57 goto done;
58 }
59
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));
64 -
65 + ieee80211_hw_config(local);
66
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
70
71 if (!skip) {
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),
76 - chan->center_freq);
77 + if (ieee80211_hw_config(local))
78 skip = 1;
79 - }
80 }
81
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_
86
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)
93 return ret;
94 - }
95 local->oper_channel = chan;
96
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);
102 }
103
104 - if (need_reconfig) {
105 + 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. */
110 - }
111
112 return 0;
113 }
This page took 0.054138 seconds and 3 git commands to generate.