|
|
@@ -1786,6 +1786,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
|
|
|
struct cfg80211_connect_params *sme)
|
|
|
{
|
|
|
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
|
|
|
+ struct mwifiex_adapter *adapter = priv->adapter;
|
|
|
int ret;
|
|
|
|
|
|
if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) {
|
|
|
@@ -1800,6 +1801,13 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
|
|
|
return -EALREADY;
|
|
|
}
|
|
|
|
|
|
+ if (adapter->surprise_removed || adapter->is_cmd_timedout) {
|
|
|
+ wiphy_err(wiphy,
|
|
|
+ "%s: Ignore connection. Card removed or FW in bad state\n",
|
|
|
+ dev->name);
|
|
|
+ return -EFAULT;
|
|
|
+ }
|
|
|
+
|
|
|
wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n",
|
|
|
(char *) sme->ssid, sme->bssid);
|
|
|
|