Skip to content

Commit

Permalink
mwifiex: check for bss_role instead of bss_mode for STA operations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avinash Patil authored and John W. Linville committed Jul 31, 2013
1 parent 161915a commit 953b353
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,9 +1716,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;
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/wireless/mwifiex/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 953b353

Please sign in to comment.