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()
783 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
786 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
794 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
797 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
800 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
808 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
811 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
823 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
827 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
835 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
838 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
846 iphy->protocol = SAS_PROTOCOL_SATA; in sci_phy_event_handler()
849 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
855 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
858 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
871 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_1_5_GBPS, in sci_phy_event_handler()
876 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_3_0_GBPS, in sci_phy_event_handler()
881 sci_phy_complete_link_training(iphy, SAS_LINK_RATE_6_0_GBPS, in sci_phy_event_handler()
886 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
889 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
895 sci_phy_start_sas_link_training(iphy); in sci_phy_event_handler()
898 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
907 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_SATA_SPEED_EN); in sci_phy_event_handler()
912 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
915 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
919 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
927 scu_link_layer_set_txcomsas_timeout(iphy, SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT); in sci_phy_event_handler()
930 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
939 if (phy_get_non_dummy_port(iphy) != NULL) in sci_phy_event_handler()
940 sci_port_broadcast_change_received(iphy->owning_port, iphy); in sci_phy_event_handler()
942 iphy->bcn_received_while_port_unassigned = true; in sci_phy_event_handler()
947 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
955 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_event_handler()
958 phy_event_warn(iphy, state, event_code); in sci_phy_event_handler()
964 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_event_handler()
970 enum sci_status sci_phy_frame_handler(struct isci_phy *iphy, u32 frame_index) in sci_phy_frame_handler() argument
972 enum sci_phy_states state = iphy->sm.current_state_id; in sci_phy_frame_handler()
973 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_frame_handler()
993 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
994 memcpy(&iphy->frame_rcvd.iaf, &iaf, sizeof(iaf)); in sci_phy_frame_handler()
995 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1008 sci_change_state(&iphy->sm, state); in sci_phy_frame_handler()
1011 dev_warn(sciphy_to_dev(iphy), in sci_phy_frame_handler()
1036 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1037 sci_controller_copy_sata_response(&iphy->frame_rcvd.fis, in sci_phy_frame_handler()
1040 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in sci_phy_frame_handler()
1043 sci_change_state(&iphy->sm, SCI_PHY_SUB_FINAL); in sci_phy_frame_handler()
1047 dev_warn(sciphy_to_dev(iphy), in sci_phy_frame_handler()
1058 dev_dbg(sciphy_to_dev(iphy), "%s: in wrong state: %s\n", in sci_phy_frame_handler()
1067 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_initial_substate_enter() local
1070 sci_change_state(&iphy->sm, SCI_PHY_SUB_AWAIT_OSSP_EN); in sci_phy_starting_initial_substate_enter()
1075 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sas_power_substate_enter() local
1076 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_enter()
1078 sci_controller_power_control_queue_insert(ihost, iphy); in sci_phy_starting_await_sas_power_substate_enter()
1083 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sas_power_substate_exit() local
1084 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sas_power_substate_exit()
1086 sci_controller_power_control_queue_remove(ihost, iphy); in sci_phy_starting_await_sas_power_substate_exit()
1091 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_power_substate_enter() local
1092 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_enter()
1094 sci_controller_power_control_queue_insert(ihost, iphy); in sci_phy_starting_await_sata_power_substate_enter()
1099 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_power_substate_exit() local
1100 struct isci_host *ihost = iphy->owning_port->owning_controller; in sci_phy_starting_await_sata_power_substate_exit()
1102 sci_controller_power_control_queue_remove(ihost, iphy); in sci_phy_starting_await_sata_power_substate_exit()
1107 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_phy_substate_enter() local
1109 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_phy_substate_enter()
1114 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_phy_substate_exit() local
1116 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_phy_substate_exit()
1121 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_speed_substate_enter() local
1123 sci_mod_timer(&iphy->sata_timer, SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT); in sci_phy_starting_await_sata_speed_substate_enter()
1128 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sata_speed_substate_exit() local
1130 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sata_speed_substate_exit()
1135 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sig_fis_uf_substate_enter() local
1137 if (sci_port_link_detected(iphy->owning_port, iphy)) { in sci_phy_starting_await_sig_fis_uf_substate_enter()
1145 sci_phy_resume(iphy); in sci_phy_starting_await_sig_fis_uf_substate_enter()
1147 sci_mod_timer(&iphy->sata_timer, in sci_phy_starting_await_sig_fis_uf_substate_enter()
1150 iphy->is_in_link_training = false; in sci_phy_starting_await_sig_fis_uf_substate_enter()
1155 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_await_sig_fis_uf_substate_exit() local
1157 sci_del_timer(&iphy->sata_timer); in sci_phy_starting_await_sig_fis_uf_substate_exit()
1162 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_final_substate_enter() local
1167 sci_change_state(&iphy->sm, SCI_PHY_READY); in sci_phy_starting_final_substate_enter()
1179 struct isci_phy *iphy) in scu_link_layer_stop_protocol_engine() argument
1186 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1192 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_stop_protocol_engine()
1195 enable_spinup_value = readl(&iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1197 writel(enable_spinup_value, &iphy->link_layer_registers->notify_enable_spinup_control); in scu_link_layer_stop_protocol_engine()
1200 static void scu_link_layer_start_oob(struct isci_phy *iphy) in scu_link_layer_start_oob() argument
1202 struct scu_link_layer_registers __iomem *ll = iphy->link_layer_registers; in scu_link_layer_start_oob()
1231 struct isci_phy *iphy) in scu_link_layer_tx_hard_reset() argument
1239 readl(&iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1245 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1251 &iphy->link_layer_registers->phy_configuration); in scu_link_layer_tx_hard_reset()
1256 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_stopped_state_enter() local
1257 struct isci_port *iport = iphy->owning_port; in sci_phy_stopped_state_enter()
1264 sci_del_timer(&iphy->sata_timer); in sci_phy_stopped_state_enter()
1266 scu_link_layer_stop_protocol_engine(iphy); in sci_phy_stopped_state_enter()
1268 if (iphy->sm.previous_state_id != SCI_PHY_INITIAL) in sci_phy_stopped_state_enter()
1269 sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_stopped_state_enter()
1274 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_starting_state_enter() local
1275 struct isci_port *iport = iphy->owning_port; in sci_phy_starting_state_enter()
1278 scu_link_layer_stop_protocol_engine(iphy); in sci_phy_starting_state_enter()
1279 scu_link_layer_start_oob(iphy); in sci_phy_starting_state_enter()
1282 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_starting_state_enter()
1283 iphy->bcn_received_while_port_unassigned = false; in sci_phy_starting_state_enter()
1285 if (iphy->sm.previous_state_id == SCI_PHY_READY) in sci_phy_starting_state_enter()
1286 sci_controller_link_down(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_starting_state_enter()
1288 sci_change_state(&iphy->sm, SCI_PHY_SUB_INITIAL); in sci_phy_starting_state_enter()
1293 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_ready_state_enter() local
1294 struct isci_port *iport = iphy->owning_port; in sci_phy_ready_state_enter()
1297 sci_controller_link_up(ihost, phy_get_non_dummy_port(iphy), iphy); in sci_phy_ready_state_enter()
1302 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_ready_state_exit() local
1304 sci_phy_suspend(iphy); in sci_phy_ready_state_exit()
1309 struct isci_phy *iphy = container_of(sm, typeof(*iphy), sm); in sci_phy_resetting_state_enter() local
1315 sci_port_deactivate_phy(iphy->owning_port, iphy, false); in sci_phy_resetting_state_enter()
1317 if (iphy->protocol == SAS_PROTOCOL_SSP) { in sci_phy_resetting_state_enter()
1318 scu_link_layer_tx_hard_reset(iphy); in sci_phy_resetting_state_enter()
1323 sci_change_state(&iphy->sm, SCI_PHY_STARTING); in sci_phy_resetting_state_enter()
1374 void sci_phy_construct(struct isci_phy *iphy, in sci_phy_construct() argument
1377 sci_init_sm(&iphy->sm, sci_phy_state_table, SCI_PHY_INITIAL); in sci_phy_construct()
1380 iphy->owning_port = iport; in sci_phy_construct()
1381 iphy->phy_index = phy_index; in sci_phy_construct()
1382 iphy->bcn_received_while_port_unassigned = false; in sci_phy_construct()
1383 iphy->protocol = SAS_PROTOCOL_NONE; in sci_phy_construct()
1384 iphy->link_layer_registers = NULL; in sci_phy_construct()
1385 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; in sci_phy_construct()
1388 sci_init_timer(&iphy->sata_timer, phy_sata_timeout); in sci_phy_construct()
1391 void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index) in isci_phy_init() argument
1401 memcpy(iphy->sas_addr, &sas_addr, sizeof(sas_addr)); in isci_phy_init()
1403 iphy->sas_phy.enabled = 0; in isci_phy_init()
1404 iphy->sas_phy.id = index; in isci_phy_init()
1405 iphy->sas_phy.sas_addr = &iphy->sas_addr[0]; in isci_phy_init()
1406 iphy->sas_phy.frame_rcvd = (u8 *)&iphy->frame_rcvd; in isci_phy_init()
1407 iphy->sas_phy.ha = &ihost->sas_ha; in isci_phy_init()
1408 iphy->sas_phy.lldd_phy = iphy; in isci_phy_init()
1409 iphy->sas_phy.enabled = 1; in isci_phy_init()
1410 iphy->sas_phy.class = SAS; in isci_phy_init()
1411 iphy->sas_phy.iproto = SAS_PROTOCOL_ALL; in isci_phy_init()
1412 iphy->sas_phy.tproto = 0; in isci_phy_init()
1413 iphy->sas_phy.type = PHY_TYPE_PHYSICAL; in isci_phy_init()
1414 iphy->sas_phy.role = PHY_ROLE_INITIATOR; in isci_phy_init()
1415 iphy->sas_phy.oob_mode = OOB_NOT_CONNECTED; in isci_phy_init()
1416 iphy->sas_phy.linkrate = SAS_LINK_RATE_UNKNOWN; in isci_phy_init()
1417 memset(&iphy->frame_rcvd, 0, sizeof(iphy->frame_rcvd)); in isci_phy_init()
1435 struct isci_phy *iphy = sas_phy->lldd_phy; in isci_phy_control() local
1442 __func__, sas_phy, func, buf, iphy, port); in isci_phy_control()
1447 scu_link_layer_start_oob(iphy); in isci_phy_control()
1448 sci_phy_stop(iphy); in isci_phy_control()
1454 scu_link_layer_start_oob(iphy); in isci_phy_control()
1455 sci_phy_stop(iphy); in isci_phy_control()
1456 sci_phy_start(iphy); in isci_phy_control()
1464 ret = isci_port_perform_hard_reset(ihost, port->lldd_port, iphy); in isci_phy_control()
1471 r = iphy->link_layer_registers; in isci_phy_control()