removed now obsolete ext_datagram_queu
authorMartin Troxler <ch1010277@ch10pc446>
Thu, 16 Dec 2010 11:29:23 +0100
changeset 2021 ee30e7f90c2e
parent 2020 47db5df5c7b3
child 2022 393e7aef6706
removed now obsolete ext_datagram_queu
master/master.c
master/master.h
--- a/master/master.c	Thu Dec 16 11:23:32 2010 +0100
+++ b/master/master.c	Thu Dec 16 11:29:23 2010 +0100
@@ -169,9 +169,7 @@
     INIT_LIST_HEAD(&master->datagram_queue);
     master->datagram_index = 0;
 
-    INIT_LIST_HEAD(&master->ext_datagram_queue);
-    sema_init(&master->ext_queue_sem, 1);
-
+    sema_init(&master->fsm_queue_sem, 1);
     INIT_LIST_HEAD(&master->fsm_datagram_queue);
     
     // send interval in IDLE phase
@@ -690,9 +688,9 @@
     ec_datagram_t *datagram, *n;
     size_t queue_size = 0;
 
-    down(&master->ext_queue_sem);
+    down(&master->fsm_queue_sem);
     if (list_empty(&master->fsm_datagram_queue)) {
-        up(&master->ext_queue_sem);
+        up(&master->fsm_queue_sem);
         return;
     }
     list_for_each_entry(datagram, &master->datagram_queue, queue) {
@@ -762,7 +760,7 @@
             }
         }
     }
-    up(&master->ext_queue_sem);
+    up(&master->fsm_queue_sem);
 }
 
 /*****************************************************************************/
@@ -805,14 +803,14 @@
 {
     ec_datagram_t *queued_datagram;
 
-    down(&master->ext_queue_sem);
+    down(&master->fsm_queue_sem);
 
     // check, if the datagram is already queued
     list_for_each_entry(queued_datagram, &master->fsm_datagram_queue,
             queue) {
         if (queued_datagram == datagram) {
             datagram->state = EC_DATAGRAM_QUEUED;
-            up(&master->ext_queue_sem);
+            up(&master->fsm_queue_sem);
             return;
         }
     }
@@ -829,7 +827,7 @@
 #endif
     datagram->jiffies_sent = jiffies;
 
-    up(&master->ext_queue_sem);
+    up(&master->fsm_queue_sem);
 }
 
 /*****************************************************************************/
@@ -859,19 +857,6 @@
     datagram->state = EC_DATAGRAM_QUEUED;
 }
 
-/*****************************************************************************/
-
-/** Places a datagram in the non-application datagram queue.
- */
-void ec_master_queue_datagram_ext(
-        ec_master_t *master, /**< EtherCAT master */
-        ec_datagram_t *datagram /**< datagram */
-        )
-{
-    down(&master->ext_queue_sem);
-    list_add_tail(&datagram->queue, &master->ext_datagram_queue);
-    up(&master->ext_queue_sem);
-}
 
 /*****************************************************************************/
 
@@ -2115,14 +2100,6 @@
 
 void ecrt_master_send_ext(ec_master_t *master)
 {
-    ec_datagram_t *datagram, *next;
-
-    list_for_each_entry_safe(datagram, next, &master->ext_datagram_queue,
-            queue) {
-        list_del(&datagram->queue);
-        ec_master_queue_datagram(master, datagram);
-    }
-
     ecrt_master_send(master);
 }
 
--- a/master/master.h	Thu Dec 16 11:23:32 2010 +0100
+++ b/master/master.h	Thu Dec 16 11:29:23 2010 +0100
@@ -210,12 +210,10 @@
     struct list_head datagram_queue; /**< Datagram queue. */
     uint8_t datagram_index; /**< Current datagram index. */
 
-    struct list_head ext_datagram_queue; /**< Queue for non-application
-                                           datagrams. */
-    struct semaphore ext_queue_sem; /**< Semaphore protecting the \a
-                                      ext_datagram_queue. */
-
+    struct semaphore fsm_queue_sem; /**< Semaphore protecting the \a
+                                      fsm_datagram_queue. */
     struct list_head fsm_datagram_queue; /**< External Datagram queue. */
+
     unsigned int send_interval; /**< Interval between calls to ecrt_master_send */
     size_t max_queue_size; /**< Maximum size of datagram queue */
 
@@ -267,7 +265,6 @@
 // datagram IO
 void ec_master_receive_datagrams(ec_master_t *, const uint8_t *, size_t);
 void ec_master_queue_datagram(ec_master_t *, ec_datagram_t *);
-void ec_master_queue_datagram_ext(ec_master_t *, ec_datagram_t *);
 void ec_master_queue_request_fsm_datagram(ec_master_t *, ec_datagram_t *);
 void ec_master_queue_fsm_datagram(ec_master_t *, ec_datagram_t *);
 void ec_master_inject_fsm_datagrams(ec_master_t *);