Skip to content
Snippets Groups Projects
Commit 7f99feeb authored by Florian Pose's avatar Florian Pose
Browse files

Renamed Sysfs attributes.

parent b7a843c3
No related branches found
No related tags found
No related merge requests found
...@@ -53,10 +53,10 @@ ssize_t ec_show_domain_attribute(struct kobject *, struct attribute *, char *); ...@@ -53,10 +53,10 @@ ssize_t ec_show_domain_attribute(struct kobject *, struct attribute *, char *);
/** \cond */ /** \cond */
EC_SYSFS_READ_ATTR(data_size); EC_SYSFS_READ_ATTR(image_size);
static struct attribute *def_attrs[] = { static struct attribute *def_attrs[] = {
&attr_data_size, &attr_image_size,
NULL, NULL,
}; };
...@@ -345,7 +345,7 @@ ssize_t ec_show_domain_attribute(struct kobject *kobj, /**< kobject */ ...@@ -345,7 +345,7 @@ ssize_t ec_show_domain_attribute(struct kobject *kobj, /**< kobject */
{ {
ec_domain_t *domain = container_of(kobj, ec_domain_t, kobj); ec_domain_t *domain = container_of(kobj, ec_domain_t, kobj);
if (attr == &attr_data_size) { if (attr == &attr_image_size) {
return sprintf(buffer, "%i\n", domain->data_size); return sprintf(buffer, "%i\n", domain->data_size);
} }
......
...@@ -62,22 +62,22 @@ ssize_t ec_store_slave_attribute(struct kobject *, struct attribute *, ...@@ -62,22 +62,22 @@ ssize_t ec_store_slave_attribute(struct kobject *, struct attribute *,
/** \cond */ /** \cond */
EC_SYSFS_READ_ATTR(ring_position); EC_SYSFS_READ_ATTR(ring_position);
EC_SYSFS_READ_ATTR(coupler_address); EC_SYSFS_READ_ATTR(advanced_position);
EC_SYSFS_READ_ATTR(vendor_name); EC_SYSFS_READ_ATTR(vendor_name); // deprecated
EC_SYSFS_READ_ATTR(product_name); EC_SYSFS_READ_ATTR(product_name); // deprecated
EC_SYSFS_READ_ATTR(product_desc); EC_SYSFS_READ_ATTR(product_desc); // deprecated
EC_SYSFS_READ_ATTR(sii_name); EC_SYSFS_READ_ATTR(name);
EC_SYSFS_READ_ATTR(type); EC_SYSFS_READ_ATTR(type); // deprecated
EC_SYSFS_READ_WRITE_ATTR(state); EC_SYSFS_READ_WRITE_ATTR(state);
EC_SYSFS_READ_WRITE_ATTR(eeprom); EC_SYSFS_READ_WRITE_ATTR(eeprom);
static struct attribute *def_attrs[] = { static struct attribute *def_attrs[] = {
&attr_ring_position, &attr_ring_position,
&attr_coupler_address, &attr_advanced_position,
&attr_vendor_name, &attr_vendor_name,
&attr_product_name, &attr_product_name,
&attr_product_desc, &attr_product_desc,
&attr_sii_name, &attr_name,
&attr_type, &attr_type,
&attr_state, &attr_state,
&attr_eeprom, &attr_eeprom,
...@@ -1353,7 +1353,7 @@ ssize_t ec_show_slave_attribute(struct kobject *kobj, /**< slave's kobject */ ...@@ -1353,7 +1353,7 @@ ssize_t ec_show_slave_attribute(struct kobject *kobj, /**< slave's kobject */
if (attr == &attr_ring_position) { if (attr == &attr_ring_position) {
return sprintf(buffer, "%i\n", slave->ring_position); return sprintf(buffer, "%i\n", slave->ring_position);
} }
else if (attr == &attr_coupler_address) { else if (attr == &attr_advanced_position) {
return sprintf(buffer, "%i:%i\n", slave->coupler_index, return sprintf(buffer, "%i:%i\n", slave->coupler_index,
slave->coupler_subindex); slave->coupler_subindex);
} }
...@@ -1369,7 +1369,7 @@ ssize_t ec_show_slave_attribute(struct kobject *kobj, /**< slave's kobject */ ...@@ -1369,7 +1369,7 @@ ssize_t ec_show_slave_attribute(struct kobject *kobj, /**< slave's kobject */
if (slave->type) if (slave->type)
return sprintf(buffer, "%s\n", slave->type->description); return sprintf(buffer, "%s\n", slave->type->description);
} }
else if (attr == &attr_sii_name) { else if (attr == &attr_name) {
if (slave->eeprom_name) if (slave->eeprom_name)
return sprintf(buffer, "%s\n", slave->eeprom_name); return sprintf(buffer, "%s\n", slave->eeprom_name);
} }
......
...@@ -84,8 +84,8 @@ sub query_slaves ...@@ -84,8 +84,8 @@ sub query_slaves
$slave = {}; $slave = {};
$slave->{'ring_position'} = $slave->{'ring_position'} =
&read_integer("$slave_dir/ring_position"); &read_integer("$slave_dir/ring_position");
$slave->{'coupler_address'} = $slave->{'advanced_position'} =
&read_string("$slave_dir/coupler_address"); &read_string("$slave_dir/advanced_position");
unless ($show_sii_naming) { unless ($show_sii_naming) {
$slave->{'vendor_name'} = $slave->{'vendor_name'} =
&read_string("$slave_dir/vendor_name"); &read_string("$slave_dir/vendor_name");
...@@ -95,8 +95,8 @@ sub query_slaves ...@@ -95,8 +95,8 @@ sub query_slaves
&read_string("$slave_dir/product_desc"); &read_string("$slave_dir/product_desc");
} }
else { else {
$slave->{'sii_name'} = $slave->{'name'} =
&read_string("$slave_dir/sii_name"); &read_string("$slave_dir/name");
} }
$slave->{'type'} = $slave->{'type'} =
&read_string("$slave_dir/type"); &read_string("$slave_dir/type");
...@@ -114,13 +114,13 @@ sub query_slaves ...@@ -114,13 +114,13 @@ sub query_slaves
} }
$abs = sprintf "%i", $slave->{'ring_position'}; $abs = sprintf "%i", $slave->{'ring_position'};
printf(" %3s %8s ", $abs, $slave->{'coupler_address'}); printf(" %3s %8s ", $abs, $slave->{'advanced_position'});
unless ($show_sii_naming) { unless ($show_sii_naming) {
printf("%-12s %-10s %s\n", $slave->{'vendor_name'}, printf("%-12s %-10s %s\n", $slave->{'vendor_name'},
$slave->{'product_name'}, $slave->{'product_desc'}); $slave->{'product_name'}, $slave->{'product_desc'});
} }
else { else {
printf("%s\n", $slave->{'sii_name'}); printf("%s\n", $slave->{'name'});
} }
} }
} }
...@@ -183,7 +183,7 @@ sub print_usage ...@@ -183,7 +183,7 @@ sub print_usage
{ {
print "Usage: ec_list [OPTIONS]\n"; print "Usage: ec_list [OPTIONS]\n";
print " -m <IDX> Query master <IDX>.\n"; print " -m <IDX> Query master <IDX>.\n";
print " -s Show SII naming instead of"; print " -s Show EEPROM name instead of";
print " vendor/product/description.\n"; print " vendor/product/description.\n";
print " -h Show this help.\n"; print " -h Show this help.\n";
exit 0; exit 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment