From: <Ajay.Kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <Claudiu.Beznea@microchip.com>, <Sripad.Balwadgi@microchip.com>,
<Ajay.Kathat@microchip.com>
Subject: [PATCH 6/8] wifi: wilc1000: cancel the connect operation during interface down
Date: Wed, 20 Jul 2022 16:03:05 +0000 [thread overview]
Message-ID: <20220720160302.231516-6-ajay.kathat@microchip.com> (raw)
In-Reply-To: <20220720160302.231516-1-ajay.kathat@microchip.com>
From: Ajay Singh <ajay.kathat@microchip.com>
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>
---
drivers/net/wireless/microchip/wilc1000/hif.c | 6 ++----
drivers/net/wireless/microchip/wilc1000/hif.h | 1 +
drivers/net/wireless/microchip/wilc1000/netdev.c | 1 +
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c
index 021e0db80bd2..b89519ab9205 100644
--- a/drivers/net/wireless/microchip/wilc1000/hif.c
+++ b/drivers/net/wireless/microchip/wilc1000/hif.c
@@ -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);
diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h
index d8dd94dcfe14..69ba1d469e9f 100644
--- a/drivers/net/wireless/microchip/wilc1000/hif.h
+++ b/drivers/net/wireless/microchip/wilc1000/hif.h
@@ -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
diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c
index 7879446f282f..2de5838a4426 100644
--- a/drivers/net/wireless/microchip/wilc1000/netdev.c
+++ b/drivers/net/wireless/microchip/wilc1000/netdev.c
@@ -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);
}
--
2.34.1
next prev parent reply other threads:[~2022-07-20 16:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 16:03 [PATCH 1/8] wifi: wilc1000: fix incorrect type assignment sparse warning Ajay.Kathat
2022-07-20 16:03 ` [PATCH 2/8] wifi: wilc1000: add WID_TX_POWER WID in g_cfg_byte array Ajay.Kathat
2022-07-27 12:58 ` Kalle Valo
2022-07-20 16:03 ` [PATCH 3/8] wifi: wilc1000: set correct value of 'close' variable in failure case Ajay.Kathat
2022-07-20 16:03 ` [PATCH 4/8] wifi: wilc1000: set station_info flag only when signal value is valid Ajay.Kathat
2022-07-20 16:03 ` [PATCH 5/8] wifi: wilc1000: get correct length of string WID from received config packet Ajay.Kathat
2022-07-20 16:03 ` Ajay.Kathat [this message]
2022-07-20 16:03 ` [PATCH 7/8] wifi: wilc1000: add 'isinit' flag for SDIO bus similar to SPI Ajay.Kathat
2022-07-20 16:03 ` [PATCH 8/8] wifi: wilc1000: use existing iftype variable to store the interface type Ajay.Kathat
2022-07-27 13:00 ` [PATCH 1/8] wifi: wilc1000: fix incorrect type assignment sparse warning Kalle Valo
2022-07-27 17:32 ` Ajay.Kathat
2022-10-13 6:13 ` Kalle Valo
2022-10-13 7:39 ` Johannes Berg
2022-10-13 9:40 ` Jouni Malinen
2022-10-13 10:10 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220720160302.231516-6-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=Claudiu.Beznea@microchip.com \
--cc=Sripad.Balwadgi@microchip.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).