Home | History | Annotate | Line # | Download | only in include
pci_machdep.h revision 1.2.6.2
      1  1.2.6.2  yamt /*	$OpenBSD: pci_machdep.h,v 1.1 2003/09/29 19:23:02 mickey Exp $	*/
      2  1.2.6.2  yamt 
      3  1.2.6.2  yamt /*
      4  1.2.6.2  yamt  * Copyright (c) 2003 Michael Shalayeff
      5  1.2.6.2  yamt  * All rights reserved.
      6  1.2.6.2  yamt  *
      7  1.2.6.2  yamt  * Redistribution and use in source and binary forms, with or without
      8  1.2.6.2  yamt  * modification, are permitted provided that the following conditions
      9  1.2.6.2  yamt  * are met:
     10  1.2.6.2  yamt  * 1. Redistributions of source code must retain the above copyright
     11  1.2.6.2  yamt  *    notice, this list of conditions and the following disclaimer.
     12  1.2.6.2  yamt  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.2.6.2  yamt  *    notice, this list of conditions and the following disclaimer in the
     14  1.2.6.2  yamt  *    documentation and/or other materials provided with the distribution.
     15  1.2.6.2  yamt  *
     16  1.2.6.2  yamt  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  1.2.6.2  yamt  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  1.2.6.2  yamt  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  1.2.6.2  yamt  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
     20  1.2.6.2  yamt  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     21  1.2.6.2  yamt  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     22  1.2.6.2  yamt  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23  1.2.6.2  yamt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     24  1.2.6.2  yamt  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     25  1.2.6.2  yamt  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     26  1.2.6.2  yamt  * THE POSSIBILITY OF SUCH DAMAGE.
     27  1.2.6.2  yamt  */
     28  1.2.6.2  yamt 
     29  1.2.6.2  yamt #ifndef	_MACHINE_PCI_MACHDEP_H_
     30  1.2.6.2  yamt #define	_MACHINE_PCI_MACHDEP_H_
     31  1.2.6.2  yamt 
     32  1.2.6.2  yamt /*
     33  1.2.6.2  yamt  * Types provided to machine-independent PCI code
     34  1.2.6.2  yamt  */
     35  1.2.6.2  yamt typedef struct hppa_pci_chipset_tag *pci_chipset_tag_t;
     36  1.2.6.2  yamt typedef u_long pcitag_t;
     37  1.2.6.2  yamt typedef u_long pci_intr_handle_t;
     38  1.2.6.2  yamt 
     39  1.2.6.2  yamt struct pci_attach_args;
     40  1.2.6.2  yamt 
     41  1.2.6.2  yamt struct hppa_pci_chipset_tag {
     42  1.2.6.2  yamt 	void		*_cookie;
     43  1.2.6.2  yamt 	void		(*pc_attach_hook)(device_t,
     44  1.2.6.2  yamt 			    device_t, struct pcibus_attach_args *);
     45  1.2.6.2  yamt 	int		(*pc_bus_maxdevs)(void *, int);
     46  1.2.6.2  yamt 	pcitag_t	(*pc_make_tag)(void *, int, int, int);
     47  1.2.6.2  yamt 	void		(*pc_decompose_tag)(void *, pcitag_t, int *,
     48  1.2.6.2  yamt 			    int *, int *);
     49  1.2.6.2  yamt 	pcireg_t	(*pc_conf_read)(void *, pcitag_t, int);
     50  1.2.6.2  yamt 	void		(*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
     51  1.2.6.2  yamt 
     52  1.2.6.2  yamt 	int		(*pc_intr_map)(const struct pci_attach_args *,
     53  1.2.6.2  yamt 			    pci_intr_handle_t *);
     54  1.2.6.2  yamt 	const char	*(*pc_intr_string)(void *, pci_intr_handle_t,
     55  1.2.6.2  yamt 			    char *, size_t);
     56  1.2.6.2  yamt 	void		*(*pc_intr_establish)(void *, pci_intr_handle_t,
     57  1.2.6.2  yamt 			    int, int (*)(void *), void *);
     58  1.2.6.2  yamt 	void		(*pc_intr_disestablish)(void *, void *);
     59  1.2.6.2  yamt 
     60  1.2.6.2  yamt 	void		*(*pc_alloc_parent)(device_t,
     61  1.2.6.2  yamt 			    struct pci_attach_args *, int);
     62  1.2.6.2  yamt };
     63  1.2.6.2  yamt 
     64  1.2.6.2  yamt /*
     65  1.2.6.2  yamt  * Functions provided to machine-independent PCI code.
     66  1.2.6.2  yamt  */
     67  1.2.6.2  yamt #define	pci_attach_hook(p, s, pba)					\
     68  1.2.6.2  yamt     (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba))
     69  1.2.6.2  yamt #define	pci_bus_maxdevs(c, b)						\
     70  1.2.6.2  yamt     (*(c)->pc_bus_maxdevs)((c)->_cookie, (b))
     71  1.2.6.2  yamt #define	pci_make_tag(c, b, d, f)					\
     72  1.2.6.2  yamt     (*(c)->pc_make_tag)((c)->_cookie, (b), (d), (f))
     73  1.2.6.2  yamt #define	pci_decompose_tag(c, t, bp, dp, fp)				\
     74  1.2.6.2  yamt     (*(c)->pc_decompose_tag)((c)->_cookie, (t), (bp), (dp), (fp))
     75  1.2.6.2  yamt #define	pci_conf_read(c, t, r)						\
     76  1.2.6.2  yamt     (*(c)->pc_conf_read)((c)->_cookie, (t), (r))
     77  1.2.6.2  yamt #define	pci_conf_write(c, t, r, v)					\
     78  1.2.6.2  yamt     (*(c)->pc_conf_write)((c)->_cookie, (t), (r), (v))
     79  1.2.6.2  yamt #define	pci_intr_map(p, ihp)						\
     80  1.2.6.2  yamt     (*(p)->pa_pc->pc_intr_map)((p), (ihp))
     81  1.2.6.2  yamt #define	pci_intr_line(ih)	(ih)
     82  1.2.6.2  yamt #define	pci_intr_string(c, ih, buf, len)				\
     83  1.2.6.2  yamt     (*(c)->pc_intr_string)((c)->_cookie, (ih), (buf), (len))
     84  1.2.6.2  yamt #define	pci_intr_establish(c, ih, l, h, a)				\
     85  1.2.6.2  yamt     (*(c)->pc_intr_establish)((c)->_cookie, (ih), (l), (h), (a))
     86  1.2.6.2  yamt #define	pci_intr_disestablish(c, iv)					\
     87  1.2.6.2  yamt     (*(c)->pc_intr_disestablish)((c)->_cookie, (iv))
     88  1.2.6.2  yamt 
     89  1.2.6.2  yamt #define	pciide_machdep_compat_intr_establish(a, b, c, d, e)	(NULL)
     90  1.2.6.2  yamt #define	pciide_machdep_compat_intr_disestablish(a, b)	((void)(a), (void)(b))
     91  1.2.6.2  yamt 
     92  1.2.6.2  yamt #define	pci_intr_evcnt(a, b) (NULL)
     93  1.2.6.2  yamt 
     94  1.2.6.2  yamt #endif /* _MACHINE_PCI_MACHDEP_H_ */
     95