aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/412-mac80211-warn-ieee80211_hw_config-failure.patch
blob: f18569b93692e0cfcab7d7df915a63afa6a49564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Subject: 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>
---
 net/mac80211/cfg.c  |    3 +--
 net/mac80211/main.c |    8 +++++++-
 net/mac80211/scan.c |   16 +++-------------
 net/mac80211/util.c |    5 +----
 net/mac80211/wext.c |    6 +-----
 5 files changed, 13 insertions(+), 25 deletions(-)

--- everything.orig/net/mac80211/cfg.c	2008-10-07 20:06:42.000000000 +0200
+++ everything/net/mac80211/cfg.c	2008-10-07 20:06:43.000000000 +0200
@@ -396,8 +396,7 @@ static int ieee80211_config_beacon(struc
 	 */
 	if (params->interval) {
 		sdata->local->hw.conf.beacon_int = params->interval;
-		if (ieee80211_hw_config(sdata->local))
-			return -EINVAL;
+		ieee80211_hw_config(sdata->local);
 		/*
 		 * We updated some parameter so if below bails out
 		 * it's not an error.
--- everything.orig/net/mac80211/main.c	2008-10-07 20:06:41.000000000 +0200
+++ everything/net/mac80211/main.c	2008-10-07 20:06:43.000000000 +0200
@@ -222,8 +222,14 @@ int ieee80211_hw_config(struct ieee80211
 	       wiphy_name(local->hw.wiphy), chan->center_freq);
 #endif
 
-	if (local->open_count)
+	if (local->open_count) {
 		ret = local->ops->config(local_to_hw(local), &local->hw.conf);
+		/*
+		 * HW reconfiguration should never fail, the driver has told
+		 * us what it can support so it should live up to that promise.
+		 */
+		WARN_ON(ret);
+	}
 
 	return ret;
 }
--- everything.orig/net/mac80211/scan.c	2008-10-07 20:05:27.000000000 +0200
+++ everything/net/mac80211/scan.c	2008-10-07 20:06:43.000000000 +0200
@@ -447,18 +447,12 @@ void ieee80211_scan_completed(struct iee
 
 	if (local->hw_scanning) {
 		local->hw_scanning = false;
-		if (ieee80211_hw_config(local))
-			printk(KERN_DEBUG "%s: failed to restore operational "
-			       "channel after scan\n", wiphy_name(local->hw.wiphy));
-
+		ieee80211_hw_config(local);
 		goto done;
 	}
 
 	local->sw_scanning = false;
-	if (ieee80211_hw_config(local))
-		printk(KERN_DEBUG "%s: failed to restore operational "
-		       "channel after scan\n", wiphy_name(local->hw.wiphy));
-
+	ieee80211_hw_config(local);
 
 	netif_tx_lock_bh(local->mdev);
 	netif_addr_lock(local->mdev);
@@ -545,12 +539,8 @@ void ieee80211_scan_work(struct work_str
 
 		if (!skip) {
 			local->scan_channel = chan;
-			if (ieee80211_hw_config(local)) {
-				printk(KERN_DEBUG "%s: failed to set freq to "
-				       "%d MHz for scan\n", wiphy_name(local->hw.wiphy),
-				       chan->center_freq);
+			if (ieee80211_hw_config(local))
 				skip = 1;
-			}
 		}
 
 		/* advance state machine to next channel/band */
--- everything.orig/net/mac80211/util.c	2008-10-07 20:05:27.000000000 +0200
+++ everything/net/mac80211/util.c	2008-10-07 20:06:43.000000000 +0200
@@ -638,11 +638,8 @@ int ieee80211_set_freq(struct ieee80211_
 
 	if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
 		if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
-		    chan->flags & IEEE80211_CHAN_NO_IBSS) {
-			printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
-				"%d MHz\n", sdata->dev->name, chan->center_freq);
+		    chan->flags & IEEE80211_CHAN_NO_IBSS)
 			return ret;
-		}
 		local->oper_channel = chan;
 
 		if (local->sw_scanning || local->hw_scanning)
--- everything.orig/net/mac80211/wext.c	2008-10-07 20:05:27.000000000 +0200
+++ everything/net/mac80211/wext.c	2008-10-07 20:06:43.000000000 +0200
@@ -689,12 +689,8 @@ static int ieee80211_ioctl_siwtxpower(st
 		ieee80211_led_radio(local, local->hw.conf.radio_enabled);
 	}
 
-	if (need_reconfig) {
+	if (need_reconfig)
 		ieee80211_hw_config(local);
-		/* The return value of hw_config is not of big interest here,
-		 * as it doesn't say that it failed because of _this_ config
-		 * change or something else. Ignore it. */
-	}
 
 	return 0;
 }