Skip to content

Commit

Permalink
Deprecate the slaveOnly option in favor of clientOnly.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
  • Loading branch information
richardcochran committed Jan 18, 2021
1 parent a1cd870 commit fe01cc7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,12 +955,12 @@ struct clock *clock_create(enum clock_type type, struct config *config,

c->dds.domainNumber = config_get_int(config, NULL, "domainNumber");

if (config_get_int(config, NULL, "slaveOnly")) {
if (config_get_int(config, NULL, "clientOnly")) {
c->dds.flags |= DDS_SLAVE_ONLY;
}
if (!config_get_int(config, NULL, "gmCapable") &&
c->dds.flags & DDS_SLAVE_ONLY) {
pr_err("Cannot mix 1588 slaveOnly with 802.1AS !gmCapable");
pr_err("Cannot mix 1588 clientOnly with 802.1AS !gmCapable");
return NULL;
}
if (!config_get_int(config, NULL, "gmCapable") ||
Expand Down
5 changes: 4 additions & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("boundary_clock_jbod", 0, 0, 1),
PORT_ITEM_ENU("BMCA", BMCA_PTP, bmca_enu),
GLOB_ITEM_INT("check_fup_sync", 0, 0, 1),
GLOB_ITEM_INT("clientOnly", 0, 0, 1),
GLOB_ITEM_INT("clockAccuracy", 0xfe, 0, UINT8_MAX),
GLOB_ITEM_INT("clockClass", 248, 0, UINT8_MAX),
GLOB_ITEM_STR("clockIdentity", "000000.0000.000000"),
Expand Down Expand Up @@ -299,7 +300,7 @@ struct config_item config_tab[] = {
GLOB_ITEM_INT("servo_num_offset_values", 10, 0, INT_MAX),
GLOB_ITEM_INT("servo_offset_threshold", 0, 0, INT_MAX),
GLOB_ITEM_STR("slave_event_monitor", ""),
GLOB_ITEM_INT("slaveOnly", 0, 0, 1),
GLOB_ITEM_INT("slaveOnly", 0, 0, 1), /*deprecated*/
GLOB_ITEM_INT("socket_priority", 0, 0, 15),
GLOB_ITEM_DBL("step_threshold", 0.0, 0.0, DBL_MAX),
GLOB_ITEM_INT("summary_interval", 0, INT_MIN, INT_MAX),
Expand Down Expand Up @@ -707,6 +708,8 @@ static void check_deprecated_options(const char **option)
new_option = "first_step_threshold";
} else if (!strcmp(*option, "pi_max_frequency")) {
new_option = "max_frequency";
} else if (!strcmp(*option, "slaveOnly")) {
new_option = "clientOnly";
}

if (new_option) {
Expand Down
2 changes: 1 addition & 1 deletion port.c
Original file line number Diff line number Diff line change
Expand Up @@ -3048,7 +3048,7 @@ struct port *port_open(const char *phc_device,
} else if (clock_slave_only(clock)) {
p->state_machine = designated_slave_fsm;
} else {
pr_err("Please enable at least one of masterOnly or slaveOnly when BMCA == noop.\n");
pr_err("Please enable at least one of masterOnly or clientOnly when BMCA == noop.\n");
goto err_port;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion ptp4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int main(int argc, char *argv[])
req_phc = optarg;
break;
case 's':
if (config_set_int(cfg, "slaveOnly", 1)) {
if (config_set_int(cfg, "clientOnly", 1)) {
goto out;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion timemaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static int add_ptp_source(struct ptp_domain *source,
extend_config_string(&config_file->content,
source->ptp4l_settings);
string_appendf(&config_file->content,
"slaveOnly 1\n"
"clientOnly 1\n"
"domainNumber %d\n"
"uds_address %s\n"
"message_tag %s\n",
Expand Down

0 comments on commit fe01cc7

Please sign in to comment.