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
7
Merge Requests
7
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
3279defc
Commit
3279defc
authored
Aug 20, 2020
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell/sfp: add match force command for new boards bringups
parent
f3e5b6f9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
sfp.c
dev/sfp.c
+2
-2
sfp.h
include/sfp.h
+1
-1
snmp.c
lib/snmp.c
+1
-1
cmd_sfp.c
shell/cmd_sfp.c
+5
-1
wrc_main.c
wrc_main.c
+1
-1
No files found.
dev/sfp.c
View file @
3279defc
...
...
@@ -66,12 +66,12 @@ static int sfp_read_part_id(char *part_id)
return
-
1
;
}
int
sfp_match
(
void
)
int
sfp_match
(
int
force
)
{
struct
s_sfpinfo
sfp
;
sfp_pn
[
0
]
=
'\0'
;
if
(
!
sfp_present
())
{
if
(
!
force
&&
!
sfp_present
())
{
return
-
ENODEV
;
}
if
(
sfp_read_part_id
(
sfp_pn
))
{
...
...
include/sfp.h
View file @
3279defc
...
...
@@ -24,6 +24,6 @@ extern int32_t sfp_deltaTx;
extern
int32_t
sfp_deltaRx
;
/* Match plugged SFP with a DB entry */
int
sfp_match
(
void
);
int
sfp_match
(
int
force
);
#endif
lib/snmp.c
View file @
3279defc
...
...
@@ -1365,7 +1365,7 @@ static int set_ptp_config(uint8_t *buf, struct snmp_oid *obj)
break
;
}
/* perform a sfp match */
temp
=
sfp_match
();
temp
=
sfp_match
(
0
);
if
(
temp
)
{
snmp_verbose
(
"%s: Match error (%d)
\n
"
,
__func__
,
temp
);
*
apply_mode
=
applySuccessfulMatchFailed
;
...
...
shell/cmd_sfp.c
View file @
3279defc
...
...
@@ -88,7 +88,11 @@ static int cmd_sfp(const char *args[])
}
return
0
;
}
else
if
(
!
strcasecmp
(
args
[
0
],
"match"
))
{
ret
=
sfp_match
();
if
(
args
[
1
]
&&
!
strcasecmp
(
args
[
1
],
"force"
))
{
ret
=
sfp_match
(
1
);
}
else
{
ret
=
sfp_match
(
0
);
}
if
(
ret
==
-
ENODEV
)
{
pp_printf
(
"No SFP.
\n
"
);
return
ret
;
...
...
wrc_main.c
View file @
3279defc
...
...
@@ -125,7 +125,7 @@ static int wrc_check_link(void)
wrc_verbose
(
"Link up.
\n
"
);
event_post
(
WRC_EVENT_LINK_UP
);
gen_gpio_out
(
&
pin_sysc_led_link
,
1
);
sfp_match
();
sfp_match
(
0
);
wrc_ptp_start
();
link_status
=
LINK_WENT_UP
;
rv
=
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