Added ec_soe_request_copy() method.
authorFlorian Pose <fp@igh-essen.com>
Fri, 05 Mar 2010 18:02:13 +0100
changeset 1843 4d44d8bee580
parent 1842 6d3190b9d464
child 1844 b6bd88d4806b
Added ec_soe_request_copy() method.
master/soe_request.c
master/soe_request.h
--- a/master/soe_request.c	Fri Mar 05 17:48:50 2010 +0100
+++ b/master/soe_request.c	Fri Mar 05 18:02:13 2010 +0100
@@ -61,7 +61,6 @@
     req->data_size = 0;
     req->dir = EC_DIR_INVALID;
     req->state = EC_INT_REQUEST_INIT;
-    //req->jiffies_start = 0U;
     req->jiffies_sent = 0U;
     req->error_code = 0x0000;
 }
@@ -79,6 +78,19 @@
 
 /*****************************************************************************/
 
+/** Copy another SoE request.
+ */
+int ec_soe_request_copy(
+        ec_soe_request_t *req, /**< SoE request. */
+        const ec_soe_request_t *other /**< Other SoE request to copy from. */
+        )
+{
+    req->idn = other->idn;
+    return ec_soe_request_copy_data(req, other->data, other->data_size);
+}
+
+/*****************************************************************************/
+
 /** Set IDN.
  */
 void ec_soe_request_set_idn(
@@ -89,25 +101,6 @@
     req->idn = idn;
 }
 
-#if 0
-/*****************************************************************************/
-
-/** Copy another SoE request.
- *
- * \attention Only the index subindex and data are copied.
- */
-int ec_soe_request_copy(
-        ec_soe_request_t *req, /**< SoE request. */
-        const ec_soe_request_t *other /**< Other SoE request to copy from. */
-        )
-{
-    req->complete_access = other->complete_access;
-    req->index = other->index;
-    req->subindex = other->subindex;
-    return ec_soe_request_copy_data(req, other->data, other->data_size);
-}
-#endif
-
 /*****************************************************************************/
 
 /** Free allocated memory.
--- a/master/soe_request.h	Fri Mar 05 17:48:50 2010 +0100
+++ b/master/soe_request.h	Fri Mar 05 18:02:13 2010 +0100
@@ -64,17 +64,13 @@
 void ec_soe_request_init(ec_soe_request_t *);
 void ec_soe_request_clear(ec_soe_request_t *);
 
+int ec_soe_request_copy(ec_soe_request_t *, const ec_soe_request_t *);
 void ec_soe_request_set_idn(ec_soe_request_t *, uint16_t);
 int ec_soe_request_alloc(ec_soe_request_t *, size_t);
 int ec_soe_request_copy_data(ec_soe_request_t *, const uint8_t *, size_t);
 void ec_soe_request_read(ec_soe_request_t *);
 void ec_soe_request_write(ec_soe_request_t *);
 
-#if 0
-int ec_soe_request_copy(ec_soe_request_t *, const ec_soe_request_t *);
-int ec_soe_request_timed_out(const ec_soe_request_t *);
-#endif
-
 /*****************************************************************************/
 
 #endif