File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
subsys/net/l2/ethernet/gptp Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -521,18 +521,23 @@ static void gptp_state_machine(void)
521
521
for (port = GPTP_PORT_START ; port < GPTP_PORT_END ; port ++ ) {
522
522
struct gptp_port_ds * port_ds = GPTP_PORT_DS (port );
523
523
524
- switch (GPTP_GLOBAL_DS ()-> selected_role [port ]) {
525
- case GPTP_PORT_DISABLED :
526
- case GPTP_PORT_MASTER :
527
- case GPTP_PORT_PASSIVE :
528
- case GPTP_PORT_SLAVE :
529
- gptp_md_state_machines (port );
530
- gptp_mi_port_sync_state_machines (port );
531
- gptp_mi_port_bmca_state_machines (port );
532
- break ;
533
- default :
534
- NET_DBG ("%s: Unknown port state" , __func__ );
535
- break ;
524
+ /* If interface is down, don't move foward */
525
+ if (net_if_flag_is_set (GPTP_PORT_IFACE (port ), NET_IF_UP )) {
526
+ switch (GPTP_GLOBAL_DS ()-> selected_role [port ]) {
527
+ case GPTP_PORT_DISABLED :
528
+ case GPTP_PORT_MASTER :
529
+ case GPTP_PORT_PASSIVE :
530
+ case GPTP_PORT_SLAVE :
531
+ gptp_md_state_machines (port );
532
+ gptp_mi_port_sync_state_machines (port );
533
+ gptp_mi_port_bmca_state_machines (port );
534
+ break ;
535
+ default :
536
+ NET_DBG ("%s: Unknown port state" , __func__ );
537
+ break ;
538
+ }
539
+ } else {
540
+ GPTP_GLOBAL_DS ()-> selected_role [port ] = GPTP_PORT_DISABLED ;
536
541
}
537
542
538
543
port_ds -> prev_ptt_port_enabled = port_ds -> ptt_port_enabled ;
You can’t perform that action at this time.
0 commit comments