Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
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
Software for White Rabbit PTP Core
Commits
76a225d3
Commit
76a225d3
authored
Oct 01, 2013
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix t24p, we used default value and not the one returned from calib procedure
parent
3bc91804
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
7 deletions
+22
-7
eeprom.c
dev/eeprom.c
+6
-2
rxts_calibrator.c
dev/rxts_calibrator.c
+9
-2
ptpd_netif.h
include/ptpd_netif.h
+1
-0
net.c
lib/net.c
+6
-3
No files found.
dev/eeprom.c
View file @
76a225d3
...
...
@@ -225,13 +225,17 @@ int8_t eeprom_match_sfp(uint8_t i2cif, uint8_t i2c_addr, struct s_sfpinfo * sfp)
int8_t
eeprom_phtrans
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
*
val
,
uint8_t
write
)
{
int8_t
ret
;
if
(
write
)
{
*
val
|=
(
1
<<
31
);
if
(
eeprom_write
(
i2cif
,
i2c_addr
,
EE_BASE_CAL
,
(
uint8_t
*
)
val
,
sizeof
(
*
val
))
!=
sizeof
(
*
val
))
ret
urn
EE_RET_I2CERR
;
ret
=
EE_RET_I2CERR
;
else
return
1
;
ret
=
1
;
*
val
&=
0x7fffffff
;
//return ph_trans value without validity bit
return
ret
;
}
else
{
if
(
eeprom_read
(
i2cif
,
i2c_addr
,
EE_BASE_CAL
,
(
uint8_t
*
)
val
,
sizeof
(
*
val
))
!=
sizeof
(
*
val
))
...
...
dev/rxts_calibrator.c
View file @
76a225d3
...
...
@@ -18,6 +18,7 @@
#include "softpll_ng.h"
#include "wrc_ptp.h"
#include "eeprom.h"
#include "ptpd_netif.h"
/* New calibrator for the transition phase value. A major pain in the ass for
the folks who frequently rebuild their gatewares. The idea is described
...
...
@@ -235,8 +236,14 @@ static int calib_t24p_master(uint32_t *value)
int
calib_t24p
(
int
mode
,
uint32_t
*
value
)
{
int
ret
;
if
(
mode
==
WRC_MODE_SLAVE
)
ret
urn
calib_t24p_slave
(
value
);
ret
=
calib_t24p_slave
(
value
);
else
return
calib_t24p_master
(
value
);
ret
=
calib_t24p_master
(
value
);
//update phtrans value in socket struct
ptpd_netif_set_phase_transition
(
*
value
);
return
ret
;
}
include/ptpd_netif.h
View file @
76a225d3
...
...
@@ -242,5 +242,6 @@ void ptpd_netif_linearize_rx_timestamp(wr_timestamp_t * ts, int32_t dmtd_phase,
int
clock_period
);
int
ptpd_netif_enable_timing_output
(
int
enable
);
int
ptpd_netif_enable_phase_tracking
(
const
char
*
if_name
);
void
ptpd_netif_set_phase_transition
(
uint32_t
phase
);
#endif
lib/net.c
View file @
76a225d3
...
...
@@ -56,10 +56,13 @@ int ptpd_netif_get_hw_addr(wr_socket_t * sock, mac_addr_t * mac)
return
0
;
}
void
ptpd_netif_set_phase_transition
(
wr_socket_t
*
sock
,
in
t
phase
)
void
ptpd_netif_set_phase_transition
(
uint32_
t
phase
)
{
struct
my_socket
*
s
=
(
struct
my_socket
*
)
sock
;
s
->
phase_transition
=
phase
;
int
i
;
for
(
i
=
0
;
i
<
NET_MAX_SOCKETS
;
++
i
)
{
socks
[
i
].
phase_transition
=
phase
;
}
}
wr_socket_t
*
ptpd_netif_create_socket
(
int
sock_type
,
int
flags
,
...
...
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