summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/tdls.c
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2014-02-28 04:35:12 +0100
committerJohn W. Linville <linville@tuxdriver.com>2014-02-28 20:33:40 +0100
commitfa0ecbb9905d985a77e76801ba1153394ba593e8 (patch)
tree65b9a9e5fece3e020b82b14e4cf1479a0eec6372 /drivers/net/wireless/mwifiex/tdls.c
parentrtlwifi: Remove redundant if clause (diff)
downloadlinux-fa0ecbb9905d985a77e76801ba1153394ba593e8.tar.xz
linux-fa0ecbb9905d985a77e76801ba1153394ba593e8.zip
mwifiex: remove global variable cmd_wait_q_required
There is a race condition while queuing synchronous command and asynchronous command requested from different threads, because the wait_q_enabled flag is set based on a global variable cmd_wait_q_required. The issue is fixed by removing this global variable and using a unified function with an argument 'sync' passed into the function. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/tdls.c')
-rw-r--r--drivers/net/wireless/mwifiex/tdls.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c
index 1ba2a16ee471..8cec6e4ba8c4 100644
--- a/drivers/net/wireless/mwifiex/tdls.c
+++ b/drivers/net/wireless/mwifiex/tdls.c
@@ -864,8 +864,8 @@ mwifiex_tdls_process_config_link(struct mwifiex_private *priv, u8 *peer)
memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN);
tdls_oper.tdls_action = MWIFIEX_TDLS_CONFIG_LINK;
- return mwifiex_send_cmd_sync(priv, HostCmd_CMD_TDLS_OPER,
- HostCmd_ACT_GEN_SET, 0, &tdls_oper);
+ return mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER,
+ HostCmd_ACT_GEN_SET, 0, &tdls_oper, true);
}
static int
@@ -891,8 +891,8 @@ mwifiex_tdls_process_create_link(struct mwifiex_private *priv, u8 *peer)
mwifiex_hold_tdls_packets(priv, peer);
memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN);
tdls_oper.tdls_action = MWIFIEX_TDLS_CREATE_LINK;
- return mwifiex_send_cmd_sync(priv, HostCmd_CMD_TDLS_OPER,
- HostCmd_ACT_GEN_SET, 0, &tdls_oper);
+ return mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER,
+ HostCmd_ACT_GEN_SET, 0, &tdls_oper, true);
}
static int
@@ -920,8 +920,8 @@ mwifiex_tdls_process_disable_link(struct mwifiex_private *priv, u8 *peer)
mwifiex_restore_tdls_packets(priv, peer, TDLS_LINK_TEARDOWN);
memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN);
tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK;
- return mwifiex_send_cmd_sync(priv, HostCmd_CMD_TDLS_OPER,
- HostCmd_ACT_GEN_SET, 0, &tdls_oper);
+ return mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER,
+ HostCmd_ACT_GEN_SET, 0, &tdls_oper, true);
}
static int
@@ -1033,8 +1033,8 @@ void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv)
TDLS_LINK_TEARDOWN);
memcpy(&tdls_oper.peer_mac, sta_ptr->mac_addr, ETH_ALEN);
tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK;
- if (mwifiex_send_cmd_async(priv, HostCmd_CMD_TDLS_OPER,
- HostCmd_ACT_GEN_SET, 0, &tdls_oper))
+ if (mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER,
+ HostCmd_ACT_GEN_SET, 0, &tdls_oper, false))
dev_warn(priv->adapter->dev,
"Disable link failed for TDLS peer %pM",
sta_ptr->mac_addr);