diff options
-rw-r--r-- | fwcmd.c | 10 | ||||
-rw-r--r-- | fwcmd.h | 2 | ||||
-rw-r--r-- | fwdl.c | 12 | ||||
-rw-r--r-- | main.c | 10 | ||||
-rw-r--r-- | rx.c | 9 |
5 files changed, 28 insertions, 15 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. */ @@ -103,6 +105,12 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) if (!len) break; + /* failed to read register? */ + if (len == 0xffffffff) { + wiphy_err(hw->wiphy,"Failed to read len from SCRATCH2 C40\n"); + goto err_download; + } + /* this copies the next chunk of fw binary to be delivered */ memcpy((char *)&priv->pcmd_buf[0], (fw->data + size_fw_downloaded), len); @@ -169,7 +169,7 @@ static int mwl_alloc_pci_resource(struct mwl_priv *priv) goto err; } priv->iobase0 = addr; - wiphy_debug(priv->hw->wiphy, "priv->iobase0 = %p\n", priv->iobase0); + wiphy_debug(priv->hw->wiphy, "priv->iobase0: %p => %pR\n", priv->iobase0, &pdev->resource[0]); addr = devm_ioremap_resource(priv->dev, &pdev->resource[priv->next_bar_num]); @@ -180,7 +180,7 @@ static int mwl_alloc_pci_resource(struct mwl_priv *priv) goto err; } priv->iobase1 = addr; - wiphy_debug(priv->hw->wiphy, "priv->iobase1 = %p\n", priv->iobase1); + wiphy_debug(priv->hw->wiphy, "priv->iobase1: %p => %pR\n", priv->iobase1, &pdev->resource[priv->next_bar_num]); priv->pcmd_buf = (unsigned short *)dmam_alloc_coherent(priv->dev, @@ -780,6 +780,7 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id) SET_IEEE80211_DEV(hw, priv->dev); rc = mwl_alloc_pci_resource(priv); + if (rc) goto err_alloc_pci_resource; @@ -791,7 +792,6 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id) #endif rc = mwl_init_firmware(priv, fw_name); - if (rc) { wiphy_err(hw->wiphy, "%s: fail to initialize firmware\n", MWL_DRV_NAME); @@ -833,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: @@ -294,6 +294,7 @@ static inline void mwl_rx_enable_sta_amsdu(struct mwl_priv *priv, drv_priv[0]); if (ether_addr_equal(sta->addr, sta_addr)) { sta_info->is_amsdu_allowed = true; + wiphy_dbg(priv->hw->wiphy, "enabling A-MSDU for %pM\n", sta_addr); break; } } @@ -582,7 +583,7 @@ void mwl_rx_recv(unsigned long data) if (ieee80211_is_mgmt(wh->frame_control)) { struct ieee80211_mgmt *mgmt; - __le16 capab; + u16 capab; mgmt = (struct ieee80211_mgmt *)prx_skb->data; @@ -591,8 +592,10 @@ void mwl_rx_recv(unsigned long data) WLAN_CATEGORY_BACK && mgmt->u.action.u.addba_resp.action_code == WLAN_ACTION_ADDBA_RESP)) { - capab = mgmt->u.action.u.addba_resp.capab; - if (le16_to_cpu(capab) & 1) + capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab); + wiphy_dbg(hw->wiphy, "%pM - addba_resp.capab=0x%hx\n", + mgmt->sa, capab); + if (capab & 1) mwl_rx_enable_sta_amsdu(priv, mgmt->sa); } } |