Reverted revision number checking from r1228.
authorFlorian Pose <fp@igh-essen.com>
Tue, 17 Jun 2008 09:44:46 +0000
changeset 1010 6672b86e7b10
parent 1009 6012e1414bec
child 1011 a0759d0dded4
Reverted revision number checking from r1228.
include/ecrt.h
master/domain.c
master/master.c
master/slave_config.c
master/slave_config.h
--- a/include/ecrt.h	Mon Jun 16 09:30:58 2008 +0000
+++ b/include/ecrt.h	Tue Jun 17 09:44:46 2008 +0000
@@ -246,7 +246,6 @@
     uint16_t position; /**< Slave position. */
     uint32_t vendor_id; /**< Slave vendor ID. */
     uint32_t product_code; /**< Slave product code. */
-    uint32_t revision_number; /**< Slave revision number. */
     uint16_t index; /**< Pdo entry index. */
     uint8_t subindex; /**< Pdo entry subindex. */
     unsigned int *offset; /**< Pointer to a variable to store the Pdo entry's
@@ -351,8 +350,7 @@
         uint16_t alias, /**< Slave alias. */
         uint16_t position, /**< Slave position. */
         uint32_t vendor_id, /**< Expected vendor ID. */
-        uint32_t product_code, /**< Expected product code. */
-        uint32_t revision_number /**< Expected revision number. */
+        uint32_t product_code /**< Expected product code. */
         );
 
 /** Finishes the configuration phase and prepares for realtime mode.
--- a/master/domain.c	Mon Jun 16 09:30:58 2008 +0000
+++ b/master/domain.c	Tue Jun 17 09:44:46 2008 +0000
@@ -320,8 +320,7 @@
     
     for (reg = regs; reg->index; reg++) {
         if (!(sc = ecrt_master_slave_config(domain->master, reg->alias,
-                        reg->position, reg->vendor_id, reg->product_code,
-                        reg->revision_number)))
+                        reg->position, reg->vendor_id, reg->product_code)))
             return -1;
 
         if ((ret = ecrt_slave_config_reg_pdo_entry(sc, reg->index,
--- a/master/master.c	Mon Jun 16 09:30:58 2008 +0000
+++ b/master/master.c	Tue Jun 17 09:44:46 2008 +0000
@@ -1287,7 +1287,7 @@
 
 ec_slave_config_t *ecrt_master_slave_config(ec_master_t *master,
         uint16_t alias, uint16_t position, uint32_t vendor_id,
-        uint32_t product_code, uint32_t revision_number)
+        uint32_t product_code)
 {
     ec_slave_config_t *sc;
     unsigned int found = 0;
@@ -1304,21 +1304,18 @@
             EC_INFO("Using existing slave configuration for %u:%u\n",
                     alias, position);
         }
-        if (sc->vendor_id != vendor_id
-                || sc->product_code != product_code
-                || sc->revision_number != revision_number) {
+        if (sc->vendor_id != vendor_id || sc->product_code != product_code) {
             EC_ERR("Slave type mismatch. Slave was configured as"
-                    " 0x%08X/0x%08X/0x%08X before. Now configuring with"
-                    " 0x%08X/0x%08X/0x%08X.\n",
-                    sc->vendor_id, sc->product_code, sc->revision_number,
-                    vendor_id, product_code, revision_number);
+                    " 0x%08X/0x%08X before. Now configuring with"
+                    " 0x%08X/0x%08X.\n", sc->vendor_id, sc->product_code,
+                    vendor_id, product_code);
             return NULL;
         }
     } else {
         if (master->debug_level) {
             EC_INFO("Creating slave configuration for %u:%u,"
-                    " 0x%08X/0x%08X/0x%08X.\n", alias, position,
-                    vendor_id, product_code, revision_number);
+                    " 0x%08X/0x%08X.\n", alias, position, vendor_id,
+                    product_code);
         }
 
         if (!(sc = (ec_slave_config_t *) kmalloc(sizeof(ec_slave_config_t),
@@ -1328,7 +1325,7 @@
         }
 
         ec_slave_config_init(sc, master,
-                alias, position, vendor_id, product_code, revision_number);
+                alias, position, vendor_id, product_code);
 
         // try to find the addressed slave
         ec_slave_config_attach(sc);
--- a/master/slave_config.c	Mon Jun 16 09:30:58 2008 +0000
+++ b/master/slave_config.c	Tue Jun 17 09:44:46 2008 +0000
@@ -58,8 +58,7 @@
         uint16_t alias, /**< Slave alias. */
         uint16_t position, /**< Slave position. */
         uint32_t vendor_id, /**< Expected vendor ID. */
-        uint32_t product_code, /**< Expected product code. */
-        uint32_t revision_number /**< Expected revision number. */
+        uint32_t product_code /**< Expected product code. */
         )
 {
     ec_direction_t dir;
@@ -69,7 +68,6 @@
     sc->position = position;
     sc->vendor_id = vendor_id;
     sc->product_code = product_code;
-    sc->revision_number = revision_number;
     sc->slave = NULL;
 
     for (dir = EC_DIR_OUTPUT; dir <= EC_DIR_INPUT; dir++)
@@ -188,14 +186,12 @@
 		return -2;
 	}
 	if (slave->sii.vendor_id != sc->vendor_id
-			|| slave->sii.product_code != sc->product_code
-			|| slave->sii.revision_number != sc->revision_number) {
-		EC_ERR("Slave %u has an invalid type (0x%08X/0x%08X/0x%08X) for"
-				" configuration %u:%u (0x%08X/0x%08X/0x%08X).\n",
-				slave->ring_position,
-                slave->sii.vendor_id, slave->sii.product_code,
-                slave->sii.revision_number, sc->alias, sc->position,
-				sc->vendor_id, sc->product_code, sc->revision_number);
+			|| slave->sii.product_code != sc->product_code) {
+		EC_ERR("Slave %u has an invalid type (0x%08X/0x%08X) for"
+				" configuration %u:%u (0x%08X/0x%08X).\n",
+				slave->ring_position, slave->sii.vendor_id,
+				slave->sii.product_code, sc->alias, sc->position,
+				sc->vendor_id, sc->product_code);
 		return -3;
 	}
 
--- a/master/slave_config.h	Mon Jun 16 09:30:58 2008 +0000
+++ b/master/slave_config.h	Tue Jun 17 09:44:46 2008 +0000
@@ -63,7 +63,6 @@
                          ring position. */
     uint32_t vendor_id; /**< Slave vendor ID. */
     uint32_t product_code; /**< Slave product code. */
-    uint32_t revision_number; /**< Slave revision number. */
 
     ec_slave_t *slave; /**< Slave pointer. This is \a NULL, if the slave is
                          offline. */
@@ -80,7 +79,7 @@
 /*****************************************************************************/
 
 void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t,
-        uint16_t, uint32_t, uint32_t, uint32_t);
+        uint16_t, uint32_t, uint32_t);
 void ec_slave_config_clear(ec_slave_config_t *);
 
 int ec_slave_config_attach(ec_slave_config_t *);