aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac/main.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-06-30 09:16:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-10 12:16:56 -0400
commitcacaa64be6c7806fff90bc090a08da02be872d20 (patch)
treee95e88fdc26f3c69fd32234606c626d4dc602a54 /drivers/net/wireless/brcm80211/brcmsmac/main.c
parentec5ab1dd73a4b28c2e02d8ad585cae01ad626c9a (diff)
brcmsmac: extend brcms_c_chipmatch() to also handle non PCIe devices
Now brcms_c_chipmatch() is also able to handle non PCI devices and also does some checking for SoC if they are supported by brcmsmac. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/main.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 942ef9942538..d39f7d041e0b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4469,11 +4469,9 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
4469 } 4469 }
4470 4470
4471 /* verify again the device is supported */ 4471 /* verify again the device is supported */
4472 if (core->bus->hosttype == BCMA_HOSTTYPE_PCI && 4472 if (!brcms_c_chipmatch(core)) {
4473 !brcms_c_chipmatch(pcidev->vendor, pcidev->device)) { 4473 wiphy_err(wiphy, "wl%d: brcms_b_attach: Unsupported device\n",
4474 wiphy_err(wiphy, "wl%d: brcms_b_attach: Unsupported " 4474 unit);
4475 "vendor/device (0x%x/0x%x)\n",
4476 unit, pcidev->vendor, pcidev->device);
4477 err = 12; 4475 err = 12;
4478 goto fail; 4476 goto fail;
4479 } 4477 }
@@ -5786,8 +5784,12 @@ void brcms_c_print_txstatus(struct tx_status *txs)
5786 (txs->ackphyrxsh & PRXS1_SQ_MASK) >> PRXS1_SQ_SHIFT); 5784 (txs->ackphyrxsh & PRXS1_SQ_MASK) >> PRXS1_SQ_SHIFT);
5787} 5785}
5788 5786
5789bool brcms_c_chipmatch(u16 vendor, u16 device) 5787static bool brcms_c_chipmatch_pci(struct bcma_device *core)
5790{ 5788{
5789 struct pci_dev *pcidev = core->bus->host_pci;
5790 u16 vendor = pcidev->vendor;
5791 u16 device = pcidev->device;
5792
5791 if (vendor != PCI_VENDOR_ID_BROADCOM) { 5793 if (vendor != PCI_VENDOR_ID_BROADCOM) {
5792 pr_err("unknown vendor id %04x\n", vendor); 5794 pr_err("unknown vendor id %04x\n", vendor);
5793 return false; 5795 return false;
@@ -5806,6 +5808,30 @@ bool brcms_c_chipmatch(u16 vendor, u16 device)
5806 return false; 5808 return false;
5807} 5809}
5808 5810
5811static bool brcms_c_chipmatch_soc(struct bcma_device *core)
5812{
5813 struct bcma_chipinfo *chipinfo = &core->bus->chipinfo;
5814
5815 if (chipinfo->id == BCMA_CHIP_ID_BCM4716)
5816 return true;
5817
5818 pr_err("unknown chip id %04x\n", chipinfo->id);
5819 return false;
5820}
5821
5822bool brcms_c_chipmatch(struct bcma_device *core)
5823{
5824 switch (core->bus->hosttype) {
5825 case BCMA_HOSTTYPE_PCI:
5826 return brcms_c_chipmatch_pci(core);
5827 case BCMA_HOSTTYPE_SOC:
5828 return brcms_c_chipmatch_soc(core);
5829 default:
5830 pr_err("unknown host type: %i\n", core->bus->hosttype);
5831 return false;
5832 }
5833}
5834
5809#if defined(DEBUG) 5835#if defined(DEBUG)
5810void brcms_c_print_txdesc(struct d11txh *txh) 5836void brcms_c_print_txdesc(struct d11txh *txh)
5811{ 5837{