diff options
-rw-r--r-- | fwcmd.c | 11 | ||||
-rw-r--r-- | fwcmd.h | 2 | ||||
-rw-r--r-- | fwdl.c | 5 |
3 files changed, 12 insertions, 6 deletions
@@ -661,13 +661,16 @@ 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) @@ -55,7 +55,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); @@ -60,7 +60,9 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) fw = priv->fw_ucode; - mwl_fwcmd_reset(hw); + /* if reset fails, then dl will most likely hang */ + if (mwl_fwcmd_reset(hw) < 0) + goto err_reset; /* FW before jumping to boot rom, it will enable PCIe transaction retry, * wait for boot code to stop it. @@ -178,5 +180,6 @@ err_download: mwl_fwcmd_reset(hw); +err_reset: return -EIO; } |