devLib2
2.11
|
Data Structures | |
struct | epicsPCIID |
PCI device identifier. More... | |
struct | PCIBar |
struct | epicsPCIDevice |
Device token. More... | |
Macros | |
#define | DEVLIBPCI_MAJOR 1 |
API major version. More... | |
#define | DEVLIBPCI_MINOR 3 |
API minor version. More... | |
#define | DEVPCI_ANY_DEVICE 0x10000 |
#define | DEVPCI_ANY_VENDOR 0x10000 |
#define | DEVPCI_ANY_SUBDEVICE 0x10000 |
#define | DEVPCI_ANY_SUBVENDOR 0x10000 |
#define | DEVPCI_ANY_CLASS 0x1000000 |
#define | DEVPCI_ANY_REVISION 0x100 |
#define | DEVPCI_LAST_DEVICE 0xffff0000 |
#define | DEVPCI_END {DEVPCI_LAST_DEVICE,0,0,0,0,0} |
The last item in a list of PCI IDS. More... | |
#define | DEVPCI_DEVICE_ANY() |
#define | DEVPCI_DEVICE_VENDOR(dev, vend) |
#define | DEVPCI_DEVICE_VENDOR_CLASS(dev, vend, pclass) |
#define | DEVPCI_SUBDEVICE_SUBVENDOR(dev, vend, sdev, svend) |
#define | DEVPCI_SUBDEVICE_SUBVENDOR_CLASS(dev, vend, sdev, svend, revision, pclass) |
#define | DEVPCI_NO_SLOT NULL |
#define | PCIBARCOUNT NELEMENTS( ((epicsPCIDevice*)0)->bar ) |
The maximum number of base address registers (BARs). More... | |
#define | DEVLIB_MAP_UIO1TO1 0 |
#define | DEVLIB_MAP_UIOCOMPACT 0 |
Typedefs | |
typedef int(* | devPCISearchFn) (void *ptr, const epicsPCIDevice *dev) |
PCI search callback prototype. More... | |
Functions | |
epicsShareFunc int | devPCIFindCB (const epicsPCIID *idlist, devPCISearchFn searchfn, void *arg, unsigned int opt) |
PCI bus search w/ callback. More... | |
epicsShareFunc int | devPCIFindSpec (const epicsPCIID *idlist, const char *spec, const epicsPCIDevice **found, unsigned int opt) |
PCI bus search by specification string. More... | |
epicsShareFunc int | devPCIFindDBDF (const epicsPCIID *idlist, unsigned int domain, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
PCI bus probe. More... | |
epicsShareFunc int | devPCIFindBDF (const epicsPCIID *idlist, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt) |
epicsShareFunc int | devPCIToLocalAddr (const epicsPCIDevice *id, unsigned int bar, volatile void **ppLocalAddr, unsigned int opt) |
Get pointer to PCI BAR. More... | |
epicsShareFunc int | devPCIBarLen (const epicsPCIDevice *id, unsigned int bar, epicsUInt32 *len) |
Find the size of a BAR. More... | |
epicsShareFunc int | devPCIConnectInterrupt (const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter, unsigned int opt) |
Request interrupts for device. More... | |
epicsShareFunc int | devPCIDisconnectInterrupt (const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter) |
Stop receiving interrupts. More... | |
epicsShareFunc void | devPCIShow (int lvl, int vendor, int device, int exact) |
epicsShareFunc void | devPCIShowMatch (int lvl, const char *spec, int vendor, int device) |
epicsShareFunc void | devPCIShowDevice (int lvl, const epicsPCIDevice *dev) |
epicsShareFunc int | devLibPCIUse (const char *name) |
Select driver implementation. Pick driver implementation by name, or NULL to use default. If no selection is made then the default will be used if available. More... | |
epicsShareFunc const char * | devLibPCIDriverName () |
epicsShareFunc int | devPCIConfigRead8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 *pResult) |
Read byte from configuration space. More... | |
epicsShareFunc int | devPCIConfigRead16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 *pResult) |
Read (16-bit) word from configuration space. More... | |
epicsShareFunc int | devPCIConfigRead32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 *pResult) |
Read (32-bit) dword from configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 value) |
Write byte to configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 value) |
Write (16-bit) word from configuration space. More... | |
epicsShareFunc int | devPCIConfigWrite32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 value) |
Write (32-bit) dword from configuration space. More... | |
epicsShareFunc int | devPCIEnableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsShareFunc int | devPCIDisableInterrupt (const epicsPCIDevice *dev) |
Enable interrupts at the device. More... | |
epicsShareFunc const char * | devPCIDeviceClassToString (int classId) |
Translate class id to string. More... | |
Variables | |
epicsShareExtern int | devPCIDebug |
Library to support PCI bus access
#define DEVLIB_MAP_UIO1TO1 0 |
Definition at line 232 of file devLibPCI.h.
#define DEVLIB_MAP_UIOCOMPACT 0 |
Definition at line 233 of file devLibPCI.h.
#define DEVLIBPCI_MAJOR 1 |
API major version.
Definition at line 30 of file devLibPCI.h.
#define DEVLIBPCI_MINOR 3 |
API minor version.
Definition at line 31 of file devLibPCI.h.
#define DEVPCI_ANY_CLASS 0x1000000 |
Definition at line 66 of file devLibPCI.h.
#define DEVPCI_ANY_DEVICE 0x10000 |
Definition at line 62 of file devLibPCI.h.
#define DEVPCI_ANY_REVISION 0x100 |
Definition at line 67 of file devLibPCI.h.
#define DEVPCI_ANY_SUBDEVICE 0x10000 |
Definition at line 64 of file devLibPCI.h.
#define DEVPCI_ANY_SUBVENDOR 0x10000 |
Definition at line 65 of file devLibPCI.h.
#define DEVPCI_ANY_VENDOR 0x10000 |
Definition at line 63 of file devLibPCI.h.
#define DEVPCI_DEVICE_ANY | ( | ) |
Definition at line 74 of file devLibPCI.h.
#define DEVPCI_DEVICE_VENDOR | ( | dev, | |
vend | |||
) |
Definition at line 79 of file devLibPCI.h.
#define DEVPCI_DEVICE_VENDOR_CLASS | ( | dev, | |
vend, | |||
pclass | |||
) |
Definition at line 83 of file devLibPCI.h.
#define DEVPCI_END {DEVPCI_LAST_DEVICE,0,0,0,0,0} |
The last item in a list of PCI IDS.
Definition at line 72 of file devLibPCI.h.
#define DEVPCI_LAST_DEVICE 0xffff0000 |
Definition at line 69 of file devLibPCI.h.
#define DEVPCI_NO_SLOT NULL |
Definition at line 95 of file devLibPCI.h.
#define DEVPCI_SUBDEVICE_SUBVENDOR | ( | dev, | |
vend, | |||
sdev, | |||
svend | |||
) |
Definition at line 87 of file devLibPCI.h.
#define DEVPCI_SUBDEVICE_SUBVENDOR_CLASS | ( | dev, | |
vend, | |||
sdev, | |||
svend, | |||
revision, | |||
pclass | |||
) |
Definition at line 91 of file devLibPCI.h.
#define PCIBARCOUNT NELEMENTS( ((epicsPCIDevice*)0)->bar ) |
The maximum number of base address registers (BARs).
Definition at line 126 of file devLibPCI.h.
typedef int(* devPCISearchFn) (void *ptr, const epicsPCIDevice *dev) |
PCI search callback prototype.
ptr | User pointer |
dev | PCI device pointer |
Definition at line 136 of file devLibPCI.h.
epicsShareFunc const char* devLibPCIDriverName | ( | ) |
Definition at line 138 of file devLibPCI.c.
epicsShareFunc int devLibPCIUse | ( | const char * | name | ) |
Select driver implementation. Pick driver implementation by name, or NULL to use default. If no selection is made then the default will be used if available.
name | An implementation name |
Definition at line 107 of file devLibPCI.c.
epicsShareFunc int devPCIBarLen | ( | const epicsPCIDevice * | id, |
unsigned int | bar, | ||
epicsUInt32 * | len | ||
) |
Find the size of a BAR.
Returns the size (in bytes) of the region visible through the given BAR.
id | PCI device pointer | |
bar | BAR number | |
[out] | len | BAR size in bytes |
Definition at line 449 of file devLibPCI.c.
epicsShareFunc int devPCIConfigRead16 | ( | const epicsPCIDevice * | dev, |
unsigned | offset, | ||
epicsUInt16 * | pResult | ||
) |
Read (16-bit) word from configuration space.
dev | A PCI device handle |
offset | Offset into configuration space (must be 16-bit aligned) |
pResult | Pointer to where result is to be written |
Definition at line 609 of file devLibPCI.c.
epicsShareFunc int devPCIConfigRead32 | ( | const epicsPCIDevice * | dev, |
unsigned | offset, | ||
epicsUInt32 * | pResult | ||
) |
Read (32-bit) dword from configuration space.
dev | A PCI device handle |
offset | Offset into configuration space (must be 32-bit aligned) |
pResult | Pointer to where result is to be written |
Definition at line 615 of file devLibPCI.c.
epicsShareFunc int devPCIConfigRead8 | ( | const epicsPCIDevice * | dev, |
unsigned | offset, | ||
epicsUInt8 * | pResult | ||
) |
Read byte from configuration space.
dev | A PCI device handle |
offset | Offset into configuration space |
pResult | Pointer to where result is to be written |
Definition at line 603 of file devLibPCI.c.
epicsShareFunc int devPCIConfigWrite16 | ( | const epicsPCIDevice * | dev, |
unsigned | offset, | ||
epicsUInt16 | value | ||
) |
Write (16-bit) word from configuration space.
dev | A PCI device handle |
offset | Offset into configuration space (must be 16-bit aligned) |
value | Value to be written |
Definition at line 627 of file devLibPCI.c.
epicsShareFunc int devPCIConfigWrite32 | ( | const epicsPCIDevice * | dev, |
unsigned | offset, | ||
epicsUInt32 | value | ||
) |
Write (32-bit) dword from configuration space.
dev | A PCI device handle |
offset | Offset into configuration space (must be 32-bit aligned) |
value | Value to be written |
Definition at line 633 of file devLibPCI.c.
epicsShareFunc int devPCIConfigWrite8 | ( | const epicsPCIDevice * | dev, |
unsigned | offset, | ||
epicsUInt8 | value | ||
) |
Write byte to configuration space.
dev | A PCI device handle |
offset | Offset into configuration space |
value | Value to be written |
Definition at line 621 of file devLibPCI.c.
epicsShareFunc int devPCIConnectInterrupt | ( | const epicsPCIDevice * | id, |
void(*)(void *) | pFunction, | ||
void * | parameter, | ||
unsigned int | opt | ||
) |
Request interrupts for device.
Request that the provided callback be invoked whenever the device asserts an interrupt.
id | PCI device pointer |
pFunction | User ISR |
parameter | User pointer |
opt | Modifiers. Currently unused |
Definition at line 463 of file devLibPCI.c.
epicsShareFunc const char* devPCIDeviceClassToString | ( | int | classId | ) |
Translate class id to string.
classId | PCI class Id |
Definition at line 7 of file devLibPCIStrings.c.
epicsShareFunc int devPCIDisableInterrupt | ( | const epicsPCIDevice * | dev | ) |
Enable interrupts at the device.
dev | A PCI device handle |
Definition at line 649 of file devLibPCI.c.
epicsShareFunc int devPCIDisconnectInterrupt | ( | const epicsPCIDevice * | id, |
void(*)(void *) | pFunction, | ||
void * | parameter | ||
) |
Stop receiving interrupts.
Use the same arguments passed to devPCIConnectInterrupt()
id | PCI device pointer |
pFunction | User ISR |
parameter | User pointer |
Definition at line 476 of file devLibPCI.c.
epicsShareFunc int devPCIEnableInterrupt | ( | const epicsPCIDevice * | dev | ) |
Enable interrupts at the device.
dev | A PCI device handle |
Definition at line 640 of file devLibPCI.c.
epicsShareFunc int devPCIFindBDF | ( | const epicsPCIID * | idlist, |
unsigned int | b, | ||
unsigned int | d, | ||
unsigned int | f, | ||
const epicsPCIDevice ** | found, | ||
unsigned int | opt | ||
) |
Definition at line 418 of file devLibPCI.c.
epicsShareFunc int devPCIFindCB | ( | const epicsPCIID * | idlist, |
devPCISearchFn | searchfn, | ||
void * | arg, | ||
unsigned int | opt | ||
) |
PCI bus search w/ callback.
Iterate through all devices in the system and invoke the provided callback for those matching an entry in the provided ID list.
Iteration will stop when the callback returns a non-zero value. If the callback returns 1 this call will return 0. Any other value will be returned without modification.
idlist | List of PCI identifiers |
searchfn | User callback |
arg | User pointer |
opt | Modifiers. Currently unused |
Definition at line 214 of file devLibPCI.c.
epicsShareFunc int devPCIFindDBDF | ( | const epicsPCIID * | idlist, |
unsigned int | domain, | ||
unsigned int | b, | ||
unsigned int | d, | ||
unsigned int | f, | ||
const epicsPCIDevice ** | found, | ||
unsigned int | opt | ||
) |
PCI bus probe.
Probe and test a single address. If it matches, the corresponding epicsPCIDevice instance is stored in 'found'.
If no compatible device is present the call returns S_dev_noDevice.
idlist | List of PCI identifiers | |
domain | domain | |
b | bus | |
d | device | |
f | function | |
[out] | found | On success the result is stored here |
opt | Modifiers. Currently unused |
Definition at line 376 of file devLibPCI.c.
epicsShareFunc int devPCIFindSpec | ( | const epicsPCIID * | idlist, |
const char * | spec, | ||
const epicsPCIDevice ** | found, | ||
unsigned int | opt | ||
) |
PCI bus search by specification string.
Search for a device on the bus matching the given specification string, which is a space seperated list of the following:
Some targets do not support some match types (eg. only Linux matches slot numbers).
idlist | List of PCI identifiers | |
spec | specification string | |
[out] | found | On success the result is stored here |
opt | Modifiers. Currently unused |
Definition at line 267 of file devLibPCI.c.
epicsShareFunc void devPCIShow | ( | int | lvl, |
int | vendor, | ||
int | device, | ||
int | exact | ||
) |
Definition at line 504 of file devLibPCI.c.
epicsShareFunc void devPCIShowDevice | ( | int | lvl, |
const epicsPCIDevice * | dev | ||
) |
Definition at line 541 of file devLibPCI.c.
epicsShareFunc void devPCIShowMatch | ( | int | lvl, |
const char * | spec, | ||
int | vendor, | ||
int | device | ||
) |
Definition at line 522 of file devLibPCI.c.
epicsShareFunc int devPCIToLocalAddr | ( | const epicsPCIDevice * | id, |
unsigned int | bar, | ||
volatile void ** | ppLocalAddr, | ||
unsigned int | opt | ||
) |
Get pointer to PCI BAR.
Map a PCI BAR into the local process address space.
The opt argument is used to modify the mapping process. Currently only two (mutually exclusive) flags are supported which are only used by the Linux UIO bus implementation to control how requested BAR #s are mapped to UIO region numbers.
id | PCI device pointer | |
bar | BAR number | |
[out] | ppLocalAddr | Pointer to start of BAR |
opt | Modifiers. 0 or bitwise OR of one or more DEVLIB_MAP_* macros |
Definition at line 431 of file devLibPCI.c.
epicsShareExtern int devPCIDebug |
Definition at line 354 of file devLibPCI.h.