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