aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2014-09-12 10:38:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-09-15 15:00:51 -0400
commit3223db2086c987d4527fdaa487a027b0148e9692 (patch)
treed37814b7a2523ea51a4fe1c28ddc7ae5668a3d68 /drivers/net/wireless/mwifiex/scan.c
parent42a028aa952b66a039ee8c0a08ff4e3658246269 (diff)
mwifiex: rework internal scan for association
There was an issue with internal scan during association wherein we would complete internal scan on first scan command response. This would cause association failure if AP is not found in first scan response e.g. APs from A band. This patch fixes this issue by completing internal scan only when all scan commands from scan pending queue and command pending queue are sent to FW and response to last scan command is received. Tested-by: Xinmin Hu <huxm@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 195ef0ca343f..0c9ed2c730d7 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1971,9 +1971,34 @@ int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv,
1971/* This function handles the command response of extended scan */ 1971/* This function handles the command response of extended scan */
1972int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv) 1972int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv)
1973{ 1973{
1974 struct mwifiex_adapter *adapter = priv->adapter;
1975 struct host_cmd_ds_command *cmd_ptr;
1976 struct cmd_ctrl_node *cmd_node;
1977 unsigned long cmd_flags, scan_flags;
1978 bool complete_scan = false;
1979
1974 dev_dbg(priv->adapter->dev, "info: EXT scan returns successfully\n"); 1980 dev_dbg(priv->adapter->dev, "info: EXT scan returns successfully\n");
1975 1981
1976 mwifiex_complete_scan(priv); 1982 spin_lock_irqsave(&adapter->cmd_pending_q_lock, cmd_flags);
1983 spin_lock_irqsave(&adapter->scan_pending_q_lock, scan_flags);
1984 if (list_empty(&adapter->scan_pending_q)) {
1985 complete_scan = true;
1986 list_for_each_entry(cmd_node, &adapter->cmd_pending_q, list) {
1987 cmd_ptr = (void *)cmd_node->cmd_skb->data;
1988 if (le16_to_cpu(cmd_ptr->command) ==
1989 HostCmd_CMD_802_11_SCAN_EXT) {
1990 dev_dbg(priv->adapter->dev,
1991 "Scan pending in command pending list");
1992 complete_scan = false;
1993 break;
1994 }
1995 }
1996 }
1997 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, scan_flags);
1998 spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, cmd_flags);
1999
2000 if (complete_scan)
2001 mwifiex_complete_scan(priv);
1977 2002
1978 return 0; 2003 return 0;
1979} 2004}