qtnfmac: cancel scans on wireless interface changes

Cancel active scans and deactivate firmware scan watchdog timer
when wireless interface configuration is changed. The usecases
include wireless interface mode change, interface down,
AP stop, virtual interface removal.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Sergey Matyukevich 2017-09-18 15:29:50 +03:00 committed by Kalle Valo
parent 20da2ec06b
commit a715b3a0ef
3 changed files with 9 additions and 5 deletions

View File

@ -115,6 +115,8 @@ int qtnf_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
vif = qtnf_netdev_get_priv(wdev->netdev); vif = qtnf_netdev_get_priv(wdev->netdev);
qtnf_scan_done(vif->mac, true);
if (qtnf_cmd_send_del_intf(vif)) if (qtnf_cmd_send_del_intf(vif))
pr_err("VIF%u.%u: failed to delete VIF\n", vif->mac->macid, pr_err("VIF%u.%u: failed to delete VIF\n", vif->mac->macid,
vif->vifid); vif->vifid);
@ -335,6 +337,8 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev)
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
int ret; int ret;
qtnf_scan_done(vif->mac, true);
ret = qtnf_cmd_send_stop_ap(vif); ret = qtnf_cmd_send_stop_ap(vif);
if (ret) { if (ret) {
pr_err("VIF%u.%u: failed to stop AP operation in FW\n", pr_err("VIF%u.%u: failed to stop AP operation in FW\n",
@ -570,8 +574,6 @@ qtnf_del_station(struct wiphy *wiphy, struct net_device *dev,
!qtnf_sta_list_lookup(&vif->sta_list, params->mac)) !qtnf_sta_list_lookup(&vif->sta_list, params->mac))
return 0; return 0;
qtnf_scan_done(vif->mac, true);
ret = qtnf_cmd_send_del_sta(vif, params); ret = qtnf_cmd_send_del_sta(vif, params);
if (ret) if (ret)
pr_err("VIF%u.%u: failed to delete STA %pM\n", pr_err("VIF%u.%u: failed to delete STA %pM\n",
@ -1134,8 +1136,9 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev)
} }
vif->sta_state = QTNF_STA_DISCONNECTED; vif->sta_state = QTNF_STA_DISCONNECTED;
qtnf_scan_done(mac, true);
} }
qtnf_scan_done(mac, true);
} }
void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif) void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif)

View File

@ -34,6 +34,9 @@ static inline void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted)
.aborted = aborted, .aborted = aborted,
}; };
if (timer_pending(&mac->scan_timeout))
del_timer_sync(&mac->scan_timeout);
mutex_lock(&mac->mac_lock); mutex_lock(&mac->mac_lock);
if (mac->scan_req) { if (mac->scan_req) {

View File

@ -345,8 +345,6 @@ qtnf_event_handle_scan_complete(struct qtnf_wmac *mac,
return -EINVAL; return -EINVAL;
} }
if (timer_pending(&mac->scan_timeout))
del_timer_sync(&mac->scan_timeout);
qtnf_scan_done(mac, le32_to_cpu(status->flags) & QLINK_SCAN_ABORTED); qtnf_scan_done(mac, le32_to_cpu(status->flags) & QLINK_SCAN_ABORTED);
return 0; return 0;