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
82162272
Commit
82162272
authored
Mar 22, 2013
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/tools/wr_phytool: ugly fix for ttrans command
parent
5edf11ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
wr_phytool.c
userspace/tools/wr_phytool.c
+24
-4
No files found.
userspace/tools/wr_phytool.c
View file @
82162272
/*
/*
\
* WR Switch PHY testing tool
Tomasz Wlostowski / 2012
...
...
@@ -223,7 +223,6 @@ void calc_trans(int ep, int argc, char *argv[])
int
bitslide
,
phase
,
i
;
signal
(
SIGINT
,
sighandler
);
for
(
i
=
0
;
i
<
MAX_BITSLIDES
;
i
++
)
{
bslides
[
i
].
occupied
=
0
;
...
...
@@ -244,11 +243,18 @@ void calc_trans(int ep, int argc, char *argv[])
sock
=
ptpd_netif_create_socket
(
PTPD_SOCK_RAW_ETHERNET
,
0
,
&
sock_addr
);
// fpga_writel(EP_DMCR_N_AVG_W(1024) | EP_DMCR_EN, IDX_TO_EP(ep) + EP_REG(DMCR));
if
(
rts_connect
()
<
0
)
{
printf
(
"Can't connect to the RT subsys
\n
"
);
return
-
1
;
}
while
(
!
quit
)
{
char
buf
[
64
];
wr_sockaddr_t
to
;
struct
rts_pll_state
pstate
;
pcs_write
(
ep
,
MII_BMCR
,
BMCR_PDOWN
);
usleep
(
10000
);
...
...
@@ -258,12 +264,20 @@ void calc_trans(int ep, int argc, char *argv[])
while
(
!
(
pcs_read
(
ep
,
MII_BMSR
)
&
BMSR_LSTATUS
))
usleep
(
10000
);
usleep
(
200000
);
bitslide
=
get_bitslide
(
ep
);
usleep
(
1000000
);
rts_enable_ptracker
(
ep
,
0
);
rts_enable_ptracker
(
ep
,
1
);
usleep
(
1000000
);
// get_phase(ep, &phase);
ptpd_netif_get_dmtd_phase
(
sock
,
&
phase
);
rts_get_state
(
&
pstate
);
phase
=
pstate
.
channels
[
ep
].
phase_loopback
;
printf
(
"phase %d flags %x
\n
"
,
phase
,
pstate
.
channels
[
ep
].
flags
);
// ptpd_netif_get_dmtd_phase(sock, &phase);
...
...
@@ -431,6 +445,12 @@ void rt_command(int ep, int argc, char *argv[])
}
// rts_lock_channel(ep);
}
else
if
(
!
strcmp
(
argv
[
3
],
"track"
))
{
printf
(
"Enabling ptracker @ port %d
\n
"
,
ep
);
rts_enable_ptracker
(
ep
,
1
);
}
}
...
...
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