diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-10-22 14:20:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:54:36 -0500 |
commit | eae74e6545d995ab0baa8fb07309f714d9616293 (patch) | |
tree | 2ca3aa8cdc85e3b167780aeca0934704d4491136 /drivers/net/wireless/mwl8k.c | |
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>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-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 b0080ae98a83..8bec4652fda1 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -130,6 +130,7 @@ struct mwl8k_priv { | |||
130 | struct pci_dev *pdev; | 130 | struct pci_dev *pdev; |
131 | 131 | ||
132 | struct mwl8k_device_info *device_info; | 132 | struct mwl8k_device_info *device_info; |
133 | bool ap_fw; | ||
133 | 134 | ||
134 | /* firmware files and meta data */ | 135 | /* firmware files and meta data */ |
135 | struct mwl8k_firmware fw; | 136 | struct mwl8k_firmware fw; |
@@ -534,6 +535,7 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw) | |||
534 | { | 535 | { |
535 | struct mwl8k_priv *priv = hw->priv; | 536 | struct mwl8k_priv *priv = hw->priv; |
536 | struct firmware *fw = priv->fw.ucode; | 537 | struct firmware *fw = priv->fw.ucode; |
538 | struct mwl8k_device_info *di = priv->device_info; | ||
537 | int rc; | 539 | int rc; |
538 | int loops; | 540 | int loops; |
539 | 541 | ||
@@ -565,14 +567,26 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw) | |||
565 | return rc; | 567 | return rc; |
566 | } | 568 | } |
567 | 569 | ||
568 | iowrite32(MWL8K_MODE_STA, priv->regs + MWL8K_HIU_GEN_PTR); | 570 | if (di->modes & BIT(NL80211_IFTYPE_AP)) |
571 | iowrite32(MWL8K_MODE_AP, priv->regs + MWL8K_HIU_GEN_PTR); | ||
572 | else | ||
573 | iowrite32(MWL8K_MODE_STA, priv->regs + MWL8K_HIU_GEN_PTR); | ||
569 | msleep(1); | 574 | msleep(1); |
570 | 575 | ||
571 | loops = 200000; | 576 | loops = 200000; |
572 | do { | 577 | do { |
573 | if (ioread32(priv->regs + MWL8K_HIU_INT_CODE) | 578 | u32 ready_code; |
574 | == MWL8K_FWSTA_READY) | 579 | |
580 | ready_code = ioread32(priv->regs + MWL8K_HIU_INT_CODE); | ||
581 | if (ready_code == MWL8K_FWAP_READY) { | ||
582 | priv->ap_fw = 1; | ||
583 | break; | ||
584 | } else if (ready_code == MWL8K_FWSTA_READY) { | ||
585 | priv->ap_fw = 0; | ||
575 | break; | 586 | break; |
587 | } | ||
588 | |||
589 | cond_resched(); | ||
576 | udelay(1); | 590 | udelay(1); |
577 | } while (--loops); | 591 | } while (--loops); |
578 | 592 | ||
@@ -3165,9 +3179,10 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, | |||
3165 | goto err_stop_firmware; | 3179 | goto err_stop_firmware; |
3166 | } | 3180 | } |
3167 | 3181 | ||
3168 | printk(KERN_INFO "%s: %s v%d, %pM, firmware version %u.%u.%u.%u\n", | 3182 | printk(KERN_INFO "%s: %s v%d, %pM, %s firmware %u.%u.%u.%u\n", |
3169 | wiphy_name(hw->wiphy), priv->device_info->part_name, | 3183 | wiphy_name(hw->wiphy), priv->device_info->part_name, |
3170 | priv->hw_rev, hw->wiphy->perm_addr, | 3184 | priv->hw_rev, hw->wiphy->perm_addr, |
3185 | priv->ap_fw ? "AP" : "STA", | ||
3171 | (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff, | 3186 | (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff, |
3172 | (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff); | 3187 | (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff); |
3173 | 3188 | ||