1148ed571SAdrian Chadd /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 38d14ca9cSLandon J. Fuller * 4111d7cb2SLandon J. Fuller * Copyright (c) 2015-2016 Landon Fuller <landonf@FreeBSD.org> 5148ed571SAdrian Chadd * All rights reserved. 6148ed571SAdrian Chadd * 7148ed571SAdrian Chadd * Redistribution and use in source and binary forms, with or without 8148ed571SAdrian Chadd * modification, are permitted provided that the following conditions 9148ed571SAdrian Chadd * are met: 10148ed571SAdrian Chadd * 1. Redistributions of source code must retain the above copyright 118d14ca9cSLandon J. Fuller * notice, this list of conditions and the following disclaimer. 128d14ca9cSLandon J. Fuller * 2. Redistributions in binary form must reproduce the above copyright 138d14ca9cSLandon J. Fuller * notice, this list of conditions and the following disclaimer in the 148d14ca9cSLandon J. Fuller * documentation and/or other materials provided with the distribution. 15148ed571SAdrian Chadd * 168d14ca9cSLandon J. Fuller * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 178d14ca9cSLandon J. Fuller * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 188d14ca9cSLandon J. Fuller * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 198d14ca9cSLandon J. Fuller * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 208d14ca9cSLandon J. Fuller * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 218d14ca9cSLandon J. Fuller * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 228d14ca9cSLandon J. Fuller * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 238d14ca9cSLandon J. Fuller * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 248d14ca9cSLandon J. Fuller * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 258d14ca9cSLandon J. Fuller * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 268d14ca9cSLandon J. Fuller * SUCH DAMAGE. 27148ed571SAdrian Chadd * 28148ed571SAdrian Chadd */ 29148ed571SAdrian Chadd 30148ed571SAdrian Chadd #ifndef _IF_BWN_PCIVAR_H_ 31148ed571SAdrian Chadd #define _IF_BWN_PCIVAR_H_ 32148ed571SAdrian Chadd 33148ed571SAdrian Chadd struct bwn_pci_devcfg; 34148ed571SAdrian Chadd 35148ed571SAdrian Chadd /** bwn_pci per-instance state. */ 36148ed571SAdrian Chadd struct bwn_pci_softc { 37148ed571SAdrian Chadd device_t dev; /**< device */ 38148ed571SAdrian Chadd device_t bhndb_dev; /**< bhnd bridge device */ 39148ed571SAdrian Chadd const struct bwn_pci_devcfg *devcfg; /**< bwn device config */ 40148ed571SAdrian Chadd uint32_t quirks; /**< quirk flags */ 41148ed571SAdrian Chadd }; 42148ed571SAdrian Chadd 43148ed571SAdrian Chadd /* bwn device quirks */ 44148ed571SAdrian Chadd enum { 45148ed571SAdrian Chadd /** No quirks */ 46148ed571SAdrian Chadd BWN_QUIRK_NONE = 0, 47148ed571SAdrian Chadd 48148ed571SAdrian Chadd /** 49148ed571SAdrian Chadd * This model/revision has not been tested and may not work. 50148ed571SAdrian Chadd */ 51148ed571SAdrian Chadd BWN_QUIRK_UNTESTED = 1<<0, 52148ed571SAdrian Chadd 53148ed571SAdrian Chadd /** 54148ed571SAdrian Chadd * Early dual-band devices did not support accessing multiple PHYs 55148ed571SAdrian Chadd * from a single WLAN core, and instead used separate 2GHz and 5GHz 56148ed571SAdrian Chadd * WLAN cores. 57148ed571SAdrian Chadd * 58148ed571SAdrian Chadd * However, not all cards with two WLAN cores are fully populated; 59148ed571SAdrian Chadd * we must whitelist the boards on which a second WLAN core is actually 60148ed571SAdrian Chadd * usable. 61148ed571SAdrian Chadd */ 62148ed571SAdrian Chadd BWN_QUIRK_WLAN_DUALCORE = 1<<1, 63148ed571SAdrian Chadd 64148ed571SAdrian Chadd /** 65148ed571SAdrian Chadd * Some early devices shipped with unconnected ethernet cores; set 66148ed571SAdrian Chadd * this quirk to treat these cores as unpopulated. 67148ed571SAdrian Chadd */ 68148ed571SAdrian Chadd BWN_QUIRK_ENET_HW_UNPOPULATED = 1<<2, 697d616280SLandon J. Fuller 707d616280SLandon J. Fuller /** 717d616280SLandon J. Fuller * Some PCI/PCIe "Intensi-fi" chipsets shipped with floating USB 727d616280SLandon J. Fuller * host controller cores; set this quirk to treat these cores as 737d616280SLandon J. Fuller * unpopulated. 747d616280SLandon J. Fuller */ 757d616280SLandon J. Fuller BWN_QUIRK_USBH_UNPOPULATED = 1<<3, 76a225321fSLandon J. Fuller 77a225321fSLandon J. Fuller /** 78a225321fSLandon J. Fuller * Some early devices (including all BCM4306 chipsets) shipped with 79a225321fSLandon J. Fuller * floating analog softmodem codec cores; set this quirk to treat these 80a225321fSLandon J. Fuller * cores as unpopulated. 81a225321fSLandon J. Fuller */ 82a225321fSLandon J. Fuller BWN_QUIRK_SOFTMODEM_UNPOPULATED = 1<<4, 83148ed571SAdrian Chadd }; 84148ed571SAdrian Chadd 85148ed571SAdrian Chadd /* PCI device descriptor */ 86148ed571SAdrian Chadd struct bwn_pci_device { 87148ed571SAdrian Chadd uint16_t vendor; 88148ed571SAdrian Chadd uint16_t device; 89148ed571SAdrian Chadd const char *desc; 90148ed571SAdrian Chadd uint32_t quirks; 91148ed571SAdrian Chadd }; 92148ed571SAdrian Chadd 93148ed571SAdrian Chadd #define BWN_BCM_DEV(_devid, _desc, _quirks) \ 94148ed571SAdrian Chadd { PCI_VENDOR_BROADCOM, PCI_DEVID_ ## _devid, \ 95148ed571SAdrian Chadd "Broadcom " _desc " Wireless", _quirks } 96148ed571SAdrian Chadd 97148ed571SAdrian Chadd /* Supported device table */ 98148ed571SAdrian Chadd struct bwn_pci_devcfg { 99148ed571SAdrian Chadd const struct bhndb_hwcfg *bridge_hwcfg; 100148ed571SAdrian Chadd const struct bhndb_hw *bridge_hwtable; 101111d7cb2SLandon J. Fuller const struct bhndb_hw_priority *bridge_hwprio; 102148ed571SAdrian Chadd const struct bwn_pci_device *devices; 103148ed571SAdrian Chadd }; 104148ed571SAdrian Chadd 105148ed571SAdrian Chadd #endif /* _IF_BWN_PCIVAR_H_ */ 106