aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ac0241e3539b..fbb2d072cb9e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -735,14 +735,16 @@ static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
735} 735}
736 736
737static int ieee80211_set_monitor_channel(struct wiphy *wiphy, 737static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
738 struct ieee80211_channel *chan, 738 struct cfg80211_chan_def *chandef)
739 enum nl80211_channel_type channel_type)
740{ 739{
741 struct ieee80211_local *local = wiphy_priv(wiphy); 740 struct ieee80211_local *local = wiphy_priv(wiphy);
742 struct ieee80211_sub_if_data *sdata; 741 struct ieee80211_sub_if_data *sdata;
742 enum nl80211_channel_type channel_type;
743 int ret = 0; 743 int ret = 0;
744 744
745 if (local->monitor_channel == chan && 745 channel_type = cfg80211_get_chandef_type(chandef);
746
747 if (local->monitor_channel == chandef->chan &&
746 local->monitor_channel_type == channel_type) 748 local->monitor_channel_type == channel_type)
747 return 0; 749 return 0;
748 750
@@ -754,17 +756,17 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
754 if (sdata) { 756 if (sdata) {
755 ieee80211_vif_release_channel(sdata); 757 ieee80211_vif_release_channel(sdata);
756 ret = ieee80211_vif_use_channel( 758 ret = ieee80211_vif_use_channel(
757 sdata, chan, channel_type, 759 sdata, chandef->chan, channel_type,
758 IEEE80211_CHANCTX_EXCLUSIVE); 760 IEEE80211_CHANCTX_EXCLUSIVE);
759 } 761 }
760 } else if (local->open_count == local->monitors) { 762 } else if (local->open_count == local->monitors) {
761 local->_oper_channel = chan; 763 local->_oper_channel = chandef->chan;
762 local->_oper_channel_type = channel_type; 764 local->_oper_channel_type = channel_type;
763 ieee80211_hw_config(local, 0); 765 ieee80211_hw_config(local, 0);
764 } 766 }
765 767
766 if (ret == 0) { 768 if (ret == 0) {
767 local->monitor_channel = chan; 769 local->monitor_channel = chandef->chan;
768 local->monitor_channel_type = channel_type; 770 local->monitor_channel_type = channel_type;
769 } 771 }
770 mutex_unlock(&local->iflist_mtx); 772 mutex_unlock(&local->iflist_mtx);
@@ -888,9 +890,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
888 sdata->smps_mode = IEEE80211_SMPS_OFF; 890 sdata->smps_mode = IEEE80211_SMPS_OFF;
889 sdata->needed_rx_chains = sdata->local->rx_chains; 891 sdata->needed_rx_chains = sdata->local->rx_chains;
890 892
891 err = ieee80211_vif_use_channel(sdata, params->channel, 893 err = ieee80211_vif_use_channel(
892 params->channel_type, 894 sdata, params->chandef.chan,
893 IEEE80211_CHANCTX_SHARED); 895 cfg80211_get_chandef_type(&params->chandef),
896 IEEE80211_CHANCTX_SHARED);
894 if (err) 897 if (err)
895 return err; 898 return err;
896 899
@@ -1707,9 +1710,10 @@ static int ieee80211_join_mesh(struct wiphy *wiphy, struct net_device *dev,
1707 sdata->smps_mode = IEEE80211_SMPS_OFF; 1710 sdata->smps_mode = IEEE80211_SMPS_OFF;
1708 sdata->needed_rx_chains = sdata->local->rx_chains; 1711 sdata->needed_rx_chains = sdata->local->rx_chains;
1709 1712
1710 err = ieee80211_vif_use_channel(sdata, setup->channel, 1713 err = ieee80211_vif_use_channel(
1711 setup->channel_type, 1714 sdata, setup->chandef.chan,
1712 IEEE80211_CHANCTX_SHARED); 1715 cfg80211_get_chandef_type(&setup->chandef),
1716 IEEE80211_CHANCTX_SHARED);
1713 if (err) 1717 if (err)
1714 return err; 1718 return err;
1715 1719
@@ -3110,23 +3114,24 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
3110 return 0; 3114 return 0;
3111} 3115}
3112 3116
3113static struct ieee80211_channel * 3117static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
3114ieee80211_cfg_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, 3118 struct wireless_dev *wdev,
3115 enum nl80211_channel_type *type) 3119 struct cfg80211_chan_def *chandef)
3116{ 3120{
3117 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 3121 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
3118 struct ieee80211_chanctx_conf *chanctx_conf; 3122 struct ieee80211_chanctx_conf *chanctx_conf;
3119 struct ieee80211_channel *chan = NULL; 3123 int ret = -ENODATA;
3120 3124
3121 rcu_read_lock(); 3125 rcu_read_lock();
3122 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 3126 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
3123 if (chanctx_conf) { 3127 if (chanctx_conf) {
3124 *type = chanctx_conf->channel_type; 3128 chandef->chan = chanctx_conf->channel;
3125 chan = chanctx_conf->channel; 3129 chandef->_type = chanctx_conf->channel_type;
3130 ret = 0;
3126 } 3131 }
3127 rcu_read_unlock(); 3132 rcu_read_unlock();
3128 3133
3129 return chan; 3134 return ret;
3130} 3135}
3131 3136
3132#ifdef CONFIG_PM 3137#ifdef CONFIG_PM