From: Bing Zhao Date: Mon, 1 Apr 2013 19:44:45 +0000 (-0700) Subject: mwifiex: complete last internal scan X-Git-Tag: v3.8.7~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=303bf43a2390c09ff38f0efc37f5917b928d453e;p=users%2Fjedix%2Flinux-maple.git mwifiex: complete last internal scan commit 21de979ecfc7b7f9442f8aea9a54b3ab670d0151 upstream. We are waiting on first scan command of internal scan request before association, so we should complete on last internal scan command response. Tested-by: Daniel Drake Tested-by: Marco Cesarano Signed-off-by: Bing Zhao Signed-off-by: Amitkumar Karwar Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 8955a0e0f9214..771be26a27150 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1371,8 +1371,10 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, queue_work(adapter->workqueue, &adapter->main_work); /* Perform internal scan synchronously */ - if (!priv->scan_request) + if (!priv->scan_request) { + dev_dbg(adapter->dev, "wait internal scan\n"); mwifiex_wait_queue_complete(adapter, cmd_node); + } } else { spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); @@ -1768,7 +1770,12 @@ check_next_scan: /* Need to indicate IOCTL complete */ if (adapter->curr_cmd->wait_q_enabled) { adapter->cmd_wait_q.status = 0; - mwifiex_complete_cmd(adapter, adapter->curr_cmd); + if (!priv->scan_request) { + dev_dbg(adapter->dev, + "complete internal scan\n"); + mwifiex_complete_cmd(adapter, + adapter->curr_cmd); + } } if (priv->report_scan_result) priv->report_scan_result = false;