mac80211: fix BSS info reconfiguration
When reconfiguring an interface due to a previous hardware restart, mac80211 will currently include the new IBSS flag on non-IBSS interfaces which may confuse drivers. Instead of doing the ~0 trick, simply spell out which things are going to be reconfigured. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
bac6fafd4d
commit
ac8dd506e4
2 changed files with 22 additions and 5 deletions
|
@ -160,6 +160,8 @@ enum ieee80211_bss_change {
|
||||||
BSS_CHANGED_BEACON_ENABLED = 1<<9,
|
BSS_CHANGED_BEACON_ENABLED = 1<<9,
|
||||||
BSS_CHANGED_CQM = 1<<10,
|
BSS_CHANGED_CQM = 1<<10,
|
||||||
BSS_CHANGED_IBSS = 1<<11,
|
BSS_CHANGED_IBSS = 1<<11,
|
||||||
|
|
||||||
|
/* when adding here, make sure to change ieee80211_reconfig */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1160,18 +1160,33 @@ int ieee80211_reconfig(struct ieee80211_local *local)
|
||||||
|
|
||||||
/* Finally also reconfigure all the BSS information */
|
/* Finally also reconfigure all the BSS information */
|
||||||
list_for_each_entry(sdata, &local->interfaces, list) {
|
list_for_each_entry(sdata, &local->interfaces, list) {
|
||||||
u32 changed = ~0;
|
u32 changed;
|
||||||
|
|
||||||
if (!ieee80211_sdata_running(sdata))
|
if (!ieee80211_sdata_running(sdata))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* common change flags for all interface types */
|
||||||
|
changed = BSS_CHANGED_ERP_CTS_PROT |
|
||||||
|
BSS_CHANGED_ERP_PREAMBLE |
|
||||||
|
BSS_CHANGED_ERP_SLOT |
|
||||||
|
BSS_CHANGED_HT |
|
||||||
|
BSS_CHANGED_BASIC_RATES |
|
||||||
|
BSS_CHANGED_BEACON_INT |
|
||||||
|
BSS_CHANGED_BSSID |
|
||||||
|
BSS_CHANGED_CQM;
|
||||||
|
|
||||||
switch (sdata->vif.type) {
|
switch (sdata->vif.type) {
|
||||||
case NL80211_IFTYPE_STATION:
|
case NL80211_IFTYPE_STATION:
|
||||||
/* disable beacon change bits */
|
changed |= BSS_CHANGED_ASSOC;
|
||||||
changed &= ~(BSS_CHANGED_BEACON |
|
ieee80211_bss_info_change_notify(sdata, changed);
|
||||||
BSS_CHANGED_BEACON_ENABLED);
|
break;
|
||||||
/* fall through */
|
|
||||||
case NL80211_IFTYPE_ADHOC:
|
case NL80211_IFTYPE_ADHOC:
|
||||||
|
changed |= BSS_CHANGED_IBSS;
|
||||||
|
/* fall through */
|
||||||
case NL80211_IFTYPE_AP:
|
case NL80211_IFTYPE_AP:
|
||||||
case NL80211_IFTYPE_MESH_POINT:
|
case NL80211_IFTYPE_MESH_POINT:
|
||||||
|
changed |= BSS_CHANGED_BEACON |
|
||||||
|
BSS_CHANGED_BEACON_ENABLED;
|
||||||
ieee80211_bss_info_change_notify(sdata, changed);
|
ieee80211_bss_info_change_notify(sdata, changed);
|
||||||
break;
|
break;
|
||||||
case NL80211_IFTYPE_WDS:
|
case NL80211_IFTYPE_WDS:
|
||||||
|
|
Loading…
Reference in a new issue