aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-01-28 20:05:43 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-03 16:42:44 -0500
commit172710bf8305c1b145796e34426c865480884024 (patch)
treed67ead1631a8df72a2ea1794894b46e4e99ae2bf /net/mac80211
parent0fa025f0a29ec6848b67a3021db4248c9dcc78ed (diff)
mac80211: Warn users if HT fails because of freq mismatch.
I have a netgear WNDR3700 that appears to have an off-by-four bug in how it fills out the hti->control_chan (I configure the AP to channel 11, it reports 15 as control_chan). Poke a message into the kernel logs to give users a clue as to why they are not getting the expected channel-type or rate. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mlme.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index dfa752e5520b..e059b3a6f285 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -161,6 +161,7 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
161 struct ieee80211_supported_band *sband; 161 struct ieee80211_supported_band *sband;
162 struct sta_info *sta; 162 struct sta_info *sta;
163 u32 changed = 0; 163 u32 changed = 0;
164 int hti_cfreq;
164 u16 ht_opmode; 165 u16 ht_opmode;
165 bool enable_ht = true; 166 bool enable_ht = true;
166 enum nl80211_channel_type prev_chantype; 167 enum nl80211_channel_type prev_chantype;
@@ -174,10 +175,27 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
174 if (!sband->ht_cap.ht_supported) 175 if (!sband->ht_cap.ht_supported)
175 enable_ht = false; 176 enable_ht = false;
176 177
177 /* check that channel matches the right operating channel */ 178 if (enable_ht) {
178 if (local->hw.conf.channel->center_freq != 179 hti_cfreq = ieee80211_channel_to_frequency(hti->control_chan,
179 ieee80211_channel_to_frequency(hti->control_chan, sband->band)) 180 sband->band);
180 enable_ht = false; 181 /* check that channel matches the right operating channel */
182 if (local->hw.conf.channel->center_freq != hti_cfreq) {
183 /* Some APs mess this up, evidently.
184 * Netgear WNDR3700 sometimes reports 4 higher than
185 * the actual channel, for instance.
186 */
187 printk(KERN_DEBUG
188 "%s: Wrong control channel in association"
189 " response: configured center-freq: %d"
190 " hti-cfreq: %d hti->control_chan: %d"
191 " band: %d. Disabling HT.\n",
192 sdata->name,
193 local->hw.conf.channel->center_freq,
194 hti_cfreq, hti->control_chan,
195 sband->band);
196 enable_ht = false;
197 }
198 }
181 199
182 if (enable_ht) { 200 if (enable_ht) {
183 channel_type = NL80211_CHAN_HT20; 201 channel_type = NL80211_CHAN_HT20;