aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-14 08:34:25 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 07:01:37 -0500
commitad2d223aa900179031feb40273881e212941573d (patch)
tree2d9a697ae91adb3460aabf32901e7108bdc8523f /net/mac80211/main.c
parentb8dc1a35c88dddcf62ce7bc59a7ed4c38c2f7597 (diff)
mac80211: assign bss_conf.bssid only once
Instead of checking every time bss_info_changed is called, assign the pointer once depending on the interface type and then leave it untouched until the interface type is changed. This makes the ieee80211_bss_info_change_notify() now a simple wrapper to call the driver only. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index b719a16eabde..e6514f240fce 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -207,30 +207,10 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
207 u32 changed) 207 u32 changed)
208{ 208{
209 struct ieee80211_local *local = sdata->local; 209 struct ieee80211_local *local = sdata->local;
210 static const u8 zero[ETH_ALEN] = { 0 };
211 210
212 if (!changed) 211 if (!changed)
213 return; 212 return;
214 213
215 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
216 sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid;
217 } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
218 sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid;
219 else if (sdata->vif.type == NL80211_IFTYPE_AP)
220 sdata->vif.bss_conf.bssid = sdata->vif.addr;
221 else if (sdata->vif.type == NL80211_IFTYPE_WDS)
222 sdata->vif.bss_conf.bssid = NULL;
223 else if (ieee80211_vif_is_mesh(&sdata->vif)) {
224 sdata->vif.bss_conf.bssid = zero;
225 } else if (sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) {
226 sdata->vif.bss_conf.bssid = sdata->vif.addr;
227 WARN_ONCE(changed & ~(BSS_CHANGED_IDLE),
228 "P2P Device BSS changed %#x", changed);
229 } else {
230 WARN_ON(1);
231 return;
232 }
233
234 drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed); 214 drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
235} 215}
236 216