1 | /* |
---|
2 | * This software is Copyright (C) 1998 by T.sqware - all rights limited |
---|
3 | * It is provided in to the public domain "as is", can be freely modified |
---|
4 | * as far as this copyight notice is kept unchanged, but does not imply |
---|
5 | * an endorsement by T.sqware of the product in which it is included. |
---|
6 | */ |
---|
7 | |
---|
8 | #ifndef _PCIB_H |
---|
9 | #define _PCIB_H |
---|
10 | |
---|
11 | #include <rtems/pci.h> |
---|
12 | |
---|
13 | /* |
---|
14 | * Make device signature from bus number, device numebr and function |
---|
15 | * number |
---|
16 | */ |
---|
17 | #define PCIB_DEVSIG_MAKE(b,d,f) ((b<<8)|(d<<3)|(f)) |
---|
18 | |
---|
19 | /* |
---|
20 | * Extract valrous part from device signature |
---|
21 | */ |
---|
22 | #define PCIB_DEVSIG_BUS(x) (((x)>>8) &0xff) |
---|
23 | #define PCIB_DEVSIG_DEV(x) (((x)>>3) & 0x1f) |
---|
24 | #define PCIB_DEVSIG_FUNC(x) ((x) & 0x7) |
---|
25 | |
---|
26 | #ifdef __cplusplus |
---|
27 | extern "C" { |
---|
28 | #endif |
---|
29 | |
---|
30 | int pcib_find_by_class(int classCode, int idx, int *sig); |
---|
31 | int pcib_special_cycle(int busNo, int data); |
---|
32 | int pcib_conf_read8(int sig, int off, uint8_t *data); |
---|
33 | int pcib_conf_read16(int sig, int off, uint16_t *data); |
---|
34 | int pcib_conf_read32(int sig, int off, uint32_t *data); |
---|
35 | int pcib_conf_write8(int sig, int off, uint8_t data); |
---|
36 | int pcib_conf_write16(int sig, int off, uint16_t data); |
---|
37 | int pcib_conf_write32(int sig, int off, uint32_t data); |
---|
38 | |
---|
39 | int |
---|
40 | pci_find_device( unsigned short vendorid, unsigned short deviceid, |
---|
41 | int instance, int *pbus, int *pdev, int *pfun ); |
---|
42 | |
---|
43 | #ifdef __cplusplus |
---|
44 | } |
---|
45 | #endif |
---|
46 | |
---|
47 | #endif /* _PCIB_H */ |
---|