]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wifi: wilc1000: cancel the connect operation during interface down
authorAjay Singh <ajay.kathat@microchip.com>
Wed, 20 Jul 2022 16:03:05 +0000 (16:03 +0000)
committerKalle Valo <kvalo@kernel.org>
Wed, 27 Jul 2022 12:58:10 +0000 (15:58 +0300)
Cancel the ongoing connection request to avoid any issue if the
interface is set down before the connection request is completed.
host_int_handle_disconnect was already available, so renamed it and used
the same API for 'ndio_close' cb.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220720160302.231516-6-ajay.kathat@microchip.com
drivers/net/wireless/microchip/wilc1000/hif.c
drivers/net/wireless/microchip/wilc1000/hif.h
drivers/net/wireless/microchip/wilc1000/netdev.c

index 021e0db80bd243eee96074d347240c3c5d4ef506..b89519ab92052b2e53a95fb5a4d91c304f8e3211 100644 (file)
@@ -635,7 +635,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
        conn_info->req_ies_len = 0;
 }
 
-static inline void host_int_handle_disconnect(struct wilc_vif *vif)
+inline void wilc_handle_disconnect(struct wilc_vif *vif)
 {
        struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -647,8 +647,6 @@ static inline void host_int_handle_disconnect(struct wilc_vif *vif)
        if (hif_drv->conn_info.conn_result)
                hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
                                               0, hif_drv->conn_info.arg);
-       else
-               netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
 
        eth_zero_addr(hif_drv->assoc_bssid);
 
@@ -684,7 +682,7 @@ static void handle_rcvd_gnrl_async_info(struct work_struct *work)
                host_int_parse_assoc_resp_info(vif, mac_info->status);
        } else if (mac_info->status == WILC_MAC_STATUS_DISCONNECTED) {
                if (hif_drv->hif_state == HOST_IF_CONNECTED) {
-                       host_int_handle_disconnect(vif);
+                       wilc_handle_disconnect(vif);
                } else if (hif_drv->usr_scan_req.scan_result) {
                        del_timer(&hif_drv->scan_timer);
                        handle_scan_done(vif, SCAN_EVENT_ABORTED);
index d8dd94dcfe149a9a0ff1bc555ebfd2329efe2ffa..69ba1d469e9f0028e6604ec332182740d9922b9f 100644 (file)
@@ -215,4 +215,5 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length);
 void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,
                                struct cfg80211_crypto_settings *crypto);
 int wilc_set_default_mgmt_key_index(struct wilc_vif *vif, u8 index);
+inline void wilc_handle_disconnect(struct wilc_vif *vif);
 #endif
index 7879446f282fe630d4643d143684eec9c1b424b4..2de5838a4426aeca140ef2db5b2b30914f438ab4 100644 (file)
@@ -780,6 +780,7 @@ static int wilc_mac_close(struct net_device *ndev)
        if (vif->ndev) {
                netif_stop_queue(vif->ndev);
 
+               wilc_handle_disconnect(vif);
                wilc_deinit_host_int(vif->ndev);
        }