freebsd-dev/sys/dev/bwn/if_bwn_pcivar.h
Adrian Chadd 148ed57165 [bwn] [bhnd] initial support for using bhnd for if_bwn devices.
This is an initial work in progress to use the replacement bhnd
bus code for devices which support it.

* Add manpage updates for bhnd, bhndb, siba
* Add kernel options for bhnd, bhndbus, etc
* Add initial support in if_bwn_pci / if_bwn_mac for using bhnd
  as the bus transport for suppoted NICs
* if_bwn_pci will eventually be the PCI bus glue to interface to bwn,
  which will use the right backend bus to attach to, versus direct
  nexus/bhnd attachments (as found in embedded broadcom devices.)

The PCI glue defaults to probing at a lower level than the bwn glue,
so bwn should still attach as per normal without a boot time tunable set.

It's also not fully fleshed out - the bwn probe/attach code needs to be
broken out into platform and bus specific things (just like ath, ath_pci,
ath_ahb) before we can shift the driver over to using this.

Tested:

* BCM4311, STA mode
* BCM4312, STA mode

Submitted by:	Landon Fuller <landonf@landonf.org>
Differential Revision:	https://reviews.freebsd.org/D6191
2016-05-04 23:38:27 +00:00

93 lines
3.0 KiB
C

/*-
* Copyright (c) 2015 Landon Fuller <landon@landonf.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
* redistribution must be conditioned upon including a substantially
* similar Disclaimer requirement for further binary redistribution.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGES.
*
* $FreeBSD$
*/
#ifndef _IF_BWN_PCIVAR_H_
#define _IF_BWN_PCIVAR_H_
struct bwn_pci_devcfg;
/** bwn_pci per-instance state. */
struct bwn_pci_softc {
device_t dev; /**< device */
device_t bhndb_dev; /**< bhnd bridge device */
const struct bwn_pci_devcfg *devcfg; /**< bwn device config */
uint32_t quirks; /**< quirk flags */
};
/* bwn device quirks */
enum {
/** No quirks */
BWN_QUIRK_NONE = 0,
/**
* This model/revision has not been tested and may not work.
*/
BWN_QUIRK_UNTESTED = 1<<0,
/**
* Early dual-band devices did not support accessing multiple PHYs
* from a single WLAN core, and instead used separate 2GHz and 5GHz
* WLAN cores.
*
* However, not all cards with two WLAN cores are fully populated;
* we must whitelist the boards on which a second WLAN core is actually
* usable.
*/
BWN_QUIRK_WLAN_DUALCORE = 1<<1,
/**
* Some early devices shipped with unconnected ethernet cores; set
* this quirk to treat these cores as unpopulated.
*/
BWN_QUIRK_ENET_HW_UNPOPULATED = 1<<2,
};
/* PCI device descriptor */
struct bwn_pci_device {
uint16_t vendor;
uint16_t device;
const char *desc;
uint32_t quirks;
};
#define BWN_BCM_DEV(_devid, _desc, _quirks) \
{ PCI_VENDOR_BROADCOM, PCI_DEVID_ ## _devid, \
"Broadcom " _desc " Wireless", _quirks }
/* Supported device table */
struct bwn_pci_devcfg {
const struct bhndb_hwcfg *bridge_hwcfg;
const struct bhndb_hw *bridge_hwtable;
const struct bwn_pci_device *devices;
};
#endif /* _IF_BWN_PCIVAR_H_ */