Commit 8006109b authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: adds a cfg80211_disconnected() function



This patch is adds a cfg80211_disconnected() when connection is lost already.
We was find this situation while test the 'rmmod sdio'.
SDIO remove function are include both remove mac_close and unregister net_device.
That is received one more a disconnect cmd from cfg80211.
Driver was already performed disconnect.
If wilc->close value was set to true, adds a call to cfg80211_disconnected().

Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3f626cf4
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -819,11 +819,22 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co
	struct wilc_priv *priv;
	struct host_if_drv *pstrWFIDrv;
	struct wilc_vif *vif;
	struct wilc *wilc;
	u8 NullBssid[ETH_ALEN] = {0};

	wilc_connecting = 0;
	priv = wiphy_priv(wiphy);
	vif = netdev_priv(priv->dev);
	wilc = vif->wilc;

	if (!wilc)
		return -EIO;

	if (wilc->close) {
		/* already disconnected done */
		cfg80211_disconnected(dev, 0, NULL, 0, true, GFP_KERNEL);
		return 0;
	}

	pstrWFIDrv = (struct host_if_drv *)priv->hif_drv;
	if (!pstrWFIDrv->p2p_connect)