提交 100106d7 编写于 作者: V Vladimir Kondratiev 提交者: Kalle Valo

wil6210: fix disconnect 1 STA in AP

When disconnecting single STA in AP, it might be that STA
in question is already disconnected. In this case, need to do nothing.
Previously, it was mis-interpreted as "disconnect all"
Signed-off-by: NVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 56637e7b
...@@ -188,18 +188,29 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, ...@@ -188,18 +188,29 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid,
struct wireless_dev *wdev = wil->wdev; struct wireless_dev *wdev = wil->wdev;
might_sleep(); might_sleep();
if (bssid) { wil_dbg_misc(wil, "%s(bssid=%pM, reason=%d, ev%s)\n", __func__, bssid,
reason_code, from_event ? "+" : "-");
/* Cases are:
* - disconnect single STA, still connected
* - disconnect single STA, already disconnected
* - disconnect all
*
* For "disconnect all", there are 2 options:
* - bssid == NULL
* - bssid is our MAC address
*/
if (bssid && memcmp(ndev->dev_addr, bssid, ETH_ALEN)) {
cid = wil_find_cid(wil, bssid); cid = wil_find_cid(wil, bssid);
wil_dbg_misc(wil, "%s(%pM, CID %d)\n", __func__, bssid, cid); wil_dbg_misc(wil, "Disconnect %pM, CID=%d, reason=%d\n",
} else { bssid, cid, reason_code);
wil_dbg_misc(wil, "%s(all)\n", __func__); if (cid >= 0) /* disconnect 1 peer */
} wil_disconnect_cid(wil, cid, reason_code, from_event);
} else { /* all */
if (cid >= 0) /* disconnect 1 peer */ wil_dbg_misc(wil, "Disconnect all\n");
wil_disconnect_cid(wil, cid, reason_code, from_event);
else /* disconnect all */
for (cid = 0; cid < WIL6210_MAX_CID; cid++) for (cid = 0; cid < WIL6210_MAX_CID; cid++)
wil_disconnect_cid(wil, cid, reason_code, from_event); wil_disconnect_cid(wil, cid, reason_code, from_event);
}
/* link state */ /* link state */
switch (wdev->iftype) { switch (wdev->iftype) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册