summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>2018-10-05 10:11:28 +0000
committerKalle Valo <kvalo@codeaurora.org>2018-10-05 14:01:16 +0300
commitd5f693bc4bb925713d9afce09271cda7ee54f035 (patch)
tree850d2e203de3eb52972e259a4ab302000c6c0dca
parent263ee96b77a755ebf119e5a61bcdfc761cef500e (diff)
downloadlinux-d5f693bc4bb925713d9afce09271cda7ee54f035.tar.gz
qtnfmac: generate local disconnect event in disconnect callback
When cfg80211 disconnect callback is triggered and command is processed by firmware, disconnect event with local parameter set must be sent immediately. Indicating that it's a "local" event (not from AP) will help upper layers to process this event correctly. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/cfg80211.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 776cfba7396e..87f48b7fb673 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -660,10 +660,14 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev,
qtnf_scan_done(mac, true);
ret = qtnf_cmd_send_disconnect(vif, reason_code);
- if (ret) {
+ if (ret)
pr_err("VIF%u.%u: failed to disconnect\n", mac->macid,
vif->vifid);
- goto out;
+
+ if (vif->wdev.current_bss) {
+ netif_carrier_off(vif->netdev);
+ cfg80211_disconnected(vif->netdev, reason_code,
+ NULL, 0, true, GFP_KERNEL);
}
out:
@@ -1140,12 +1144,9 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev)
struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev);
struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy);
- if (vif->wdev.iftype == NL80211_IFTYPE_STATION) {
- cfg80211_disconnected(vif->netdev, WLAN_REASON_DEAUTH_LEAVING,
- NULL, 0, 1, GFP_KERNEL);
+ if (vif->wdev.iftype == NL80211_IFTYPE_STATION)
qtnf_disconnect(vif->wdev.wiphy, ndev,
WLAN_REASON_DEAUTH_LEAVING);
- }
qtnf_scan_done(mac, true);
}