Home | History | Annotate | Line # | Download | only in include
pci_machdep.h revision 1.2.8.1
      1  1.2.8.1  nathanw /* $NetBSD: pci_machdep.h,v 1.2.8.1 2002/06/20 03:37:59 nathanw Exp $ */
      2      1.1     soda /* NetBSD: pci_machdep.h,v 1.3 1999/03/19 03:40:46 cgd Exp  */
      3      1.1     soda 
      4      1.1     soda /*
      5      1.1     soda  * Copyright (c) 1996 Carnegie-Mellon University.
      6      1.1     soda  * All rights reserved.
      7      1.1     soda  *
      8      1.1     soda  * Author: Chris G. Demetriou
      9      1.1     soda  *
     10      1.1     soda  * Permission to use, copy, modify and distribute this software and
     11      1.1     soda  * its documentation is hereby granted, provided that both the copyright
     12      1.1     soda  * notice and this permission notice appear in all copies of the
     13      1.1     soda  * software, derivative works or modified versions, and any portions
     14      1.1     soda  * thereof, and that both notices appear in supporting documentation.
     15      1.1     soda  *
     16      1.1     soda  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     17      1.1     soda  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     18      1.1     soda  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     19      1.1     soda  *
     20      1.1     soda  * Carnegie Mellon requests users of this software to return to
     21      1.1     soda  *
     22      1.1     soda  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     23      1.1     soda  *  School of Computer Science
     24      1.1     soda  *  Carnegie Mellon University
     25      1.1     soda  *  Pittsburgh PA 15213-3890
     26      1.1     soda  *
     27      1.1     soda  * any improvements or extensions that they make and grant Carnegie the
     28      1.1     soda  * rights to redistribute these changes.
     29      1.1     soda  */
     30      1.1     soda 
     31      1.1     soda /*
     32      1.1     soda  * Machine-specific definitions for PCI autoconfiguration.
     33      1.1     soda  */
     34      1.1     soda 
     35      1.1     soda /*
     36      1.2       ur  * Forward declarations.
     37      1.2       ur  */
     38      1.2       ur struct pci_attach_args;
     39      1.2       ur 
     40      1.2       ur /*
     41      1.1     soda  * Types provided to machine-independent PCI code
     42      1.1     soda  */
     43      1.1     soda typedef struct arc_pci_chipset *pci_chipset_tag_t;
     44      1.1     soda typedef u_long pcitag_t;
     45      1.1     soda typedef u_long pci_intr_handle_t;
     46      1.1     soda 
     47      1.1     soda /*
     48      1.1     soda  * arc-specific PCI structure and type definitions.
     49      1.1     soda  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
     50      1.1     soda  */
     51      1.1     soda struct arc_pci_chipset {
     52      1.1     soda 	void		(*pc_attach_hook) __P((struct device *,
     53      1.1     soda 			    struct device *, struct pcibus_attach_args *));
     54      1.1     soda 	int		(*pc_bus_maxdevs) __P((pci_chipset_tag_t, int));
     55      1.1     soda 	pcitag_t	(*pc_make_tag) __P((pci_chipset_tag_t, int, int, int));
     56  1.2.8.1  nathanw 	void		(*pc_decompose_tag) __P((pci_chipset_tag_t, pcitag_t,
     57  1.2.8.1  nathanw 			    int *, int *, int *));
     58      1.1     soda 	pcireg_t	(*pc_conf_read) __P((pci_chipset_tag_t, pcitag_t,
     59      1.1     soda 			    int));
     60      1.1     soda 	void		(*pc_conf_write) __P((pci_chipset_tag_t, pcitag_t, int,
     61      1.1     soda 			    pcireg_t));
     62      1.2       ur 	int		(*pc_intr_map) __P((struct pci_attach_args *,
     63      1.2       ur 			    pci_intr_handle_t *));
     64      1.1     soda 	const char	*(*pc_intr_string) __P((pci_chipset_tag_t,
     65      1.1     soda 			    pci_intr_handle_t));
     66      1.1     soda 	void		*(*pc_intr_establish) __P((pci_chipset_tag_t,
     67      1.1     soda 			    pci_intr_handle_t, int, int (*)(void *), void *));
     68      1.1     soda 	void		(*pc_intr_disestablish) __P((pci_chipset_tag_t,
     69      1.1     soda 			    void *));
     70      1.1     soda };
     71      1.1     soda 
     72      1.1     soda /*
     73      1.1     soda  * Functions provided to machine-independent PCI code.
     74      1.1     soda  */
     75      1.1     soda #define	pci_attach_hook(p, s, pba)					\
     76      1.1     soda     (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba))
     77      1.1     soda #define	pci_bus_maxdevs(c, b)						\
     78      1.1     soda     (*(c)->pc_bus_maxdevs)((c), (b))
     79      1.1     soda #define	pci_make_tag(c, b, d, f)					\
     80      1.1     soda     (*(c)->pc_make_tag)((c), (b), (d), (f))
     81  1.2.8.1  nathanw #define	pci_decompose_tag(c, t, bp, dp, fp)				\
     82  1.2.8.1  nathanw     (*(c)->pc_decompose_tag)((c), (t), (bp), (dp), (fp))
     83      1.1     soda #define	pci_conf_read(c, t, r)						\
     84      1.1     soda     (*(c)->pc_conf_read)((c), (t), (r))
     85      1.1     soda #define	pci_conf_write(c, t, r, v)					\
     86      1.1     soda     (*(c)->pc_conf_write)((c), (t), (r), (v))
     87      1.2       ur #define	pci_intr_map(pa, ihp)						\
     88      1.2       ur     (*(pa)->pa_pc->pc_intr_map)((pa), (ihp))
     89      1.1     soda #define	pci_intr_string(c, ih)						\
     90      1.1     soda     (*(c)->pc_intr_string)((c), (ih))
     91      1.1     soda #define	pci_intr_establish(c, ih, l, h, a)				\
     92      1.1     soda     (*(c)->pc_intr_establish)((c), (ih), (l), (h), (a))
     93      1.1     soda #define	pci_intr_disestablish(c, iv)					\
     94      1.1     soda     (*(c)->pc_intr_disestablish)((c), (iv))
     95  1.2.8.1  nathanw 
     96  1.2.8.1  nathanw #define	pci_enumerate_bus(sc, m, p)					\
     97  1.2.8.1  nathanw 	pci_enumerate_bus_generic((sc), (m), (p))
     98