On Thu, Aug 16, 2018 at 10:42:12AM -0700, Vedang Patel wrote:
> diff --git a/fsm.c b/fsm.c
> index ce6efad30937..a0c98891e39f 100644
> --- a/fsm.c
> +++ b/fsm.c
> @@ -335,3 +335,103 @@ enum port_state ptp_slave_fsm(enum port_state state, 
> enum fsm_event event,
>  
>       return next;
>  }
> +
> +enum port_state designated_master_fsm(enum port_state state,
> +                                   enum fsm_event event,
> +                                   int mdiff)
> +{
        ...
> +}
> +
> +enum port_state designated_slave_fsm(enum port_state state,
> +                                  enum fsm_event event,
> +                                  int mdiff)
> +{
        ...
> +}

Can these two go into their own, new file?

> @@ -2853,10 +2868,24 @@ struct port *port_open(int phc_index,
>               goto err_port;
>       }
>  
> -     p->state_machine = clock_slave_only(clock) ? ptp_slave_fsm : ptp_fsm;
>       p->phc_index = phc_index;
>       p->jbod = config_get_int(cfg, interface->name, "boundary_clock_jbod");
>       transport = config_get_int(cfg, interface->name, "network_transport");
> +     p->master_only = config_get_int(cfg, p->name, "masterOnly");
> +     p->bmca = config_get_int(cfg, p->name, "BMCA");
> +
> +     if (p->bmca == BMCA_NOOP && transport != TRANS_UDS) {
> +             if (p->master_only) {
> +                     p->state_machine = designated_master_fsm;
> +             } else if (clock_slave_only(clock)) {
> +                     p->state_machine = designated_slave_fsm;
> +             } else {
> +                     pr_err("Please enable atleast one of masterOnly or 
> slaveOnly when BMCA == noop.\n");

"at least" -----------------------------------^

Thanks,
Richard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to