master/mailbox.c
changeset 1989 6aa393418fb3
parent 1921 d9cf40facbc4
child 2045 ff2a13a4603c
child 2488 c0b4c64fcebd
--- a/master/mailbox.c	Fri May 07 15:26:26 2010 +0200
+++ b/master/mailbox.c	Tue May 11 13:57:58 2010 +0200
@@ -58,15 +58,15 @@
     int ret;
 
     if (unlikely(!slave->sii.mailbox_protocols)) {
-        EC_ERR("Slave %u does not support mailbox communication!\n",
-               slave->ring_position);
+        EC_SLAVE_ERR(slave, "Slave does not support mailbox"
+                " communication!\n");
         return ERR_PTR(-EPROTONOSUPPORT);
     }
 
     total_size = EC_MBOX_HEADER_SIZE + size;
 
     if (unlikely(total_size > slave->configured_rx_mailbox_size)) {
-        EC_ERR("Data size (%zu) does not fit in mailbox (%u)!\n",
+        EC_SLAVE_ERR(slave, "Data size (%zu) does not fit in mailbox (%u)!\n",
                 total_size, slave->configured_rx_mailbox_size);
         return ERR_PTR(-EOVERFLOW);
     }
@@ -173,8 +173,7 @@
     data_size = EC_READ_U16(datagram->data);
 
     if (data_size + EC_MBOX_HEADER_SIZE > slave->configured_tx_mailbox_size) {
-        EC_ERR("Corrupt mailbox response received from slave %u!\n",
-                slave->ring_position);
+        EC_SLAVE_ERR(slave, "Corrupt mailbox response received!\n");
         ec_print_data(datagram->data, slave->configured_tx_mailbox_size);
         return ERR_PTR(-EPROTO);
     }
@@ -186,8 +185,7 @@
         const ec_code_msg_t *mbox_msg;
         uint16_t code = EC_READ_U16(datagram->data + 8);
 
-        EC_ERR("Mailbox error response received from slave %u - ",
-                slave->ring_position);
+        EC_SLAVE_ERR(slave, "Mailbox error response received - ");
 
         for (mbox_msg = mbox_error_messages; mbox_msg->code; mbox_msg++) {
             if (mbox_msg->code != code)