aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-05-16 17:50:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-05 15:32:15 -0400
commit8a2ac260bb89dc34bd31d694e885164a3b78c4d9 (patch)
tree55386fef484641e65ab1c6967683aa5c0355c33b /net/mac80211/cfg.c
parent9dde64232586bd35c8454615266d209106b73c0f (diff)
mac80211: clean up ieee80211_set_channel
There's no need for ieee80211_set_channel to check whether a change in configuration happened since ieee80211_hw_config() auto-detects it. Additionally, it's wrong to pretend the HT config for the BSS changed, it didn't, the BSS can't be up & running (AP beaconing etc.) when the channel type is changed anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f099cf4d12bc..bb04f4a707e7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1684,9 +1684,6 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
1684{ 1684{
1685 struct ieee80211_local *local = wiphy_priv(wiphy); 1685 struct ieee80211_local *local = wiphy_priv(wiphy);
1686 struct ieee80211_sub_if_data *sdata = NULL; 1686 struct ieee80211_sub_if_data *sdata = NULL;
1687 struct ieee80211_channel *old_oper;
1688 enum nl80211_channel_type old_oper_type;
1689 enum nl80211_channel_type old_vif_oper_type= NL80211_CHAN_NO_HT;
1690 1687
1691 if (netdev) 1688 if (netdev)
1692 sdata = IEEE80211_DEV_TO_SUB_IF(netdev); 1689 sdata = IEEE80211_DEV_TO_SUB_IF(netdev);
@@ -1704,24 +1701,13 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
1704 break; 1701 break;
1705 } 1702 }
1706 1703
1707 if (sdata)
1708 old_vif_oper_type = sdata->vif.bss_conf.channel_type;
1709 old_oper_type = local->_oper_channel_type;
1710
1711 if (!ieee80211_set_channel_type(local, sdata, channel_type)) 1704 if (!ieee80211_set_channel_type(local, sdata, channel_type))
1712 return -EBUSY; 1705 return -EBUSY;
1713 1706
1714 old_oper = local->oper_channel;
1715 local->oper_channel = chan; 1707 local->oper_channel = chan;
1716 1708
1717 /* Update driver if changes were actually made. */ 1709 /* auto-detects changes */
1718 if ((old_oper != local->oper_channel) || 1710 ieee80211_hw_config(local, 0);
1719 (old_oper_type != local->_oper_channel_type))
1720 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
1721
1722 if (sdata && sdata->vif.type != NL80211_IFTYPE_MONITOR &&
1723 old_vif_oper_type != sdata->vif.bss_conf.channel_type)
1724 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
1725 1711
1726 return 0; 1712 return 0;
1727} 1713}