Xenomai  3.0.5
udd_device Struct Reference
Collaboration diagram for udd_device:

Data Structures

struct  udd_reserved
 Reserved to the UDD core. More...
 

Data Fields

const char * device_name
 Name of the device managed by the mini-driver, appears automatically in the /dev/rtdm namespace upon creation.
 
int device_flags
 Additional device flags (e.g. More...
 
int device_subclass
 Subclass code of the device managed by the mini-driver (see RTDM_SUBCLASS_xxx definition in the Device Profiles). More...
 
int irq
 IRQ number. More...
 
struct udd_memregion mem_regions [UDD_NR_MAPS]
 Array of memory regions defined by the device. More...
 
int(* open )(struct rtdm_fd *fd, int oflags)
 Ancillary open() handler, optional. More...
 
void(* close )(struct rtdm_fd *fd)
 Ancillary close() handler, optional. More...
 
int(* ioctl )(struct rtdm_fd *fd, unsigned int request, void *arg)
 Ancillary ioctl() handler, optional. More...
 
int(* mmap )(struct rtdm_fd *fd, struct vm_area_struct *vma)
 Ancillary mmap() handler for the mapper device, optional. More...
 
int(* interrupt )(struct udd_device *udd)
 

Detailed Description

UDD device descriptor.

This descriptor defines the characteristics of a UDD-based mini-driver when registering via a call to udd_register_device().

Field Documentation

◆ close

void(* udd_device::close) (struct rtdm_fd *fd)

Ancillary close() handler, optional.

See rtdm_close_handler().

Note
This handler is called from secondary mode only.

◆ device_flags

int udd_device::device_flags

Additional device flags (e.g.

RTDM_EXCLUSIVE) RTDM_NAMED_DEVICE may be omitted).

Referenced by udd_register_device().

◆ device_subclass

int udd_device::device_subclass

Subclass code of the device managed by the mini-driver (see RTDM_SUBCLASS_xxx definition in the Device Profiles).

The main class code is pre-set to RTDM_CLASS_UDD.

◆ interrupt

int(* udd_device::interrupt) (struct udd_device *udd)

Ancillary handler for receiving interrupts. This handler must be provided if the mini-driver hands over IRQ handling to the UDD core, by setting the irq field to a valid value, different from UDD_IRQ_CUSTOM and UDD_IRQ_NONE.

The ->interrupt() handler shall return one of the following status codes:

  • RTDM_IRQ_HANDLED, if the mini-driver successfully handled the IRQ. This flag can be combined with RTDM_IRQ_DISABLE to prevent the Cobalt kernel from re-enabling the interrupt line upon return, otherwise it is re-enabled automatically.
  • RTDM_IRQ_NONE, if the interrupt does not match any IRQ the mini-driver can handle.

Once the ->interrupt() handler has returned, the UDD core notifies user-space Cobalt threads waiting for IRQ events (if any).

Note
This handler is called from primary mode only.

Referenced by udd_register_device().

◆ ioctl

int(* udd_device::ioctl) (struct rtdm_fd *fd, unsigned int request, void *arg)

Ancillary ioctl() handler, optional.

See rtdm_ioctl_handler().

If this routine returns -ENOSYS, the default action implemented by the UDD core for the corresponding request will be applied, as if no ioctl handler had been defined.

Note
This handler is called from primary mode only.

◆ irq

int udd_device::irq

IRQ number.

If valid, the UDD core manages the corresponding interrupt line, installing a base handler. Otherwise, a special value can be passed for declaring unmanaged IRQs.

Referenced by udd_disable_irq(), udd_enable_irq(), udd_register_device(), and udd_unregister_device().

◆ mem_regions

struct udd_memregion udd_device::mem_regions[UDD_NR_MAPS]

Array of memory regions defined by the device.

The array can be sparse, with some entries bearing the UDD_MEM_NONE type interleaved with valid ones. See the discussion about UDD memory regions.

◆ mmap

int(* udd_device::mmap) (struct rtdm_fd *fd, struct vm_area_struct *vma)

Ancillary mmap() handler for the mapper device, optional.

See rtdm_mmap_handler(). The mapper device operates on a valid region defined in the mem_regions[] array. A pointer to the region can be obtained by a call to udd_get_region().

If this handler is NULL, the UDD core establishes the mapping automatically, depending on the memory type defined for the region.

Note
This handler is called from secondary mode only.

◆ open

int(* udd_device::open) (struct rtdm_fd *fd, int oflags)

Ancillary open() handler, optional.

See rtdm_open_handler().

Note
This handler is called from secondary mode only.

The documentation for this struct was generated from the following file: