Skip to content

Commit a715b3a

Browse files
Sergey MatyukevichKalle Valo
authored andcommitted
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 <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 20da2ec commit a715b3a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ int qtnf_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
115115

116116
vif = qtnf_netdev_get_priv(wdev->netdev);
117117

118+
qtnf_scan_done(vif->mac, true);
119+
118120
if (qtnf_cmd_send_del_intf(vif))
119121
pr_err("VIF%u.%u: failed to delete VIF\n", vif->mac->macid,
120122
vif->vifid);
@@ -335,6 +337,8 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev)
335337
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
336338
int ret;
337339

340+
qtnf_scan_done(vif->mac, true);
341+
338342
ret = qtnf_cmd_send_stop_ap(vif);
339343
if (ret) {
340344
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,
570574
!qtnf_sta_list_lookup(&vif->sta_list, params->mac))
571575
return 0;
572576

573-
qtnf_scan_done(vif->mac, true);
574-
575577
ret = qtnf_cmd_send_del_sta(vif, params);
576578
if (ret)
577579
pr_err("VIF%u.%u: failed to delete STA %pM\n",
@@ -1134,8 +1136,9 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev)
11341136
}
11351137

11361138
vif->sta_state = QTNF_STA_DISCONNECTED;
1137-
qtnf_scan_done(mac, true);
11381139
}
1140+
1141+
qtnf_scan_done(mac, true);
11391142
}
11401143

11411144
void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif)

drivers/net/wireless/quantenna/qtnfmac/cfg80211.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ static inline void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted)
3434
.aborted = aborted,
3535
};
3636

37+
if (timer_pending(&mac->scan_timeout))
38+
del_timer_sync(&mac->scan_timeout);
39+
3740
mutex_lock(&mac->mac_lock);
3841

3942
if (mac->scan_req) {

drivers/net/wireless/quantenna/qtnfmac/event.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,6 @@ qtnf_event_handle_scan_complete(struct qtnf_wmac *mac,
345345
return -EINVAL;
346346
}
347347

348-
if (timer_pending(&mac->scan_timeout))
349-
del_timer_sync(&mac->scan_timeout);
350348
qtnf_scan_done(mac, le32_to_cpu(status->flags) & QLINK_SCAN_ABORTED);
351349

352350
return 0;

0 commit comments

Comments
 (0)