Added missing code documentation.
authorFlorian Pose <fp@igh-essen.com>
Mon, 19 Apr 2010 21:56:16 +0200
changeset 1907 dd276ae226b4
parent 1906 96805a6eae3d
child 1908 666ad3a50f9f
Added missing code documentation.
master/debug.c
master/device.c
master/domain.c
master/ethernet.c
master/fsm_coe.c
master/mailbox.h
master/master.h
master/slave_config.h
master/soe_request.c
--- a/master/debug.c	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/debug.c	Mon Apr 19 21:56:16 2010 +0200
@@ -50,6 +50,8 @@
 struct net_device_stats *ec_dbgdev_stats(struct net_device *);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+/** Device operations for debug interfaces.
+ */
 static const struct net_device_ops ec_dbg_netdev_ops =
 {
     .ndo_open = ec_dbgdev_open,
--- a/master/device.c	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/device.c	Mon Apr 19 21:56:16 2010 +0200
@@ -54,6 +54,8 @@
     } while (0)
 #endif
 
+/** List of intervals for frame statistics [s].
+ */
 static const unsigned int rate_intervals[] = {
     1, 10, 60
 };
--- a/master/domain.c	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/domain.c	Mon Apr 19 21:56:16 2010 +0200
@@ -226,10 +226,13 @@
     datagram_count = 0;
     datagram_used[EC_DIR_OUTPUT] = 0;
     datagram_used[EC_DIR_INPUT] = 0;
+
     list_for_each_entry(fmmu_temp, &domain->fmmu_configs, list) {
-       ec_slave_config_t *sc = (ec_slave_config_t *)fmmu_temp->sc; // we have to remove the constness, sorry
-       sc->used_for_fmmu_datagram[fmmu_temp->dir] = 0;
-    }
+        // we have to remove the constness, sorry FIXME
+        ec_slave_config_t *sc = (ec_slave_config_t *) fmmu_temp->sc;
+        sc->used_for_fmmu_datagram[fmmu_temp->dir] = 0;
+    }
+
     list_for_each_entry(fmmu, &domain->fmmu_configs, list) {
         // Correct logical FMMU address
         fmmu->logical_start_address += base_address;
@@ -241,6 +244,7 @@
             datagram_used[fmmu->dir]++;
             sc->used_for_fmmu_datagram[fmmu->dir] = 1;
         }
+
         // If the current FMMU's data do not fit in the current datagram,
         // allocate a new one.
         if (datagram_size + fmmu->data_size > EC_MAX_DATA_SIZE) {
--- a/master/ethernet.c	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/ethernet.c	Mon Apr 19 21:56:16 2010 +0200
@@ -83,6 +83,8 @@
 /*****************************************************************************/
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+/** Device operations for EoE interfaces.
+ */
 static const struct net_device_ops ec_eoedev_ops = {
     .ndo_open = ec_eoedev_open,
     .ndo_stop = ec_eoedev_stop,
--- a/master/fsm_coe.c	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/fsm_coe.c	Mon Apr 19 21:56:16 2010 +0200
@@ -45,11 +45,24 @@
  */
 #define EC_FSM_COE_DICT_TIMEOUT 1000
 
-#define EC_COE_DOWN_REQ_HEADER_SIZE      10
-#define EC_COE_DOWN_SEG_REQ_HEADER_SIZE  3
-#define EC_COE_DOWN_SEG_MIN_DATA_SIZE    7
-
+/** CoE download request header size.
+ */
+#define EC_COE_DOWN_REQ_HEADER_SIZE 10
+
+/** CoE download segment request header size.
+ */
+#define EC_COE_DOWN_SEG_REQ_HEADER_SIZE 3
+
+/** Minimum size of download segment.
+ */
+#define EC_COE_DOWN_SEG_MIN_DATA_SIZE 7
+
+/** Enable debug output for CoE retries.
+ */
 #define DEBUG_RETRIES 0
+
+/** Enable warning output if transfers take too long.
+ */
 #define DEBUG_LONG 0
 
 /*****************************************************************************/
@@ -1256,10 +1269,8 @@
 
 /*****************************************************************************/
 
-/**
-   CoE state: DOWN CHECK.
-*/
-
+/** CoE state: DOWN CHECK.
+ */
 void ec_fsm_coe_down_check(ec_fsm_coe_t *fsm /**< finite state machine */)
 {
     ec_datagram_t *datagram = fsm->datagram;
@@ -1309,6 +1320,8 @@
 
 /*****************************************************************************/
 
+/** Prepare a download segment request.
+ */
 void ec_fsm_coe_down_prepare_segment_request(
         ec_fsm_coe_t *fsm /**< finite state machine */
         )
--- a/master/mailbox.h	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/mailbox.h	Mon Apr 19 21:56:16 2010 +0200
@@ -41,6 +41,8 @@
 
 /*****************************************************************************/
 
+/** Size of the mailbox header.
+ */
 #define EC_MBOX_HEADER_SIZE 6
 
 /*****************************************************************************/
--- a/master/master.h	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/master.h	Mon Apr 19 21:56:16 2010 +0200
@@ -155,8 +155,8 @@
                                       ext_datagram_queue. */
 
     struct list_head external_datagram_queue; /**< External Datagram queue. */
-    size_t send_interval; /* interval between calls to ecrt_master_send */
-    size_t max_queue_size; /** max. size of datagram queue */
+    size_t send_interval; /**< Interval between calls to ecrt_master_send */
+    size_t max_queue_size; /**< Maximum size of datagram queue */
     struct list_head domains; /**< List of domains. */
 
     unsigned int debug_level; /**< Master debug level. */
--- a/master/slave_config.h	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/slave_config.h	Mon Apr 19 21:56:16 2010 +0200
@@ -70,7 +70,9 @@
                                                    configurations. */
     ec_fmmu_config_t fmmu_configs[EC_MAX_FMMUS]; /**< FMMU configurations. */
     uint8_t used_fmmus; /**< Number of FMMUs used. */
-    unsigned int used_for_fmmu_datagram[EC_DIR_COUNT];
+    unsigned int used_for_fmmu_datagram[EC_DIR_COUNT]; /**< Number of FMMUs
+                                                         used for process data
+                                                         exchange datagrams. */
     uint16_t dc_assign_activate; /**< Vendor-specific AssignActivate word. */
     ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT]; /**< DC sync signals. */
 
--- a/master/soe_request.c	Mon Apr 19 21:54:54 2010 +0200
+++ b/master/soe_request.c	Mon Apr 19 21:56:16 2010 +0200
@@ -206,7 +206,11 @@
 
 /*****************************************************************************/
 
-void ec_soe_request_read(ec_soe_request_t *req)
+/** Request a read operation.
+ */
+void ec_soe_request_read(
+        ec_soe_request_t *req /**< SoE request. */
+       )
 {
     req->dir = EC_DIR_INPUT;
     req->state = EC_INT_REQUEST_QUEUED;
@@ -215,7 +219,11 @@
 
 /*****************************************************************************/
 
-void ec_soe_request_write(ec_soe_request_t *req)
+/** Request a write operation.
+ */
+void ec_soe_request_write(
+        ec_soe_request_t *req /**< SoE request. */
+        )
 {
     req->dir = EC_DIR_OUTPUT;
     req->state = EC_INT_REQUEST_QUEUED;