Lines Matching +full:link +full:- +full:loss +full:- +full:low
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
93 return -1; in sci_sas_address_compare()
94 } else if (address_one.low > address_two.low) { in sci_sas_address_compare()
96 } else if (address_one.low < address_two.low) { in sci_sas_address_compare()
97 return -1; in sci_sas_address_compare()
133 for (i = 0; i < ihost->logical_port_entries; i++) { in sci_port_configuration_agent_find_port()
134 struct isci_port *iport = &ihost->ports[i]; in sci_port_configuration_agent_find_port()
154 * -> (PE0), (PE0, PE1), (PE0, PE1, PE2, PE3) LP1 -> (PE1) LP2 -> (PE2), (PE2,
155 * PE3) LP3 -> (PE3) enum sci_status SCI_SUCCESS the port configuration is valid for
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()
197 sci_phy_get_sas_address(&ihost->phys[0], &first_address); in sci_port_configuration_agent_validate_ports()
198 sci_phy_get_sas_address(&ihost->phys[3], &second_address); 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()
210 sci_phy_get_sas_address(&ihost->phys[0], &first_address); in sci_port_configuration_agent_validate_ports()
211 sci_phy_get_sas_address(&ihost->phys[2], &second_address); 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()
224 sci_phy_get_sas_address(&ihost->phys[1], &first_address); in sci_port_configuration_agent_validate_ports()
225 sci_phy_get_sas_address(&ihost->phys[3], &second_address); in sci_port_configuration_agent_validate_ports()
254 sas_address.low = 0; in sci_mpc_agent_validate_phy_configuration()
257 phy_mask = ihost->oem_parameters.ports[port_index].phy_mask; in sci_mpc_agent_validate_phy_configuration()
272 sci_phy_get_sas_address(&ihost->phys[phy_index], in sci_mpc_agent_validate_phy_configuration()
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()
297 sci_phy_get_sas_address(&ihost->phys[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()
310 sci_port_add_phy(&ihost->ports[port_index], in sci_mpc_agent_validate_phy_configuration()
311 &ihost->phys[phy_index]); in sci_mpc_agent_validate_phy_configuration()
333 spin_lock_irqsave(&ihost->scic_lock, flags); in mpc_agent_timeout()
335 if (tmr->cancel) 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()
344 struct isci_phy *iphy = &ihost->phys[index]; in mpc_agent_timeout()
347 port_agent->link_up_handler(ihost, port_agent, in mpc_agent_timeout()
354 spin_unlock_irqrestore(&ihost->scic_lock, flags); in mpc_agent_timeout()
369 port_agent->phy_ready_mask |= (1 << iphy->phy_index); in sci_mpc_agent_link_up()
371 if ((iport->active_phy_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()
377 * @ihost: This is the controller object that receives the link down
385 * @iphy: This is the phy object which has gone link down.
387 * This function handles the manual port configuration link down notifications.
389 * around and notifiy the port object of the link down event. If this PHY is
391 * link down notification from a phy that has no assocoated port?
407 port_agent->phy_ready_mask &= ~(1 << iphy->phy_index); in sci_mpc_agent_link_down()
408 port_agent->phy_configured_mask &= ~(1 << iphy->phy_index); in sci_mpc_agent_link_down()
416 if ((port_agent->phy_configured_mask == 0x0000) && in sci_mpc_agent_link_down()
417 (port_agent->phy_ready_mask != 0x0000) && in sci_mpc_agent_link_down()
418 !port_agent->timer_pending) { in sci_mpc_agent_link_down()
419 port_agent->timer_pending = true; in sci_mpc_agent_link_down()
421 sci_mod_timer(&port_agent->timer, in sci_mpc_agent_link_down()
447 sci_phy_get_sas_address(&ihost->phys[phy_index], in sci_apc_agent_validate_phy_configuration()
451 sci_phy_get_sas_address(&ihost->phys[phy_index], in sci_apc_agent_validate_phy_configuration()
456 port_agent->phy_valid_port_range[phy_index].min_index = port_index; in sci_apc_agent_validate_phy_configuration()
457 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; in sci_apc_agent_validate_phy_configuration()
459 port_agent->phy_valid_port_range[phy_index].min_index = phy_index; in sci_apc_agent_validate_phy_configuration()
460 port_agent->phy_valid_port_range[phy_index].max_index = phy_index; in sci_apc_agent_validate_phy_configuration()
471 * timer for the next time period. This could be caused by either a link
472 * down event or a link up event where we can not yet tell to which a phy
478 port_agent->timer_pending = true; in sci_apc_agent_start_timer()
479 sci_mod_timer(&port_agent->timer, timeout); in sci_apc_agent_start_timer()
495 if (sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) in sci_apc_agent_configure_ports()
506 for (port_index = port_agent->phy_valid_port_range[iphy->phy_index].min_index; in sci_apc_agent_configure_ports()
507 port_index <= port_agent->phy_valid_port_range[iphy->phy_index].max_index; in sci_apc_agent_configure_ports()
510 iport = &ihost->ports[port_index]; in sci_apc_agent_configure_ports()
513 if (sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) { in sci_apc_agent_configure_ports()
516 * PHY that has gone link up. This phy can not be part of any in sci_apc_agent_configure_ports()
518 if (iport->active_phy_mask > (1 << iphy->phy_index)) { in sci_apc_agent_configure_ports()
527 if (iport->physical_port_index == iphy->phy_index) { in sci_apc_agent_configure_ports()
544 if (iport->active_phy_mask == 0) { in sci_apc_agent_configure_ports()
547 } else if (iport->active_phy_mask != 0) { in sci_apc_agent_configure_ports()
576 port_agent->phy_configured_mask |= (1 << iphy->phy_index); in sci_apc_agent_configure_ports()
593 * sci_apc_agent_link_up - handle apc link up events
594 * @ihost: This is the controller object that receives the link up
599 * @iphy: This is the phy object which has gone link up.
601 * This method handles the automatic port configuration for link up
602 * notifications. Is it possible to get a link down notification from a phy
610 u8 phy_index = iphy->phy_index; in sci_apc_agent_link_up()
614 port_agent->phy_ready_mask |= 1 << phy_index; in sci_apc_agent_link_up()
619 port_agent->phy_ready_mask |= 1 << phy_index; in sci_apc_agent_link_up()
626 * @ihost: This is the controller object that receives the link down
631 * @iphy: This is the phy object which has gone link down.
633 * This method handles the automatic port configuration link down
635 * possible to get a link down notification from a phy that has no assocoated
644 port_agent->phy_ready_mask &= ~(1 << iphy->phy_index); in sci_apc_agent_link_down()
648 if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) { in sci_apc_agent_link_down()
654 port_agent->phy_configured_mask &= ~(1 << iphy->phy_index); in sci_apc_agent_link_down()
671 spin_lock_irqsave(&ihost->scic_lock, flags); in apc_agent_timeout()
673 if (tmr->cancel) in apc_agent_timeout()
676 port_agent->timer_pending = false; in apc_agent_timeout()
678 configure_phy_mask = ~port_agent->phy_configured_mask & port_agent->phy_ready_mask; in apc_agent_timeout()
688 &ihost->phys[index], false); in apc_agent_timeout()
695 spin_unlock_irqrestore(&ihost->scic_lock, flags); in apc_agent_timeout()
713 port_agent->phy_configured_mask = 0x00; in sci_port_configuration_agent_construct()
714 port_agent->phy_ready_mask = 0x00; in sci_port_configuration_agent_construct()
716 port_agent->link_up_handler = NULL; in sci_port_configuration_agent_construct()
717 port_agent->link_down_handler = NULL; in sci_port_configuration_agent_construct()
719 port_agent->timer_pending = false; in sci_port_configuration_agent_construct()
722 port_agent->phy_valid_port_range[index].min_index = 0; in sci_port_configuration_agent_construct()
723 port_agent->phy_valid_port_range[index].max_index = 0; in sci_port_configuration_agent_construct()
729 return ihost->port_agent.link_up_handler == sci_apc_agent_link_up; in is_port_config_apc()
739 mode = ihost->oem_parameters.controller.mode_type; in sci_port_configuration_agent_initialize()
745 port_agent->link_up_handler = sci_mpc_agent_link_up; in sci_port_configuration_agent_initialize()
746 port_agent->link_down_handler = sci_mpc_agent_link_down; in sci_port_configuration_agent_initialize()
748 sci_init_timer(&port_agent->timer, mpc_agent_timeout); in sci_port_configuration_agent_initialize()
753 port_agent->link_up_handler = sci_apc_agent_link_up; in sci_port_configuration_agent_initialize()
754 port_agent->link_down_handler = sci_apc_agent_link_down; in sci_port_configuration_agent_initialize()
756 sci_init_timer(&port_agent->timer, apc_agent_timeout); in sci_port_configuration_agent_initialize()