summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sta_cmdresp.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-04-13 17:27:06 -0700
committerJohn W. Linville <linville@tuxdriver.com>2011-04-14 15:35:11 -0400
commit600f5d909a54a8dccf8c8c23898fc2e91bc0953e (patch)
treedad2709218946398c370647f16d0dd6f2f9a1919 /drivers/net/wireless/mwifiex/sta_cmdresp.c
parent3a9dddea89eb2132ba919fe04cb3b44a3b1e6db7 (diff)
mwifiex: cleanup ioctl wait queue and abstraction layer
1) remove mwifiex_alloc_fill_wait_queue() and mwifiex_request_ioctl() 2) avoid dynamic allocation of wait queue 3) remove unnecessary mwifiex_error_code macros that were used mainly by the wait queue status code 4) remove some abstraction functions 5) split mwifiex_prepare_cmd() to mwifiex_send_cmd_async() and mwifiex_send_sync() to handle asynchronous and synchronous commands respectively Signed-off-by: Amitkumar Karwar <akarwar@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/sta_cmdresp.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 648df690f5d..8743c116bee 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -41,8 +41,7 @@
*/
static void
mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
- struct host_cmd_ds_command *resp,
- struct mwifiex_wait_queue *wq_buf)
+ struct host_cmd_ds_command *resp)
{
struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL;
struct mwifiex_adapter *adapter = priv->adapter;
@@ -51,8 +50,9 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
dev_err(adapter->dev, "CMD_RESP: cmd %#x error, result=%#x\n",
resp->command, resp->result);
- if (wq_buf)
- wq_buf->status = MWIFIEX_ERROR_FW_CMDRESP;
+
+ if (adapter->curr_cmd->wait_q_enabled)
+ adapter->cmd_wait_q.status = -1;
switch (le16_to_cpu(resp->command)) {
case HostCmd_CMD_802_11_PS_MODE_ENH:
@@ -328,9 +328,9 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
if (priv->is_data_rate_auto)
priv->data_rate = 0;
else
- ret = mwifiex_prepare_cmd(priv,
+ ret = mwifiex_send_cmd_async(priv,
HostCmd_CMD_802_11_TX_RATE_QUERY,
- HostCmd_ACT_GEN_GET, 0, NULL, NULL);
+ HostCmd_ACT_GEN_GET, 0, NULL);
if (data_buf) {
ds_rate = (struct mwifiex_rate_cfg *) data_buf;
@@ -833,19 +833,17 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv,
* response handlers based on the command ID.
*/
int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv,
- u16 cmdresp_no, void *cmd_buf, void *wq_buf)
+ u16 cmdresp_no, void *cmd_buf)
{
int ret = 0;
struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_command *resp =
(struct host_cmd_ds_command *) cmd_buf;
- struct mwifiex_wait_queue *wait_queue =
- (struct mwifiex_wait_queue *) wq_buf;
void *data_buf = adapter->curr_cmd->data_buf;
/* If the command is not successful, cleanup and return failure */
if (resp->result != HostCmd_RESULT_OK) {
- mwifiex_process_cmdresp_error(priv, resp, wait_queue);
+ mwifiex_process_cmdresp_error(priv, resp);
return -1;
}
/* Command successful, handle response */
@@ -865,12 +863,11 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv,
ret = mwifiex_ret_tx_rate_cfg(priv, resp, data_buf);
break;
case HostCmd_CMD_802_11_SCAN:
- ret = mwifiex_ret_802_11_scan(priv, resp, wait_queue);
- wait_queue = NULL;
- adapter->curr_cmd->wq_buf = NULL;
+ ret = mwifiex_ret_802_11_scan(priv, resp);
+ adapter->curr_cmd->wait_q_enabled = false;
break;
case HostCmd_CMD_802_11_BG_SCAN_QUERY:
- ret = mwifiex_ret_802_11_scan(priv, resp, wait_queue);
+ ret = mwifiex_ret_802_11_scan(priv, resp);
dev_dbg(adapter->dev,
"info: CMD_RESP: BG_SCAN result is ready!\n");
break;
@@ -884,14 +881,14 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv,
ret = mwifiex_ret_802_11_hs_cfg(priv, resp);
break;
case HostCmd_CMD_802_11_ASSOCIATE:
- ret = mwifiex_ret_802_11_associate(priv, resp, wait_queue);
+ ret = mwifiex_ret_802_11_associate(priv, resp);
break;
case HostCmd_CMD_802_11_DEAUTHENTICATE:
ret = mwifiex_ret_802_11_deauthenticate(priv, resp);
break;
case HostCmd_CMD_802_11_AD_HOC_START:
case HostCmd_CMD_802_11_AD_HOC_JOIN:
- ret = mwifiex_ret_802_11_ad_hoc(priv, resp, wait_queue);
+ ret = mwifiex_ret_802_11_ad_hoc(priv, resp);
break;
case HostCmd_CMD_802_11_AD_HOC_STOP:
ret = mwifiex_ret_802_11_ad_hoc_stop(priv, resp);