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>
This commit is contained in:
Amitkumar Karwar 2012-02-01 20:41:43 -08:00 committed by John W. Linville
parent 8149415efa
commit b7097eb75f

View File

@ -54,7 +54,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
{ {
bool cancel_flag = false; bool cancel_flag = false;
int status = adapter->cmd_wait_q.status; int status;
struct cmd_ctrl_node *cmd_queued; struct cmd_ctrl_node *cmd_queued;
if (!adapter->cmd_queued) if (!adapter->cmd_queued)
@ -79,6 +79,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
mwifiex_cancel_pending_ioctl(adapter); mwifiex_cancel_pending_ioctl(adapter);
dev_dbg(adapter->dev, "cmd cancel\n"); dev_dbg(adapter->dev, "cmd cancel\n");
} }
status = adapter->cmd_wait_q.status;
adapter->cmd_wait_q.status = 0; adapter->cmd_wait_q.status = 0;
return status; return status;
@ -240,6 +242,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
if (!netif_queue_stopped(priv->netdev)) if (!netif_queue_stopped(priv->netdev))
mwifiex_stop_net_dev_queue(priv->netdev, adapter); mwifiex_stop_net_dev_queue(priv->netdev, adapter);
if (netif_carrier_ok(priv->netdev))
netif_carrier_off(priv->netdev);
/* Clear any past association response stored for /* Clear any past association response stored for
* application retrieval */ * application retrieval */
@ -271,6 +275,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
if (!netif_queue_stopped(priv->netdev)) if (!netif_queue_stopped(priv->netdev))
mwifiex_stop_net_dev_queue(priv->netdev, adapter); mwifiex_stop_net_dev_queue(priv->netdev, adapter);
if (netif_carrier_ok(priv->netdev))
netif_carrier_off(priv->netdev);
if (!ret) { if (!ret) {
dev_dbg(adapter->dev, "info: network found in scan" dev_dbg(adapter->dev, "info: network found in scan"