On 19.01.11 09:28, Christoph Egger wrote: > On 19.01.11 09:19, Michael wrote: >> Hello, >> >> On Jan 19, 2011, at 3:08 AM, Christoph Egger wrote: >> >>> On 19.01.11 00:22, Christoph Egger wrote: >>>> On 19.01.11 00:09, David Young wrote: >>>>> On Wed, Jan 19, 2011 at 08:18:40AM +1100, matthew green wrote: >>>>>> David Young wrote: >>>>>>> On Tue, Jan 18, 2011 at 11:22:33AM +0100, Christoph Egger wrote: >>>>>>>> Moving that function into wsdisplay.c will add bus dependencies >>>>>>>> to wsdisplay.c. >>>>>>> >>>>>>> I think I agree with Christoph here: if he avoids sprinkling >>>>>>> wsdisplay.c >>>>>>> with bus-related #ifdefs by adding new files, he should definitely do >>>>>>> that. >>>>>> >>>>>> that's a good idea. >>>>>> >>>>>> since it's PCI specific, perhaps sys/dev/pci/wsdisplay_pci.c is >>>>>> a better place? >>>>> >>>>> Sounds good. Christoph, what do you think? >>>> >>>> The scheme sys/dev/<bus>/wsdisplay_<bus>.[ch] where <bus> >>>> is pci, sbus, etc. is fine with me. >> >>> When trying to do that I uncovered a problem with doing it: >> >>> In sys/dev/pci/files.pci I can't do 'wsdisplay & pci' >>> because 'wsdisplay' is defined in sys/dev/wscons/files.wscons. >> >>> So I will leave it as is for now and will do it later when a solution >>> is found for that. >> >> The drivers can ( and should ) pull it in themselves. > > Oh, right. I just found 'wsemuldisplaydev' in files.pci. > I retry.
Ok, here we go. I only resend the kernel side patch. The others didn't change. To my surprise config(1) can actually deal with 'wsdisplay & pci' even though it is defined elsewhere. Christoph
Index: sys/dev/pci/chipsfb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/chipsfb.c,v retrieving revision 1.24 diff -u -p -r1.24 chipsfb.c --- sys/dev/pci/chipsfb.c 23 Dec 2010 21:11:37 -0000 1.24 +++ sys/dev/pci/chipsfb.c 19 Jan 2011 09:22:26 -0000 @@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: chipsfb.c,v #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/i2c/i2cvar.h> @@ -850,6 +851,10 @@ chipsfb_ioctl(void *v, void *vs, u_long return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(&sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_SMODE: { int new_mode = *(int*)data; if (new_mode != sc->sc_mode) { Index: sys/dev/pci/files.pci =================================================================== RCS file: /cvsroot/src/sys/dev/pci/files.pci,v retrieving revision 1.335 diff -u -p -r1.335 files.pci --- sys/dev/pci/files.pci 11 Dec 2010 18:18:09 -0000 1.335 +++ sys/dev/pci/files.pci 19 Jan 2011 09:22:26 -0000 @@ -28,6 +28,8 @@ file dev/pci/pcibusprint.c pcibus file dev/pci/pci_verbose.c pci & pciverbose +file dev/pci/wsdisplay_pci.c wsdisplay & pci + # Cypress 82c693 hyperCache(tm) Stand-Alone PCI Peripheral Controller # with USB. This is a combo chip: # Index: sys/dev/pci/genfb_pci.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/genfb_pci.c,v retrieving revision 1.26 diff -u -p -r1.26 genfb_pci.c --- sys/dev/pci/genfb_pci.c 16 Dec 2010 06:45:50 -0000 1.26 +++ sys/dev/pci/genfb_pci.c 19 Jan 2011 09:22:26 -0000 @@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_pci.c, #include <dev/pci/pciio.h> #include <dev/wsfb/genfbvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/pci/genfb_pcivar.h> @@ -197,6 +198,11 @@ pci_genfb_ioctl(void *v, void *vs, u_lon case PCI_IOC_CFGWRITE: return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_gen.sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_SMODE: { int new_mode = *(int*)data, i; if (new_mode == WSDISPLAYIO_MODE_EMUL) { Index: sys/dev/pci/machfb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/machfb.c,v retrieving revision 1.62 diff -u -p -r1.62 machfb.c --- sys/dev/pci/machfb.c 16 Dec 2010 06:45:50 -0000 1.62 +++ sys/dev/pci/machfb.c 19 Jan 2011 09:22:27 -0000 @@ -65,6 +65,7 @@ __KERNEL_RCSID(0, #include <dev/wscons/wsconsio.h> #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/wscons/wsdisplay_vconsvar.h> @@ -1709,7 +1710,11 @@ mach64_ioctl(void *v, void *vs, u_long c case PCI_IOC_CFGWRITE: return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); - + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_SMODE: { int new_mode = *(int*)data; if (new_mode != sc->sc_mode) { @@ -2007,6 +2012,11 @@ machfb_fbioctl(dev_t dev, u_long cmd, vo #endif return ret; } + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + default: #ifdef MACHFB_DEBUG log(LOG_NOTICE, "machfb_fbioctl(0x%lx) (%s[%d])\n", cmd, Index: sys/dev/pci/pm2fb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/pm2fb.c,v retrieving revision 1.6 diff -u -p -r1.6 pm2fb.c --- sys/dev/pci/pm2fb.c 16 Dec 2010 06:45:50 -0000 1.6 +++ sys/dev/pci/pm2fb.c 19 Jan 2011 09:22:27 -0000 @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1. #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/i2c/i2cvar.h> @@ -317,6 +318,10 @@ pm2fb_ioctl(void *v, void *vs, u_long cm return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_GINFO: if (ms == NULL) return ENODEV; Index: sys/dev/pci/r128fb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/r128fb.c,v retrieving revision 1.19 diff -u -p -r1.19 r128fb.c --- sys/dev/pci/r128fb.c 6 Jan 2011 07:43:05 -0000 1.19 +++ sys/dev/pci/r128fb.c 19 Jan 2011 09:22:27 -0000 @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1 #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/i2c/i2cvar.h> @@ -349,8 +350,11 @@ r128fb_ioctl(void *v, void *vs, u_long c /* PCI config read/write passthrough. */ case PCI_IOC_CFGREAD: case PCI_IOC_CFGWRITE: - return (pci_devioctl(sc->sc_pc, sc->sc_pcitag, - cmd, data, flag, l)); + return pci_devioctl(sc->sc_pc, sc->sc_pcitag, + cmd, data, flag, l); + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, sc->sc_pcitag, data); case WSDISPLAYIO_GINFO: if (ms == NULL) Index: sys/dev/pci/radeonfb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/radeonfb.c,v retrieving revision 1.40 diff -u -p -r1.40 radeonfb.c --- sys/dev/pci/radeonfb.c 16 Dec 2010 06:45:50 -0000 1.40 +++ sys/dev/pci/radeonfb.c 19 Jan 2011 09:22:28 -0000 @@ -90,6 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v #include <dev/videomode/videomode.h> #include <dev/videomode/edidvar.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/pci/pcidevs.h> #include <dev/pci/pcireg.h> @@ -1096,6 +1097,10 @@ radeonfb_ioctl(void *v, void *vs, case PCI_IOC_CFGWRITE: return pci_devioctl(sc->sc_pc, sc->sc_pt, cmd, d, flag, l); + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(&sc->sc_dev, sc->sc_pc, + sc->sc_pt, d); + default: return EPASSTHROUGH; } Index: sys/dev/pci/tga.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/tga.c,v retrieving revision 1.80 diff -u -p -r1.80 tga.c --- sys/dev/pci/tga.c 13 Nov 2010 13:52:08 -0000 1.80 +++ sys/dev/pci/tga.c 19 Jan 2011 09:22:28 -0000 @@ -58,6 +58,8 @@ __KERNEL_RCSID(0, "$NetBSD: tga.c,v 1.80 #include <dev/wscons/wscons_raster.h> #include <dev/rasops/rasops.h> #include <dev/wsfont/wsfont.h> +#include <dev/pci/wsdisplay_pci.h> + int tgamatch(device_t, cfdata_t, void *); void tgaattach(device_t, device_t, void *); int tgaprint(void *, const char *); @@ -594,6 +596,10 @@ tga_ioctl(void *v, void *vs, u_long cmd, case PCI_IOC_CFGWRITE: return pci_devioctl(dc->dc_pc, dc->dc_pcitag, cmd, data, flag, l); + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(vc->softc->sc_dev, dc->dc_pc, + dc->dc_pcitag, data); } return EPASSTHROUGH; } Index: sys/dev/pci/unichromefb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/unichromefb.c,v retrieving revision 1.17 diff -u -p -r1.17 unichromefb.c --- sys/dev/pci/unichromefb.c 16 Dec 2010 06:45:50 -0000 1.17 +++ sys/dev/pci/unichromefb.c 19 Jan 2011 09:22:28 -0000 @@ -70,6 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: unichromefb. #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/pci/unichromereg.h> #include <dev/pci/unichromemode.h> @@ -478,6 +479,11 @@ unichromefb_ioctl(void *v, void *vs, u_l case PCI_IOC_CFGWRITE: return (pci_devioctl(sc->sc_pa.pa_pc, sc->sc_pa.pa_tag, cmd, data, flag, l)); + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, + sc->sc_pa.pa_pc, sc->sc_pa.pa_tag, data); + } return EPASSTHROUGH; Index: sys/dev/pci/vga_pci.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/vga_pci.c,v retrieving revision 1.52 diff -u -p -r1.52 vga_pci.c --- sys/dev/pci/vga_pci.c 16 Dec 2010 06:45:50 -0000 1.52 +++ sys/dev/pci/vga_pci.c 19 Jan 2011 09:22:28 -0000 @@ -51,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> +#include <dev/pci/wsdisplay_pci.h> #include "opt_vga.h" @@ -313,6 +314,10 @@ vga_pci_ioctl(void *v, u_long cmd, void return pci_devioctl(psc->sc_pc, psc->sc_pcitag, cmd, data, flag, l); + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(vc->softc->sc_dev, + psc->sc_pc, psc->sc_pcitag, data); + default: return EPASSTHROUGH; } Index: sys/dev/pci/voodoofb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/voodoofb.c,v retrieving revision 1.26 diff -u -p -r1.26 voodoofb.c --- sys/dev/pci/voodoofb.c 25 Dec 2010 11:51:21 -0000 1.26 +++ sys/dev/pci/voodoofb.c 19 Jan 2011 09:22:28 -0000 @@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include "opt_wsemul.h" @@ -936,7 +937,11 @@ voodoofb_ioctl(void *v, void *vs, u_long case PCI_IOC_CFGWRITE: return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); - + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_SMODE: { int new_mode = *(int*)data; if (new_mode != sc->sc_mode) { Index: sys/dev/pci/voyagerfb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/voyagerfb.c,v retrieving revision 1.6 diff -u -p -r1.6 voyagerfb.c --- sys/dev/pci/voyagerfb.c 23 Dec 2010 21:34:02 -0000 1.6 +++ sys/dev/pci/voyagerfb.c 19 Jan 2011 09:22:28 -0000 @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: voyagerfb.c, #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include <dev/i2c/i2cvar.h> @@ -325,6 +326,10 @@ voyagerfb_ioctl(void *v, void *vs, u_lon return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_GINFO: if (ms == NULL) return ENODEV; Index: sys/dev/pci/wcfb.c =================================================================== RCS file: /cvsroot/src/sys/dev/pci/wcfb.c,v retrieving revision 1.7 diff -u -p -r1.7 wcfb.c --- sys/dev/pci/wcfb.c 16 Dec 2010 06:45:51 -0000 1.7 +++ sys/dev/pci/wcfb.c 19 Jan 2011 09:22:28 -0000 @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: wcfb.c,v 1.7 #include <dev/wsfont/wsfont.h> #include <dev/rasops/rasops.h> #include <dev/wscons/wsdisplay_vconsvar.h> +#include <dev/pci/wsdisplay_pci.h> #include "opt_wsfb.h" #include "opt_wsdisplay_compat.h" @@ -318,6 +319,11 @@ wcfb_ioctl(void *v, void *vs, u_long cmd case PCI_IOC_CFGWRITE: return pci_devioctl(sc->sc_pc, sc->sc_pcitag, cmd, data, flag, l); + + case WSDISPLAYIO_GET_BUSID: + return wsdisplayio_busid_pci(sc->sc_dev, sc->sc_pc, + sc->sc_pcitag, data); + case WSDISPLAYIO_SMODE: { /*int new_mode = *(int*)data, i;*/ } Index: sys/dev/pci/wsdisplay_pci.c =================================================================== RCS file: sys/dev/pci/wsdisplay_pci.c diff -N sys/dev/pci/wsdisplay_pci.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/pci/wsdisplay_pci.c 19 Jan 2011 09:22:28 -0000 @@ -0,0 +1,53 @@ +/* $NetBSD: $ */ +/* + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christoph Egger. + * + * 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. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 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 DAMAGE. + */ + +#include <sys/cdefs.h> +__KERNEL_RCSID(0, "$NetBSD: $"); + +#include <sys/param.h> +#include <sys/bus.h> +#include <dev/pci/pcivar.h> +#include <dev/wscons/wsconsio.h> +#include <dev/pci/wsdisplay_pci.h> + +int +wsdisplayio_busid_pci(device_t self, pci_chipset_tag_t pc, + pcitag_t tag, void *data) +{ + struct wsdisplayio_bus_id *busid = data; + + KASSERT(device_is_a(device_parent(self), "pci")); + busid->bus_type = WSDISPLAYIO_BUS_PCI; + busid->ubus.pci.domain = device_unit(device_parent(self)); + pci_decompose_tag(pc, tag, + &busid->ubus.pci.bus, &busid->ubus.pci.device, + &busid->ubus.pci.function); + return 0; +} Index: sys/dev/pci/wsdisplay_pci.h =================================================================== RCS file: sys/dev/pci/wsdisplay_pci.h diff -N sys/dev/pci/wsdisplay_pci.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/pci/wsdisplay_pci.h 19 Jan 2011 09:22:28 -0000 @@ -0,0 +1,40 @@ +/* $NetBSD: $ */ +/* + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christoph Egger. + * + * 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. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 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 DAMAGE. + */ + +#ifndef _SYS_DEV_PCI_WSDISPLAYPCI_H_ +#define _SYS_DEV_PCI_WSDISPLAYPCI_H_ + +#include <dev/pci/pcivar.h> +#include <sys/device_if.h> + +int +wsdisplayio_busid_pci(device_t, pci_chipset_tag_t, pcitag_t, void *); + +#endif /* _SYS_DEV_PCI_WSDISPLAYPCI_H_ */ Index: sys/dev/wscons/wsconsio.h =================================================================== RCS file: /cvsroot/src/sys/dev/wscons/wsconsio.h,v retrieving revision 1.93 diff -u -p -r1.93 wsconsio.h --- sys/dev/wscons/wsconsio.h 2 Oct 2010 00:52:02 -0000 1.93 +++ sys/dev/wscons/wsconsio.h 19 Jan 2011 09:22:28 -0000 @@ -542,4 +542,26 @@ struct wsmux_device_list { #define WSMUXIO_INJECTEVENT _IOW('W', 100, struct wscons_event) #define WSMUX_INJECTEVENT WSMUXIO_INJECTEVENT /* XXX compat */ +/* Mapping information retrieval. */ +struct wsdisplayio_bus_id { + u_int bus_type; +#define WSDISPLAYIO_BUS_PCI 0 +#define WSDISPLAYIO_BUS_SBUS 1 + union bus_data { + struct bus_pci { + uint32_t domain; + uint32_t bus; + uint32_t device; + uint32_t function; + } pci; + struct bus_sbus { + uint32_t fb_instance; + } sbus; + /* so the size doesn't change if we add more bus types */ + char pad[32]; + } ubus; +}; + +#define WSDISPLAYIO_GET_BUSID _IOR('W', 101, struct wsdisplayio_bus_id) + #endif /* _DEV_WSCONS_WSCONSIO_H_ */