master/rtdm.c
branchstable-1.5
changeset 2524 6d9865c37b6f
parent 2522 ec403cf308eb
child 2700 93ef210e9b56
--- a/master/rtdm.c	Tue Feb 12 16:37:11 2013 +0100
+++ b/master/rtdm.c	Tue Feb 12 17:15:09 2013 +0100
@@ -26,6 +26,10 @@
  *
  ****************************************************************************/
 
+/** \file
+ * RTDM interface.
+ */
+
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mman.h>
@@ -45,7 +49,7 @@
 /** Context structure for an open RTDM file handle.
  */
 typedef struct {
-    rtdm_user_info_t *user_info; /**< RTDM user info. */
+    rtdm_user_info_t *user_info; /**< RTDM user data. */
     ec_ioctl_context_t ioctl_ctx; /**< Context structure. */
 } ec_rtdm_context_t;
 
@@ -58,9 +62,13 @@
 
 /****************************************************************************/
 
+/** Initialize an RTDM device.
+ *
+ * \return Zero on success, otherwise a negative error code.
+ */
 int ec_rtdm_dev_init(
-        ec_rtdm_dev_t *rtdm_dev,
-        ec_master_t *master
+        ec_rtdm_dev_t *rtdm_dev, /**< EtherCAT RTDM device. */
+        ec_master_t *master /**< EtherCAT master. */
         )
 {
     int ret;
@@ -105,8 +113,10 @@
 
 /****************************************************************************/
 
+/** Clear an RTDM device.
+ */
 void ec_rtdm_dev_clear(
-        ec_rtdm_dev_t *rtdm_dev
+        ec_rtdm_dev_t *rtdm_dev /**< EtherCAT RTDM device. */
         )
 {
     int ret;
@@ -125,11 +135,13 @@
 /****************************************************************************/
 
 /** Driver open.
+ *
+ * \return Always zero (success).
  */
 int ec_rtdm_open(
-        struct rtdm_dev_context *context,
-        rtdm_user_info_t *user_info,
-        int oflags
+        struct rtdm_dev_context *context, /**< Context. */
+        rtdm_user_info_t *user_info, /**< User data. */
+        int oflags /**< Open flags. */
         )
 {
     ec_rtdm_context_t *ctx = (ec_rtdm_context_t *) context->dev_private;
@@ -153,9 +165,13 @@
 /****************************************************************************/
 
 /** Driver close.
- */
-int ec_rtdm_close(struct rtdm_dev_context *context,
-        rtdm_user_info_t *user_info)
+ *
+ * \return Always zero (success).
+ */
+int ec_rtdm_close(
+        struct rtdm_dev_context *context, /**< Context. */
+        rtdm_user_info_t *user_info /**< User data. */
+        )
 {
     ec_rtdm_context_t *ctx = (ec_rtdm_context_t *) context->dev_private;
     ec_rtdm_dev_t *rtdm_dev = (ec_rtdm_dev_t *) context->device->device_data;
@@ -174,6 +190,8 @@
 /****************************************************************************/
 
 /** Driver ioctl.
+ *
+ * \return ioctl() return code.
  */
 int ec_rtdm_ioctl(
         struct rtdm_dev_context *context, /**< Context. */
@@ -196,8 +214,13 @@
 /****************************************************************************/
 
 /** Memory-map process data to user space.
- */
-int ec_rtdm_mmap(ec_ioctl_context_t *ioctl_ctx, void **user_address)
+ *
+ * \return Zero on success, otherwise a negative error code.
+ */
+int ec_rtdm_mmap(
+        ec_ioctl_context_t *ioctl_ctx, /**< Context. */
+        void **user_address /**< Userspace address. */
+        )
 {
     ec_rtdm_context_t *ctx =
         container_of(ioctl_ctx, ec_rtdm_context_t, ioctl_ctx);