mwifiex: fix command timeout for PCIe chipsets
authorZhaoyang Liu <liuzy@marvell.com>
Wed, 22 Jul 2015 11:53:43 +0000 (04:53 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 6 Aug 2015 07:13:50 +0000 (10:13 +0300)
When WLAN interface is up and running, driver unload and
load was causing command timeout error.

We enable Rx data by updating RX ring read pointer in
init_fw_port(). It should be done when FW is completely
intialialised. Command timeout is fixed in this patch by
moving init_fw_port() call to mwifiex_init_fw_complete().

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/util.c

index 8fa363add9706364843207a85d475096f20dbeb7..7a970c28c5570524db8436cc8f9a23f1ee8ae2c0 100644 (file)
@@ -551,11 +551,6 @@ int mwifiex_init_fw(struct mwifiex_adapter *adapter)
                }
        }
 
-       if (adapter->if_ops.init_fw_port) {
-               if (adapter->if_ops.init_fw_port(adapter))
-                       return -1;
-       }
-
        for (i = 0; i < adapter->priv_num; i++) {
                if (adapter->priv[i]) {
                        ret = mwifiex_sta_init_cmd(adapter->priv[i], first_sta,
index a5f34f2c1086424b39da8de6c30fece84e300093..0cec8a64473e9c1f764b841b27c74c9b36800fc5 100644 (file)
@@ -126,6 +126,10 @@ static int num_of_items = ARRAY_SIZE(items);
 int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter)
 {
 
+       if (adapter->hw_status == MWIFIEX_HW_STATUS_READY)
+               if (adapter->if_ops.init_fw_port)
+                       adapter->if_ops.init_fw_port(adapter);
+
        adapter->init_wait_q_woken = true;
        wake_up_interruptible(&adapter->init_wait_q);
        return 0;