* [PATCH 3.12 1/2] mwifiex: inform cfg80211 about disconnect if device is removed
@ 2013-10-12 1:31 Bing Zhao
2013-10-12 1:31 ` [PATCH 3.12 2/2] mwifiex: inform cfg80211 about disconnect for P2P client interface Bing Zhao
0 siblings, 1 reply; 2+ messages in thread
From: Bing Zhao @ 2013-10-12 1:31 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Avinash Patil, Amitkumar Karwar,
Nishant Sarmukadam, Frank Huang, Bing Zhao
From: Avinash Patil <patila@marvell.com>
If device is surprise removed, commands sent to FW including
deauthenticate command fail as bus writes fail.
We update our media_connected status to false and inform cfg80211
about disconnection only when command is successful. Since cfg80211
assumes device is still connected, it results into following
WARN_ON during unload:
WARNING: CPU: 0 PID: 18245 at net/wireless/core.c:937
cfg80211_netdev_notifier_call+0x175/0x4d0 [cfg80211]()
Avoid this by emitting cfg80211_disconnected event even if the
deauthenticate command fails.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/join.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 717fbe2..4e4686e 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1422,13 +1422,19 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
*/
int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
{
+ int ret = 0;
+
if (!priv->media_connected)
return 0;
switch (priv->bss_mode) {
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_P2P_CLIENT:
- return mwifiex_deauthenticate_infra(priv, mac);
+ ret = mwifiex_deauthenticate_infra(priv, mac);
+ if (ret)
+ cfg80211_disconnected(priv->netdev, 0, NULL, 0,
+ GFP_KERNEL);
+ break;
case NL80211_IFTYPE_ADHOC:
return mwifiex_send_cmd_sync(priv,
HostCmd_CMD_802_11_AD_HOC_STOP,
@@ -1440,7 +1446,7 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
break;
}
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(mwifiex_deauthenticate);
--
1.8.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 3.12 2/2] mwifiex: inform cfg80211 about disconnect for P2P client interface
2013-10-12 1:31 [PATCH 3.12 1/2] mwifiex: inform cfg80211 about disconnect if device is removed Bing Zhao
@ 2013-10-12 1:31 ` Bing Zhao
0 siblings, 0 replies; 2+ messages in thread
From: Bing Zhao @ 2013-10-12 1:31 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Avinash Patil, Amitkumar Karwar,
Nishant Sarmukadam, Frank Huang, Bing Zhao
From: Avinash Patil <patila@marvell.com>
This patch adds missing cfg80211_disconnected event for P2P client
interface upon successful deauthenticate command, deauthenticate
event or disassociate event from FW.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/sta_event.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 8b05752..8c351f7 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -118,7 +118,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
dev_dbg(adapter->dev,
"info: successfully disconnected from %pM: reason code %d\n",
priv->cfg_bssid, reason_code);
- if (priv->bss_mode == NL80211_IFTYPE_STATION) {
+ if (priv->bss_mode == NL80211_IFTYPE_STATION ||
+ priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
cfg80211_disconnected(priv->netdev, reason_code, NULL, 0,
GFP_KERNEL);
}
--
1.8.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-12 1:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-12 1:31 [PATCH 3.12 1/2] mwifiex: inform cfg80211 about disconnect if device is removed Bing Zhao
2013-10-12 1:31 ` [PATCH 3.12 2/2] mwifiex: inform cfg80211 about disconnect for P2P client interface Bing Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox