Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 3.11 1/3] mwifiex: check for bss_role instead of bss_mode for STA operations
@ 2013-07-29 23:32 Bing Zhao
  2013-07-29 23:32 ` [PATCH 3.11 2/3] mwifiex: fix wrong data rates in P2P client Bing Zhao
  2013-07-29 23:32 ` [PATCH 3.11 3/3] mwifiex: fix command 0x2c timeout during p2p_find or p2p_connect Bing Zhao
  0 siblings, 2 replies; 3+ messages in thread
From: Bing Zhao @ 2013-07-29 23:32 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Avinash Patil, Stone Piao, Amitkumar Karwar,
	Nishant Sarmukadam, Frank Huang, Bing Zhao

From: Avinash Patil <patila@marvell.com>

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>
---
 drivers/net/wireless/mwifiex/cfg80211.c | 4 ++--
 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 cc334d5..d1e4816 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1727,9 +1727,9 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 	int ret;
 
-	if (priv->bss_mode != NL80211_IFTYPE_STATION) {
+	if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) {
 		wiphy_err(wiphy,
-			  "%s: reject infra assoc request in non-STA mode\n",
+			  "%s: reject infra assoc request in non-STA role\n",
 			  dev->name);
 		return -EINVAL;
 	}
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index ba043ca..9d7c0e6 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,
 {
 	u8 current_bssid[ETH_ALEN];
 
-	/* Return error if the adapter or table entry is not marked as infra */
-	if ((priv->bss_mode != NL80211_IFTYPE_STATION) ||
+	/* Return error if the adapter is not STA role or table entry
+	 * is not marked as infra.
+	 */
+	if ((GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) ||
 	    (bss_desc->bss_mode != NL80211_IFTYPE_STATION))
 		return -1;
 
-- 
1.8.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-29 23:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-29 23:32 [PATCH 3.11 1/3] mwifiex: check for bss_role instead of bss_mode for STA operations Bing Zhao
2013-07-29 23:32 ` [PATCH 3.11 2/3] mwifiex: fix wrong data rates in P2P client Bing Zhao
2013-07-29 23:32 ` [PATCH 3.11 3/3] mwifiex: fix command 0x2c timeout during p2p_find or p2p_connect Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox