1 | /* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
|
---|
5 | *
|
---|
6 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
7 | * copy of this software and associated documentation files (the "Software"),
|
---|
8 | * to deal in the Software without restriction, including without limitation
|
---|
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
10 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
11 | * Software is furnished to do so, subject to the following conditions:
|
---|
12 | *
|
---|
13 | * The above copyright notice and this permission notice shall be included in
|
---|
14 | * all copies or substantial portions of the Software.
|
---|
15 | *
|
---|
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
19 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
22 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
23 | *
|
---|
24 | * Except as contained in this notice, the name of the copyright holder(s)
|
---|
25 | * and author(s) shall not be used in advertising or otherwise to promote
|
---|
26 | * the sale, use or other dealings in this Software without prior written
|
---|
27 | * authorization from the copyright holder(s) and author(s).
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifdef HAVE_XORG_CONFIG_H
|
---|
31 | #include <xorg-config.h>
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #ifndef PCI_DATA_H_
|
---|
35 | #define PCI_DATA_H_
|
---|
36 |
|
---|
37 | #define NOVENDOR 0xFFFF
|
---|
38 | #define NODEVICE 0xFFFF
|
---|
39 | #define NOSUBSYS 0xFFFF
|
---|
40 |
|
---|
41 | typedef Bool (*ScanPciSetupProcPtr)(void);
|
---|
42 | typedef void (*ScanPciCloseProcPtr)(void);
|
---|
43 | typedef int (*ScanPciFindByDeviceProcPtr)(
|
---|
44 | unsigned short vendor, unsigned short device,
|
---|
45 | unsigned short svendor, unsigned short subsys,
|
---|
46 | const char **vname, const char **dname,
|
---|
47 | const char **svname, const char **sname);
|
---|
48 | typedef int (*ScanPciFindBySubsysProcPtr)(
|
---|
49 | unsigned short svendor, unsigned short subsys,
|
---|
50 | const char **svname, const char **sname);
|
---|
51 | typedef CARD32 (*ScanPciFindClassBySubsysProcPtr)(
|
---|
52 | unsigned short vendor, unsigned short subsystem);
|
---|
53 | typedef CARD32 (*ScanPciFindClassByDeviceProcPtr)(
|
---|
54 | unsigned short vendor, unsigned short device);
|
---|
55 |
|
---|
56 | /*
|
---|
57 | * Whoever loads this module needs to define these and initialise them
|
---|
58 | * after loading.
|
---|
59 | */
|
---|
60 | extern ScanPciSetupProcPtr xf86SetupPciIds;
|
---|
61 | extern ScanPciCloseProcPtr xf86ClosePciIds;
|
---|
62 | extern ScanPciFindByDeviceProcPtr xf86FindPciNamesByDevice;
|
---|
63 | extern ScanPciFindBySubsysProcPtr xf86FindPciNamesBySubsys;
|
---|
64 | extern ScanPciFindClassBySubsysProcPtr xf86FindPciClassBySubsys;
|
---|
65 | extern ScanPciFindClassByDeviceProcPtr xf86FindPciClassByDevice;
|
---|
66 |
|
---|
67 | Bool ScanPciSetupPciIds(void);
|
---|
68 | void ScanPciClosePciIds(void);
|
---|
69 | int ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
|
---|
70 | unsigned short svendor, unsigned short subsys,
|
---|
71 | const char **vname, const char **dname,
|
---|
72 | const char **svname, const char **sname);
|
---|
73 | int ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
|
---|
74 | const char **svname, const char **sname);
|
---|
75 | CARD32 ScanPciFindPciClassBySubsys(unsigned short vendor,
|
---|
76 | unsigned short subsystem);
|
---|
77 | CARD32 ScanPciFindPciClassByDevice(unsigned short vendor,
|
---|
78 | unsigned short device);
|
---|
79 |
|
---|
80 | #endif
|
---|