diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2012-02-01 23:41:43 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-03 14:17:12 -0500 |
commit | b7097eb75fa11c302dcdec83f1dbfa874e0af0d1 (patch) | |
tree | 81087145879edb7e798c4e61ca33d4f293e9f0bc /drivers/net/wireless | |
parent | 8149415efa033ca138c0080ded77329e98697c7b (diff) |
mwifiex: handle association failure case correctly
Currently even if association is failed "iw link" shows some
information about connected BSS and "Tx timeout" error is seen in
dmesg log.
This patch fixes below issues in the code to handle assoc failure
case correctly.
1) "status" variable in mwifiex_wait_queue_complete() is not
correctly updated. Hence driver doesn't inform cfg80211 stack
about association failure.
2) During association network queues are stopped but carrier is
not cleared, which gives Tx timeout error in failure case
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')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 470ca75ec250..b0fbf5d4fea0 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -54,7 +54,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, | |||
54 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | 54 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) |
55 | { | 55 | { |
56 | bool cancel_flag = false; | 56 | bool cancel_flag = false; |
57 | int status = adapter->cmd_wait_q.status; | 57 | int status; |
58 | struct cmd_ctrl_node *cmd_queued; | 58 | struct cmd_ctrl_node *cmd_queued; |
59 | 59 | ||
60 | if (!adapter->cmd_queued) | 60 | if (!adapter->cmd_queued) |
@@ -79,6 +79,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) | |||
79 | mwifiex_cancel_pending_ioctl(adapter); | 79 | mwifiex_cancel_pending_ioctl(adapter); |
80 | dev_dbg(adapter->dev, "cmd cancel\n"); | 80 | dev_dbg(adapter->dev, "cmd cancel\n"); |
81 | } | 81 | } |
82 | |||
83 | status = adapter->cmd_wait_q.status; | ||
82 | adapter->cmd_wait_q.status = 0; | 84 | adapter->cmd_wait_q.status = 0; |
83 | 85 | ||
84 | return status; | 86 | return status; |
@@ -240,6 +242,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
240 | 242 | ||
241 | if (!netif_queue_stopped(priv->netdev)) | 243 | if (!netif_queue_stopped(priv->netdev)) |
242 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); | 244 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); |
245 | if (netif_carrier_ok(priv->netdev)) | ||
246 | netif_carrier_off(priv->netdev); | ||
243 | 247 | ||
244 | /* Clear any past association response stored for | 248 | /* Clear any past association response stored for |
245 | * application retrieval */ | 249 | * application retrieval */ |
@@ -271,6 +275,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
271 | 275 | ||
272 | if (!netif_queue_stopped(priv->netdev)) | 276 | if (!netif_queue_stopped(priv->netdev)) |
273 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); | 277 | mwifiex_stop_net_dev_queue(priv->netdev, adapter); |
278 | if (netif_carrier_ok(priv->netdev)) | ||
279 | netif_carrier_off(priv->netdev); | ||
274 | 280 | ||
275 | if (!ret) { | 281 | if (!ret) { |
276 | dev_dbg(adapter->dev, "info: network found in scan" | 282 | dev_dbg(adapter->dev, "info: network found in scan" |