diff options
author | Landon J. Fuller <landonf@FreeBSD.org> | 2017-12-14 01:58:05 +0000 |
---|---|---|
committer | Landon J. Fuller <landonf@FreeBSD.org> | 2017-12-14 01:58:05 +0000 |
commit | 566ca880a1361331e9dfd340bf39d6f14238151d (patch) | |
tree | 280bdfaac71d31f2e2653acfb5982e049a22cdb2 /sys/mips/broadcom | |
parent | 4d4709520a21ed3b17e44f6a82d75fa15f146ef3 (diff) | |
download | src-566ca880a1361331e9dfd340bf39d6f14238151d.tar.gz src-566ca880a1361331e9dfd340bf39d6f14238151d.zip |
bhnd(4): Include board_devid in the bhnd_board_info structure, and populate
the expected default board_vendor value on MIPS SoCs.
This is required by bwn(4) to differentiate between single-band and
dual-band device variants that otherwise share a common chip ID.
Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=326836
Diffstat (limited to 'sys/mips/broadcom')
-rw-r--r-- | sys/mips/broadcom/bhnd_nexus.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/mips/broadcom/bhnd_nexus.c b/sys/mips/broadcom/bhnd_nexus.c index 771a858a1c97..97ca497e9c9c 100644 --- a/sys/mips/broadcom/bhnd_nexus.c +++ b/sys/mips/broadcom/bhnd_nexus.c @@ -153,6 +153,27 @@ bhnd_nexus_get_chipid(device_t dev, device_t child) } /** + * Default bhnd_nexus implementation of BHND_BUS_READ_BOARD_INFO(). + */ +static int +bhnd_nexus_read_board_info(device_t dev, device_t child, + struct bhnd_board_info *info) +{ + int error; + + /* Initialize with NVRAM-derived values */ + if ((error = bhnd_bus_generic_read_board_info(dev, child, info))) + return (error); + + /* The board vendor should default to PCI_VENDOR_BROADCOM if not + * otherwise specified */ + if (info->board_vendor == 0) + info->board_vendor = PCI_VENDOR_BROADCOM; + + return (0); +} + +/** * Default bhnd_nexus implementation of BHND_BUS_MAP_INTR(). */ static int @@ -249,6 +270,7 @@ static device_method_t bhnd_nexus_methods[] = { DEVMETHOD(bhnd_bus_get_dma_translation, bhnd_nexus_get_dma_translation), DEVMETHOD(bhnd_bus_get_intr_domain, bhnd_bus_generic_get_intr_domain), DEVMETHOD(bhnd_bus_map_intr, bhnd_nexus_map_intr), + DEVMETHOD(bhnd_bus_read_board_info, bhnd_nexus_read_board_info), DEVMETHOD(bhnd_bus_unmap_intr, bhnd_nexus_unmap_intr), DEVMETHOD_END |