aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-06-27 22:57:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-28 14:37:48 -0400
commit1a1fb970472d66d1668ff66bc46c2cd977f9a4fc (patch)
treed164ac3c4c2808fcc218bc798615254852fd31b7 /drivers/net/wireless/mwifiex/scan.c
parent469979173ecda9c472c495608d6d540ec33ab85d (diff)
mwifiex: wakeup main thread to handle command queued
We miss to wakeup main thread after adding command to cmd pending queue at follwing places. These commands are handled later when main thread is woken up for handling an interrupt for sleep event from firmware. This adds worst case delay of 50msec. 1) We don't wakeup main thread when asynchronous command is added to cmd pending queue. Move queue_work() call from mwifiex_wait_queue_complete() to mwifiex_send_cmd_async() to wakeup main thread for sync as well as async commands. 2) Scan operation is triggered due to following reasons a) request from user (ex. "iw scan" command) b) Scan performed by driver internally. In first case main thread is woken up when first scan command is queued in cmd pending queue (we don't need to wakeup main thread for subsequent scan commands, because they are queued in scan command response handler), but it is not done for second case. queue_work() is moved inside mwifiex_scan_networks() to handle both the cases. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@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.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index efaf26ccd6ba..884ed6377003 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1296,8 +1296,8 @@ mwifiex_radio_type_to_band(u8 radio_type)
1296 * order to send the appropriate scan commands to firmware to populate or 1296 * order to send the appropriate scan commands to firmware to populate or
1297 * update the internal driver scan table. 1297 * update the internal driver scan table.
1298 */ 1298 */
1299static int mwifiex_scan_networks(struct mwifiex_private *priv, 1299int mwifiex_scan_networks(struct mwifiex_private *priv,
1300 const struct mwifiex_user_scan_cfg *user_scan_in) 1300 const struct mwifiex_user_scan_cfg *user_scan_in)
1301{ 1301{
1302 int ret = 0; 1302 int ret = 0;
1303 struct mwifiex_adapter *adapter = priv->adapter; 1303 struct mwifiex_adapter *adapter = priv->adapter;
@@ -1362,6 +1362,7 @@ static int mwifiex_scan_networks(struct mwifiex_private *priv,
1362 adapter->cmd_queued = cmd_node; 1362 adapter->cmd_queued = cmd_node;
1363 mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, 1363 mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
1364 true); 1364 true);
1365 queue_work(adapter->workqueue, &adapter->main_work);
1365 } else { 1366 } else {
1366 spin_unlock_irqrestore(&adapter->scan_pending_q_lock, 1367 spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
1367 flags); 1368 flags);
@@ -1378,26 +1379,6 @@ static int mwifiex_scan_networks(struct mwifiex_private *priv,
1378} 1379}
1379 1380
1380/* 1381/*
1381 * Sends IOCTL request to start a scan with user configurations.
1382 *
1383 * This function allocates the IOCTL request buffer, fills it
1384 * with requisite parameters and calls the IOCTL handler.
1385 *
1386 * Upon completion, it also generates a wireless event to notify
1387 * applications.
1388 */
1389int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
1390 struct mwifiex_user_scan_cfg *scan_req)
1391{
1392 int status;
1393
1394 status = mwifiex_scan_networks(priv, scan_req);
1395 queue_work(priv->adapter->workqueue, &priv->adapter->main_work);
1396
1397 return status;
1398}
1399
1400/*
1401 * This function prepares a scan command to be sent to the firmware. 1382 * This function prepares a scan command to be sent to the firmware.
1402 * 1383 *
1403 * This uses the scan command configuration sent to the command processing 1384 * This uses the scan command configuration sent to the command processing