EoE frame types.
authorFlorian Pose <fp@igh-essen.com>
Wed, 05 Nov 2014 19:04:36 +0100
changeset 2592 c075dd6b7eef
parent 2591 23b360e4a530
child 2593 e2388daebfbc
EoE frame types.
master/ethernet.c
master/ethernet.h
--- a/master/ethernet.c	Wed Nov 05 18:42:12 2014 +0100
+++ b/master/ethernet.c	Wed Nov 05 19:04:36 2014 +0100
@@ -303,7 +303,7 @@
     if (IS_ERR(data))
         return PTR_ERR(data);
 
-    EC_WRITE_U8 (data,     0x00); // eoe fragment req.
+    EC_WRITE_U8 (data, EC_EOE_FRAMETYPE_FRAG_REQ);
     EC_WRITE_U8 (data + 1, last_fragment);
     EC_WRITE_U16(data + 2, ((eoe->tx_fragment_number & 0x3F) |
                             (complete_offset & 0x3F) << 6 |
@@ -490,7 +490,7 @@
 
     frame_type = EC_READ_U16(data) & 0x000F;
 
-    if (frame_type != 0x00) {
+    if (frame_type != EC_EOE_FRAMETYPE_FRAG_REQ) {
 #if EOE_DEBUG_LEVEL >= 1
         EC_SLAVE_WARN(eoe->slave, "%s: Other frame received."
                 " Dropping.\n", eoe->dev->name);
--- a/master/ethernet.h	Wed Nov 05 18:42:12 2014 +0100
+++ b/master/ethernet.h	Wed Nov 05 19:04:36 2014 +0100
@@ -52,6 +52,18 @@
 
 /*****************************************************************************/
 
+/** EoE frame types.
+ */
+enum {
+    EC_EOE_FRAMETYPE_FRAG_REQ = 0x00, /** EoE Fragment Request. */
+    EC_EOE_FRAMETYPE_INIT_REQ = 0x02, /** Initiate EoE Request. */
+    EC_EOE_FRAMETYPE_INIT_RES = 0x03, /** Initiate EoE Response. */
+    EC_EOE_FRAMETYPE_FILT_REQ = 0x04, /** Set Address Filter Request. */
+    EC_EOE_FRAMETYPE_FILT_RES = 0x05, /** Set Address Filter Response. */
+};
+
+/*****************************************************************************/
+
 /**
    Queued frame structure.
 */