Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
925e35bd
Commit
925e35bd
authored
Jul 18, 2011
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
Jul 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NIC: PPSG/nanosecond part merging bufix
parent
ec9fa52e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
nic-core.c
kernel/nic/nic-core.c
+1
-1
nic-hardware.h
kernel/nic/nic-hardware.h
+2
-0
timestamp.c
kernel/nic/timestamp.c
+4
-4
No files found.
kernel/nic/nic-core.c
View file @
925e35bd
...
...
@@ -324,7 +324,7 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
wrn_ppsg_read_time
(
wrn
,
&
counter_ppsg
,
&
utc
);
if
(
counter_ppsg
<
ts_r
)
if
(
counter_ppsg
<
REFCLK_FREQ
/
4
&&
ts_r
>
3
*
REFCLK_FREQ
/
4
)
utc
--
;
hwts
->
hwtstamp
.
tv
.
sec
=
(
s32
)
utc
&
0x7fffffff
;
...
...
kernel/nic/nic-hardware.h
View file @
925e35bd
...
...
@@ -14,6 +14,8 @@
/* Our host CPU is this one, no way out of it */
#include <mach/at91sam9263.h>
#define REFCLK_FREQ 125000000
/* The interrupt is one of those managed by our WRVIC device */
#define WRN_IRQ_BASE 192
#define WRN_IRQ_PPSG (WRN_IRQ_BASE + 0)
...
...
kernel/nic/timestamp.c
View file @
925e35bd
...
...
@@ -38,7 +38,7 @@ void wrn_tstamp_find_skb(struct wrn_dev *wrn, int desc)
/* so we found the skb, do the timestamping magic */
hwts
=
skb_hwtstamps
(
skb
);
wrn_ppsg_read_time
(
wrn
,
&
counter_ppsg
,
&
utc
);
if
(
counter_ppsg
<
wrn
->
ts_buf
[
i
].
ts
)
if
(
counter_ppsg
>
3
*
REFCLK_FREQ
/
4
&&
wrn
->
ts_buf
[
i
].
ts
<
REFCLK_FREQ
/
4
)
utc
--
;
hwts
->
hwtstamp
.
tv
.
sec
=
(
s32
)
utc
&
0x7fffffff
;
...
...
@@ -61,8 +61,8 @@ static int record_tstamp(struct wrn_dev *wrn, u32 ts, u32 idreg)
u32
utc
,
counter_ppsg
;
/* PPS generator nanosecond counter */
int
i
;
/* FIXME: use list for faster access */
printk
(
"%s: Got TS: %x pid %d fid %d
\n
"
,
__func__
,
ts
,
port_id
,
frame_id
);
/*
printk("%s: Got TS: %x pid %d fid %d\n", __func__,
ts, port_id, frame_id);
*/
/* First of all look if the skb is already pending */
for
(
i
=
0
;
i
<
WRN_NR_DESC
;
i
++
)
...
...
@@ -70,7 +70,7 @@ static int record_tstamp(struct wrn_dev *wrn, u32 ts, u32 idreg)
break
;
if
(
i
<
WRN_NR_DESC
)
{
printk
(
"%s: found
\n
"
,
__func__
);
/*printk("%s: found\n", __func__);*/
skb
=
wrn
->
skb_desc
[
i
].
skb
;
hwts
=
skb_hwtstamps
(
skb
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment