Commit 3279defc authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

shell/sfp: add match force command for new boards bringups

parent f3e5b6f9
......@@ -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)) {
......
......@@ -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
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment