diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-14 08:34:25 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:37 -0500 |
commit | ad2d223aa900179031feb40273881e212941573d (patch) | |
tree | 2d9a697ae91adb3460aabf32901e7108bdc8523f /net/mac80211/iface.c | |
parent | b8dc1a35c88dddcf62ce7bc59a7ed4c38c2f7597 (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/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 1ab7d8e57d39..06fac2991d40 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -1227,6 +1227,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
1227 | case NL80211_IFTYPE_AP: | 1227 | case NL80211_IFTYPE_AP: |
1228 | skb_queue_head_init(&sdata->u.ap.ps.bc_buf); | 1228 | skb_queue_head_init(&sdata->u.ap.ps.bc_buf); |
1229 | INIT_LIST_HEAD(&sdata->u.ap.vlans); | 1229 | INIT_LIST_HEAD(&sdata->u.ap.vlans); |
1230 | sdata->vif.bss_conf.bssid = sdata->vif.addr; | ||
1230 | break; | 1231 | break; |
1231 | case NL80211_IFTYPE_P2P_CLIENT: | 1232 | case NL80211_IFTYPE_P2P_CLIENT: |
1232 | type = NL80211_IFTYPE_STATION; | 1233 | type = NL80211_IFTYPE_STATION; |
@@ -1234,9 +1235,11 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
1234 | sdata->vif.p2p = true; | 1235 | sdata->vif.p2p = true; |
1235 | /* fall through */ | 1236 | /* fall through */ |
1236 | case NL80211_IFTYPE_STATION: | 1237 | case NL80211_IFTYPE_STATION: |
1238 | sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid; | ||
1237 | ieee80211_sta_setup_sdata(sdata); | 1239 | ieee80211_sta_setup_sdata(sdata); |
1238 | break; | 1240 | break; |
1239 | case NL80211_IFTYPE_ADHOC: | 1241 | case NL80211_IFTYPE_ADHOC: |
1242 | sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid; | ||
1240 | ieee80211_ibss_setup_sdata(sdata); | 1243 | ieee80211_ibss_setup_sdata(sdata); |
1241 | break; | 1244 | break; |
1242 | case NL80211_IFTYPE_MESH_POINT: | 1245 | case NL80211_IFTYPE_MESH_POINT: |
@@ -1250,8 +1253,12 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
1250 | MONITOR_FLAG_OTHER_BSS; | 1253 | MONITOR_FLAG_OTHER_BSS; |
1251 | break; | 1254 | break; |
1252 | case NL80211_IFTYPE_WDS: | 1255 | case NL80211_IFTYPE_WDS: |
1256 | sdata->vif.bss_conf.bssid = NULL; | ||
1257 | break; | ||
1253 | case NL80211_IFTYPE_AP_VLAN: | 1258 | case NL80211_IFTYPE_AP_VLAN: |
1259 | break; | ||
1254 | case NL80211_IFTYPE_P2P_DEVICE: | 1260 | case NL80211_IFTYPE_P2P_DEVICE: |
1261 | sdata->vif.bss_conf.bssid = sdata->vif.addr; | ||
1255 | break; | 1262 | break; |
1256 | case NL80211_IFTYPE_UNSPECIFIED: | 1263 | case NL80211_IFTYPE_UNSPECIFIED: |
1257 | case NUM_NL80211_IFTYPES: | 1264 | case NUM_NL80211_IFTYPES: |