Lines Matching refs:port_agent

161 	struct sci_port_configuration_agent *port_agent)  in sci_port_configuration_agent_validate_ports()  argument
169 if (port_agent->phy_valid_port_range[0].max_index != 0 || in sci_port_configuration_agent_validate_ports()
170 port_agent->phy_valid_port_range[1].max_index != 1 || in sci_port_configuration_agent_validate_ports()
171 port_agent->phy_valid_port_range[2].max_index != 2 || in sci_port_configuration_agent_validate_ports()
172 port_agent->phy_valid_port_range[3].max_index != 3) in sci_port_configuration_agent_validate_ports()
178 if (port_agent->phy_valid_port_range[0].min_index == 0 && in sci_port_configuration_agent_validate_ports()
179 port_agent->phy_valid_port_range[1].min_index == 0 && in sci_port_configuration_agent_validate_ports()
180 port_agent->phy_valid_port_range[2].min_index == 0 && in sci_port_configuration_agent_validate_ports()
181 port_agent->phy_valid_port_range[3].min_index == 0) in sci_port_configuration_agent_validate_ports()
189 if (port_agent->phy_valid_port_range[2].min_index == 1) { in sci_port_configuration_agent_validate_ports()
208 if (port_agent->phy_valid_port_range[0].min_index == 0 && in sci_port_configuration_agent_validate_ports()
209 port_agent->phy_valid_port_range[1].min_index == 1) { in sci_port_configuration_agent_validate_ports()
222 if (port_agent->phy_valid_port_range[2].min_index == 2 && in sci_port_configuration_agent_validate_ports()
223 port_agent->phy_valid_port_range[3].min_index == 3) { in sci_port_configuration_agent_validate_ports()
243 struct sci_port_configuration_agent *port_agent) in sci_mpc_agent_validate_phy_configuration() argument
279 port_agent->phy_valid_port_range[phy_index].min_index = port_index; in sci_mpc_agent_validate_phy_configuration()
280 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; in sci_mpc_agent_validate_phy_configuration()
307 port_agent->phy_valid_port_range[phy_index].min_index = port_index; in sci_mpc_agent_validate_phy_configuration()
308 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; in sci_mpc_agent_validate_phy_configuration()
318 return sci_port_configuration_agent_validate_ports(ihost, port_agent); in sci_mpc_agent_validate_phy_configuration()
325 struct sci_port_configuration_agent *port_agent; in mpc_agent_timeout() local
330 port_agent = container_of(tmr, typeof(*port_agent), timer); in mpc_agent_timeout()
331 ihost = container_of(port_agent, typeof(*ihost), port_agent); in mpc_agent_timeout()
338 port_agent->timer_pending = false; in mpc_agent_timeout()
341 configure_phy_mask = ~port_agent->phy_configured_mask & port_agent->phy_ready_mask; in mpc_agent_timeout()
347 port_agent->link_up_handler(ihost, port_agent, in mpc_agent_timeout()
358 struct sci_port_configuration_agent *port_agent, in sci_mpc_agent_link_up() argument
369 port_agent->phy_ready_mask |= (1 << iphy->phy_index); in sci_mpc_agent_link_up()
372 port_agent->phy_configured_mask |= (1 << iphy->phy_index); in sci_mpc_agent_link_up()
394 struct sci_port_configuration_agent *port_agent, in sci_mpc_agent_link_down() argument
406 port_agent->phy_ready_mask &= ~(1 << iphy->phy_index); in sci_mpc_agent_link_down()
407 port_agent->phy_configured_mask &= ~(1 << iphy->phy_index); in sci_mpc_agent_link_down()
415 if ((port_agent->phy_configured_mask == 0x0000) && in sci_mpc_agent_link_down()
416 (port_agent->phy_ready_mask != 0x0000) && in sci_mpc_agent_link_down()
417 !port_agent->timer_pending) { in sci_mpc_agent_link_down()
418 port_agent->timer_pending = true; in sci_mpc_agent_link_down()
420 sci_mod_timer(&port_agent->timer, in sci_mpc_agent_link_down()
433 struct sci_port_configuration_agent *port_agent) in sci_apc_agent_validate_phy_configuration() argument
455 port_agent->phy_valid_port_range[phy_index].min_index = port_index; in sci_apc_agent_validate_phy_configuration()
456 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; in sci_apc_agent_validate_phy_configuration()
458 port_agent->phy_valid_port_range[phy_index].min_index = phy_index; in sci_apc_agent_validate_phy_configuration()
459 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; in sci_apc_agent_validate_phy_configuration()
465 return sci_port_configuration_agent_validate_ports(ihost, port_agent); in sci_apc_agent_validate_phy_configuration()
474 static void sci_apc_agent_start_timer(struct sci_port_configuration_agent *port_agent, in sci_apc_agent_start_timer() argument
477 port_agent->timer_pending = true; in sci_apc_agent_start_timer()
478 sci_mod_timer(&port_agent->timer, timeout); in sci_apc_agent_start_timer()
482 struct sci_port_configuration_agent *port_agent, in sci_apc_agent_configure_ports() argument
505 for (port_index = port_agent->phy_valid_port_range[iphy->phy_index].min_index; in sci_apc_agent_configure_ports()
506 port_index <= port_agent->phy_valid_port_range[iphy->phy_index].max_index; in sci_apc_agent_configure_ports()
575 port_agent->phy_configured_mask |= (1 << iphy->phy_index); in sci_apc_agent_configure_ports()
580 sci_apc_agent_start_timer(port_agent, in sci_apc_agent_configure_ports()
604 struct sci_port_configuration_agent *port_agent, in sci_apc_agent_link_up() argument
612 port_agent->phy_ready_mask |= 1 << phy_index; in sci_apc_agent_link_up()
613 sci_apc_agent_start_timer(port_agent, in sci_apc_agent_link_up()
617 port_agent->phy_ready_mask |= 1 << phy_index; in sci_apc_agent_link_up()
637 struct sci_port_configuration_agent *port_agent, in sci_apc_agent_link_down() argument
641 port_agent->phy_ready_mask &= ~(1 << iphy->phy_index); in sci_apc_agent_link_down()
645 if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) { in sci_apc_agent_link_down()
651 port_agent->phy_configured_mask &= ~(1 << iphy->phy_index); in sci_apc_agent_link_down()
660 struct sci_port_configuration_agent *port_agent; in apc_agent_timeout() local
665 port_agent = container_of(tmr, typeof(*port_agent), timer); in apc_agent_timeout()
666 ihost = container_of(port_agent, typeof(*ihost), port_agent); in apc_agent_timeout()
673 port_agent->timer_pending = false; in apc_agent_timeout()
675 configure_phy_mask = ~port_agent->phy_configured_mask & port_agent->phy_ready_mask; in apc_agent_timeout()
684 sci_apc_agent_configure_ports(ihost, port_agent, in apc_agent_timeout()
708 struct sci_port_configuration_agent *port_agent) in sci_port_configuration_agent_construct() argument
712 port_agent->phy_configured_mask = 0x00; in sci_port_configuration_agent_construct()
713 port_agent->phy_ready_mask = 0x00; in sci_port_configuration_agent_construct()
715 port_agent->link_up_handler = NULL; in sci_port_configuration_agent_construct()
716 port_agent->link_down_handler = NULL; in sci_port_configuration_agent_construct()
718 port_agent->timer_pending = false; in sci_port_configuration_agent_construct()
721 port_agent->phy_valid_port_range[index].min_index = 0; in sci_port_configuration_agent_construct()
722 port_agent->phy_valid_port_range[index].max_index = 0; in sci_port_configuration_agent_construct()
728 return ihost->port_agent.link_up_handler == sci_apc_agent_link_up; in is_port_config_apc()
733 struct sci_port_configuration_agent *port_agent) in sci_port_configuration_agent_initialize() argument
742 ihost, port_agent); in sci_port_configuration_agent_initialize()
744 port_agent->link_up_handler = sci_mpc_agent_link_up; in sci_port_configuration_agent_initialize()
745 port_agent->link_down_handler = sci_mpc_agent_link_down; in sci_port_configuration_agent_initialize()
747 sci_init_timer(&port_agent->timer, mpc_agent_timeout); in sci_port_configuration_agent_initialize()
750 ihost, port_agent); in sci_port_configuration_agent_initialize()
752 port_agent->link_up_handler = sci_apc_agent_link_up; in sci_port_configuration_agent_initialize()
753 port_agent->link_down_handler = sci_apc_agent_link_down; in sci_port_configuration_agent_initialize()
755 sci_init_timer(&port_agent->timer, apc_agent_timeout); in sci_port_configuration_agent_initialize()