/* Reads the port error status CSR for the master port to determine if the port has an active link. Returns PORT_N_ERR_STS_PORT_OK if the master port is active or %0 if it is inactive.  */
static int rio_mport_is_active(struct rio_mport *port)
/* Reads the port error status CSR for the master port to determine if the port has an active link. Returns PORT_N_ERR_STS_PORT_OK if the master port is active or %0 if it is inactive.  */
static int rio_mport_is_active(struct rio_mport *port)
{
	u32 result = 0;
	u32 ext_ftr_ptr;
	int *entry = rio_mport_phys_table;
	do {
		if ((ext_ftr_ptr =
		     rio_mport_get_feature(port, 1, 0, 0, *entry)))
			break;
	} while (*++entry >= 0);
	if (ext_ftr_ptr)
		rio_local_read_config_32(port,
					 ext_ftr_ptr +
					 RIO_PORT_N_ERR_STS_CSR(port->index),
					 &result);
	return (result & PORT_N_ERR_STS_PORT_OK);
}