/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2015-2016 Landon Fuller <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*27*/2829#ifndef _IF_BWN_PCIVAR_H_30#define _IF_BWN_PCIVAR_H_3132struct bwn_pci_devcfg;3334/** bwn_pci per-instance state. */35struct bwn_pci_softc {36device_t dev; /**< device */37device_t bhndb_dev; /**< bhnd bridge device */38const struct bwn_pci_devcfg *devcfg; /**< bwn device config */39uint32_t quirks; /**< quirk flags */40};4142/* bwn device quirks */43enum {44/** No quirks */45BWN_QUIRK_NONE = 0,4647/**48* This model/revision has not been tested and may not work.49*/50BWN_QUIRK_UNTESTED = 1<<0,5152/**53* Early dual-band devices did not support accessing multiple PHYs54* from a single WLAN core, and instead used separate 2GHz and 5GHz55* WLAN cores.56*57* However, not all cards with two WLAN cores are fully populated;58* we must whitelist the boards on which a second WLAN core is actually59* usable.60*/61BWN_QUIRK_WLAN_DUALCORE = 1<<1,6263/**64* Some early devices shipped with unconnected ethernet cores; set65* this quirk to treat these cores as unpopulated.66*/67BWN_QUIRK_ENET_HW_UNPOPULATED = 1<<2,6869/**70* Some PCI/PCIe "Intensi-fi" chipsets shipped with floating USB71* host controller cores; set this quirk to treat these cores as72* unpopulated.73*/74BWN_QUIRK_USBH_UNPOPULATED = 1<<3,7576/**77* Some early devices (including all BCM4306 chipsets) shipped with78* floating analog softmodem codec cores; set this quirk to treat these79* cores as unpopulated.80*/81BWN_QUIRK_SOFTMODEM_UNPOPULATED = 1<<4,82};8384/* PCI device descriptor */85struct bwn_pci_device {86uint16_t vendor;87uint16_t device;88const char *desc;89uint32_t quirks;90};9192#define BWN_BCM_DEV(_devid, _desc, _quirks) \93{ PCI_VENDOR_BROADCOM, PCI_DEVID_ ## _devid, \94"Broadcom " _desc " Wireless", _quirks }9596/* Supported device table */97struct bwn_pci_devcfg {98const struct bhndb_hwcfg *bridge_hwcfg;99const struct bhndb_hw *bridge_hwtable;100const struct bhndb_hw_priority *bridge_hwprio;101const struct bwn_pci_device *devices;102};103104#endif /* _IF_BWN_PCIVAR_H_ */105106107