/* Check if the port can be used for TOD synchronization. For PPS mode the port has to receive OTEs. For ETR mode the port has to receive OTEs, the ETR stepping bit has to be zero and the validity bits for data frame 1, 2, and 3 have to be 1.  */
static int etr_port_valid(struct etr_aib *aib, int port)
/* Check if the port can be used for TOD synchronization. For PPS mode the port has to receive OTEs. For ETR mode the port has to receive OTEs, the ETR stepping bit has to be zero and the validity bits for data frame 1, 2, and 3 have to be 1.  */
static int etr_port_valid(struct etr_aib *aib, int port)
{
	unsigned int psc;
	if (aib->tsp == 0)
		return 0;
	psc = port ? aib->esw.psc1 : aib->esw.psc0;
	if (psc == etr_lpsc_pps_mode)
		return 1;
	if (psc == etr_lpsc_operational_step)
		return !aib->esw.y && aib->slsw.v1 &&
			aib->slsw.v2 && aib->slsw.v3;
	return 0;
}