]> git.saurik.com Git - apple/boot.git/blob - i386/libsaio/pci.h
d1fde1a91c7ad34f6d90c6a1d57fe306bf608b44
[apple/boot.git] / i386 / libsaio / pci.h
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24 /*
25 * Copyright 1994 NeXT Computer, Inc.
26 * All rights reserved.
27 */
28
29 #ifndef __LIBSAIO_PCI_H
30 #define __LIBSAIO_PCI_H
31
32 typedef struct _pci_slot_info {
33 unsigned long int pid, sid;
34 unsigned dev;
35 unsigned func;
36 unsigned bus;
37 } _pci_slot_info_t;
38
39 extern _pci_slot_info_t *PCISlotInfo;
40
41 /* The IOPCIConfigSpace structure can be used to decode the 256 byte
42 * configuration space presented by each PCI device. This structure
43 * is based on the PCI LOCAL BUS SPECIFICATION, rev 2.1, section 6.1
44 */
45
46 typedef struct _IOPCIConfigSpace {
47 unsigned short VendorID;
48 unsigned short DeviceID;
49 unsigned short Command;
50 unsigned short Status;
51 unsigned long RevisionID:8;
52 unsigned long ClassCode:24;
53 unsigned char CacheLineSize;
54 unsigned char LatencyTimer;
55 unsigned char HeaderType;
56 unsigned char BuiltInSelfTest;
57 unsigned long BaseAddress[6];
58 unsigned long CardbusCISpointer;
59 unsigned short SubVendorID;
60 unsigned short SubDeviceID;
61 unsigned long ROMBaseAddress;
62 unsigned long reserved3;
63 unsigned long reserved4;
64 unsigned char InterruptLine;
65 unsigned char InterruptPin;
66 unsigned char MinGrant;
67 unsigned char MaxLatency;
68 unsigned long VendorUnique[48];
69 } IOPCIConfigSpace;
70
71
72 /* PCI_DEFAULT_DATA is the value resulting from a read to a non-existent
73 * PCI device's configuration space.
74 */
75
76 #define PCI_DEFAULT_DATA 0xffffffff
77
78
79 /* PCI_INVALID_VENDOR_ID is a Vendor ID reserved by the PCI/SIG and is
80 * guaranteed not to be assigned to any vendor.
81 */
82
83 #define PCI_INVALID_VENDOR_ID 0xffff
84
85 #endif /* !__LIBSAIO_PCI_H */