From 4797938c5dfa22af30fd16679192972f878419a1 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 7 Jan 2009 10:13:27 +0100 Subject: mac80211: clean up channel type config The channel_type really doesn't need to be the only member in a new structure, so remove the struct. Additionally, remove the _CONF_CHANGE_HT flag and use _CONF_CHANGE_CHANNEL when the channel type changes, since that's enough of a change to require reprogramming the hardware anyway. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/ht.c | 8 +++++--- net/mac80211/main.c | 4 ++-- net/mac80211/mlme.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'net') diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index f6547de5ac6..832adf888ac 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c @@ -131,12 +131,14 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, } ht_changed = conf_is_ht(&local->hw.conf) != enable_ht || - channel_type != local->hw.conf.ht.channel_type; + channel_type != local->hw.conf.channel_type; local->oper_channel_type = channel_type; - if (ht_changed) - ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_HT); + if (ht_changed) { + /* channel_type change automatically detected */ + ieee80211_hw_config(local, 0); + } /* disable HT */ if (!enable_ht) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index b55b9970dc9..e9f3e85d1a9 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -208,9 +208,9 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) } if (chan != local->hw.conf.channel || - channel_type != local->hw.conf.ht.channel_type) { + channel_type != local->hw.conf.channel_type) { local->hw.conf.channel = chan; - local->hw.conf.ht.channel_type = channel_type; + local->hw.conf.channel_type = channel_type; changed |= IEEE80211_CONF_CHANGE_CHANNEL; } diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index aafa112ae09..6a90171c859 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -901,8 +901,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, rcu_read_unlock(); + /* channel(_type) changes are handled by ieee80211_hw_config */ local->oper_channel_type = NL80211_CHAN_NO_HT; - config_changed |= IEEE80211_CONF_CHANGE_HT; del_timer_sync(&local->dynamic_ps_timer); cancel_work_sync(&local->dynamic_ps_enable_work); -- cgit v1.2.3