diff options
author | Bjørn Mork <bjorn@mork.no> | 2016-01-07 11:21:05 +0100 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2016-01-07 11:21:05 +0100 |
commit | 71b20e37580c9492ad4c291783d1c6171bad5891 (patch) | |
tree | 580e07ed2590306f9204dc34c6eaa8df38cb624d | |
parent | 7f24b72a03e22452320deb6316838af2b28f6c9d (diff) |
working early exit20160107-3
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r-- | fwcmd.c | 10 | ||||
-rw-r--r-- | fwcmd.h | 2 | ||||
-rw-r--r-- | fwdl.c | 6 | ||||
-rw-r--r-- | main.c | 8 |
4 files changed, 13 insertions, 13 deletions
@@ -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) @@ -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); @@ -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. */ @@ -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: |