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