devLib2  2.11
Data Structures | Macros | Functions | Variables
devLibPCI.c File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ellLib.h>
#include <errlog.h>
#include <epicsThread.h>
#include <epicsMutex.h>
#include <iocsh.h>
#include <epicsStdio.h>
#include "devLibPCIImpl.h"
#include "devLibPCI.h"
#include <epicsExport.h>

Go to the source code of this file.

Data Structures

struct  bdfmatch
 
struct  searchinfo
 

Macros

#define epicsExportSharedSymbols
 
#define CONTAINER(ptr, structure, member)   ((structure*)((char*)(ptr) - offsetof(structure, member)))
 
#define PCIINIT
 

Functions

int devLibPCIRegisterDriver2 (devLibPCI *drv, size_t drvsize)
 
int devLibPCIUse (const char *use)
 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...
 
const char * devLibPCIDriverName ()
 
int devLibPCIMatch (const epicsPCIID *match, const epicsPCIID *dev)
 
int devPCIFindCB (const epicsPCIID *idlist, devPCISearchFn searchfn, void *arg, unsigned int opt)
 PCI bus search w/ callback. More...
 
int devPCIFindSpec (const epicsPCIID *idlist, const char *spec, const epicsPCIDevice **found, unsigned int opt)
 PCI bus search by specification string. More...
 
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...
 
int devPCIFindBDF (const epicsPCIID *idlist, unsigned int b, unsigned int d, unsigned int f, const epicsPCIDevice **found, unsigned int opt)
 
int devPCIToLocalAddr (const epicsPCIDevice *curdev, unsigned int bar, volatile void **ppLocalAddr, unsigned int opt)
 Get pointer to PCI BAR. More...
 
int devPCIBarLen (const epicsPCIDevice *curdev, unsigned int bar, epicsUInt32 *len)
 Find the size of a BAR. More...
 
int devPCIConnectInterrupt (const epicsPCIDevice *curdev, void(*pFunction)(void *), void *parameter, unsigned int opt)
 Request interrupts for device. More...
 
int devPCIDisconnectInterrupt (const epicsPCIDevice *curdev, void(*pFunction)(void *), void *parameter)
 Stop receiving interrupts. More...
 
void devPCIShow (int lvl, int vendor, int device, int exact)
 
void devPCIShowMatch (int lvl, const char *spec, int vendor, int device)
 
void devPCIShowDevice (int lvl, const epicsPCIDevice *dev)
 
int devPCIConfigRead8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 *pResult)
 Read byte from configuration space. More...
 
int devPCIConfigRead16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 *pResult)
 Read (16-bit) word from configuration space. More...
 
int devPCIConfigRead32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 *pResult)
 Read (32-bit) dword from configuration space. More...
 
int devPCIConfigWrite8 (const epicsPCIDevice *dev, unsigned offset, epicsUInt8 value)
 Write byte to configuration space. More...
 
int devPCIConfigWrite16 (const epicsPCIDevice *dev, unsigned offset, epicsUInt16 value)
 Write (16-bit) word from configuration space. More...
 
int devPCIConfigWrite32 (const epicsPCIDevice *dev, unsigned offset, epicsUInt32 value)
 Write (32-bit) dword from configuration space. More...
 
int devPCIEnableInterrupt (const epicsPCIDevice *dev)
 Enable interrupts at the device. More...
 
int devPCIDisableInterrupt (const epicsPCIDevice *dev)
 Enable interrupts at the device. More...
 
 epicsExportRegistrar (devLibPCIIOCSH)
 
 epicsExportAddress (int, devPCIDebug)
 

Variables

int devPCIDebug = 0
 

Macro Definition Documentation

◆ CONTAINER

#define CONTAINER (   ptr,
  structure,
  member 
)    ((structure*)((char*)(ptr) - offsetof(structure, member)))

Definition at line 33 of file devLibPCI.c.

◆ epicsExportSharedSymbols

#define epicsExportSharedSymbols

Definition at line 22 of file devLibPCI.c.

◆ PCIINIT

#define PCIINIT
Value:
do { \
epicsThreadOnce(&devPCIInit_once, &devInit, NULL); \
if (devPCIInit_result) return devPCIInit_result; \
} while(0)

Definition at line 205 of file devLibPCI.c.

Function Documentation

◆ devLibPCIMatch()

int devLibPCIMatch ( const epicsPCIID match,
const epicsPCIID dev 
)

Helper for implementing devLibPCI::pDevPCIFind()

Returns true if the given match (which may include DEVPCI_ANY_* wildcards) matches the given device (which may not).

Definition at line 153 of file devLibPCI.c.

◆ devLibPCIRegisterDriver2()

int devLibPCIRegisterDriver2 ( devLibPCI drv,
size_t  drvsize 
)

Definition at line 70 of file devLibPCI.c.

◆ epicsExportAddress()

epicsExportAddress ( int  ,
devPCIDebug   
)

◆ epicsExportRegistrar()

epicsExportRegistrar ( devLibPCIIOCSH  )

Variable Documentation

◆ devPCIDebug

int devPCIDebug = 0

Definition at line 48 of file devLibPCI.c.