pci_machdep.h revision 1.7
11.7Ssommerfe/*	$NetBSD: pci_machdep.h,v 1.7 2000/12/28 22:59:08 sommerfeld Exp $	*/
21.1Ssakamoto
31.1Ssakamoto/*
41.1Ssakamoto * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
51.2Smycroft * Copyright (c) 1994 Charles M. Hannum.  All rights reserved.
61.1Ssakamoto *
71.1Ssakamoto * Redistribution and use in source and binary forms, with or without
81.1Ssakamoto * modification, are permitted provided that the following conditions
91.1Ssakamoto * are met:
101.1Ssakamoto * 1. Redistributions of source code must retain the above copyright
111.1Ssakamoto *    notice, this list of conditions and the following disclaimer.
121.1Ssakamoto * 2. Redistributions in binary form must reproduce the above copyright
131.1Ssakamoto *    notice, this list of conditions and the following disclaimer in the
141.1Ssakamoto *    documentation and/or other materials provided with the distribution.
151.1Ssakamoto * 3. All advertising materials mentioning features or use of this software
161.1Ssakamoto *    must display the following acknowledgement:
171.2Smycroft *	This product includes software developed by Charles M. Hannum.
181.1Ssakamoto * 4. The name of the author may not be used to endorse or promote products
191.1Ssakamoto *    derived from this software without specific prior written permission.
201.1Ssakamoto *
211.1Ssakamoto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
221.1Ssakamoto * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
231.1Ssakamoto * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
241.1Ssakamoto * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
251.1Ssakamoto * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
261.1Ssakamoto * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
271.1Ssakamoto * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
281.1Ssakamoto * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
291.1Ssakamoto * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
301.1Ssakamoto * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311.1Ssakamoto */
321.1Ssakamoto
331.1Ssakamoto/*
341.1Ssakamoto * Machine-specific definitions for PCI autoconfiguration.
351.1Ssakamoto */
361.1Ssakamoto
371.1Ssakamoto/*
381.1Ssakamoto * be-specific PCI structure and type definitions.
391.1Ssakamoto * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
401.1Ssakamoto *
411.1Ssakamoto * Configuration tag; created from a {bus,device,function} triplet by
421.1Ssakamoto * pci_make_tag(), and passed to pci_conf_read() and pci_conf_write().
431.1Ssakamoto * We could instead always pass the {bus,device,function} triplet to
441.1Ssakamoto * the read and write routines, but this would cause extra overhead.
451.1Ssakamoto */
461.1Ssakamoto
471.1Ssakamoto/*
481.7Ssommerfe * Forward declarations.
491.7Ssommerfe */
501.7Ssommerfestruct pci_attach_args;
511.7Ssommerfe
521.7Ssommerfe/*
531.1Ssakamoto * Types provided to machine-independent PCI code
541.1Ssakamoto */
551.1Ssakamototypedef void *pci_chipset_tag_t;
561.1Ssakamototypedef int pcitag_t;
571.1Ssakamototypedef int pci_intr_handle_t;
581.1Ssakamoto
591.1Ssakamoto/*
601.1Ssakamoto * Functions provided to machine-independent PCI code.
611.1Ssakamoto */
621.5Scgdvoid		pci_attach_hook(struct device *, struct device *,
631.5Scgd		    struct pcibus_attach_args *);
641.5Scgdint		pci_bus_maxdevs(pci_chipset_tag_t, int);
651.5Scgdpcitag_t	pci_make_tag(pci_chipset_tag_t, int, int, int);
661.5Scgdvoid		pci_decompose_tag(pci_chipset_tag_t, pcitag_t,
671.5Scgd		    int *, int *, int *);
681.5Scgdpcireg_t	pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
691.5Scgdvoid		pci_conf_write(pci_chipset_tag_t, pcitag_t, int,
701.5Scgd		    pcireg_t);
711.7Ssommerfeint		pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
721.5Scgdconst char	*pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
731.6Scgdconst struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t);
741.5Scgdvoid		*pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
751.5Scgd		    int, int (*)(void *), void *);
761.5Scgdvoid		pci_intr_disestablish(pci_chipset_tag_t, void *);
77