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
2727be57
Commit
2727be57
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Macro for SysFS attribute definition
parent
338d8a83
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
master/domain.c
+1
-5
1 addition, 5 deletions
master/domain.c
master/globals.h
+8
-0
8 additions, 0 deletions
master/globals.h
master/master.c
+1
-5
1 addition, 5 deletions
master/master.c
master/module.c
+1
-3
1 addition, 3 deletions
master/module.c
master/slave.c
+5
-19
5 additions, 19 deletions
master/slave.c
with
16 additions
and
32 deletions
master/domain.c
+
1
−
5
View file @
2727be57
...
...
@@ -19,11 +19,7 @@ ssize_t ec_show_domain_attribute(struct kobject *, struct attribute *, char *);
/*****************************************************************************/
static
struct
attribute
attr_data_size
=
{
.
name
=
"data_size"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
EC_SYSFS_READ_ATTR
(
data_size
);
static
struct
attribute
*
def_attrs
[]
=
{
&
attr_data_size
,
...
...
This diff is collapsed.
Click to expand it.
master/globals.h
+
8
−
0
View file @
2727be57
...
...
@@ -43,6 +43,14 @@
#define EC_DBG(fmt, args...) \
printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args)
#define EC_LIT(X) #X
#define EC_STR(X) EC_LIT(X)
#define EC_SYSFS_READ_ATTR(NAME) \
static struct attribute attr_##NAME = { \
.name = EC_STR(NAME), .owner = THIS_MODULE, .mode = S_IRUGO \
}
/*****************************************************************************/
extern
void
ec_print_data
(
const
uint8_t
*
,
size_t
);
...
...
This diff is collapsed.
Click to expand it.
master/master.c
+
1
−
5
View file @
2727be57
...
...
@@ -29,11 +29,7 @@ ssize_t ec_show_master_attribute(struct kobject *, struct attribute *, char *);
/*****************************************************************************/
static
struct
attribute
attr_slave_count
=
{
.
name
=
"slave_count"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
EC_SYSFS_READ_ATTR
(
slave_count
);
static
struct
attribute
*
ec_def_attrs
[]
=
{
&
attr_slave_count
,
...
...
This diff is collapsed.
Click to expand it.
master/module.c
+
1
−
3
View file @
2727be57
...
...
@@ -22,6 +22,7 @@
#include
<linux/kernel.h>
#include
<linux/init.h>
#include
"globals.h"
#include
"master.h"
#include
"device.h"
...
...
@@ -32,9 +33,6 @@ void __exit ec_cleanup_module(void);
/*****************************************************************************/
#define EC_LIT(X) #X
#define EC_STR(X) EC_LIT(X)
#define COMPILE_INFO "Revision " EC_STR(SVNREV) \
", compiled by " EC_STR(USER) \
" at " __DATE__ " " __TIME__
...
...
This diff is collapsed.
Click to expand it.
master/slave.c
+
5
−
19
View file @
2727be57
...
...
@@ -28,25 +28,11 @@ ssize_t ec_show_slave_attribute(struct kobject *, struct attribute *, char *);
/*****************************************************************************/
static
struct
attribute
attr_ring_position
=
{
.
name
=
"ring_position"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
static
struct
attribute
attr_station_address
=
{
.
name
=
"station_address"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
static
struct
attribute
attr_vendor_name
=
{
.
name
=
"vendor_name"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
static
struct
attribute
attr_product_name
=
{
.
name
=
"product_name"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
static
struct
attribute
attr_product_desc
=
{
.
name
=
"product_description"
,
.
owner
=
THIS_MODULE
,
.
mode
=
S_IRUGO
};
EC_SYSFS_READ_ATTR
(
ring_position
);
EC_SYSFS_READ_ATTR
(
station_address
);
EC_SYSFS_READ_ATTR
(
vendor_name
);
EC_SYSFS_READ_ATTR
(
product_name
);
EC_SYSFS_READ_ATTR
(
product_desc
);
static
struct
attribute
*
def_attrs
[]
=
{
&
attr_ring_position
,
...
...
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