Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06975884 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville
Browse files

mwifiex: update cfg80211 with correct reason code when association fails



This patch adds support to send correct reason code got from
firmware when association attempt fails. Also, the error message
displayed for association failure due to network incompatibility
is modified. Current message "cannot find ssid.." misleads user.

Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 061f2e69
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -1596,8 +1596,9 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
		}
	}

	if (mwifiex_bss_start(priv, bss, &req_ssid))
		return -EFAULT;
	ret = mwifiex_bss_start(priv, bss, &req_ssid);
	if (ret)
		return ret;

	if (mode == NL80211_IFTYPE_ADHOC) {
		/* Inform the BSS information to kernel, otherwise
@@ -1652,9 +1653,19 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
			"info: association to bssid %pM failed\n",
			priv->cfg_bssid);
		memset(priv->cfg_bssid, 0, ETH_ALEN);

		if (ret > 0)
			cfg80211_connect_result(priv->netdev, priv->cfg_bssid,
						NULL, 0, NULL, 0, ret,
						GFP_KERNEL);
		else
			cfg80211_connect_result(priv->netdev, priv->cfg_bssid,
						NULL, 0, NULL, 0,
						WLAN_STATUS_UNSPECIFIED_FAILURE,
						GFP_KERNEL);
	}

	return ret;
	return 0;
}

/*
+2 −2
Original line number Diff line number Diff line
@@ -1434,8 +1434,8 @@ int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
			ret = mwifiex_is_network_compatible(priv, bss_desc,
							    priv->bss_mode);
			if (ret)
				dev_err(priv->adapter->dev, "cannot find ssid "
					"%s\n", bss_desc->ssid.ssid);
				dev_err(priv->adapter->dev,
					"Incompatible network settings\n");
			break;
		default:
			ret = 0;