diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-10-22 20:20:53 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:54:36 -0500 |
commit | eae74e6545d995ab0baa8fb07309f714d9616293 (patch) | |
tree | 2ca3aa8cdc85e3b167780aeca0934704d4491136 | |
parent | a74b295edb3e2b39d6c03255b24dca862a843c59 (diff) |
mwl8k: handle loading AP firmware images
AP and STA firmware images provide a different signature in the
HIU_INT_CODE register after loading. Record which of the signatures
we saw, as it determines which command sequences to use later on.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index b0080ae98a8..8bec4652fda 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c @@ -130,6 +130,7 @@ struct mwl8k_priv { struct pci_dev *pdev; struct mwl8k_device_info *device_info; + bool ap_fw; /* firmware files and meta data */ struct mwl8k_firmware fw; @@ -534,6 +535,7 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw) { struct mwl8k_priv *priv = hw->priv; struct firmware *fw = priv->fw.ucode; + struct mwl8k_device_info *di = priv->device_info; int rc; int loops; @@ -565,14 +567,26 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw) return rc; } - iowrite32(MWL8K_MODE_STA, priv->regs + MWL8K_HIU_GEN_PTR); + if (di->modes & BIT(NL80211_IFTYPE_AP)) + iowrite32(MWL8K_MODE_AP, priv->regs + MWL8K_HIU_GEN_PTR); + else + iowrite32(MWL8K_MODE_STA, priv->regs + MWL8K_HIU_GEN_PTR); msleep(1); loops = 200000; do { - if (ioread32(priv->regs + MWL8K_HIU_INT_CODE) - == MWL8K_FWSTA_READY) + u32 ready_code; + + ready_code = ioread32(priv->regs + MWL8K_HIU_INT_CODE); + if (ready_code == MWL8K_FWAP_READY) { + priv->ap_fw = 1; + break; + } else if (ready_code == MWL8K_FWSTA_READY) { + priv->ap_fw = 0; break; + } + + cond_resched(); udelay(1); } while (--loops); @@ -3165,9 +3179,10 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, goto err_stop_firmware; } - printk(KERN_INFO "%s: %s v%d, %pM, firmware version %u.%u.%u.%u\n", + printk(KERN_INFO "%s: %s v%d, %pM, %s firmware %u.%u.%u.%u\n", wiphy_name(hw->wiphy), priv->device_info->part_name, priv->hw_rev, hw->wiphy->perm_addr, + priv->ap_fw ? "AP" : "STA", (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff, (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff); |