mwifiex: check for bss_role instead of bss_mode for STA operations
authorAvinash Patil <patila@marvell.com>
Mon, 29 Jul 2013 23:32:37 +0000 (16:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2013 01:35:23 +0000 (18:35 -0700)
commit440166b9bb8b4fcd182531a65fd75816066f82f9
tree4b4ad37b048d189697d5a4797faeedcbae084c00
parent558c62c2c0883b3c4f58c3baff021856eb4cb95b
mwifiex: check for bss_role instead of bss_mode for STA operations

commit 953b3539ef9301b8ef73f4b6e2fd824b86aae65a upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/join.c