Commit f4489ebeffa436c8427a20e2f05004e783708cde
Committed by
Johannes Berg
1 parent
ac800140c2
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
cfg80211: add channel tracking for AP and mesh
We need to know which channel is used by a running AP and mesh for channel context accounting and finding matching/active interface combination. STA/IBSS have current_bss already which allows us to check which channel a vif is tuned to. Non-fixed channel IBSS can be handled with additional changes. Monitor mode is going to be handled differently. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Showing 5 changed files with 22 additions and 5 deletions Side-by-side Diff
include/net/cfg80211.h
net/wireless/ap.c
net/wireless/mesh.c
... | ... | @@ -159,6 +159,7 @@ |
159 | 159 | if (!err) { |
160 | 160 | memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len); |
161 | 161 | wdev->mesh_id_len = setup->mesh_id_len; |
162 | + wdev->channel = setup->channel; | |
162 | 163 | } |
163 | 164 | |
164 | 165 | return err; |
... | ... | @@ -184,6 +185,7 @@ |
184 | 185 | enum nl80211_channel_type channel_type) |
185 | 186 | { |
186 | 187 | struct ieee80211_channel *channel; |
188 | + int err; | |
187 | 189 | |
188 | 190 | channel = rdev_freq_to_chan(rdev, freq, channel_type); |
189 | 191 | if (!channel || !cfg80211_can_beacon_sec_chan(&rdev->wiphy, |
... | ... | @@ -205,9 +207,14 @@ |
205 | 207 | |
206 | 208 | if (!netif_running(wdev->netdev)) |
207 | 209 | return -ENETDOWN; |
208 | - return rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, | |
209 | - wdev->netdev, | |
210 | - channel); | |
210 | + | |
211 | + err = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, | |
212 | + wdev->netdev, | |
213 | + channel); | |
214 | + if (!err) | |
215 | + wdev->channel = channel; | |
216 | + | |
217 | + return err; | |
211 | 218 | } |
212 | 219 | |
213 | 220 | if (wdev->mesh_id_len) |
214 | 221 | |
... | ... | @@ -249,8 +256,11 @@ |
249 | 256 | return -ENOTCONN; |
250 | 257 | |
251 | 258 | err = rdev->ops->leave_mesh(&rdev->wiphy, dev); |
252 | - if (!err) | |
259 | + if (!err) { | |
253 | 260 | wdev->mesh_id_len = 0; |
261 | + wdev->channel = NULL; | |
262 | + } | |
263 | + | |
254 | 264 | return err; |
255 | 265 | } |
256 | 266 |
net/wireless/mlme.c
net/wireless/nl80211.c