]> git.saurik.com Git - apple/xnu.git/blob - bsd/dev/i386/pci_device.h
xnu-123.5.tar.gz
[apple/xnu.git] / bsd / dev / i386 / pci_device.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_FREE_COPYRIGHT@
24 *
25 */
26 /*
27 * HISTORY
28 *
29 * Revision 1.2 1998/09/30 21:20:44 wsanchez
30 * Merged in IntelMerge1 (mburg: Intel support)
31 *
32 * Revision 1.1.2.1 1998/09/30 18:18:50 mburg
33 * Changes for Intel port
34 *
35 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
36 * Import of OSF Mach kernel (~mburg)
37 *
38 * Revision 1.1.6.2 1995/12/15 10:52:14 bernadat
39 * Split dev and vendor ids.
40 * [95/11/15 bernadat]
41 *
42 * Revision 1.1.6.1 1995/02/23 17:22:27 alanl
43 * Taken from DIPC2_SHARED
44 * [1995/01/03 19:09:31 alanl]
45 *
46 * Revision 1.1.2.1 1994/10/11 18:24:42 rwd
47 * Created.
48 * [1994/10/11 18:15:31 rwd]
49 *
50 * $EndLog$
51 */
52 /*
53 * Taken from
54 *
55 * Copyright (c) 1994 Wolfgang Stanglmeier, Koeln, Germany
56 * <wolf@dentaro.GUN.de>
57 */
58
59 #ifndef __PCI_DEVICE_H__
60 #define __PCI_DEVICE_H__
61
62 /*------------------------------------------------------------
63 *
64 * Per driver structure.
65 *
66 *------------------------------------------------------------
67 */
68
69 typedef unsigned short pci_vendor_id_t;
70 typedef unsigned short pci_dev_id_t;
71
72 typedef union {
73 unsigned long cfg1;
74 struct {
75 unsigned char enable;
76 unsigned char forward;
77 unsigned short port;
78 } cfg2;
79 } pcici_t;
80
81 struct pci_driver {
82 int (*probe )(pcici_t pci_ident); /* test whether device
83 is present */
84 int (*attach)(pcici_t pci_ident); /* setup driver for a
85 device */
86 pci_vendor_id_t vendor_id; /* vendor pci id */
87 pci_dev_id_t device_id; /* device pci id */
88 char *name; /* device name */
89 char *vendor; /* device long name */
90 void (*intr)(int); /* interupt handler */
91 };
92
93 /*-----------------------------------------------------------
94 *
95 * Per device structure.
96 *
97 * It is initialized by the config utility and should live in
98 * "ioconf.c". At the moment there is only one field.
99 *
100 * This is a first attempt to include the pci bus to 386bsd.
101 * So this structure may grow ..
102 *
103 *-----------------------------------------------------------
104 */
105
106 struct pci_device {
107 struct pci_driver * pd_driver;
108 };
109
110 /*-----------------------------------------------------------
111 *
112 * This functions may be used by drivers to map devices
113 * to virtual and physical addresses. The va and pa
114 * addresses are "in/out" parameters. If they are 0
115 * on entry, the mapping function assigns an address.
116 *
117 *-----------------------------------------------------------
118 */
119
120 int pci_map_mem(pcici_t tag,
121 unsigned long entry,
122 vm_offset_t *va,
123 vm_offset_t *pa);
124 #endif /*__PCI_DEVICE_H__*/