Lines Matching refs:iphy
75 enum sas_linkrate sci_phy_linkrate(struct isci_phy *iphy) in sci_phy_linkrate() argument
77 return iphy->max_negotiated_speed; in sci_phy_linkrate()
80 static struct isci_host *phy_to_host(struct isci_phy *iphy) in phy_to_host() argument
82 struct isci_phy *table = iphy - iphy->phy_index; in phy_to_host()
88 static struct device *sciphy_to_dev(struct isci_phy *iphy) in sciphy_to_dev() argument
90 return &phy_to_host(iphy)->pdev->dev; in sciphy_to_dev()
94 sci_phy_transport_layer_initialization(struct isci_phy *iphy, in sci_phy_transport_layer_initialization() argument
99 iphy->transport_layer_registers = reg; in sci_phy_transport_layer_initialization()
102 &iphy->transport_layer_registers->stp_rni); in sci_phy_transport_layer_initialization()
108 tl_control = readl(&iphy->transport_layer_registers->control); in sci_phy_transport_layer_initialization()
110 writel(tl_control, &iphy->transport_layer_registers->control); in sci_phy_transport_layer_initialization()
116 sci_phy_link_layer_initialization(struct isci_phy *iphy, in sci_phy_link_layer_initialization() argument
119 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_link_layer_initialization()
122 int phy_idx = iphy->phy_index; in sci_phy_link_layer_initialization()
133 iphy->link_layer_registers = llr; in sci_phy_link_layer_initialization()
313 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_link_layer_initialization()
321 struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer); in phy_sata_timeout() local
322 struct isci_host *ihost = iphy->owning_port->owning_controller; in phy_sata_timeout()
330 dev_dbg(sciphy_to_dev(iphy), in phy_sata_timeout()
334 iphy); in phy_sata_timeout()
336 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in phy_sata_timeout()
354 struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy) in phy_get_non_dummy_port() argument
356 struct isci_port *iport = iphy->owning_port; in phy_get_non_dummy_port()
361 return iphy->owning_port; in phy_get_non_dummy_port()
368 struct isci_phy *iphy, in sci_phy_set_port() argument
371 iphy->owning_port = iport; in sci_phy_set_port()
373 if (iphy->bcn_received_while_port_unassigned) { in sci_phy_set_port()
374 iphy->bcn_received_while_port_unassigned = false; in sci_phy_set_port()
375 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_set_port()
379 enum sci_status sci_phy_initialize(struct isci_phy *iphy, in sci_phy_initialize() argument
384 sci_phy_transport_layer_initialization(iphy, tl); in sci_phy_initialize()
387 sci_phy_link_layer_initialization(iphy, ll); in sci_phy_initialize()
392 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_initialize()
406 void sci_phy_setup_transport(struct isci_phy *iphy, u32 device_id) in sci_phy_setup_transport() argument
410 writel(device_id, &iphy->transport_layer_registers->stp_rni); in sci_phy_setup_transport()
416 tl_control = readl(&iphy->transport_layer_registers->control); in sci_phy_setup_transport()
418 writel(tl_control, &iphy->transport_layer_registers->control); in sci_phy_setup_transport()
421 static void sci_phy_suspend(struct isci_phy *iphy) in sci_phy_suspend() argument
426 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_suspend()
429 &iphy->link_layer_registers->phy_configuration); in sci_phy_suspend()
431 sci_phy_setup_transport(iphy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); in sci_phy_suspend()
434 void sci_phy_resume(struct isci_phy *iphy) in sci_phy_resume() argument
439 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_resume()
442 &iphy->link_layer_registers->phy_configuration); in sci_phy_resume()
445 void sci_phy_get_sas_address(struct isci_phy *iphy, struct sci_sas_address *sas) in sci_phy_get_sas_address() argument
447 sas->high = readl(&iphy->link_layer_registers->source_sas_address_high); in sci_phy_get_sas_address()
448 sas->low = readl(&iphy->link_layer_registers->source_sas_address_low); in sci_phy_get_sas_address()
451 void sci_phy_get_attached_sas_address(struct isci_phy *iphy, struct sci_sas_address *sas) in sci_phy_get_attached_sas_address() argument
455 iaf = &iphy->frame_rcvd.iaf; in sci_phy_get_attached_sas_address()
459 void sci_phy_get_protocols(struct isci_phy *iphy, struct sci_phy_proto *proto) in sci_phy_get_protocols() argument
461 proto->all = readl(&iphy->link_layer_registers->transmit_identification); in sci_phy_get_protocols()
464 enum sci_status sci_phy_start(struct isci_phy *iphy) in sci_phy_start() argument
466 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_start()
469 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_start()
474 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_start()
478 enum sci_status sci_phy_stop(struct isci_phy *iphy) in sci_phy_stop() argument
480 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_stop()
495 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_stop()
500 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_stop()
504 enum sci_status sci_phy_reset(struct isci_phy *iphy) in sci_phy_reset() argument
506 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_reset()
509 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_reset()
514 sci_change_state(&iphy->sm, SCI_PHY_RESETTING); in sci_phy_reset()
518 enum sci_status sci_phy_consume_power_handler(struct isci_phy *iphy) in sci_phy_consume_power_handler() argument
520 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_consume_power_handler()
526 enable_spinup = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in sci_phy_consume_power_handler()
528 writel(enable_spinup, &iphy->link_layer_registers->notify_enable_spinup_control); in sci_phy_consume_power_handler()
531 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_consume_power_handler()
540 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
545 &iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
551 &iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
554 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_PHY_EN); in sci_phy_consume_power_handler()
559 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_consume_power_handler()
565 static void sci_phy_start_sas_link_training(struct isci_phy *iphy) in sci_phy_start_sas_link_training() argument
573 phy_control = readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_start_sas_link_training()
576 &iphy->link_layer_registers->phy_configuration); in sci_phy_start_sas_link_training()
578 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN); in sci_phy_start_sas_link_training()
580 iphy->protocol = SAS_PROTOCOL_SSP; in sci_phy_start_sas_link_training()
583 static void sci_phy_start_sata_link_training(struct isci_phy *iphy) in sci_phy_start_sata_link_training() argument
589 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER); in sci_phy_start_sata_link_training()
591 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_start_sata_link_training()
605 static void sci_phy_complete_link_training(struct isci_phy *iphy, in sci_phy_complete_link_training() argument
609 iphy->max_negotiated_speed = max_link_rate; in sci_phy_complete_link_training()
611 sci_change_state(&iphy->sm, next_state); in sci_phy_complete_link_training()
658 #define phy_event_dbg(iphy, state, code) \ argument
659 dev_dbg(sciphy_to_dev(iphy), "phy-%d:%d: %s event: %s (%x)\n", \
660 phy_to_host(iphy)->id, iphy->phy_index, \
663 #define phy_event_warn(iphy, state, code) \ argument
664 dev_warn(sciphy_to_dev(iphy), "phy-%d:%d: %s event: %s (%x)\n", \
665 phy_to_host(iphy)->id, iphy->phy_index, \
669 static void scu_link_layer_set_txcomsas_timeout(struct isci_phy *iphy, u32 timeout) in scu_link_layer_set_txcomsas_timeout() argument
674 val = readl(&iphy->link_layer_registers->transmit_comsas_signal); in scu_link_layer_set_txcomsas_timeout()
678 writel(val, &iphy->link_layer_registers->transmit_comsas_signal); in scu_link_layer_set_txcomsas_timeout()
681 enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code) in sci_phy_event_handler() argument
683 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_event_handler()
689 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
690 iphy->is_in_link_training = true; in sci_phy_event_handler()
693 sci_phy_start_sata_link_training(iphy); in sci_phy_event_handler()
694 iphy->is_in_link_training = true; in sci_phy_event_handler()
698 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_EXTENDED); in sci_phy_event_handler()
701 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
704 phy_event_dbg(iphy, state, event_code); in sci_phy_event_handler()
717 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, in sci_phy_event_handler()
722 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, in sci_phy_event_handler()
727 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, in sci_phy_event_handler()
734 sci_phy_start_sata_link_training(iphy); in sci_phy_event_handler()
738 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
741 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
745 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_EXTENDED); in sci_phy_event_handler()
748 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
751 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
759 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
766 sci_phy_start_sata_link_training(iphy); in sci_phy_event_handler()
770 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_EXTENDED); in sci_phy_event_handler()
773 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
776 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
780 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
783 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
791 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
794 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
797 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
805 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
808 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
820 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
824 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
832 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
835 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
843 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_event_handler()
846 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
852 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
855 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
868 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, in sci_phy_event_handler()
873 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, in sci_phy_event_handler()
878 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, in sci_phy_event_handler()
883 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
886 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
892 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
895 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
904 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
909 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
912 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
916 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
924 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
927 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
936 if (phy_get_non_dummy_port(iphy) != NULL) in sci_phy_event_handler()
937 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_event_handler()
939 iphy->bcn_received_while_port_unassigned = true; in sci_phy_event_handler()
944 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
952 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
955 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
960 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_event_handler()
966 enum sci_status sci_phy_frame_handler(struct isci_phy *iphy, u32 frame_index) in sci_phy_frame_handler() argument
968 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_frame_handler()
969 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_frame_handler()
989 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
990 memcpy(&iphy->frame_rcvd.iaf, &iaf, sizeof(iaf)); in sci_phy_frame_handler()
991 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1004 sci_change_state(&iphy->sm, state); in sci_phy_frame_handler()
1007 dev_warn(sciphy_to_dev(iphy), in sci_phy_frame_handler()
1032 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1033 sci_controller_copy_sata_response(&iphy->frame_rcvd.fis, in sci_phy_frame_handler()
1036 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1039 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_frame_handler()
1043 dev_warn(sciphy_to_dev(iphy), in sci_phy_frame_handler()
1054 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_frame_handler()
1063 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_initial_substate_enter() local
1066 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_OSSP_EN); in sci_phy_starting_initial_substate_enter()
1071 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sas_power_substate_enter() local
1072 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_enter()
1074 sci_controller_power_control_queue_insert(ihost, iphy); in sci_phy_starting_await_sas_power_substate_enter()
1079 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sas_power_substate_exit() local
1080 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_exit()
1082 sci_controller_power_control_queue_remove(ihost, iphy); in sci_phy_starting_await_sas_power_substate_exit()
1087 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_power_substate_enter() local
1088 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_enter()
1090 sci_controller_power_control_queue_insert(ihost, iphy); in sci_phy_starting_await_sata_power_substate_enter()
1095 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_power_substate_exit() local
1096 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_exit()
1098 sci_controller_power_control_queue_remove(ihost, iphy); in sci_phy_starting_await_sata_power_substate_exit()
1103 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_phy_substate_enter() local
1105 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_phy_substate_enter()
1110 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_phy_substate_exit() local
1112 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_phy_substate_exit()
1117 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_speed_substate_enter() local
1119 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_speed_substate_enter()
1124 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_speed_substate_exit() local
1126 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_speed_substate_exit()
1131 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sig_fis_uf_substate_enter() local
1133 if (sci_port_link_detected(iphy->owning_port, iphy)) { in sci_phy_starting_await_sig_fis_uf_substate_enter()
1141 sci_phy_resume(iphy); in sci_phy_starting_await_sig_fis_uf_substate_enter()
1143 sci_mod_timer(&iphy->sata_timer, in sci_phy_starting_await_sig_fis_uf_substate_enter()
1146 iphy->is_in_link_training = false; in sci_phy_starting_await_sig_fis_uf_substate_enter()
1151 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sig_fis_uf_substate_exit() local
1153 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sig_fis_uf_substate_exit()
1158 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_final_substate_enter() local
1163 sci_change_state(&iphy->sm, SCI_PHY_READY); in sci_phy_starting_final_substate_enter()
1175 struct isci_phy *iphy) in scu_link_layer_stop_protocol_engine() argument
1182 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1188 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1191 enable_spinup_value = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1193 writel(enable_spinup_value, &iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1196 static void scu_link_layer_start_oob(struct isci_phy *iphy) in scu_link_layer_start_oob() argument
1198 struct scu_link_layer_registers __iomem *ll = iphy->link_layer_registers; in scu_link_layer_start_oob()
1228 struct isci_phy *iphy) in scu_link_layer_tx_hard_reset() argument
1236 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1242 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1248 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1253 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_stopped_state_enter() local
1254 struct isci_port *iport = iphy->owning_port; in sci_phy_stopped_state_enter()
1261 sci_del_timer(&iphy->sata_timer); in sci_phy_stopped_state_enter()
1263 scu_link_layer_stop_protocol_engine(iphy); in sci_phy_stopped_state_enter()
1265 if (iphy->sm.previous_state_id != SCI_PHY_INITIAL) in sci_phy_stopped_state_enter()
1266 sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_stopped_state_enter()
1271 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_state_enter() local
1272 struct isci_port *iport = iphy->owning_port; in sci_phy_starting_state_enter()
1275 scu_link_layer_stop_protocol_engine(iphy); in sci_phy_starting_state_enter()
1276 scu_link_layer_start_oob(iphy); in sci_phy_starting_state_enter()
1279 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_starting_state_enter()
1280 iphy->bcn_received_while_port_unassigned = false; in sci_phy_starting_state_enter()
1282 if (iphy->sm.previous_state_id == SCI_PHY_READY) in sci_phy_starting_state_enter()
1283 sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_starting_state_enter()
1285 sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL); in sci_phy_starting_state_enter()
1290 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_ready_state_enter() local
1291 struct isci_port *iport = iphy->owning_port; in sci_phy_ready_state_enter()
1294 sci_controller_link_up(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_ready_state_enter()
1299 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_ready_state_exit() local
1301 sci_phy_suspend(iphy); in sci_phy_ready_state_exit()
1306 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_resetting_state_enter() local
1312 sci_port_deactivate_phy(iphy->owning_port, iphy, false); in sci_phy_resetting_state_enter()
1314 if (iphy->protocol == SAS_PROTOCOL_SSP) { in sci_phy_resetting_state_enter()
1315 scu_link_layer_tx_hard_reset(iphy); in sci_phy_resetting_state_enter()
1320 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_resetting_state_enter()
1371 void sci_phy_construct(struct isci_phy *iphy, in sci_phy_construct() argument
1374 sci_init_sm(&iphy->sm, sci_phy_state_table, SCI_PHY_INITIAL); in sci_phy_construct()
1377 iphy->owning_port = iport; in sci_phy_construct()
1378 iphy->phy_index = phy_index; in sci_phy_construct()
1379 iphy->bcn_received_while_port_unassigned = false; in sci_phy_construct()
1380 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_construct()
1381 iphy->link_layer_registers = NULL; in sci_phy_construct()
1382 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; in sci_phy_construct()
1385 sci_init_timer(&iphy->sata_timer, phy_sata_timeout); in sci_phy_construct()
1388 void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) in isci_phy_init() argument
1398 memcpy(iphy->sas_addr, &sas_addr, sizeof(sas_addr)); in isci_phy_init()
1400 iphy->sas_phy.enabled = 0; in isci_phy_init()
1401 iphy->sas_phy.id = index; in isci_phy_init()
1402 iphy->sas_phy.sas_addr = &iphy->sas_addr[0]; in isci_phy_init()
1403 iphy->sas_phy.frame_rcvd = (u8 *)&iphy->frame_rcvd; in isci_phy_init()
1404 iphy->sas_phy.ha = &ihost->sas_ha; in isci_phy_init()
1405 iphy->sas_phy.lldd_phy = iphy; in isci_phy_init()
1406 iphy->sas_phy.enabled = 1; in isci_phy_init()
1407 iphy->sas_phy.class = SAS; in isci_phy_init()
1408 iphy->sas_phy.iproto = SAS_PROTOCOL_ALL; in isci_phy_init()
1409 iphy->sas_phy.tproto = 0; in isci_phy_init()
1410 iphy->sas_phy.type = PHY_TYPE_PHYSICAL; in isci_phy_init()
1411 iphy->sas_phy.role = PHY_ROLE_INITIATOR; in isci_phy_init()
1412 iphy->sas_phy.oob_mode = OOB_NOT_CONNECTED; in isci_phy_init()
1413 iphy->sas_phy.linkrate = SAS_LINK_RATE_UNKNOWN; in isci_phy_init()
1414 memset(&iphy->frame_rcvd, 0, sizeof(iphy->frame_rcvd)); in isci_phy_init()
1432 struct isci_phy *iphy = sas_phy->lldd_phy; in isci_phy_control() local
1439 __func__, sas_phy, func, buf, iphy, port); in isci_phy_control()
1444 scu_link_layer_start_oob(iphy); in isci_phy_control()
1445 sci_phy_stop(iphy); in isci_phy_control()
1451 scu_link_layer_start_oob(iphy); in isci_phy_control()
1452 sci_phy_stop(iphy); in isci_phy_control()
1453 sci_phy_start(iphy); in isci_phy_control()
1461 ret = isci_port_perform_hard_reset(ihost, port->lldd_port, iphy); in isci_phy_control()
1468 r = iphy->link_layer_registers; in isci_phy_control()