Module: xenomai-forge Branch: master Commit: 62dc685c8e6f6f4c6daa1ad71c343006100b47a6 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=62dc685c8e6f6f4c6daa1ad71c343006100b47a6
Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org> Date: Sat May 10 18:01:55 2014 +0200 drivers/rtdm: update documentation --- include/cobalt/kernel/rtdm/driver.h | 29 +++++++++++++++++++---------- include/cobalt/kernel/rtdm/fd.h | 10 +++++----- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/include/cobalt/kernel/rtdm/driver.h b/include/cobalt/kernel/rtdm/driver.h index c853ceb..63d12b5 100644 --- a/include/cobalt/kernel/rtdm/driver.h +++ b/include/cobalt/kernel/rtdm/driver.h @@ -212,7 +212,7 @@ static inline struct rtdm_dev_context *rtdm_fd_to_context(struct rtdm_fd *fd) * device instance * * @return The address of the private driver area associated to @a - * context. + * file descriptor. */ static inline void *rtdm_fd_to_private(struct rtdm_fd *fd) { @@ -234,11 +234,27 @@ static inline struct rtdm_fd *rtdm_private_to_fd(void *dev_private) return &ctx->fd; } +/** + * Tell whether the passed file descriptor belongs to an application. + * + * @param[in] fd File descriptor + * + * @return true if passed file descriptor belongs to an application, + * false otherwise. + */ static inline bool rtdm_fd_is_user(struct rtdm_fd *fd) { return rtdm_fd_owner(fd) != &__xnsys_global_ppd; } +/** + * Locate a device structure from a file descriptor. + * + * @param[in] fd File descriptor + * + * @return The address of the device structure to which this file + * descriptor is attached. + */ static inline struct rtdm_device *rtdm_fd_device(struct rtdm_fd *fd) { return rtdm_fd_to_context(fd)->device; @@ -286,17 +302,10 @@ struct rtdm_device { /** Protocol device identification: socket type (SOCK_xxx) */ int socket_type; - /** Named device instance creation for real-time contexts, - * optional (but deprecated) if open_nrt is non-NULL, ignored for - * protocol devices - * @deprecated Only use non-real-time open handler in new drivers. */ + /** Named device instance creation for real-time contexts. */ rtdm_open_handler_t open; - /** Protocol socket creation for real-time contexts, - * optional (but deprecated) if socket_nrt is non-NULL, ignored for - * named devices - * @deprecated Only use non-real-time socket creation handler in new - * drivers. */ + /** Protocol socket creation for real-time contexts. */ rtdm_socket_handler_t socket; /** Default operations on newly opened device instance */ diff --git a/include/cobalt/kernel/rtdm/fd.h b/include/cobalt/kernel/rtdm/fd.h index 19ab6f4..f137b00 100644 --- a/include/cobalt/kernel/rtdm/fd.h +++ b/include/cobalt/kernel/rtdm/fd.h @@ -32,7 +32,7 @@ struct xnsys_ppd; /** * IOCTL handler * - * @param[in] fd File descriptor structure associated with opened device instance + * @param[in] fd File descriptor structure * @param[in] request Request number as passed by the user * @param[in,out] arg Request argument as passed by the user * @@ -48,7 +48,7 @@ typedef int rtdm_fd_ioctl_t(struct rtdm_fd *fd, unsigned int request, void __use /** * Read handler * - * @param[in] fd File descriptor structure associated with opened device instance + * @param[in] fd File descriptor structure * @param[out] buf Input buffer as passed by the user * @param[in] size Number of bytes the user requests to read * @@ -64,7 +64,7 @@ typedef ssize_t rtdm_fd_read_t(struct rtdm_fd *fd, void __user *buf, size_t size /** * Write handler * - * @param[in] fd File descriptor structure associated with opened device instance + * @param[in] fd File descriptor structure * @param[in] buf Output buffer as passed by the user * @param[in] size Number of bytes the user requests to write * @@ -80,7 +80,7 @@ typedef ssize_t rtdm_fd_write_t(struct rtdm_fd *fd, const void __user *buf, size /** * Receive message handler * - * @param[in] fd File descriptor structure associated with opened device instance + * @param[in] fd File descriptor structure * @param[in,out] msg Message descriptor as passed by the user, automatically * mirrored to safe kernel memory in case of user mode call * @param[in] flags Message flags as passed by the user @@ -97,7 +97,7 @@ typedef ssize_t rtdm_fd_recvmsg_t(struct rtdm_fd *fd, struct msghdr *msg, int fl /** * Transmit message handler * - * @param[in] fd File descriptor structure associated with opened device instance + * @param[in] fd File descriptor structure * @param[in] user_info Opaque pointer to information about user mode caller, * NULL if kernel mode call * @param[in] msg Message descriptor as passed by the user, automatically _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git