master/mailbox.c
branchstable-1.1
changeset 1715 e675450f2174
parent 295 934ec4051dd4
child 390 685c267d80d8
--- a/master/mailbox.c	Thu Jul 13 13:10:57 2006 +0000
+++ b/master/mailbox.c	Thu Aug 03 12:59:01 2006 +0000
@@ -165,83 +165,3 @@
 }
 
 /*****************************************************************************/
-
-/**
-   Sends a mailbox datagram and waits for its reception.
-   \return pointer to the received data
-*/
-
-uint8_t *ec_slave_mbox_simple_io(const ec_slave_t *slave, /**< slave */
-                                 ec_datagram_t *datagram, /**< datagram */
-                                 size_t *size /**< size of the received data */
-                                 )
-{
-    uint8_t type;
-
-    type = EC_READ_U8(datagram->data + 5);
-
-    if (unlikely(ec_master_simple_io(slave->master, datagram))) {
-        EC_ERR("Mailbox checking failed on slave %i!\n",
-               slave->ring_position);
-        return NULL;
-    }
-
-    return ec_slave_mbox_simple_receive(slave, datagram, type, size);
-}
-
-/*****************************************************************************/
-
-/**
-   Waits for the reception of a mailbox datagram.
-   \return pointer to the received data
-*/
-
-uint8_t *ec_slave_mbox_simple_receive(const ec_slave_t *slave, /**< slave */
-                                      ec_datagram_t *datagram, /**< datagram */
-                                      uint8_t type, /**< expected protocol */
-                                      size_t *size /**< received data size */
-                                      )
-{
-    cycles_t start, end, timeout;
-
-    start = get_cycles();
-    timeout = (cycles_t) 100 * cpu_khz; // 100ms
-
-    while (1)
-    {
-        if (ec_slave_mbox_prepare_check(slave, datagram)) return NULL;
-        if (unlikely(ec_master_simple_io(slave->master, datagram))) {
-            EC_ERR("Mailbox checking failed on slave %i!\n",
-                   slave->ring_position);
-            return NULL;
-        }
-
-        end = get_cycles();
-
-        if (ec_slave_mbox_check(datagram))
-            break; // proceed with receiving data
-
-        if ((end - start) >= timeout) {
-            EC_ERR("Mailbox check - Slave %i timed out.\n",
-                   slave->ring_position);
-            return NULL;
-        }
-
-        udelay(100);
-    }
-
-    if (ec_slave_mbox_prepare_fetch(slave, datagram)) return NULL;
-    if (unlikely(ec_master_simple_io(slave->master, datagram))) {
-        EC_ERR("Mailbox receiving failed on slave %i!\n",
-               slave->ring_position);
-        return NULL;
-    }
-
-    if (unlikely(slave->master->debug_level) > 1)
-        EC_DBG("Mailbox receive took %ius.\n",
-               ((unsigned int) (end - start) * 1000 / cpu_khz));
-
-    return ec_slave_mbox_fetch(slave, datagram, type, size);
-}
-
-/*****************************************************************************/