Lines Matching refs:sci_rnc

85 	struct sci_remote_node_context *sci_rnc)  in sci_remote_node_context_is_ready()  argument
87 u32 current_state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_ready()
96 bool sci_remote_node_context_is_suspended(struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_is_suspended() argument
98 u32 current_state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_suspended()
114 static void sci_remote_node_context_construct_buffer(struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_construct_buffer() argument
116 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_construct_buffer()
118 int rni = sci_rnc->remote_node_index; in sci_remote_node_context_construct_buffer()
172 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_setup_to_resume() argument
177 if (sci_rnc->destination_state != RNC_DEST_FINAL) { in sci_remote_node_context_setup_to_resume()
178 sci_rnc->destination_state = dest_param; in sci_remote_node_context_setup_to_resume()
180 sci_rnc->user_callback = callback; in sci_remote_node_context_setup_to_resume()
181 sci_rnc->user_cookie = callback_parameter; in sci_remote_node_context_setup_to_resume()
187 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_setup_to_destroy() argument
191 struct isci_host *ihost = idev_to_ihost(rnc_to_dev(sci_rnc)); in sci_remote_node_context_setup_to_destroy()
193 sci_rnc->destination_state = RNC_DEST_FINAL; in sci_remote_node_context_setup_to_destroy()
194 sci_rnc->user_callback = callback; in sci_remote_node_context_setup_to_destroy()
195 sci_rnc->user_cookie = callback_parameter; in sci_remote_node_context_setup_to_destroy()
232 static void sci_remote_node_context_validate_context_buffer(struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_validate_context_buffer() argument
235 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_validate_context_buffer()
239 rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); in sci_remote_node_context_validate_context_buffer()
250 sci_rnc->remote_node_index); in sci_remote_node_context_validate_context_buffer()
254 …tic void sci_remote_node_context_invalidate_context_buffer(struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_invalidate_context_buffer() argument
257 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_invalidate_context_buffer()
260 rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); in sci_remote_node_context_invalidate_context_buffer()
264 sci_remote_device_post_request(rnc_to_dev(sci_rnc), in sci_remote_node_context_invalidate_context_buffer()
288 struct sci_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); in sci_remote_node_context_posting_state_enter() local
290 sci_remote_node_context_validate_context_buffer(sci_rnc); in sci_remote_node_context_posting_state_enter()
421 enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_event_handler() argument
427 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_event_handler()
432 sci_change_state(&sci_rnc->sm, SCI_RNC_READY); in sci_remote_node_context_event_handler()
440 if (sci_rnc->destination_state == RNC_DEST_FINAL) in sci_remote_node_context_event_handler()
444 sci_change_state(&sci_rnc->sm, next_state); in sci_remote_node_context_event_handler()
451 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
454 "invalidated.\n", __func__, sci_rnc); in sci_remote_node_context_event_handler()
463 sci_change_state(&sci_rnc->sm, SCI_RNC_READY); in sci_remote_node_context_event_handler()
470 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
473 __func__, sci_rnc); in sci_remote_node_context_event_handler()
483 sci_change_state(&sci_rnc->sm, SCI_RNC_TX_SUSPENDED); in sci_remote_node_context_event_handler()
484 sci_rnc->suspend_type = scu_get_event_type(event_code); in sci_remote_node_context_event_handler()
487 sci_change_state(&sci_rnc->sm, SCI_RNC_TX_RX_SUSPENDED); in sci_remote_node_context_event_handler()
488 sci_rnc->suspend_type = scu_get_event_type(event_code); in sci_remote_node_context_event_handler()
505 if (sci_rnc->suspend_type == scu_get_event_type(event_code)) in sci_remote_node_context_event_handler()
506 sci_change_state(&sci_rnc->sm, next_state); in sci_remote_node_context_event_handler()
509 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
517 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
524 enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_destruct() argument
530 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_destruct()
533 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); in sci_remote_node_context_destruct()
540 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); in sci_remote_node_context_destruct()
541 sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); in sci_remote_node_context_destruct()
544 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); in sci_remote_node_context_destruct()
547 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_destruct()
556 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_destruct()
564 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_suspend() argument
569 = sci_rnc->sm.current_state_id; in sci_remote_node_context_suspend()
570 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_suspend()
578 __func__, rnc_state_name(state), sci_rnc->suspend_type, in sci_remote_node_context_suspend()
579 sci_rnc->destination_state, suspend_reason, in sci_remote_node_context_suspend()
584 (sci_rnc->destination_state == RNC_DEST_FINAL)) in sci_remote_node_context_suspend()
585 dest_param = sci_rnc->destination_state; in sci_remote_node_context_suspend()
591 if (sci_rnc->destination_state == RNC_DEST_FINAL) { in sci_remote_node_context_suspend()
594 __func__, sci_rnc); in sci_remote_node_context_suspend()
605 if (sci_rnc->destination_state != RNC_DEST_FINAL) in sci_remote_node_context_suspend()
606 sci_rnc->destination_state = RNC_DEST_SUSPENDED; in sci_remote_node_context_suspend()
607 sci_rnc->suspend_type = suspend_type; in sci_remote_node_context_suspend()
608 sci_rnc->suspend_reason = suspend_reason; in sci_remote_node_context_suspend()
620 if ((sci_rnc->suspend_type == SCU_EVENT_TL_RNC_SUSPEND_TX_RX) in sci_remote_node_context_suspend()
621 || (suspend_type == sci_rnc->suspend_type)) in sci_remote_node_context_suspend()
625 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_suspend()
630 sci_rnc->destination_state = dest_param; in sci_remote_node_context_suspend()
631 sci_rnc->suspend_type = suspend_type; in sci_remote_node_context_suspend()
632 sci_rnc->suspend_reason = suspend_reason; in sci_remote_node_context_suspend()
650 sci_change_state(&sci_rnc->sm, SCI_RNC_AWAIT_SUSPENSION); in sci_remote_node_context_suspend()
655 enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_resume() argument
660 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_resume()
662 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_resume()
667 sci_rnc->destination_state, in sci_remote_node_context_resume()
673 if (sci_rnc->remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) in sci_remote_node_context_resume()
676 sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
679 sci_remote_node_context_construct_buffer(sci_rnc); in sci_remote_node_context_resume()
680 sci_change_state(&sci_rnc->sm, SCI_RNC_POSTING); in sci_remote_node_context_resume()
690 switch (sci_rnc->destination_state) { in sci_remote_node_context_resume()
697 sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
702 sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
718 sci_rnc, cb_fn, cb_p, RNC_DEST_READY); in sci_remote_node_context_resume()
722 (sci_rnc->destination_state == RNC_DEST_FINAL)) in sci_remote_node_context_resume()
723 sci_change_state(&sci_rnc->sm, in sci_remote_node_context_resume()
726 sci_change_state(&sci_rnc->sm, in sci_remote_node_context_resume()
734 sci_rnc, cb_fn, cb_p, RNC_DEST_SUSPENDED_RESUME); in sci_remote_node_context_resume()
737 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_resume()
744 enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_start_io() argument
749 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_start_io()
757 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_io()
762 dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_io()
770 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_start_task() argument
775 enum sci_status status = sci_remote_node_context_resume(sci_rnc, in sci_remote_node_context_start_task()
778 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_task()
784 struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_is_safe_to_abort() argument
788 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_safe_to_abort()
801 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_is_safe_to_abort()