Commit 3b56c15f authored by Dedy Lansky's avatar Dedy Lansky Committed by Kalle Valo

wil6210: correctly report locally generated disconnect in STA mode

Driver always invoke cfg80211_disconnected() with locally_generated as
false.
Fix this by reporting true whenever the disconnect is triggered from
upper layers (cfg80211) or from within the driver itself (reset,
deinit).
Signed-off-by: default avatarDedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: default avatarMaya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 628639b1
...@@ -710,6 +710,7 @@ static int wil_cfg80211_disconnect(struct wiphy *wiphy, ...@@ -710,6 +710,7 @@ static int wil_cfg80211_disconnect(struct wiphy *wiphy,
return 0; return 0;
} }
wil->locally_generated_disc = true;
rc = wmi_call(wil, WMI_DISCONNECT_CMDID, NULL, 0, rc = wmi_call(wil, WMI_DISCONNECT_CMDID, NULL, 0,
WMI_DISCONNECT_EVENTID, NULL, 0, WMI_DISCONNECT_EVENTID, NULL, 0,
WIL6210_DISCONNECT_TO_MS); WIL6210_DISCONNECT_TO_MS);
......
...@@ -279,7 +279,10 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, ...@@ -279,7 +279,10 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid,
if (test_bit(wil_status_fwconnected, wil->status)) { if (test_bit(wil_status_fwconnected, wil->status)) {
clear_bit(wil_status_fwconnected, wil->status); clear_bit(wil_status_fwconnected, wil->status);
cfg80211_disconnected(ndev, reason_code, cfg80211_disconnected(ndev, reason_code,
NULL, 0, false, GFP_KERNEL); NULL, 0,
wil->locally_generated_disc,
GFP_KERNEL);
wil->locally_generated_disc = false;
} else if (test_bit(wil_status_fwconnecting, wil->status)) { } else if (test_bit(wil_status_fwconnecting, wil->status)) {
cfg80211_connect_result(ndev, bssid, NULL, 0, NULL, 0, cfg80211_connect_result(ndev, bssid, NULL, 0, NULL, 0,
WLAN_STATUS_UNSPECIFIED_FAILURE, WLAN_STATUS_UNSPECIFIED_FAILURE,
......
...@@ -614,6 +614,7 @@ struct wil6210_priv { ...@@ -614,6 +614,7 @@ struct wil6210_priv {
int sinfo_gen; int sinfo_gen;
u32 ap_isolate; /* no intra-BSS communication */ u32 ap_isolate; /* no intra-BSS communication */
struct cfg80211_bss *bss; /* connected bss, relevant in STA mode */ struct cfg80211_bss *bss; /* connected bss, relevant in STA mode */
int locally_generated_disc; /* relevant in STA mode */
/* interrupt moderation */ /* interrupt moderation */
u32 tx_max_burst_duration; u32 tx_max_burst_duration;
u32 tx_interframe_timeout; u32 tx_interframe_timeout;
......
...@@ -1497,6 +1497,7 @@ int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac, ...@@ -1497,6 +1497,7 @@ int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac,
wil_dbg_wmi(wil, "disconnect_sta: (%pM, reason %d)\n", mac, reason); wil_dbg_wmi(wil, "disconnect_sta: (%pM, reason %d)\n", mac, reason);
wil->locally_generated_disc = true;
if (del_sta) { if (del_sta) {
ether_addr_copy(del_sta_cmd.dst_mac, mac); ether_addr_copy(del_sta_cmd.dst_mac, mac);
rc = wmi_call(wil, WMI_DEL_STA_CMDID, &del_sta_cmd, rc = wmi_call(wil, WMI_DEL_STA_CMDID, &del_sta_cmd,
......
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