]> git.saurik.com Git - apple/xnu.git/blame - bsd/dev/arm/pci_device.h
xnu-4570.71.2.tar.gz
[apple/xnu.git] / bsd / dev / arm / pci_device.h
CommitLineData
5ba3f43e
A
1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 */
4/*
5 * @OSF_FREE_COPYRIGHT@
6 *
7 */
8/*
9 * HISTORY
10 *
11 * Revision 1.2 1998/09/30 21:20:44 wsanchez
12 * Merged in IntelMerge1 (mburg: Intel support)
13 *
14 * Revision 1.1.2.1 1998/09/30 18:18:50 mburg
15 * Changes for Intel port
16 *
17 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
18 * Import of OSF Mach kernel (~mburg)
19 *
20 * Revision 1.1.6.2 1995/12/15 10:52:14 bernadat
21 * Split dev and vendor ids.
22 * [95/11/15 bernadat]
23 *
24 * Revision 1.1.6.1 1995/02/23 17:22:27 alanl
25 * Taken from DIPC2_SHARED
26 * [1995/01/03 19:09:31 alanl]
27 *
28 * Revision 1.1.2.1 1994/10/11 18:24:42 rwd
29 * Created.
30 * [1994/10/11 18:15:31 rwd]
31 *
32 * $EndLog$
33 */
34/*
35 * Taken from
36 *
37 * Copyright (c) 1994 Wolfgang Stanglmeier, Koeln, Germany
38 * <wolf@dentaro.GUN.de>
39 */
40
41#ifndef __PCI_DEVICE_H__
42#define __PCI_DEVICE_H__
43
44/*------------------------------------------------------------
45 *
46 * Per driver structure.
47 *
48 *------------------------------------------------------------
49*/
50
51typedef unsigned short pci_vendor_id_t;
52typedef unsigned short pci_dev_id_t;
53
54typedef union {
55 unsigned long cfg1;
56 struct {
57 unsigned char enable;
58 unsigned char forward;
59 unsigned short port;
60 } cfg2;
61 } pcici_t;
62
63struct pci_driver {
64 int (*probe )(pcici_t pci_ident); /* test whether device
65 is present */
66 int (*attach)(pcici_t pci_ident); /* setup driver for a
67 device */
68 pci_vendor_id_t vendor_id; /* vendor pci id */
69 pci_dev_id_t device_id; /* device pci id */
70 char *name; /* device name */
71 char *vendor; /* device long name */
72 void (*intr)(int); /* interupt handler */
73};
74
75/*-----------------------------------------------------------
76 *
77 * Per device structure.
78 *
79 * It is initialized by the config utility and should live in
80 * "ioconf.c". At the moment there is only one field.
81 *
82 * This is a first attempt to include the pci bus to 386bsd.
83 * So this structure may grow ..
84 *
85 *-----------------------------------------------------------
86*/
87
88struct pci_device {
89 struct pci_driver * pd_driver;
90};
91
92/*-----------------------------------------------------------
93 *
94 * This functions may be used by drivers to map devices
95 * to virtual and physical addresses. The va and pa
96 * addresses are "in/out" parameters. If they are 0
97 * on entry, the mapping function assigns an address.
98 *
99 *-----------------------------------------------------------
100*/
101
102int pci_map_mem(pcici_t tag,
103 unsigned long entry,
104 vm_offset_t *va,
105 vm_offset_t *pa);
106#endif /*__PCI_DEVICE_H__*/