提交 eae74e65 编写于 作者: L Lennert Buytenhek 提交者: John W. Linville

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: NLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a74b295e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册