Xenomai
3.1
|
Data Structures | |
struct | rtdm_fd_ops |
RTDM file operation descriptor. More... | |
Macros | |
#define | RTDM_MAX_MINOR 4096 |
Maximum number of named devices per driver. More... | |
Functions | |
int | rtdm_open_handler (struct rtdm_fd *fd, int oflags) |
Open handler for named devices. More... | |
int | rtdm_socket_handler (struct rtdm_fd *fd, int protocol) |
Socket creation handler for protocol devices. More... | |
void | rtdm_close_handler (struct rtdm_fd *fd) |
Close handler. More... | |
int | rtdm_ioctl_handler (struct rtdm_fd *fd, unsigned int request, void __user *arg) |
IOCTL handler. More... | |
ssize_t | rtdm_read_handler (struct rtdm_fd *fd, void __user *buf, size_t size) |
Read handler. More... | |
ssize_t | rtdm_write_handler (struct rtdm_fd *fd, const void __user *buf, size_t size) |
Write handler. More... | |
ssize_t | rtdm_recvmsg_handler (struct rtdm_fd *fd, struct user_msghdr *msg, int flags) |
Receive message handler. More... | |
ssize_t | rtdm_sendmsg_handler (struct rtdm_fd *fd, const struct user_msghdr *msg, int flags) |
Transmit message handler. More... | |
int | rtdm_select_handler (struct rtdm_fd *fd, struct xnselector *selector, unsigned int type, unsigned int index) |
Select handler. More... | |
int | rtdm_mmap_handler (struct rtdm_fd *fd, struct vm_area_struct *vma) |
Memory mapping handler. More... | |
unsigned long | rtdm_get_unmapped_area_handler (struct rtdm_fd *fd, unsigned long len, unsigned long pgoff, unsigned long flags) |
Allocate mapping region in address space. More... | |
int | rtdm_dev_register (struct rtdm_device *dev) |
Register a RTDM device More... | |
void | rtdm_dev_unregister (struct rtdm_device *dev) |
Unregister a RTDM device More... | |
int | rtdm_drv_set_sysclass (struct rtdm_driver *drv, struct class *cls) |
Set the kernel device class of a RTDM driver. More... | |
Device Flags | |
#define | RTDM_EXCLUSIVE 0x0001 |
If set, only a single instance of the device can be requested by an application. More... | |
#define | RTDM_FIXED_MINOR 0x0002 |
Use fixed minor provided in the rtdm_device description for registering. More... | |
#define | RTDM_NAMED_DEVICE 0x0010 |
If set, the device is addressed via a clear-text name. More... | |
#define | RTDM_PROTOCOL_DEVICE 0x0020 |
If set, the device is addressed via a combination of protocol ID and socket type. More... | |
#define | RTDM_DEVICE_TYPE_MASK 0x00F0 |
Mask selecting the device type. More... | |
#define | RTDM_SECURE_DEVICE 0x80000000 |
Flag indicating a secure variant of RTDM (not supported here) | |
#define RTDM_DEVICE_TYPE_MASK 0x00F0 |
Mask selecting the device type.
#define RTDM_EXCLUSIVE 0x0001 |
If set, only a single instance of the device can be requested by an application.
#define RTDM_FIXED_MINOR 0x0002 |
Use fixed minor provided in the rtdm_device description for registering.
If this flag is absent, the RTDM core assigns minor numbers to devices managed by a driver in order of registration.
#define RTDM_MAX_MINOR 4096 |
Maximum number of named devices per driver.
#define RTDM_NAMED_DEVICE 0x0010 |
If set, the device is addressed via a clear-text name.
#define RTDM_PROTOCOL_DEVICE 0x0020 |
If set, the device is addressed via a combination of protocol ID and socket type.
Referenced by udd_register_device().
void rtdm_close_handler | ( | struct rtdm_fd * | fd | ) |
Close handler.
[in] | fd | File descriptor associated with opened device instance. |
close()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 int rtdm_dev_register | ( | struct rtdm_device * | dev | ) |
Register a RTDM device
Registers a device in the RTDM namespace.
[in] | dev | Device descriptor. |
void rtdm_dev_unregister | ( | struct rtdm_device * | dev | ) |
Unregister a RTDM device
Removes the device from the RTDM namespace. This routine first attempts to teardown all active connections to the device prior to unregistering.
[in] | dev | Device descriptor. |
int rtdm_drv_set_sysclass | ( | struct rtdm_driver * | drv, |
struct class * | cls | ||
) |
Set the kernel device class of a RTDM driver.
Set the kernel device class assigned to the RTDM driver. By default, RTDM drivers belong to Linux's "rtdm" device class, creating a device node hierarchy rooted at /dev/rtdm, and sysfs nodes under /sys/class/rtdm.
This call assigns a user-defined kernel device class to the RTDM driver, so that its devices are created into a different system hierarchy.
rtdm_drv_set_sysclass() is meaningful only before the first device which is attached to drv is registered by a call to rtdm_dev_register().
[in] | drv | Address of the RTDM driver descriptor. |
[in] | cls | Pointer to the kernel device class. NULL is allowed to clear a previous setting, switching back to the default "rtdm" device class. |
unsigned long rtdm_get_unmapped_area_handler | ( | struct rtdm_fd * | fd, |
unsigned long | len, | ||
unsigned long | pgoff, | ||
unsigned long | flags | ||
) |
Allocate mapping region in address space.
When present, this optional handler should return the start address of a free region in the process's address space, large enough to cover the ongoing mmap() operation. If unspecified, the default architecture-defined handler is invoked.
Most drivers can omit this handler, except on MMU-less platforms (see second note).
[in] | fd | File descriptor |
[in] | len | Length of the requested region |
[in] | pgoff | Page frame number to map to (see second note). |
[in] | flags | Requested mapping flags |
int rtdm_ioctl_handler | ( | struct rtdm_fd * | fd, |
unsigned int | request, | ||
void __user * | arg | ||
) |
IOCTL handler.
[in] | fd | File descriptor |
[in] | request | Request number as passed by the user |
[in,out] | arg | Request argument as passed by the user |
ioctl()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 int rtdm_mmap_handler | ( | struct rtdm_fd * | fd, |
struct vm_area_struct * | vma | ||
) |
Memory mapping handler.
[in] | fd | File descriptor |
[in] | vma | Virtual memory area descriptor |
mmap()
in POSIX.1-2001, http://pubs.opengroup.org/onlinepubs/7908799/xsh/mmap.htmlint rtdm_open_handler | ( | struct rtdm_fd * | fd, |
int | oflags | ||
) |
Open handler for named devices.
[in] | fd | File descriptor associated with opened device instance |
[in] | oflags | Open flags as passed by the user |
The file descriptor carries a device minor information which can be retrieved by a call to rtdm_fd_minor(fd). The minor number can be used for distinguishing devices managed by a driver.
open()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 ssize_t rtdm_read_handler | ( | struct rtdm_fd * | fd, |
void __user * | buf, | ||
size_t | size | ||
) |
Read handler.
[in] | fd | File descriptor |
[out] | buf | Input buffer as passed by the user |
[in] | size | Number of bytes the user requests to read |
read()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 ssize_t rtdm_recvmsg_handler | ( | struct rtdm_fd * | fd, |
struct user_msghdr * | msg, | ||
int | flags | ||
) |
Receive message handler.
[in] | fd | File descriptor |
[in,out] | msg | Message descriptor as passed by the user, automatically mirrored to safe kernel memory in case of user mode call |
[in] | flags | Message flags as passed by the user |
recvmsg()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 int rtdm_select_handler | ( | struct rtdm_fd * | fd, |
struct xnselector * | selector, | ||
unsigned int | type, | ||
unsigned int | index | ||
) |
Select handler.
[in] | fd | File descriptor |
selector | Pointer to the selector structure | |
type | Type of events (XNSELECT_READ, XNSELECT_WRITE, or XNSELECT_EXCEPT) | |
index | Index of the file descriptor |
select()
in POSIX.1-2001, http://pubs.opengroup.org/onlinepubs/007908799/xsh/select.html ssize_t rtdm_sendmsg_handler | ( | struct rtdm_fd * | fd, |
const struct user_msghdr * | msg, | ||
int | flags | ||
) |
Transmit message handler.
[in] | fd | File descriptor |
[in] | msg | Message descriptor as passed by the user, automatically mirrored to safe kernel memory in case of user mode call |
[in] | flags | Message flags as passed by the user |
sendmsg()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 int rtdm_socket_handler | ( | struct rtdm_fd * | fd, |
int | protocol | ||
) |
Socket creation handler for protocol devices.
[in] | fd | File descriptor associated with opened device instance |
[in] | protocol | Protocol number as passed by the user |
socket()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399 ssize_t rtdm_write_handler | ( | struct rtdm_fd * | fd, |
const void __user * | buf, | ||
size_t | size | ||
) |
Write handler.
[in] | fd | File descriptor |
[in] | buf | Output buffer as passed by the user |
[in] | size | Number of bytes the user requests to write |
write()
in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399