Commit 37b1c004 authored by Denis Kenzior's avatar Denis Kenzior Committed by Johannes Berg

cfg80211: Support all iftypes in autodisconnect_wk

Currently autodisconnect_wk assumes that only interface types of
P2P_CLIENT and STATION use conn_owner_nlportid.  Change this so all
interface types are supported.
Signed-off-by: default avatarDenis Kenzior <denkenz@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 2c390e44
...@@ -1239,17 +1239,38 @@ void cfg80211_autodisconnect_wk(struct work_struct *work) ...@@ -1239,17 +1239,38 @@ void cfg80211_autodisconnect_wk(struct work_struct *work)
wdev_lock(wdev); wdev_lock(wdev);
if (wdev->conn_owner_nlportid) { if (wdev->conn_owner_nlportid) {
/* switch (wdev->iftype) {
* Use disconnect_bssid if still connecting and ops->disconnect case NL80211_IFTYPE_ADHOC:
* not implemented. Otherwise we can use cfg80211_disconnect. cfg80211_leave_ibss(rdev, wdev->netdev, false);
*/ break;
if (rdev->ops->disconnect || wdev->current_bss) case NL80211_IFTYPE_AP:
cfg80211_disconnect(rdev, wdev->netdev, case NL80211_IFTYPE_P2P_GO:
WLAN_REASON_DEAUTH_LEAVING, true); cfg80211_stop_ap(rdev, wdev->netdev, false);
else break;
cfg80211_mlme_deauth(rdev, wdev->netdev, case NL80211_IFTYPE_MESH_POINT:
wdev->disconnect_bssid, NULL, 0, cfg80211_leave_mesh(rdev, wdev->netdev);
WLAN_REASON_DEAUTH_LEAVING, false); break;
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_P2P_CLIENT:
/*
* Use disconnect_bssid if still connecting and
* ops->disconnect not implemented. Otherwise we can
* use cfg80211_disconnect.
*/
if (rdev->ops->disconnect || wdev->current_bss)
cfg80211_disconnect(rdev, wdev->netdev,
WLAN_REASON_DEAUTH_LEAVING,
true);
else
cfg80211_mlme_deauth(rdev, wdev->netdev,
wdev->disconnect_bssid,
NULL, 0,
WLAN_REASON_DEAUTH_LEAVING,
false);
break;
default:
break;
}
} }
wdev_unlock(wdev); wdev_unlock(wdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment