aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h3
-rw-r--r--net/wireless/ap.c4
-rw-r--r--net/wireless/mesh.c18
-rw-r--r--net/wireless/mlme.c1
-rw-r--r--net/wireless/nl80211.c1
5 files changed, 22 insertions, 5 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1fc89c4f930c..c62bc7864adf 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2408,6 +2408,9 @@ struct wireless_dev {
2408 struct ieee80211_channel *preset_chan; 2408 struct ieee80211_channel *preset_chan;
2409 enum nl80211_channel_type preset_chantype; 2409 enum nl80211_channel_type preset_chantype;
2410 2410
2411 /* for AP and mesh channel tracking */
2412 struct ieee80211_channel *channel;
2413
2411 bool ps; 2414 bool ps;
2412 int ps_timeout; 2415 int ps_timeout;
2413 2416
diff --git a/net/wireless/ap.c b/net/wireless/ap.c
index 45199cca63d5..fcc60d8dbefa 100644
--- a/net/wireless/ap.c
+++ b/net/wireless/ap.c
@@ -24,8 +24,10 @@ static int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
24 return -ENOENT; 24 return -ENOENT;
25 25
26 err = rdev->ops->stop_ap(&rdev->wiphy, dev); 26 err = rdev->ops->stop_ap(&rdev->wiphy, dev);
27 if (!err) 27 if (!err) {
28 wdev->beacon_interval = 0; 28 wdev->beacon_interval = 0;
29 wdev->channel = NULL;
30 }
29 31
30 return err; 32 return err;
31} 33}
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 3b73b07486cf..bab381344723 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -159,6 +159,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
159 if (!err) { 159 if (!err) {
160 memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len); 160 memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len);
161 wdev->mesh_id_len = setup->mesh_id_len; 161 wdev->mesh_id_len = setup->mesh_id_len;
162 wdev->channel = setup->channel;
162 } 163 }
163 164
164 return err; 165 return err;
@@ -184,6 +185,7 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
184 enum nl80211_channel_type channel_type) 185 enum nl80211_channel_type channel_type)
185{ 186{
186 struct ieee80211_channel *channel; 187 struct ieee80211_channel *channel;
188 int err;
187 189
188 channel = rdev_freq_to_chan(rdev, freq, channel_type); 190 channel = rdev_freq_to_chan(rdev, freq, channel_type);
189 if (!channel || !cfg80211_can_beacon_sec_chan(&rdev->wiphy, 191 if (!channel || !cfg80211_can_beacon_sec_chan(&rdev->wiphy,
@@ -205,9 +207,14 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
205 207
206 if (!netif_running(wdev->netdev)) 208 if (!netif_running(wdev->netdev))
207 return -ENETDOWN; 209 return -ENETDOWN;
208 return rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, 210
209 wdev->netdev, 211 err = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy,
210 channel); 212 wdev->netdev,
213 channel);
214 if (!err)
215 wdev->channel = channel;
216
217 return err;
211 } 218 }
212 219
213 if (wdev->mesh_id_len) 220 if (wdev->mesh_id_len)
@@ -249,8 +256,11 @@ static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
249 return -ENOTCONN; 256 return -ENOTCONN;
250 257
251 err = rdev->ops->leave_mesh(&rdev->wiphy, dev); 258 err = rdev->ops->leave_mesh(&rdev->wiphy, dev);
252 if (!err) 259 if (!err) {
253 wdev->mesh_id_len = 0; 260 wdev->mesh_id_len = 0;
261 wdev->channel = NULL;
262 }
263
254 return err; 264 return err;
255} 265}
256 266
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index da4406f11929..a7882eb8c46e 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -947,6 +947,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, int freq,
947 if (WARN_ON(!chan)) 947 if (WARN_ON(!chan))
948 goto out; 948 goto out;
949 949
950 wdev->channel = chan;
950 nl80211_ch_switch_notify(rdev, dev, freq, type, GFP_KERNEL); 951 nl80211_ch_switch_notify(rdev, dev, freq, type, GFP_KERNEL);
951out: 952out:
952 wdev_unlock(wdev); 953 wdev_unlock(wdev);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 20d0fd6d1286..12096b4ebf62 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2488,6 +2488,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
2488 wdev->preset_chan = params.channel; 2488 wdev->preset_chan = params.channel;
2489 wdev->preset_chantype = params.channel_type; 2489 wdev->preset_chantype = params.channel_type;
2490 wdev->beacon_interval = params.beacon_interval; 2490 wdev->beacon_interval = params.beacon_interval;
2491 wdev->channel = params.channel;
2491 } 2492 }
2492 return err; 2493 return err;
2493} 2494}