Changed EEPROM string/property names and changed sii_desc property to sii_name.
authorFlorian Pose <fp@igh-essen.com>
Mon, 29 May 2006 07:48:33 +0000
changeset 264 76cba93ba122
parent 263 aa6623e5d958
child 265 fb965f033bb3
Changed EEPROM string/property names and changed sii_desc property to sii_name.
master/slave.c
master/slave.h
script/ec_list.pl
--- a/master/slave.c	Mon May 29 07:45:28 2006 +0000
+++ b/master/slave.c	Mon May 29 07:48:33 2006 +0000
@@ -66,7 +66,7 @@
 EC_SYSFS_READ_ATTR(vendor_name);
 EC_SYSFS_READ_ATTR(product_name);
 EC_SYSFS_READ_ATTR(product_desc);
-EC_SYSFS_READ_ATTR(sii_desc);
+EC_SYSFS_READ_ATTR(sii_name);
 EC_SYSFS_READ_ATTR(type);
 EC_SYSFS_READ_WRITE_ATTR(state);
 
@@ -76,7 +76,7 @@
     &attr_vendor_name,
     &attr_product_name,
     &attr_product_desc,
-    &attr_sii_desc,
+    &attr_sii_name,
     &attr_type,
     &attr_state,
     NULL,
@@ -145,9 +145,10 @@
     slave->type = NULL;
     slave->registered = 0;
     slave->fmmu_count = 0;
+    slave->eeprom_group = NULL;
+    slave->eeprom_image = NULL;
+    slave->eeprom_order = NULL;
     slave->eeprom_name = NULL;
-    slave->eeprom_group = NULL;
-    slave->eeprom_desc = NULL;
     slave->requested_state = EC_SLAVE_STATE_UNKNOWN;
     slave->current_state = EC_SLAVE_STATE_UNKNOWN;
     slave->state_error = 0;
@@ -215,9 +216,10 @@
         kfree(pdo);
     }
 
+    if (slave->eeprom_group) kfree(slave->eeprom_group);
+    if (slave->eeprom_image) kfree(slave->eeprom_image);
+    if (slave->eeprom_order) kfree(slave->eeprom_order);
     if (slave->eeprom_name) kfree(slave->eeprom_name);
-    if (slave->eeprom_group) kfree(slave->eeprom_group);
-    if (slave->eeprom_desc) kfree(slave->eeprom_desc);
 
     // free all SDOs
     list_for_each_entry_safe(sdo, next_sdo, &slave->sdo_dictionary, list) {
@@ -648,9 +650,11 @@
 
     if (ec_slave_locate_string(slave, data[0], &slave->eeprom_group))
         return -1;
-    if (ec_slave_locate_string(slave, data[1], &slave->eeprom_name))
-        return -1;
-    if (ec_slave_locate_string(slave, data[3], &slave->eeprom_desc))
+    if (ec_slave_locate_string(slave, data[1], &slave->eeprom_image))
+        return -1;
+    if (ec_slave_locate_string(slave, data[2], &slave->eeprom_order))
+        return -1;
+    if (ec_slave_locate_string(slave, data[3], &slave->eeprom_name))
         return -1;
 
     for (i = 0; i < 4; i++)
@@ -1126,12 +1130,14 @@
     EC_INFO("    Revision number: 0x%08X, Serial number: 0x%08X\n",
             slave->sii_revision_number, slave->sii_serial_number);
 
+    if (slave->eeprom_group)
+        EC_INFO("    Group: %s\n", slave->eeprom_group);
+    if (slave->eeprom_image)
+        EC_INFO("    Image: %s\n", slave->eeprom_image);
+    if (slave->eeprom_order)
+        EC_INFO("    Order#: %s\n", slave->eeprom_order);
     if (slave->eeprom_name)
         EC_INFO("    Name: %s\n", slave->eeprom_name);
-    if (slave->eeprom_group)
-        EC_INFO("    Group: %s\n", slave->eeprom_group);
-    if (slave->eeprom_desc)
-        EC_INFO("    Description: %s\n", slave->eeprom_desc);
 
     if (!list_empty(&slave->eeprom_syncs)) {
         EC_INFO("    Sync-Managers:\n");
@@ -1263,9 +1269,9 @@
         if (slave->type)
             return sprintf(buffer, "%s\n", slave->type->description);
     }
-    else if (attr == &attr_sii_desc) {
-        if (slave->eeprom_desc)
-            return sprintf(buffer, "%s\n", slave->eeprom_desc);
+    else if (attr == &attr_sii_name) {
+        if (slave->eeprom_name)
+            return sprintf(buffer, "%s\n", slave->eeprom_name);
     }
     else if (attr == &attr_type) {
         if (slave->type) {
--- a/master/slave.h	Mon May 29 07:45:28 2006 +0000
+++ b/master/slave.h	Mon May 29 07:48:33 2006 +0000
@@ -265,9 +265,10 @@
     struct list_head eeprom_syncs; /**< EEPROM SYNC MANAGER categories */
     struct list_head eeprom_pdos; /**< EEPROM [RT]XPDO categories */
 
+    char *eeprom_group; /**< slave group acc. to EEPROM */
+    char *eeprom_image; /**< slave image name acc. to EEPROM */
+    char *eeprom_order; /**< slave order number acc. to EEPROM */
     char *eeprom_name; /**< slave name acc. to EEPROM */
-    char *eeprom_group; /**< slave group acc. to EEPROM */
-    char *eeprom_desc; /**< slave description acc. to EEPROM */
 
     struct list_head sdo_dictionary; /**< SDO directory list */
 
--- a/script/ec_list.pl	Mon May 29 07:45:28 2006 +0000
+++ b/script/ec_list.pl	Mon May 29 07:48:33 2006 +0000
@@ -42,7 +42,7 @@
 
 my $master_index;
 my $master_dir;
-my $show_sii_desc;
+my $show_sii_naming;
 
 #------------------------------------------------------------------------------
 
@@ -86,7 +86,7 @@
 	    &read_integer("$slave_dir/ring_position");
 	$slave->{'coupler_address'} =
 	    &read_string("$slave_dir/coupler_address");
-	unless ($show_sii_desc) {
+	unless ($show_sii_naming) {
 	    $slave->{'vendor_name'} =
 		&read_string("$slave_dir/vendor_name");
 	    $slave->{'product_name'} =
@@ -95,8 +95,8 @@
 		&read_string("$slave_dir/product_desc");
 	}
 	else {
-	    $slave->{'sii_desc'} =
-		&read_string("$slave_dir/sii_desc");
+	    $slave->{'sii_name'} =
+		&read_string("$slave_dir/sii_name");
 	}
 	$slave->{'type'} =
 	    &read_string("$slave_dir/type");
@@ -115,12 +115,12 @@
 
 	$abs = sprintf "%i", $slave->{'ring_position'};
 	printf(" %3s %8s   ", $abs, $slave->{'coupler_address'});
-	unless ($show_sii_desc) {
+	unless ($show_sii_naming) {
 	    printf("%-12s %-10s %s\n", $slave->{'vendor_name'},
 		   $slave->{'product_name'}, $slave->{'product_desc'});
 	}
 	else {
-	    printf("%s\n", $slave->{'sii_desc'});
+	    printf("%s\n", $slave->{'sii_name'});
 	}
     }
 }
@@ -174,7 +174,7 @@
 	$master_index = 0;
     }
 
-    $show_sii_desc = defined $opt{'s'};
+    $show_sii_naming = defined $opt{'s'};
 }
 
 #------------------------------------------------------------------------------
@@ -183,7 +183,7 @@
 {
     print "Usage: ec_list [OPTIONS]\n";
     print "        -m <IDX>    Query master <IDX>.\n";
-    print "        -s          Show SII slave description instead of";
+    print "        -s          Show SII naming instead of";
     print " vendor/product/description.\n";
     print "        -h          Show this help.\n";
     exit 0;