VME Device Drivers¶
Driver registration¶
As with other subsystems within the Linux kernel, VME device drivers registerwith the VME subsystem, typically called from the devices init routine. This isachieved via a call tovme_register_driver().
A pointer to a structure of typestructvme_driver mustbe provided to the registration function. Along with the maximum number ofdevices your driver is able to support.
At the minimum, the ‘.name’, ‘.match’ and ‘.probe’ elements ofstructvme_driver should be correctly set. The ‘.name’element is a pointer to a string holding the device driver’s name.
The ‘.match’ function allows control over which VME devices should be registeredwith the driver. The match function should return 1 if a device should beprobed and 0 otherwise. This example match function (from vme_user.c) limitsthe number of devices probed to one:
#define USER_BUS_MAX 1...staticintvme_user_match(structvme_dev*vdev){if(vdev->id.num>=USER_BUS_MAX)return0;return1;}
The ‘.probe’ element should contain a pointer to the probe routine. Theprobe routine is passed astructvme_dev pointer as anargument.
Here, the ‘num’ field refers to the sequential device ID for this specificdriver. The bridge number (or bus number) can be accessed usingdev->bridge->num.
A function is also provided to unregister the driver from the VME core calledvme_unregister_driver() and should usually be called from the devicedriver’s exit routine.
Resource management¶
Once a driver has registered with the VME core the provided match routine willbe called the number of times specified during the registration. If a matchsucceeds, a non-zero value should be returned. A zero return value indicatesfailure. For all successful matches, the probe routine of the correspondingdriver is called. The probe routine is passed a pointer to the devicesdevice structure. This pointer should be saved, it will be required forrequesting VME resources.
The driver can request ownership of one or more master windows(vme_master_request()), slave windows (vme_slave_request())and/or dma channels (vme_dma_request()). Rather than allowing the devicedriver to request a specific window or DMA channel (which may be used by adifferent driver) the API allows a resource to be assigned based on the requiredattributes of the driver in question. For slave windows these attributes aresplit into the VME address spaces that need to be accessed in ‘aspace’ and VMEbus cycle types required in ‘cycle’. Master windows add a further set ofattributes in ‘width’ specifying the required data transfer widths. Theseattributes are defined as bitmasks and as such any combination of theattributes can be requested for a single window, the core will assign a windowthat meets the requirements, returning a pointer of type vme_resource thatshould be used to identify the allocated resource when it is used. For DMAcontrollers, the request function requires the potential direction of anytransfers to be provided in the route attributes. This is typically VME-to-MEMand/or MEM-to-VME, though some hardware can support VME-to-VME and MEM-to-MEMtransfers as well as test pattern generation. If an unallocated window fittingthe requirements can not be found a NULL pointer will be returned.
Functions are also provided to free window allocations once they are no longerrequired. These functions (vme_master_free(),vme_slave_free()andvme_dma_free()) should be passed the pointer to the resourceprovided during resource allocation.
Master windows¶
Master windows provide access from the local processor[s] out onto the VME bus.The number of windows available and the available access modes is dependent onthe underlying chipset. A window must be configured before it can be used.
Master window configuration¶
Once a master window has been assignedvme_master_set() can be used toconfigure it andvme_master_get() to retrieve the current settings. Theaddress spaces, transfer widths and cycle types are the same as describedunder resource management, however some of the options are mutually exclusive.For example, only one address space may be specified.
Master window access¶
The functionvme_master_read() can be used to read from andvme_master_write() used to write to configured master windows.
In addition to simple reads and writes,vme_master_rmw() is provided todo a read-modify-write transaction. Parts of a VME window can also be mappedinto user space memory usingvme_master_mmap().
Slave windows¶
Slave windows provide devices on the VME bus access into mapped portions of thelocal memory. The number of windows available and the access modes that can beused is dependent on the underlying chipset. A window must be configured beforeit can be used.
Slave window configuration¶
Once a slave window has been assignedvme_slave_set() can be used toconfigure it andvme_slave_get() to retrieve the current settings.
The address spaces, transfer widths and cycle types are the same as describedunder resource management, however some of the options are mutually exclusive.For example, only one address space may be specified.
Slave window buffer allocation¶
Functions are provided to allow the user to allocate(vme_alloc_consistent()) and free (vme_free_consistent())contiguous buffers which will be accessible by the VME bridge. These functionsdo not have to be used, other methods can be used to allocate a buffer, thoughcare must be taken to ensure that they are contiguous and accessible by the VMEbridge.
Slave window access¶
Slave windows map local memory onto the VME bus, the standard methods foraccessing memory should be used.
DMA channels¶
The VME DMA transfer provides the ability to run link-list DMA transfers. TheAPI introduces the concept of DMA lists. Each DMA list is a link-list which canbe passed to a DMA controller. Multiple lists can be created, extended,executed, reused and destroyed.
List Management¶
The functionvme_new_dma_list() is provided to create andvme_dma_list_free() to destroy DMA lists. Execution of a list will notautomatically destroy the list, thus enabling a list to be reused for repetitivetasks.
List Population¶
An item can be added to a list usingvme_dma_list_add() (the source anddestination attributes need to be created before calling this function, this iscovered under “Transfer Attributes”).
Note
The detailed attributes of the transfers source and destinationare not checked until an entry is added to a DMA list, the requestfor a DMA channel purely checks the directions in which thecontroller is expected to transfer data. As a result it ispossible for this call to return an error, for example if thesource or destination is in an unsupported VME address space.
Transfer Attributes¶
The attributes for the source and destination are handled separately from addingan item to a list. This is due to the diverse attributes required for each typeof source and destination. There are functions to create attributes for PCI, VMEand pattern sources and destinations (where appropriate):
PCI source or destination:
vme_dma_pci_attribute()VME source or destination:
vme_dma_vme_attribute()Pattern source:
vme_dma_pattern_attribute()
The functionvme_dma_free_attribute() should be used to free anattribute.
List Execution¶
The functionvme_dma_list_exec() queues a list for execution and willreturn once the list has been executed.
Interrupts¶
The VME API provides functions to attach and detach callbacks to specific VMElevel and status ID combinations and for the generation of VME interrupts withspecific VME level and status IDs.
Attaching Interrupt Handlers¶
The functionvme_irq_request() can be used to attach andvme_irq_free() to free a specific VME level and status ID combination.Any given combination can only be assigned a single callback function. A voidpointer parameter is provided, the value of which is passed to the callbackfunction, the use of this pointer is user undefined. The callback parameters areas follows. Care must be taken in writing a callback function, callbackfunctions run in interrupt context:
voidcallback(intlevel,intstatid,void*priv);
Interrupt Generation¶
The functionvme_irq_generate() can be used to generate a VME interruptat a given VME level and VME status ID.
Location monitors¶
The VME API provides the following functionality to configure the locationmonitor.
Location Monitor Management¶
The functionvme_lm_request() is provided to request the use of a blockof location monitors andvme_lm_free() to free them after they are nolonger required. Each block may provide a number of location monitors,monitoring adjacent locations. The functionvme_lm_count() can be usedto determine how many locations are provided.
Location Monitor Configuration¶
Once a bank of location monitors has been allocated, the functionvme_lm_set() is provided to configure the location and mode of thelocation monitor. The functionvme_lm_get() can be used to retrieveexisting settings.
Location Monitor Use¶
The functionvme_lm_attach() enables a callback to be attached andvme_lm_detach() allows on to be detached from each location monitorlocation. Each location monitor can monitor a number of adjacent locations. Thecallback function is declared as follows.
voidcallback(void*data);
Slot Detection¶
The functionvme_slot_num() returns the slot ID of the provided bridge.
Bus Detection¶
The functionvme_bus_num() returns the bus ID of the provided bridge.
VME API¶
- structvme_dev¶
Structure representing a VME device
Definition:
struct vme_dev { int num; struct vme_bridge *bridge; struct device dev; struct list_head drv_list; struct list_head bridge_list;};Members
numThe device number
bridgePointer to the bridge device this device is on
devInternal device structure
drv_listList of devices (per driver)
bridge_listList of devices (per bridge)
- structvme_driver¶
Structure representing a VME driver
Definition:
struct vme_driver { const char *name; int (*match)(struct vme_dev *); int (*probe)(struct vme_dev *); void (*remove)(struct vme_dev *); struct device_driver driver; struct list_head devices;};Members
nameDriver name, should be unique among VME drivers and usually the sameas the module name.
matchCallback used to determine whether probe should be run.
probeCallback for device binding, called when new device is detected.
removeCallback, called on device removal.
driverUnderlying generic device driver structure.
devicesList of VME devices (
structvme_dev) associated with this driver.
- void*vme_alloc_consistent(structvme_resource*resource,size_tsize,dma_addr_t*dma)¶
Allocate contiguous memory.
Parameters
structvme_resource*resourcePointer to VME resource.
size_tsizeSize of allocation required.
dma_addr_t*dmaPointer to variable to store physical address of allocation.
Description
Allocate a contiguous block of memory for use by the driver. This is used tocreate the buffers for the slave windows.
Return
Virtual address of allocation on success, NULL on failure.
- voidvme_free_consistent(structvme_resource*resource,size_tsize,void*vaddr,dma_addr_tdma)¶
Free previously allocated memory.
Parameters
structvme_resource*resourcePointer to VME resource.
size_tsizeSize of allocation to free.
void*vaddrVirtual address of allocation.
dma_addr_tdmaPhysical address of allocation.
Description
Free previously allocated block of contiguous memory.
- size_tvme_get_size(structvme_resource*resource)¶
Helper function returning size of a VME window
Parameters
structvme_resource*resourcePointer to VME slave or master resource.
Description
Determine the size of the VME window provided. This is a helperfunction, wrappering the call to vme_master_get or vme_slave_getdepending on the type of window resource handed to it.
Return
Size of the window on success, zero on failure.
- structvme_resource*vme_slave_request(structvme_dev*vdev,u32address,u32cycle)¶
Request a VME slave window resource.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.u32addressRequired VME address space.
u32cycleRequired VME data transfer cycle type.
Description
Request use of a VME window resource capable of being set for the requestedaddress space and data transfer cycle.
Return
Pointer to VME resource on success, NULL on failure.
- intvme_slave_set(structvme_resource*resource,intenabled,unsignedlonglongvme_base,unsignedlonglongsize,dma_addr_tbuf_base,u32aspace,u32cycle)¶
Set VME slave window configuration.
Parameters
structvme_resource*resourcePointer to VME slave resource.
intenabledState to which the window should be configured.
unsignedlonglongvme_baseBase address for the window.
unsignedlonglongsizeSize of the VME window.
dma_addr_tbuf_baseBased address of buffer used to provide VME slave window storage.
u32aspaceVME address space for the VME window.
u32cycleVME data transfer cycle type for the VME window.
Description
Set configuration for provided VME slave window.
Return
Zero on success, -EINVAL if operation is not supported on thisdevice, if an invalid resource has been provided or invalidattributes are provided. Hardware specific errors may also bereturned.
- intvme_slave_get(structvme_resource*resource,int*enabled,unsignedlonglong*vme_base,unsignedlonglong*size,dma_addr_t*buf_base,u32*aspace,u32*cycle)¶
Retrieve VME slave window configuration.
Parameters
structvme_resource*resourcePointer to VME slave resource.
int*enabledPointer to variable for storing state.
unsignedlonglong*vme_basePointer to variable for storing window base address.
unsignedlonglong*sizePointer to variable for storing window size.
dma_addr_t*buf_basePointer to variable for storing slave buffer base address.
u32*aspacePointer to variable for storing VME address space.
u32*cyclePointer to variable for storing VME data transfer cycle type.
Description
Return configuration for provided VME slave window.
Return
Zero on success, -EINVAL if operation is not supported on thisdevice or if an invalid resource has been provided.
- voidvme_slave_free(structvme_resource*resource)¶
Free VME slave window
Parameters
structvme_resource*resourcePointer to VME slave resource.
Description
Free the provided slave resource so that it may be reallocated.
- structvme_resource*vme_master_request(structvme_dev*vdev,u32address,u32cycle,u32dwidth)¶
Request a VME master window resource.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.u32addressRequired VME address space.
u32cycleRequired VME data transfer cycle type.
u32dwidthRequired VME data transfer width.
Description
Request use of a VME window resource capable of being set for the requestedaddress space, data transfer cycle and width.
Return
Pointer to VME resource on success, NULL on failure.
- intvme_master_set(structvme_resource*resource,intenabled,unsignedlonglongvme_base,unsignedlonglongsize,u32aspace,u32cycle,u32dwidth)¶
Set VME master window configuration.
Parameters
structvme_resource*resourcePointer to VME master resource.
intenabledState to which the window should be configured.
unsignedlonglongvme_baseBase address for the window.
unsignedlonglongsizeSize of the VME window.
u32aspaceVME address space for the VME window.
u32cycleVME data transfer cycle type for the VME window.
u32dwidthVME data transfer width for the VME window.
Description
Set configuration for provided VME master window.
Return
Zero on success, -EINVAL if operation is not supported on thisdevice, if an invalid resource has been provided or invalidattributes are provided. Hardware specific errors may also bereturned.
- intvme_master_get(structvme_resource*resource,int*enabled,unsignedlonglong*vme_base,unsignedlonglong*size,u32*aspace,u32*cycle,u32*dwidth)¶
Retrieve VME master window configuration.
Parameters
structvme_resource*resourcePointer to VME master resource.
int*enabledPointer to variable for storing state.
unsignedlonglong*vme_basePointer to variable for storing window base address.
unsignedlonglong*sizePointer to variable for storing window size.
u32*aspacePointer to variable for storing VME address space.
u32*cyclePointer to variable for storing VME data transfer cycle type.
u32*dwidthPointer to variable for storing VME data transfer width.
Description
Return configuration for provided VME master window.
Return
Zero on success, -EINVAL if operation is not supported on thisdevice or if an invalid resource has been provided.
- ssize_tvme_master_read(structvme_resource*resource,void*buf,size_tcount,loff_toffset)¶
Read data from VME space into a buffer.
Parameters
structvme_resource*resourcePointer to VME master resource.
void*bufPointer to buffer where data should be transferred.
size_tcountNumber of bytes to transfer.
loff_toffsetOffset into VME master window at which to start transfer.
Description
Perform read of count bytes of data from location on VME bus which maps intothe VME master window at offset to buf.
Return
Number of bytes read, -EINVAL if resource is not a VME masterresource or read operation is not supported. -EFAULT returned ifinvalid offset is provided. Hardware specific errors may also bereturned.
- ssize_tvme_master_write(structvme_resource*resource,void*buf,size_tcount,loff_toffset)¶
Write data out to VME space from a buffer.
Parameters
structvme_resource*resourcePointer to VME master resource.
void*bufPointer to buffer holding data to transfer.
size_tcountNumber of bytes to transfer.
loff_toffsetOffset into VME master window at which to start transfer.
Description
Perform write of count bytes of data from buf to location on VME bus whichmaps into the VME master window at offset.
Return
Number of bytes written, -EINVAL if resource is not a VME masterresource or write operation is not supported. -EFAULT returned ifinvalid offset is provided. Hardware specific errors may also bereturned.
- unsignedintvme_master_rmw(structvme_resource*resource,unsignedintmask,unsignedintcompare,unsignedintswap,loff_toffset)¶
Perform read-modify-write cycle.
Parameters
structvme_resource*resourcePointer to VME master resource.
unsignedintmaskBits to be compared and swapped in operation.
unsignedintcompareBits to be compared with data read from offset.
unsignedintswapBits to be swapped in data read from offset.
loff_toffsetOffset into VME master window at which to perform operation.
Description
Perform read-modify-write cycle on provided location:- Location on VME bus is read.- Bits selected by mask are compared with compare.- Where a selected bit matches that in compare and are selected in swap,the bit is swapped.- Result written back to location on VME bus.
Return
Bytes written on success, -EINVAL if resource is not a VME masterresource or RMW operation is not supported. Hardware specificerrors may also be returned.
- intvme_master_mmap(structvme_resource*resource,structvm_area_struct*vma)¶
Mmap region of VME master window.
Parameters
structvme_resource*resourcePointer to VME master resource.
structvm_area_struct*vmaPointer to definition of user mapping.
Description
Memory map a region of the VME master window into user space.
Return
Zero on success, -EINVAL if resource is not a VME masterresource or -EFAULT if map exceeds window size. Other generic mmaperrors may also be returned.
- voidvme_master_free(structvme_resource*resource)¶
Free VME master window
Parameters
structvme_resource*resourcePointer to VME master resource.
Description
Free the provided master resource so that it may be reallocated.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.u32routeRequired src/destination combination.
Description
Request a VME DMA controller with capability to perform transfers betweenrequested source/destination combination.
Return
Pointer to VME DMA resource on success, NULL on failure.
- structvme_dma_list*vme_new_dma_list(structvme_resource*resource)¶
Create new VME DMA list.
Parameters
structvme_resource*resourcePointer to VME DMA resource.
Description
Create a new VME DMA list. It is the responsibility of the user to freethe list once it is no longer required withvme_dma_list_free().
Return
Pointer to new VME DMA list, NULL on allocation failure or invalidVME DMA resource.
- structvme_dma_attr*vme_dma_pattern_attribute(u32pattern,u32type)¶
Create “Pattern” type VME DMA list attribute.
Parameters
u32patternValue to use used as pattern
u32typeType of pattern to be written.
Description
Create VME DMA list attribute for pattern generation. It is theresponsibility of the user to free used attributes usingvme_dma_free_attribute().
Return
Pointer to VME DMA attribute, NULL on failure.
- structvme_dma_attr*vme_dma_pci_attribute(dma_addr_taddress)¶
Create “PCI” type VME DMA list attribute.
Parameters
dma_addr_taddressPCI base address for DMA transfer.
Description
Create VME DMA list attribute pointing to a location on PCI for DMAtransfers. It is the responsibility of the user to free used attributesusingvme_dma_free_attribute().
Return
Pointer to VME DMA attribute, NULL on failure.
- structvme_dma_attr*vme_dma_vme_attribute(unsignedlonglongaddress,u32aspace,u32cycle,u32dwidth)¶
Create “VME” type VME DMA list attribute.
Parameters
unsignedlonglongaddressVME base address for DMA transfer.
u32aspaceVME address space to use for DMA transfer.
u32cycleVME bus cycle to use for DMA transfer.
u32dwidthVME data width to use for DMA transfer.
Description
Create VME DMA list attribute pointing to a location on the VME bus for DMAtransfers. It is the responsibility of the user to free used attributesusingvme_dma_free_attribute().
Return
Pointer to VME DMA attribute, NULL on failure.
- voidvme_dma_free_attribute(structvme_dma_attr*attributes)¶
Free DMA list attribute.
Parameters
structvme_dma_attr*attributesPointer to DMA list attribute.
Description
Free VME DMA list attribute. VME DMA list attributes can be safely freedoncevme_dma_list_add() has returned.
- intvme_dma_list_add(structvme_dma_list*list,structvme_dma_attr*src,structvme_dma_attr*dest,size_tcount)¶
Add entry to a VME DMA list.
Parameters
structvme_dma_list*listPointer to VME list.
structvme_dma_attr*srcPointer to DMA list attribute to use as source.
structvme_dma_attr*destPointer to DMA list attribute to use as destination.
size_tcountNumber of bytes to transfer.
Description
Add an entry to the provided VME DMA list. Entry requires pointers to sourceand destination DMA attributes and a count.
Please note, the attributes supported as source and destinations fortransfers are hardware dependent.
Return
Zero on success, -EINVAL if operation is not supported on thisdevice or if the link list has already been submitted for execution.Hardware specific errors also possible.
- intvme_dma_list_exec(structvme_dma_list*list)¶
Queue a VME DMA list for execution.
Parameters
structvme_dma_list*listPointer to VME list.
Description
Queue the provided VME DMA list for execution. The call will return once thelist has been executed.
Return
Zero on success, -EINVAL if operation is not supported on thisdevice. Hardware specific errors also possible.
- intvme_dma_list_free(structvme_dma_list*list)¶
Free a VME DMA list.
Parameters
structvme_dma_list*listPointer to VME list.
Description
Free the provided DMA list and all its entries.
Return
Zero on success, -EINVAL on invalid VME resource, -EBUSY if resourceis still in use. Hardware specific errors also possible.
- intvme_dma_free(structvme_resource*resource)¶
Free a VME DMA resource.
Parameters
structvme_resource*resourcePointer to VME DMA resource.
Description
Free the provided DMA resource so that it may be reallocated.
Return
Zero on success, -EINVAL on invalid VME resource, -EBUSY if resourceis still active.
- intvme_irq_request(structvme_dev*vdev,intlevel,intstatid,void(*callback)(int,int,void*),void*priv_data)¶
Request a specific VME interrupt.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.intlevelInterrupt priority being requested.
intstatidInterrupt vector being requested.
void(*callback)(int,int,void*)Pointer to callback function called when VME interrupt/vectorreceived.
void*priv_dataGeneric pointer that will be passed to the callback function.
Description
Request callback to be attached as a handler for VME interrupts with providedlevel and statid.
Return
Zero on success, -EINVAL on invalid vme device, level or if thefunction is not supported, -EBUSY if the level/statid combination isalready in use. Hardware specific errors also possible.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.intlevelInterrupt priority of interrupt being freed.
intstatidInterrupt vector of interrupt being freed.
Description
Remove previously attached callback from VME interrupt priority/vector.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.intlevelInterrupt priority at which to assert the interrupt.
intstatidInterrupt vector to associate with the interrupt.
Description
Generate a VME interrupt of the provided level and with the providedstatid.
Return
Zero on success, -EINVAL on invalid vme device, level or if thefunction is not supported. Hardware specific errors also possible.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.
Description
Allocate a location monitor resource to the driver. A location monitorallows the driver to monitor accesses to a contiguous number ofaddresses on the VME bus.
Return
Pointer to a VME resource on success or NULL on failure.
- intvme_lm_count(structvme_resource*resource)¶
Determine number of VME Addresses monitored
Parameters
structvme_resource*resourcePointer to VME location monitor resource.
Description
The number of contiguous addresses monitored is hardware dependent.Return the number of contiguous addresses monitored by thelocation monitor.
Return
Count of addresses monitored or -EINVAL when provided with aninvalid location monitor resource.
- intvme_lm_set(structvme_resource*resource,unsignedlonglonglm_base,u32aspace,u32cycle)¶
Configure location monitor
Parameters
structvme_resource*resourcePointer to VME location monitor resource.
unsignedlonglonglm_baseBase address to monitor.
u32aspaceVME address space to monitor.
u32cycleVME bus cycle type to monitor.
Description
Set the base address, address space and cycle type of accesses to bemonitored by the location monitor.
Return
Zero on success, -EINVAL when provided with an invalid locationmonitor resource or function is not supported. Hardware specificerrors may also be returned.
- intvme_lm_get(structvme_resource*resource,unsignedlonglong*lm_base,u32*aspace,u32*cycle)¶
Retrieve location monitor settings
Parameters
structvme_resource*resourcePointer to VME location monitor resource.
unsignedlonglong*lm_basePointer used to output the base address monitored.
u32*aspacePointer used to output the address space monitored.
u32*cyclePointer used to output the VME bus cycle type monitored.
Description
Retrieve the base address, address space and cycle type of accesses tobe monitored by the location monitor.
Return
Zero on success, -EINVAL when provided with an invalid locationmonitor resource or function is not supported. Hardware specificerrors may also be returned.
- intvme_lm_attach(structvme_resource*resource,intmonitor,void(*callback)(void*),void*data)¶
Provide callback for location monitor address
Parameters
structvme_resource*resourcePointer to VME location monitor resource.
intmonitorOffset to which callback should be attached.
void(*callback)(void*)Pointer to callback function called when triggered.
void*dataGeneric pointer that will be passed to the callback function.
Description
Attach a callback to the specified offset into the location monitorsmonitored addresses. A generic pointer is provided to allow data to bepassed to the callback when called.
Return
Zero on success, -EINVAL when provided with an invalid locationmonitor resource or function is not supported. Hardware specificerrors may also be returned.
- intvme_lm_detach(structvme_resource*resource,intmonitor)¶
Remove callback for location monitor address
Parameters
structvme_resource*resourcePointer to VME location monitor resource.
intmonitorOffset to which callback should be removed.
Description
Remove the callback associated with the specified offset into thelocation monitors monitored addresses.
Return
Zero on success, -EINVAL when provided with an invalid locationmonitor resource or function is not supported. Hardware specificerrors may also be returned.
- voidvme_lm_free(structvme_resource*resource)¶
Free allocated VME location monitor
Parameters
structvme_resource*resourcePointer to VME location monitor resource.
Description
Free allocation of a VME location monitor.
- WARNING: This function currently expects that any callbacks that have
been attached to the location monitor have been removed.
Return
Zero on success, -EINVAL when provided with an invalid locationmonitor resource.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.
Description
Retrieve the slot ID associated with the provided VME device.
Return
The slot ID on success, -EINVAL if VME bridge cannot be determinedor the function is not supported. Hardware specific errors may alsobe returned.
Parameters
structvme_dev*vdevPointer to VME device
structvme_devassigned to driver instance.
Description
Retrieve the bus enumeration associated with the provided VME device.
Return
The bus number on success, -EINVAL if VME bridge cannot bedetermined.
- intvme_register_driver(structvme_driver*drv,unsignedintndevs)¶
Register a VME driver
Parameters
structvme_driver*drvPointer to VME driver structure to register.
unsignedintndevsMaximum number of devices to allow to be enumerated.
Description
Register a VME device driver with the VME subsystem.
Return
Zero on success, error value on registration failure.
- voidvme_unregister_driver(structvme_driver*drv)¶
Unregister a VME driver
Parameters
structvme_driver*drvPointer to VME driver structure to unregister.
Description
Unregister a VME device driver from the VME subsystem.