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