|
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...
|
|
|
Static flags describing a RTDM device
|
#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. More...
|
|
#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.
|
|
#define | RTDM_DEVICE_TYPE_MASK 0x00F0 |
| Mask selecting the device type.
|
|
#define | RTDM_SECURE_DEVICE 0x80000000 |
| Flag indicating a secure variant of RTDM (not supported here)
|
|
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().
- Parameters
-
[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. |
- Returns
- 0 on success, otherwise:
- -EBUSY is returned if the kernel device class has already been set for drv, or some device(s) attached to drv are currently registered.
- Tags
- task-unrestricted
- Attention
- The kernel device class set by this call is not related to the RTDM class identification as defined by the RTDM profiles in any way. This is strictly related to the Linux kernel device hierarchy.
References rtdm_driver::profile_info.
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).
- Parameters
-
[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 |
- Returns
- The start address of the mapping region on success. On failure, a negative error code should be returned, with -ENOSYS meaning that the driver does not want to provide such information, in which case the ongoing mmap() operation will fail.
- Note
- The address hint passed to the mmap() request is deliberately ignored by RTDM, and therefore not passed to this handler.
-
On MMU-less platforms, this handler is required because RTDM issues mapping requests over a shareable character device internally. In such context, the RTDM core may pass a null pgoff argument to the handler, for probing for the logical start address of the memory region to map to. Otherwise, when pgoff is non-zero, pgoff << PAGE_SHIFT is usually returned.