11 #ifndef DEVLIBPCI_H_INC 12 #define DEVLIBPCI_H_INC 1 15 #include <epicsTypes.h> 30 #define DEVLIBPCI_MAJOR 1 31 #define DEVLIBPCI_MINOR 3 62 #define DEVPCI_ANY_DEVICE 0x10000 63 #define DEVPCI_ANY_VENDOR 0x10000 64 #define DEVPCI_ANY_SUBDEVICE 0x10000 65 #define DEVPCI_ANY_SUBVENDOR 0x10000 66 #define DEVPCI_ANY_CLASS 0x1000000 67 #define DEVPCI_ANY_REVISION 0x100 69 #define DEVPCI_LAST_DEVICE 0xffff0000 72 #define DEVPCI_END {DEVPCI_LAST_DEVICE,0,0,0,0,0} 74 #define DEVPCI_DEVICE_ANY() \ 75 { DEVPCI_ANY_DEVICE, DEVPCI_ANY_VENDOR, \ 76 DEVPCI_ANY_SUBDEVICE, DEVPCI_ANY_SUBVENDOR, \ 77 DEVPCI_ANY_CLASS, DEVPCI_ANY_REVISION } 79 #define DEVPCI_DEVICE_VENDOR(dev,vend) \ 80 { dev, vend, DEVPCI_ANY_SUBDEVICE, DEVPCI_ANY_SUBVENDOR, \ 81 DEVPCI_ANY_CLASS, DEVPCI_ANY_REVISION } 83 #define DEVPCI_DEVICE_VENDOR_CLASS(dev,vend,pclass) \ 84 { dev, vend, DEVPCI_ANY_SUBDEVICE, DEVPCI_ANY_SUBVENDOR, \ 85 pclass, DEVPCI_ANY_REVISION } 87 #define DEVPCI_SUBDEVICE_SUBVENDOR(dev,vend,sdev,svend) \ 88 { dev, vend, sdev, svend, \ 89 DEVPCI_ANY_CLASS, DEVPCI_ANY_REVISION } 91 #define DEVPCI_SUBDEVICE_SUBVENDOR_CLASS(dev,vend,sdev,svend,revision,pclass) \ 92 { dev, vend, sdev, svend, \ 95 #define DEVPCI_NO_SLOT NULL 116 unsigned int function;
126 #define PCIBARCOUNT NELEMENTS( ((epicsPCIDevice*)0)->bar ) 228 #define DEVLIB_MAP_UIO1TO1 0 229 #define DEVLIB_MAP_UIOCOMPACT 1 232 #define DEVLIB_MAP_UIO1TO1 0 233 #define DEVLIB_MAP_UIOCOMPACT 0 261 volatile void **ppLocalAddr,
308 void (*pFunction)(
void *),
324 void (*pFunction)(
void *),
330 devPCIShow(
int lvl,
int vendor,
int device,
int exact);
int(* devPCISearchFn)(void *ptr, const epicsPCIDevice *dev)
PCI search callback prototype.
epicsShareFunc int devPCIEnableInterrupt(const epicsPCIDevice *dev)
Enable interrupts at the device.
epicsShareFunc const char * devLibPCIDriverName()
epicsShareFunc int devPCIConnectInterrupt(const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter, unsigned int opt)
Request interrupts for device.
epicsShareFunc int devPCIConfigWrite32(const epicsPCIDevice *dev, unsigned offset, epicsUInt32 value)
Write (32-bit) dword from configuration space.
epicsShareFunc int devPCIDisableInterrupt(const epicsPCIDevice *dev)
Enable interrupts at the device.
epicsShareFunc int devPCIConfigWrite16(const epicsPCIDevice *dev, unsigned offset, epicsUInt16 value)
Write (16-bit) word from configuration space.
epicsShareFunc int devPCIConfigRead8(const epicsPCIDevice *dev, unsigned offset, epicsUInt8 *pResult)
Read byte from configuration space.
epicsShareFunc int devPCIToLocalAddr(const epicsPCIDevice *id, unsigned int bar, volatile void **ppLocalAddr, unsigned int opt)
Get pointer to PCI BAR.
epicsShareFunc void devPCIShowDevice(int lvl, const epicsPCIDevice *dev)
epicsShareFunc void devPCIShowMatch(int lvl, const char *spec, int vendor, int device)
epicsShareFunc int devPCIConfigRead16(const epicsPCIDevice *dev, unsigned offset, epicsUInt16 *pResult)
Read (16-bit) word from configuration space.
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.
epicsShareFunc int devPCIFindSpec(const epicsPCIID *idlist, const char *spec, const epicsPCIDevice **found, unsigned int opt)
PCI bus search by specification string.
epicsShareFunc int devPCIDisconnectInterrupt(const epicsPCIDevice *id, void(*pFunction)(void *), void *parameter)
Stop receiving interrupts.
epicsShareFunc int devPCIConfigWrite8(const epicsPCIDevice *dev, unsigned offset, epicsUInt8 value)
Write byte to configuration space.
epicsShareFunc int devPCIFindBDF(const epicsPCIID *idlist, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt)
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.
epicsShareFunc const char * devPCIDeviceClassToString(int classId)
Translate class id to string.
epicsShareFunc void devPCIShow(int lvl, int vendor, int device, int exact)
epicsShareFunc int devPCIBarLen(const epicsPCIDevice *id, unsigned int bar, epicsUInt32 *len)
Find the size of a BAR.
epicsPCIID id
Exact ID of device.
epicsShareFunc int devPCIConfigRead32(const epicsPCIDevice *dev, unsigned offset, epicsUInt32 *pResult)
Read (32-bit) dword from configuration space.
epicsShareExtern int devPCIDebug
epicsShareFunc int devPCIFindCB(const epicsPCIID *idlist, devPCISearchFn searchfn, void *arg, unsigned int opt)
PCI bus search w/ callback.