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
ec9fa52e
Commit
ec9fa52e
authored
Jul 18, 2011
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
Jul 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timestamp.c: TX timestamp readout bugfix
parent
bcf5c625
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
timestamp.c
kernel/nic/timestamp.c
+9
-5
No files found.
kernel/nic/timestamp.c
View file @
ec9fa52e
...
...
@@ -61,25 +61,29 @@ 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 */
pr
_debug
(
"%s: Got TS: %x pid %d fid %d
\n
"
,
__func__
,
pr
intk
(
"%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
++
)
if
(
wrn
->
skb_desc
[
i
].
skb
&&
wrn
->
skb_desc
[
i
].
id
==
frame_id
)
break
;
if
(
i
<
WRN_NR_DESC
)
{
pr
_debug
(
"%s: found
\n
"
,
__func__
);
pr
intk
(
"%s: found
\n
"
,
__func__
);
skb
=
wrn
->
skb_desc
[
i
].
skb
;
hwts
=
skb_hwtstamps
(
skb
);
wrn_ppsg_read_time
(
wrn
,
&
counter_ppsg
,
&
utc
);
if
(
counter_ppsg
<
wrn
->
ts_buf
[
i
].
ts
)
if
(
counter_ppsg
<
(
ts
&
0xfffffff
)
)
utc
--
;
hwts
->
hwtstamp
.
tv
.
sec
=
(
s32
)
utc
&
0x7fffffff
;
hwts
->
hwtstamp
.
tv
.
nsec
=
ts
*
8
;
/* scale to nanoseconds */
hwts
->
hwtstamp
.
tv
.
nsec
=
(
ts
&
0xfffffff
)
*
8
;
/* scale to nanoseconds */
skb_tstamp_tx
(
skb
,
hwts
);
dev_kfree_skb_irq
(
skb
);
wrn
->
skb_desc
[
i
].
skb
=
0
;
return
0
;
}
/* Otherwise, save it to the list */
for
(
i
=
0
;
i
<
WRN_TS_BUF_SIZE
;
i
++
)
...
...
@@ -104,7 +108,7 @@ irqreturn_t wrn_tstamp_interrupt(int irq, void *dev_id)
struct
TXTSU_WB
*
regs
=
wrn
->
txtsu_regs
;
u32
r0
,
r1
;
printk
(
"%s: %i
\n
"
,
__func__
,
__LINE__
);
/* printk("%s: %i\n", __func__, __LINE__); */
/* FIXME: locking */
r0
=
readl
(
&
regs
->
TSF_R0
);
r1
=
readl
(
&
regs
->
TSF_R1
);
...
...
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