Xenomai  3.0.8
Attach / detach Syscall API
Collaboration diagram for Attach / detach Syscall API:

Functions

int a4l_sys_attach (int fd, a4l_lnkdesc_t *arg)
 Attach an Analogy device to a driver. More...
 
int a4l_sys_detach (int fd)
 Detach an Analogy device from a driver. More...
 
int a4l_sys_bufcfg (int fd, unsigned int idx_subd, unsigned long size)
 Configure the buffer size. More...
 

Detailed Description

Function Documentation

◆ a4l_sys_attach()

int a4l_sys_attach ( int  fd,
a4l_lnkdesc_t *  arg 
)

Attach an Analogy device to a driver.

Parameters
[in]fdFile descriptor as returned by a4l_sys_open()
[in]argLink descriptor argument
Returns
0 on success. Otherwise:
  • -ENOMEM is returned if the system is out of memory
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -ENODEV is returned in case of internal error (Please, type "dmesg" for more info)
  • -ENXIO is returned in case of internal error (Please, type "dmesg" for more info)

◆ a4l_sys_bufcfg()

int a4l_sys_bufcfg ( int  fd,
unsigned int  idx_subd,
unsigned long  size 
)

Configure the buffer size.

This function can configure the buffer size of the file descriptor currently in use. If the subdevice index is set to A4L_BUF_DEFMAGIC, it can also define the default buffser size at open time.

Parameters
[in]fdFile descriptor as returned by a4l_sys_open()
[in]idx_subdIndex of the concerned subdevice
[in]sizeBuffer size to be set
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -EPERM is returned if the function is called in an RT context or if the buffer to resize is mapped in user-space (Please, type "dmesg" for more info)
  • -EFAULT is returned if a user <-> kernel transfer went wrong
  • -EBUSY is returned if the selected subdevice is already processing an asynchronous operation
  • -ENOMEM is returned if the system is out of memory

Referenced by a4l_set_bufsize().

◆ a4l_sys_detach()

int a4l_sys_detach ( int  fd)

Detach an Analogy device from a driver.

Parameters
[in]fdFile descriptor as returned by a4l_sys_open()
Returns
0 on success. Otherwise:
  • -EINVAL is returned if some argument is missing or wrong (Please, type "dmesg" for more info)
  • -EBUSY is returned if the device to be detached is in use
  • -EPERM is returned if the devive to be detached still has some buffer mapped in user-space
  • -ENODEV is returned in case of internal error (Please, type "dmesg" for more info)
  • -ENXIO is returned in case of internal error (Please, type "dmesg" for more info)