Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
7f99feeb
Commit
7f99feeb
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Renamed Sysfs attributes.
parent
b7a843c3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
master/domain.c
+3
-3
3 additions, 3 deletions
master/domain.c
master/slave.c
+10
-10
10 additions, 10 deletions
master/slave.c
script/ec_list.pl
+7
-7
7 additions, 7 deletions
script/ec_list.pl
with
20 additions
and
20 deletions
master/domain.c
+
3
−
3
View file @
7f99feeb
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
master/slave.c
+
10
−
10
View file @
7f99feeb
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
script/ec_list.pl
+
7
−
7
View file @
7f99feeb
...
@@ -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
nam
ing
instead of
";
print
"
-s Show
EEPROM
nam
e
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment