diff options
author | Avinash Patil <patila@marvell.com> | 2013-07-29 19:32:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-07-31 15:06:45 -0400 |
commit | 953b3539ef9301b8ef73f4b6e2fd824b86aae65a (patch) | |
tree | c84ce4e9d5d752582879b7ca65af0cc97c65ce10 | |
parent | 161915a07d501404710f5c89f9c98e6b58c085f0 (diff) |
mwifiex: check for bss_role instead of bss_mode for STA operations
This patch fixes an issue wherein association would fail on P2P
interfaces. This happened because we are checking priv->mode
against NL80211_IFTYPE_STATION. While this check is correct for
infrastructure stations, it would fail P2P clients for which mode
is NL80211_IFTYPE_P2P_CLIENT.
Better check would be bss_role which has only 2 values: STA/AP.
Cc: <stable@vger.kernel.org> # 3.10.y
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/join.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index ef5fa890a286..89459db4c53b 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1716,9 +1716,9 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1716 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); | 1716 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
1717 | int ret; | 1717 | int ret; |
1718 | 1718 | ||
1719 | if (priv->bss_mode != NL80211_IFTYPE_STATION) { | 1719 | if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) { |
1720 | wiphy_err(wiphy, | 1720 | wiphy_err(wiphy, |
1721 | "%s: reject infra assoc request in non-STA mode\n", | 1721 | "%s: reject infra assoc request in non-STA role\n", |
1722 | dev->name); | 1722 | dev->name); |
1723 | return -EINVAL; | 1723 | return -EINVAL; |
1724 | } | 1724 | } |
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 1c8a771e8e81..12e778159ec5 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -1291,8 +1291,10 @@ int mwifiex_associate(struct mwifiex_private *priv, | |||
1291 | { | 1291 | { |
1292 | u8 current_bssid[ETH_ALEN]; | 1292 | u8 current_bssid[ETH_ALEN]; |
1293 | 1293 | ||
1294 | /* Return error if the adapter or table entry is not marked as infra */ | 1294 | /* Return error if the adapter is not STA role or table entry |
1295 | if ((priv->bss_mode != NL80211_IFTYPE_STATION) || | 1295 | * is not marked as infra. |
1296 | */ | ||
1297 | if ((GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) || | ||
1296 | (bss_desc->bss_mode != NL80211_IFTYPE_STATION)) | 1298 | (bss_desc->bss_mode != NL80211_IFTYPE_STATION)) |
1297 | return -1; | 1299 | return -1; |
1298 | 1300 | ||