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