From e4fe4eafa41cf951fb8fe2b9725ae84c599668d8 Mon Sep 17 00:00:00 2001 From: Kiran Divekar Date: Fri, 4 Jun 2010 23:20:37 -0700 Subject: Libertas: fix WARN_ON issues in cfg80211 support In following scenarios WARN_ON() in cfg80211 code was triggered. a) Driver unload or card removal. b) Disconnect from infra network c) Adhoc start/join d) Adhoc stop Added following fixes to avoid WARN_ON() in cfg80211 code. a) Ensured that cfg80211_disconnected() function defined in cfg80211 code will be called only in infra mode. b) Solved timing issue by moving cfg80211_disconnected() call inside lbs_cfg_disconnect(). c) Updated "wdev->ssid" in driver code after Adhoc join/start d) Removed unnecessory cfg80211_disconnected() call in lbs_remove_card. Signed-off-by: Amitkumar Karwar Signed-off-by: Kiran Divekar Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/cmdresp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/libertas/cmdresp.c') diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 9c18227ecc7..52b543c52a9 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c @@ -31,7 +31,9 @@ void lbs_mac_event_disconnected(struct lbs_private *priv) * It causes problem in the Supplicant */ msleep_interruptible(1000); - lbs_send_disconnect_notification(priv); + + if (priv->wdev->iftype == NL80211_IFTYPE_STATION) + lbs_send_disconnect_notification(priv); /* report disconnect to upper layer */ netif_stop_queue(priv->dev); -- cgit v1.2.3-70-g09d2