Renamed names of enum type ec_request_state_t.
authorFlorian Pose <fp@igh-essen.com>
Mon, 12 Mar 2007 11:02:05 +0000
changeset 649 a4d3fffdaed7
parent 648 0a6d38ec463f
child 650 c68995623e94
Renamed names of enum type ec_request_state_t.
master/canopen.c
master/fsm_master.c
master/globals.h
master/slave.c
--- a/master/canopen.c	Mon Mar 12 08:47:56 2007 +0000
+++ b/master/canopen.c	Mon Mar 12 11:02:05 2007 +0000
@@ -351,10 +351,10 @@
 
     // wait for processing through FSM
     if (wait_event_interruptible(master->sdo_queue,
-                request.state != EC_REQ_QUEUED)) {
+                request.state != EC_REQUEST_QUEUED)) {
         // interrupted by signal
         down(&master->sdo_sem);
-        if (request.state == EC_REQ_QUEUED) {
+        if (request.state == EC_REQUEST_QUEUED) {
             list_del(&request.list);
             up(&master->sdo_sem);
             return -EINTR;
@@ -364,9 +364,9 @@
     }
 
     // wait until master FSM has finished processing
-    wait_event(master->sdo_queue, request.state != EC_REQ_BUSY);
-
-    if (request.state != EC_REQ_COMPLETED)
+    wait_event(master->sdo_queue, request.state != EC_REQUEST_IN_PROGRESS);
+
+    if (request.state != EC_REQUEST_COMPLETE)
         return -EIO;
 
     off += ec_sdo_entry_format_data(entry, &request, buffer);
@@ -409,7 +409,7 @@
     req->entry = entry;
     req->data = NULL;
     req->size = 0;
-    req->state = EC_REQ_QUEUED;
+    req->state = EC_REQUEST_QUEUED;
 }
 
 /*****************************************************************************/
--- a/master/fsm_master.c	Mon Mar 12 08:47:56 2007 +0000
+++ b/master/fsm_master.c	Mon Mar 12 11:02:05 2007 +0000
@@ -285,14 +285,14 @@
         request = list_entry(master->eeprom_requests.next,
                 ec_eeprom_write_request_t, list);
         list_del_init(&request->list); // dequeue
-        request->state = EC_REQ_BUSY;
+        request->state = EC_REQUEST_IN_PROGRESS;
         up(&master->eeprom_sem);
 
         slave = request->slave;
         if (slave->online_state == EC_SLAVE_OFFLINE || slave->error_flag) {
             EC_ERR("Discarding EEPROM data, slave %i not ready.\n",
                     slave->ring_position);
-            request->state = EC_REQ_ERROR;
+            request->state = EC_REQUEST_FAILURE;
             wake_up(&master->eeprom_queue);
             continue;
         }
@@ -339,7 +339,7 @@
         request =
             list_entry(master->sdo_requests.next, ec_sdo_request_t, list);
         list_del_init(&request->list); // dequeue
-        request->state = EC_REQ_BUSY;
+        request->state = EC_REQUEST_IN_PROGRESS;
         up(&master->sdo_sem);
 
         slave = request->sdo->slave;
@@ -348,7 +348,7 @@
                 slave->error_flag) {
             EC_ERR("Discarding SDO request, slave %i not ready.\n",
                     slave->ring_position);
-            request->state = EC_REQ_ERROR;
+            request->state = EC_REQUEST_FAILURE;
             wake_up(&master->sdo_queue);
             continue;
         }
@@ -789,7 +789,7 @@
         slave->error_flag = 1;
         EC_ERR("Failed to write EEPROM data to slave %i.\n",
                 slave->ring_position);
-        request->state = EC_REQ_ERROR;
+        request->state = EC_REQUEST_FAILURE;
         wake_up(&master->eeprom_queue);
         fsm->state = ec_fsm_master_state_error;
         return;
@@ -809,7 +809,7 @@
     if (master->debug_level)
         EC_DBG("Finished writing EEPROM data to slave %i.\n",
                 slave->ring_position);
-    request->state = EC_REQ_COMPLETED;
+    request->state = EC_REQUEST_COMPLETE;
     wake_up(&master->eeprom_queue);
 
     // TODO: Evaluate new EEPROM contents!
@@ -867,14 +867,14 @@
     if (!ec_fsm_coe_success(&fsm->fsm_coe)) {
         EC_DBG("Failed to process SDO request for slave %i.\n",
                 fsm->slave->ring_position);
-        request->state = EC_REQ_ERROR;
+        request->state = EC_REQUEST_FAILURE;
         wake_up(&master->sdo_queue);
         fsm->state = ec_fsm_master_state_error;
         return;
     }
 
     // SDO request finished 
-    request->state = EC_REQ_COMPLETED;
+    request->state = EC_REQUEST_COMPLETE;
     wake_up(&master->sdo_queue);
 
     if (master->debug_level)
--- a/master/globals.h	Mon Mar 12 08:47:56 2007 +0000
+++ b/master/globals.h	Mon Mar 12 11:02:05 2007 +0000
@@ -183,10 +183,10 @@
 
 typedef enum
 {
-    EC_REQ_QUEUED,
-    EC_REQ_BUSY,
-    EC_REQ_COMPLETED,
-    EC_REQ_ERROR
+    EC_REQUEST_QUEUED,
+    EC_REQUEST_IN_PROGRESS,
+    EC_REQUEST_COMPLETE,
+    EC_REQUEST_FAILURE
 }
 ec_request_state_t;
 
--- a/master/slave.c	Mon Mar 12 08:47:56 2007 +0000
+++ b/master/slave.c	Mon Mar 12 11:02:05 2007 +0000
@@ -858,7 +858,7 @@
 {
     ec_master_t *master = request->slave->master;
 
-    request->state = EC_REQ_QUEUED;
+    request->state = EC_REQUEST_QUEUED;
 
     // schedule EEPROM write request.
     down(&master->eeprom_sem);
@@ -867,10 +867,10 @@
 
     // wait for processing through FSM
     if (wait_event_interruptible(master->eeprom_queue,
-                request->state != EC_REQ_QUEUED)) {
+                request->state != EC_REQUEST_QUEUED)) {
         // interrupted by signal
         down(&master->eeprom_sem);
-        if (request->state == EC_REQ_QUEUED) {
+        if (request->state == EC_REQUEST_QUEUED) {
             list_del(&request->list);
             up(&master->eeprom_sem);
             return -EINTR;
@@ -880,9 +880,10 @@
     }
 
     // wait until master FSM has finished processing
-    wait_event(master->eeprom_queue, request->state != EC_REQ_BUSY);
-
-    return request->state == EC_REQ_COMPLETED ? 0 : -EIO;
+    wait_event(master->eeprom_queue,
+            request->state != EC_REQUEST_IN_PROGRESS);
+
+    return request->state == EC_REQUEST_COMPLETE ? 0 : -EIO;
 }
 
 /*****************************************************************************/