diff options
author | Bing Zhao <bzhao@marvell.com> | 2014-02-27 22:35:12 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:33:40 -0500 |
commit | fa0ecbb9905d985a77e76801ba1153394ba593e8 (patch) | |
tree | 65b9a9e5fece3e020b82b14e4cf1479a0eec6372 /drivers/net/wireless/mwifiex/tdls.c | |
parent | 6b7dce12b3e810a107735ab9e701f2be4e75db29 (diff) |
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.c | 16 |
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) | |||
864 | 864 | ||
865 | memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN); | 865 | memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN); |
866 | tdls_oper.tdls_action = MWIFIEX_TDLS_CONFIG_LINK; | 866 | tdls_oper.tdls_action = MWIFIEX_TDLS_CONFIG_LINK; |
867 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_TDLS_OPER, | 867 | return mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER, |
868 | HostCmd_ACT_GEN_SET, 0, &tdls_oper); | 868 | HostCmd_ACT_GEN_SET, 0, &tdls_oper, true); |
869 | } | 869 | } |
870 | 870 | ||
871 | static int | 871 | static int |
@@ -891,8 +891,8 @@ mwifiex_tdls_process_create_link(struct mwifiex_private *priv, u8 *peer) | |||
891 | mwifiex_hold_tdls_packets(priv, peer); | 891 | mwifiex_hold_tdls_packets(priv, peer); |
892 | memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN); | 892 | memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN); |
893 | tdls_oper.tdls_action = MWIFIEX_TDLS_CREATE_LINK; | 893 | tdls_oper.tdls_action = MWIFIEX_TDLS_CREATE_LINK; |
894 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_TDLS_OPER, | 894 | return mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER, |
895 | HostCmd_ACT_GEN_SET, 0, &tdls_oper); | 895 | HostCmd_ACT_GEN_SET, 0, &tdls_oper, true); |
896 | } | 896 | } |
897 | 897 | ||
898 | static int | 898 | static int |
@@ -920,8 +920,8 @@ mwifiex_tdls_process_disable_link(struct mwifiex_private *priv, u8 *peer) | |||
920 | mwifiex_restore_tdls_packets(priv, peer, TDLS_LINK_TEARDOWN); | 920 | mwifiex_restore_tdls_packets(priv, peer, TDLS_LINK_TEARDOWN); |
921 | memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN); | 921 | memcpy(&tdls_oper.peer_mac, peer, ETH_ALEN); |
922 | tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK; | 922 | tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK; |
923 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_TDLS_OPER, | 923 | return mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER, |
924 | HostCmd_ACT_GEN_SET, 0, &tdls_oper); | 924 | HostCmd_ACT_GEN_SET, 0, &tdls_oper, true); |
925 | } | 925 | } |
926 | 926 | ||
927 | static int | 927 | static int |
@@ -1033,8 +1033,8 @@ void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv) | |||
1033 | TDLS_LINK_TEARDOWN); | 1033 | TDLS_LINK_TEARDOWN); |
1034 | memcpy(&tdls_oper.peer_mac, sta_ptr->mac_addr, ETH_ALEN); | 1034 | memcpy(&tdls_oper.peer_mac, sta_ptr->mac_addr, ETH_ALEN); |
1035 | tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK; | 1035 | tdls_oper.tdls_action = MWIFIEX_TDLS_DISABLE_LINK; |
1036 | if (mwifiex_send_cmd_async(priv, HostCmd_CMD_TDLS_OPER, | 1036 | if (mwifiex_send_cmd(priv, HostCmd_CMD_TDLS_OPER, |
1037 | HostCmd_ACT_GEN_SET, 0, &tdls_oper)) | 1037 | HostCmd_ACT_GEN_SET, 0, &tdls_oper, false)) |
1038 | dev_warn(priv->adapter->dev, | 1038 | dev_warn(priv->adapter->dev, |
1039 | "Disable link failed for TDLS peer %pM", | 1039 | "Disable link failed for TDLS peer %pM", |
1040 | sta_ptr->mac_addr); | 1040 | sta_ptr->mac_addr); |