Lines Matching refs:eacr

590 static inline int etr_mode_is_pps(struct etr_eacr eacr)  in etr_mode_is_pps()  argument
592 return eacr.es && !eacr.sl; in etr_mode_is_pps()
598 static inline int etr_mode_is_etr(struct etr_eacr eacr) in etr_mode_is_etr() argument
600 return eacr.es && eacr.sl; in etr_mode_is_etr()
664 if (a1->esw.eacr.e0 != a2->esw.eacr.e0 || in etr_aib_follows()
665 a1->esw.eacr.e1 != a2->esw.eacr.e1) in etr_aib_follows()
822 static struct etr_eacr etr_handle_events(struct etr_eacr eacr) in etr_handle_events() argument
825 eacr.es = 0; in etr_handle_events()
827 eacr.es = eacr.sl = 0; in etr_handle_events()
832 if (eacr.e0) in etr_handle_events()
839 eacr.p0 = etr_port0_online; in etr_handle_events()
840 if (!eacr.p0) in etr_handle_events()
841 eacr.e0 = 0; in etr_handle_events()
845 if (eacr.e1) in etr_handle_events()
852 eacr.p1 = etr_port1_online; in etr_handle_events()
853 if (!eacr.p1) in etr_handle_events()
854 eacr.e1 = 0; in etr_handle_events()
858 return eacr; in etr_handle_events()
889 struct etr_eacr eacr) in etr_handle_update() argument
892 if (!eacr.e0 && !eacr.e1) in etr_handle_update()
893 return eacr; in etr_handle_update()
898 if (eacr.p0 && !etr_port0_uptodate) { in etr_handle_update()
905 if (eacr.p1 && !etr_port1_uptodate) { in etr_handle_update()
916 if (!eacr.es || !check_sync_clock()) in etr_handle_update()
917 return eacr; in etr_handle_update()
925 if (eacr.p0 && !etr_port0_uptodate) { in etr_handle_update()
929 if (eacr.p1 && !etr_port1_uptodate) { in etr_handle_update()
938 if ((eacr.p0 && !etr_port0_uptodate) || in etr_handle_update()
939 (eacr.p1 && !etr_port1_uptodate)) in etr_handle_update()
940 eacr.dp ^= 1; in etr_handle_update()
942 eacr.dp = 0; in etr_handle_update()
944 return eacr; in etr_handle_update()
951 static void etr_update_eacr(struct etr_eacr eacr) in etr_update_eacr() argument
955 if (memcmp(&etr_eacr, &eacr, sizeof(eacr)) == 0) in etr_update_eacr()
962 dp_changed = etr_eacr.e0 > eacr.e0 || etr_eacr.e1 > eacr.e1 || in etr_update_eacr()
963 (etr_eacr.dp ^ eacr.dp) != 0; in etr_update_eacr()
964 etr_eacr = eacr; in etr_update_eacr()
978 struct etr_eacr eacr; in etr_work_fn() local
986 eacr = etr_eacr; in etr_work_fn()
989 eacr = etr_handle_events(eacr); in etr_work_fn()
992 eacr.ea = eacr.p0 || eacr.p1; in etr_work_fn()
993 if (!eacr.ea) { in etr_work_fn()
995 eacr.dp = eacr.es = eacr.sl = 0; in etr_work_fn()
998 etr_update_eacr(eacr); in etr_work_fn()
1012 eacr = etr_handle_update(&aib, eacr); in etr_work_fn()
1027 if (eacr.p0 && aib.esw.psc0 == etr_lpsc_pps_mode) { in etr_work_fn()
1028 eacr.sl = 0; in etr_work_fn()
1029 eacr.e0 = 1; in etr_work_fn()
1031 eacr.es = 0; in etr_work_fn()
1032 if (!eacr.es || !eacr.p1 || aib.esw.psc1 != etr_lpsc_pps_mode) in etr_work_fn()
1033 eacr.e1 = 0; in etr_work_fn()
1036 eacr.e1 = 1; in etr_work_fn()
1039 } else if (eacr.p1 && aib.esw.psc1 == etr_lpsc_pps_mode) { in etr_work_fn()
1040 eacr.sl = 0; in etr_work_fn()
1041 eacr.e0 = 0; in etr_work_fn()
1042 eacr.e1 = 1; in etr_work_fn()
1044 eacr.es = 0; in etr_work_fn()
1047 } else if (eacr.p0 && aib.esw.psc0 == etr_lpsc_operational_step) { in etr_work_fn()
1048 eacr.sl = 1; in etr_work_fn()
1049 eacr.e0 = 1; in etr_work_fn()
1051 eacr.es = 0; in etr_work_fn()
1052 if (!eacr.es || !eacr.p1 || in etr_work_fn()
1054 eacr.e1 = 0; in etr_work_fn()
1057 eacr.e1 = 1; in etr_work_fn()
1060 } else if (eacr.p1 && aib.esw.psc1 == etr_lpsc_operational_step) { in etr_work_fn()
1061 eacr.sl = 1; in etr_work_fn()
1062 eacr.e0 = 0; in etr_work_fn()
1063 eacr.e1 = 1; in etr_work_fn()
1065 eacr.es = 0; in etr_work_fn()
1070 eacr.es = eacr.sl = 0; in etr_work_fn()
1078 if ((eacr.es && check_sync_clock()) || sync_port < 0) { in etr_work_fn()
1079 etr_update_eacr(eacr); in etr_work_fn()
1088 eacr.dp = 0; in etr_work_fn()
1089 eacr.es = 1; in etr_work_fn()
1098 etr_update_eacr(eacr); in etr_work_fn()
1102 eacr.es = 0; in etr_work_fn()
1103 etr_update_eacr(eacr); in etr_work_fn()