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()
353 struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy) in phy_get_non_dummy_port() argument
355 struct isci_port *iport = iphy->owning_port; in phy_get_non_dummy_port()
360 return iphy->owning_port; in phy_get_non_dummy_port()
371 struct isci_phy *iphy, in sci_phy_set_port() argument
374 iphy->owning_port = iport; in sci_phy_set_port()
376 if (iphy->bcn_received_while_port_unassigned) { in sci_phy_set_port()
377 iphy->bcn_received_while_port_unassigned = false; in sci_phy_set_port()
378 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_set_port()
382 enum sci_status sci_phy_initialize(struct isci_phy *iphy, in sci_phy_initialize() argument
387 sci_phy_transport_layer_initialization(iphy, tl); in sci_phy_initialize()
390 sci_phy_link_layer_initialization(iphy, ll); in sci_phy_initialize()
395 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_initialize()
409 void sci_phy_setup_transport(struct isci_phy *iphy, u32 device_id) in sci_phy_setup_transport() argument
413 writel(device_id, &iphy->transport_layer_registers->stp_rni); in sci_phy_setup_transport()
419 tl_control = readl(&iphy->transport_layer_registers->control); in sci_phy_setup_transport()
421 writel(tl_control, &iphy->transport_layer_registers->control); in sci_phy_setup_transport()
424 static void sci_phy_suspend(struct isci_phy *iphy) in sci_phy_suspend() argument
429 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_suspend()
432 &iphy->link_layer_registers->phy_configuration); in sci_phy_suspend()
434 sci_phy_setup_transport(iphy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); in sci_phy_suspend()
437 void sci_phy_resume(struct isci_phy *iphy) in sci_phy_resume() argument
442 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_resume()
445 &iphy->link_layer_registers->phy_configuration); in sci_phy_resume()
448 void sci_phy_get_sas_address(struct isci_phy *iphy, struct sci_sas_address *sas) in sci_phy_get_sas_address() argument
450 sas->high = readl(&iphy->link_layer_registers->source_sas_address_high); in sci_phy_get_sas_address()
451 sas->low = readl(&iphy->link_layer_registers->source_sas_address_low); in sci_phy_get_sas_address()
454 void sci_phy_get_attached_sas_address(struct isci_phy *iphy, struct sci_sas_address *sas) in sci_phy_get_attached_sas_address() argument
458 iaf = &iphy->frame_rcvd.iaf; in sci_phy_get_attached_sas_address()
462 void sci_phy_get_protocols(struct isci_phy *iphy, struct sci_phy_proto *proto) in sci_phy_get_protocols() argument
464 proto->all = readl(&iphy->link_layer_registers->transmit_identification); in sci_phy_get_protocols()
467 enum sci_status sci_phy_start(struct isci_phy *iphy) in sci_phy_start() argument
469 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_start()
472 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_start()
477 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_start()
481 enum sci_status sci_phy_stop(struct isci_phy *iphy) in sci_phy_stop() argument
483 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_stop()
498 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_stop()
503 sci_change_state(&iphy->sm, SCI_PHY_STOPPED); in sci_phy_stop()
507 enum sci_status sci_phy_reset(struct isci_phy *iphy) in sci_phy_reset() argument
509 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_reset()
512 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_reset()
517 sci_change_state(&iphy->sm, SCI_PHY_RESETTING); in sci_phy_reset()
521 enum sci_status sci_phy_consume_power_handler(struct isci_phy *iphy) in sci_phy_consume_power_handler() argument
523 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_consume_power_handler()
529 enable_spinup = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in sci_phy_consume_power_handler()
531 writel(enable_spinup, &iphy->link_layer_registers->notify_enable_spinup_control); in sci_phy_consume_power_handler()
534 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_consume_power_handler()
543 readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
548 &iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
554 &iphy->link_layer_registers->phy_configuration); in sci_phy_consume_power_handler()
557 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_PHY_EN); in sci_phy_consume_power_handler()
562 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_consume_power_handler()
568 static void sci_phy_start_sas_link_training(struct isci_phy *iphy) in sci_phy_start_sas_link_training() argument
576 phy_control = readl(&iphy->link_layer_registers->phy_configuration); in sci_phy_start_sas_link_training()
579 &iphy->link_layer_registers->phy_configuration); in sci_phy_start_sas_link_training()
581 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SAS_SPEED_EN); in sci_phy_start_sas_link_training()
583 iphy->protocol = SAS_PROTOCOL_SSP; in sci_phy_start_sas_link_training()
586 static void sci_phy_start_sata_link_training(struct isci_phy *iphy) in sci_phy_start_sata_link_training() argument
592 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_POWER); in sci_phy_start_sata_link_training()
594 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_start_sata_link_training()
608 static void sci_phy_complete_link_training(struct isci_phy *iphy, in sci_phy_complete_link_training() argument
612 iphy->max_negotiated_speed = max_link_rate; in sci_phy_complete_link_training()
614 sci_change_state(&iphy->sm, next_state); in sci_phy_complete_link_training()
661 #define phy_event_dbg(iphy, state, code) \ argument
662 dev_dbg(sciphy_to_dev(iphy), "phy-%d:%d: %s event: %s (%x)\n", \
663 phy_to_host(iphy)->id, iphy->phy_index, \
666 #define phy_event_warn(iphy, state, code) \ argument
667 dev_warn(sciphy_to_dev(iphy), "phy-%d:%d: %s event: %s (%x)\n", \
668 phy_to_host(iphy)->id, iphy->phy_index, \
672 void scu_link_layer_set_txcomsas_timeout(struct isci_phy *iphy, u32 timeout) in scu_link_layer_set_txcomsas_timeout() argument
677 val = readl(&iphy->link_layer_registers->transmit_comsas_signal); in scu_link_layer_set_txcomsas_timeout()
681 writel(val, &iphy->link_layer_registers->transmit_comsas_signal); in scu_link_layer_set_txcomsas_timeout()
684 enum sci_status sci_phy_event_handler(struct isci_phy *iphy, u32 event_code) in sci_phy_event_handler() argument
686 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_event_handler()
692 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
693 iphy->is_in_link_training = true; in sci_phy_event_handler()
696 sci_phy_start_sata_link_training(iphy); in sci_phy_event_handler()
697 iphy->is_in_link_training = true; in sci_phy_event_handler()
701 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_EXTENDED); in sci_phy_event_handler()
704 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
707 phy_event_dbg(iphy, state, event_code); in sci_phy_event_handler()
720 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, in sci_phy_event_handler()
725 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, in sci_phy_event_handler()
730 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, in sci_phy_event_handler()
737 sci_phy_start_sata_link_training(iphy); in sci_phy_event_handler()
741 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
744 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
748 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_EXTENDED); in sci_phy_event_handler()
751 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
754 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
763 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
770 sci_phy_start_sata_link_training(iphy); in sci_phy_event_handler()
774 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_EXTENDED); in sci_phy_event_handler()
777 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
780 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
784 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
787 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
795 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
798 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
801 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
809 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
812 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
824 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
828 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
836 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
839 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
847 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_event_handler()
850 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
856 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
859 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
872 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, in sci_phy_event_handler()
877 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, in sci_phy_event_handler()
882 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, in sci_phy_event_handler()
887 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
890 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
896 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
899 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
908 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
913 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
916 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
920 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
928 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
931 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
940 if (phy_get_non_dummy_port(iphy) != NULL) in sci_phy_event_handler()
941 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_event_handler()
943 iphy->bcn_received_while_port_unassigned = true; in sci_phy_event_handler()
948 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
956 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
959 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
965 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_event_handler()
971 enum sci_status sci_phy_frame_handler(struct isci_phy *iphy, u32 frame_index) in sci_phy_frame_handler() argument
973 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_frame_handler()
974 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_frame_handler()
994 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
995 memcpy(&iphy->frame_rcvd.iaf, &iaf, sizeof(iaf)); in sci_phy_frame_handler()
996 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1009 sci_change_state(&iphy->sm, state); in sci_phy_frame_handler()
1012 dev_warn(sciphy_to_dev(iphy), in sci_phy_frame_handler()
1037 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1038 sci_controller_copy_sata_response(&iphy->frame_rcvd.fis, in sci_phy_frame_handler()
1041 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1044 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_frame_handler()
1048 dev_warn(sciphy_to_dev(iphy), in sci_phy_frame_handler()
1059 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_frame_handler()
1068 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_initial_substate_enter() local
1071 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_OSSP_EN); in sci_phy_starting_initial_substate_enter()
1076 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sas_power_substate_enter() local
1077 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_enter()
1079 sci_controller_power_control_queue_insert(ihost, iphy); in sci_phy_starting_await_sas_power_substate_enter()
1084 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sas_power_substate_exit() local
1085 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_exit()
1087 sci_controller_power_control_queue_remove(ihost, iphy); in sci_phy_starting_await_sas_power_substate_exit()
1092 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_power_substate_enter() local
1093 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_enter()
1095 sci_controller_power_control_queue_insert(ihost, iphy); in sci_phy_starting_await_sata_power_substate_enter()
1100 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_power_substate_exit() local
1101 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_exit()
1103 sci_controller_power_control_queue_remove(ihost, iphy); in sci_phy_starting_await_sata_power_substate_exit()
1108 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_phy_substate_enter() local
1110 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_phy_substate_enter()
1115 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_phy_substate_exit() local
1117 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_phy_substate_exit()
1122 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_speed_substate_enter() local
1124 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_speed_substate_enter()
1129 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_speed_substate_exit() local
1131 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_speed_substate_exit()
1136 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sig_fis_uf_substate_enter() local
1138 if (sci_port_link_detected(iphy->owning_port, iphy)) { in sci_phy_starting_await_sig_fis_uf_substate_enter()
1146 sci_phy_resume(iphy); in sci_phy_starting_await_sig_fis_uf_substate_enter()
1148 sci_mod_timer(&iphy->sata_timer, in sci_phy_starting_await_sig_fis_uf_substate_enter()
1151 iphy->is_in_link_training = false; in sci_phy_starting_await_sig_fis_uf_substate_enter()
1156 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sig_fis_uf_substate_exit() local
1158 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sig_fis_uf_substate_exit()
1163 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_final_substate_enter() local
1168 sci_change_state(&iphy->sm, SCI_PHY_READY); in sci_phy_starting_final_substate_enter()
1180 struct isci_phy *iphy) in scu_link_layer_stop_protocol_engine() argument
1187 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1193 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1196 enable_spinup_value = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1198 writel(enable_spinup_value, &iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1201 static void scu_link_layer_start_oob(struct isci_phy *iphy) in scu_link_layer_start_oob() argument
1203 struct scu_link_layer_registers __iomem *ll = iphy->link_layer_registers; in scu_link_layer_start_oob()
1232 struct isci_phy *iphy) in scu_link_layer_tx_hard_reset() argument
1240 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1246 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1252 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1257 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_stopped_state_enter() local
1258 struct isci_port *iport = iphy->owning_port; in sci_phy_stopped_state_enter()
1265 sci_del_timer(&iphy->sata_timer); in sci_phy_stopped_state_enter()
1267 scu_link_layer_stop_protocol_engine(iphy); in sci_phy_stopped_state_enter()
1269 if (iphy->sm.previous_state_id != SCI_PHY_INITIAL) in sci_phy_stopped_state_enter()
1270 sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_stopped_state_enter()
1275 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_state_enter() local
1276 struct isci_port *iport = iphy->owning_port; in sci_phy_starting_state_enter()
1279 scu_link_layer_stop_protocol_engine(iphy); in sci_phy_starting_state_enter()
1280 scu_link_layer_start_oob(iphy); in sci_phy_starting_state_enter()
1283 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_starting_state_enter()
1284 iphy->bcn_received_while_port_unassigned = false; in sci_phy_starting_state_enter()
1286 if (iphy->sm.previous_state_id == SCI_PHY_READY) in sci_phy_starting_state_enter()
1287 sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_starting_state_enter()
1289 sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL); in sci_phy_starting_state_enter()
1294 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_ready_state_enter() local
1295 struct isci_port *iport = iphy->owning_port; in sci_phy_ready_state_enter()
1298 sci_controller_link_up(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_ready_state_enter()
1303 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_ready_state_exit() local
1305 sci_phy_suspend(iphy); in sci_phy_ready_state_exit()
1310 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_resetting_state_enter() local
1316 sci_port_deactivate_phy(iphy->owning_port, iphy, false); in sci_phy_resetting_state_enter()
1318 if (iphy->protocol == SAS_PROTOCOL_SSP) { in sci_phy_resetting_state_enter()
1319 scu_link_layer_tx_hard_reset(iphy); in sci_phy_resetting_state_enter()
1324 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_resetting_state_enter()
1375 void sci_phy_construct(struct isci_phy *iphy, in sci_phy_construct() argument
1378 sci_init_sm(&iphy->sm, sci_phy_state_table, SCI_PHY_INITIAL); in sci_phy_construct()
1381 iphy->owning_port = iport; in sci_phy_construct()
1382 iphy->phy_index = phy_index; in sci_phy_construct()
1383 iphy->bcn_received_while_port_unassigned = false; in sci_phy_construct()
1384 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_construct()
1385 iphy->link_layer_registers = NULL; in sci_phy_construct()
1386 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; in sci_phy_construct()
1389 sci_init_timer(&iphy->sata_timer, phy_sata_timeout); in sci_phy_construct()
1392 void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) in isci_phy_init() argument
1402 memcpy(iphy->sas_addr, &sas_addr, sizeof(sas_addr)); in isci_phy_init()
1404 iphy->sas_phy.enabled = 0; in isci_phy_init()
1405 iphy->sas_phy.id = index; in isci_phy_init()
1406 iphy->sas_phy.sas_addr = &iphy->sas_addr[0]; in isci_phy_init()
1407 iphy->sas_phy.frame_rcvd = (u8 *)&iphy->frame_rcvd; in isci_phy_init()
1408 iphy->sas_phy.ha = &ihost->sas_ha; in isci_phy_init()
1409 iphy->sas_phy.lldd_phy = iphy; in isci_phy_init()
1410 iphy->sas_phy.enabled = 1; in isci_phy_init()
1411 iphy->sas_phy.class = SAS; in isci_phy_init()
1412 iphy->sas_phy.iproto = SAS_PROTOCOL_ALL; in isci_phy_init()
1413 iphy->sas_phy.tproto = 0; in isci_phy_init()
1414 iphy->sas_phy.type = PHY_TYPE_PHYSICAL; in isci_phy_init()
1415 iphy->sas_phy.role = PHY_ROLE_INITIATOR; in isci_phy_init()
1416 iphy->sas_phy.oob_mode = OOB_NOT_CONNECTED; in isci_phy_init()
1417 iphy->sas_phy.linkrate = SAS_LINK_RATE_UNKNOWN; in isci_phy_init()
1418 memset(&iphy->frame_rcvd, 0, sizeof(iphy->frame_rcvd)); in isci_phy_init()
1436 struct isci_phy *iphy = sas_phy->lldd_phy; in isci_phy_control() local
1443 __func__, sas_phy, func, buf, iphy, port); in isci_phy_control()
1448 scu_link_layer_start_oob(iphy); in isci_phy_control()
1449 sci_phy_stop(iphy); in isci_phy_control()
1455 scu_link_layer_start_oob(iphy); in isci_phy_control()
1456 sci_phy_stop(iphy); in isci_phy_control()
1457 sci_phy_start(iphy); in isci_phy_control()
1465 ret = isci_port_perform_hard_reset(ihost, port->lldd_port, iphy); in isci_phy_control()
1472 r = iphy->link_layer_registers; in isci_phy_control()