summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2016-01-07 11:21:05 +0100
committerBjørn Mork <bjorn@mork.no>2016-01-07 11:21:05 +0100
commit71b20e37580c9492ad4c291783d1c6171bad5891 (patch)
tree580e07ed2590306f9204dc34c6eaa8df38cb624d
parent7f24b72a03e22452320deb6316838af2b28f6c9d (diff)
working early exit20160107-3
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--fwcmd.c10
-rw-r--r--fwcmd.h2
-rw-r--r--fwdl.c6
-rw-r--r--main.c8
4 files changed, 13 insertions, 13 deletions
diff --git a/fwcmd.c b/fwcmd.c
index 528c92c..8ddc8b2 100644
--- a/fwcmd.c
+++ b/fwcmd.c
@@ -830,13 +830,15 @@ static int mwl_fwcmd_encryption_set_cmd_info(struct hostcmd_cmd_set_key *cmd,
return 0;
}
-void mwl_fwcmd_reset(struct ieee80211_hw *hw)
+int mwl_fwcmd_reset(struct ieee80211_hw *hw)
{
struct mwl_priv *priv = hw->priv;
- if (mwl_fwcmd_chk_adapter(priv))
- writel(ISR_RESET,
- priv->iobase1 + MACREG_REG_H2A_INTERRUPT_EVENTS);
+ if (!mwl_fwcmd_chk_adapter(priv))
+ return -ENODEV;
+
+ writel(ISR_RESET, priv->iobase1 + MACREG_REG_H2A_INTERRUPT_EVENTS);
+ return 0;
}
void mwl_fwcmd_int_enable(struct ieee80211_hw *hw)
diff --git a/fwcmd.h b/fwcmd.h
index 8b9809d..5ea5069 100644
--- a/fwcmd.h
+++ b/fwcmd.h
@@ -59,7 +59,7 @@ enum encr_type {
ENCR_TYPE_MIX = 7,
};
-void mwl_fwcmd_reset(struct ieee80211_hw *hw);
+int mwl_fwcmd_reset(struct ieee80211_hw *hw);
void mwl_fwcmd_int_enable(struct ieee80211_hw *hw);
diff --git a/fwdl.c b/fwdl.c
index 99515bc..2f0647d 100644
--- a/fwdl.c
+++ b/fwdl.c
@@ -66,11 +66,13 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw)
#else
u32 fwreadysignature = HOSTCMD_SOFTAP_FWRDY_SIGNATURE;
#endif
+ int rc = mwl_fwcmd_reset(hw);
+ if (rc < 0)
+ return rc;
+
fw = priv->fw_ucode;
- mwl_fwcmd_reset(hw);
-
/* FW before jumping to boot rom, it will enable PCIe transaction retry,
* wait for boot code to stop it.
*/
diff --git a/main.c b/main.c
index 1b43597..a74e0b0 100644
--- a/main.c
+++ b/main.c
@@ -781,10 +781,6 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
rc = mwl_alloc_pci_resource(priv);
- /* verify that we can communicate with the hardware */
- if (!rc && !mwl_fwcmd_chk_adapter(priv))
- rc = -ENODEV;
-
if (rc)
goto err_alloc_pci_resource;
@@ -837,8 +833,8 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err_wl_init:
err_init_firmware:
-
- mwl_fwcmd_reset(hw);
+ if (rc != -ENODEV)
+ mwl_fwcmd_reset(hw);
err_alloc_pci_resource: