From 7572d09453cd1ce42cbccfc448491c73b002e38a Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Thu, 22 Oct 2009 20:20:43 +0200 Subject: [PATCH] --- yaml --- r: 171398 b: refs/heads/master c: 5b9482dda6dda11dc7050ffa5b4ebfb0c775880f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/mwl8k.c | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 21bb4559767e..9210b49da007 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 45eb400d50e1ad84a8e8f9e9a82cd8ae13d7d691 +refs/heads/master: 5b9482dda6dda11dc7050ffa5b4ebfb0c775880f diff --git a/trunk/drivers/net/wireless/mwl8k.c b/trunk/drivers/net/wireless/mwl8k.c index 80df2ebbd602..c0317e298c11 100644 --- a/trunk/drivers/net/wireless/mwl8k.c +++ b/trunk/drivers/net/wireless/mwl8k.c @@ -124,6 +124,7 @@ struct mwl8k_firmware { }; struct mwl8k_priv { + void __iomem *sram; void __iomem *regs; struct ieee80211_hw *hw; @@ -2987,13 +2988,27 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, SET_IEEE80211_DEV(hw, &pdev->dev); pci_set_drvdata(pdev, hw); - priv->regs = pci_iomap(pdev, 1, 0x10000); - if (priv->regs == NULL) { - printk(KERN_ERR "%s: Cannot map device memory\n", + priv->sram = pci_iomap(pdev, 0, 0x10000); + if (priv->sram == NULL) { + printk(KERN_ERR "%s: Cannot map device SRAM\n", wiphy_name(hw->wiphy)); goto err_iounmap; } + /* + * If BAR0 is a 32 bit BAR, the register BAR will be BAR1. + * If BAR0 is a 64 bit BAR, the register BAR will be BAR2. + */ + priv->regs = pci_iomap(pdev, 1, 0x10000); + if (priv->regs == NULL) { + priv->regs = pci_iomap(pdev, 2, 0x10000); + if (priv->regs == NULL) { + printk(KERN_ERR "%s: Cannot map device registers\n", + wiphy_name(hw->wiphy)); + goto err_iounmap; + } + } + memcpy(priv->channels, mwl8k_channels, sizeof(mwl8k_channels)); priv->band.band = IEEE80211_BAND_2GHZ; priv->band.channels = priv->channels; @@ -3165,6 +3180,9 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev, if (priv->regs != NULL) pci_iounmap(pdev, priv->regs); + if (priv->sram != NULL) + pci_iounmap(pdev, priv->sram); + pci_set_drvdata(pdev, NULL); ieee80211_free_hw(hw); @@ -3212,6 +3230,7 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev) pci_free_consistent(priv->pdev, 4, priv->cookie, priv->cookie_dma); pci_iounmap(pdev, priv->regs); + pci_iounmap(pdev, priv->sram); pci_set_drvdata(pdev, NULL); ieee80211_free_hw(hw); pci_release_regions(pdev);