diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-04-18 23:48:25 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-04-18 23:48:25 +0000 |
commit | 76067dc38b59d22fa68139e9e0f6387455213fef (patch) | |
tree | a07a31d71b761635bad242646844c4ead9cdbed8 /sys/dev/pci/pcivar.h | |
parent | 740ab8eb879aa7a6c29f0a9c83c747b8ae4988c9 (diff) |
NetBSD 960317 merge
Diffstat (limited to 'sys/dev/pci/pcivar.h')
-rw-r--r-- | sys/dev/pci/pcivar.h | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index d56141cc02b..659a87ed6db 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -1,3 +1,4 @@ +/* $OpenBSD: pcivar.h,v 1.6 1996/04/18 23:48:08 niklas Exp $ */ /* $NetBSD: pcivar.h,v 1.8 1995/06/18 01:26:50 cgd Exp $ */ /* @@ -29,6 +30,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _DEV_PCI_PCIVAR_H_ +#define _DEV_PCI_PCIVAR_H_ + /* * Definitions for PCI autoconfiguration. * @@ -37,6 +41,8 @@ * separated into pci_machdep.h. */ +#include <machine/bus.h> + #if (alpha + i386 != 1) ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE. #endif @@ -49,18 +55,57 @@ ERROR: COMPILING FOR UNSUPPORTED MACHINE, OR MORE THAN ONE. #include <i386/pci/pci_machdep.h> #endif +/* + * The maximum number of devices on a PCI bus is 32. However, some + * PCI chipsets (e.g. chipsets that implement 'Configuration Mechanism #2' + * on the i386) can't deal with that many, so let pci_machdep.h override it. + */ +#ifndef PCI_MAX_DEVICE_NUMBER +#define PCI_MAX_DEVICE_NUMBER 32 +#endif + +/* + * PCI bus attach arguments. + */ +struct pcibus_attach_args { + char *pba_busname; /* XXX should be common */ + bus_chipset_tag_t pba_bc; /* XXX should be common */ + + int pba_bus; /* PCI bus number */ +}; + +/* + * PCI device attach arguments. + */ struct pci_attach_args { - int pa_bus; - int pa_device; - pcitag_t pa_tag; - pcireg_t pa_id, pa_class; + bus_chipset_tag_t pa_bc; /* bus chipset tag */ + + int pa_device; + int pa_function; + pcitag_t pa_tag; + pcireg_t pa_id, pa_class; }; +/* + * Locators devices that attach to 'pcibus', as specified to config. + */ +#define pcibuscf_bus cf_loc[0] +#define PCIBUS_UNK_BUS -1 /* wildcarded 'bus' */ + +/* + * Locators for PCI devices, as specified to config. + */ +#define pcicf_dev cf_loc[0] +#define PCI_UNK_DEV -1 /* wildcarded 'dev' */ + +#define pcicf_function cf_loc[1] +#define PCI_UNK_FUNCTION -1 /* wildcarded 'function' */ + pcireg_t pci_conf_read __P((pcitag_t, int)); void pci_conf_write __P((pcitag_t, int, pcireg_t)); -void pci_devinfo __P((pcireg_t, pcireg_t, char *, int *)); +void pci_devinfo __P((pcireg_t, pcireg_t, int, char *)); pcitag_t pci_make_tag __P((int, int, int)); void *pci_map_int __P((pcitag_t, int, int (*)(void *), void *, char *)); int pci_map_mem __P((pcitag_t, int, vm_offset_t *, vm_offset_t *)); -int pci_attach_subdev __P((struct device *, int, int)); +#endif /* _DEV_PCI_PCIVAR_H_ */ |