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
327469eb
Commit
327469eb
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Added frame counter.
parent
f47db66e
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/device.c
+8
-0
8 additions, 0 deletions
master/device.c
master/device.h
+2
-0
2 additions, 0 deletions
master/device.h
master/master.c
+7
-0
7 additions, 0 deletions
master/master.c
with
17 additions
and
0 deletions
master/device.c
+
8
−
0
View file @
327469eb
...
...
@@ -71,6 +71,9 @@ int ec_device_init(ec_device_t *device, /**< EtherCAT device */
device
->
open
=
0
;
device
->
link_state
=
0
;
// down
device
->
tx_count
=
0
;
device
->
rx_count
=
0
;
#ifdef EC_DBG_IF
if
(
ec_debug_init
(
&
device
->
dbg
))
{
EC_ERR
(
"Failed to init debug device!
\n
"
);
...
...
@@ -146,6 +149,8 @@ int ec_device_open(ec_device_t *device /**< EtherCAT device */)
for
(
i
=
0
;
i
<
4
;
i
++
)
ec_device_call_isr
(
device
);
device
->
link_state
=
0
;
device
->
tx_count
=
0
;
device
->
rx_count
=
0
;
if
(
device
->
dev
->
open
(
device
->
dev
)
==
0
)
device
->
open
=
1
;
...
...
@@ -217,6 +222,7 @@ void ec_device_send(ec_device_t *device, /**< EtherCAT device */
// start sending
device
->
dev
->
hard_start_xmit
(
device
->
tx_skb
,
device
->
dev
);
device
->
tx_count
++
;
}
/*****************************************************************************/
...
...
@@ -251,6 +257,8 @@ void ecdev_receive(ec_device_t *device, /**< EtherCAT device */
size_t
size
/**< number of bytes received */
)
{
device
->
rx_count
++
;
if
(
unlikely
(
device
->
master
->
debug_level
>
1
))
{
EC_DBG
(
"Received frame:
\n
"
);
ec_print_data_diff
(
device
->
tx_skb
->
data
+
ETH_HLEN
,
...
...
This diff is collapsed.
Click to expand it.
master/device.h
+
2
−
0
View file @
327469eb
...
...
@@ -70,6 +70,8 @@ struct ec_device
unsigned
long
jiffies_isr
;
/**< jiffies of last ISR call */
struct
module
*
module
;
/**< pointer to the device's owning module */
uint8_t
link_state
;
/**< device link state */
unsigned
int
tx_count
;
/**< number of frames sent */
unsigned
int
rx_count
;
/**< number of frames received */
#ifdef EC_DBG_IF
ec_debug_t
dbg
;
/**< debug device */
#endif
...
...
This diff is collapsed.
Click to expand it.
master/master.c
+
7
−
0
View file @
327469eb
...
...
@@ -865,6 +865,13 @@ ssize_t ec_master_info(ec_master_t *master, /**< EtherCAT master */
off
+=
sprintf
(
buffer
+
off
,
"
\n
Slaves: %i
\n
"
,
master
->
slave_count
);
off
+=
sprintf
(
buffer
+
off
,
"
\n
Device:
\n
"
);
off
+=
sprintf
(
buffer
+
off
,
" Frames sent: %u
\n
"
,
master
->
device
->
tx_count
);
off
+=
sprintf
(
buffer
+
off
,
" Frames received: %u
\n
"
,
master
->
device
->
rx_count
);
off
+=
sprintf
(
buffer
+
off
,
" Frames lost: %u
\n
"
,
master
->
device
->
tx_count
-
master
->
device
->
rx_count
-
1
);
off
+=
sprintf
(
buffer
+
off
,
"
\n
Timing (min/avg/max) [us]:
\n
"
);
...
...
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