On 1/14/2021 6:15 AM, Richard Cochran wrote:
> Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
> ---
> clock.c | 4 ++--
> config.c | 5 ++++-
> port.c | 2 +-
> ptp4l.c | 2 +-
> timemaster.c | 2 +-
> 5 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/clock.c b/clock.c
> index 0156bc3..08c61eb 100644
> --- a/clock.c
> +++ b/clock.c
> @@ -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") ||
> diff --git a/config.c b/config.c
> index a09739d..4095b33 100644
> --- a/config.c
> +++ b/config.c
> @@ -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"),
> @@ -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),
> @@ -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";
Ahh. here is where the options get converted to support switching. Ok!
> }
>
> if (new_option) {
> diff --git a/port.c b/port.c
> index 6c52004..0a93c06 100644
> --- a/port.c
> +++ b/port.c
> @@ -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 {
> diff --git a/ptp4l.c b/ptp4l.c
> index ccbaa02..c61175b 100644
> --- a/ptp4l.c
> +++ b/ptp4l.c
> @@ -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;
> diff --git a/timemaster.c b/timemaster.c
> index 00db59f..fb27d72 100644
> --- a/timemaster.c
> +++ b/timemaster.c
> @@ -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",
>
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel