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()
177 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_setup_to_resume() argument
182 if (sci_rnc->destination_state != RNC_DEST_FINAL) { in sci_remote_node_context_setup_to_resume()
183 sci_rnc->destination_state = dest_param; in sci_remote_node_context_setup_to_resume()
185 sci_rnc->user_callback = callback; in sci_remote_node_context_setup_to_resume()
186 sci_rnc->user_cookie = callback_parameter; in sci_remote_node_context_setup_to_resume()
192 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_setup_to_destroy() argument
196 struct isci_host *ihost = idev_to_ihost(rnc_to_dev(sci_rnc)); in sci_remote_node_context_setup_to_destroy()
198 sci_rnc->destination_state = RNC_DEST_FINAL; in sci_remote_node_context_setup_to_destroy()
199 sci_rnc->user_callback = callback; in sci_remote_node_context_setup_to_destroy()
200 sci_rnc->user_cookie = callback_parameter; in sci_remote_node_context_setup_to_destroy()
239 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
242 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_validate_context_buffer()
246 rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); in sci_remote_node_context_validate_context_buffer()
257 sci_rnc->remote_node_index); in sci_remote_node_context_validate_context_buffer()
261 …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
264 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_invalidate_context_buffer()
267 rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); in sci_remote_node_context_invalidate_context_buffer()
271 sci_remote_device_post_request(rnc_to_dev(sci_rnc), in sci_remote_node_context_invalidate_context_buffer()
295 struct sci_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); in sci_remote_node_context_posting_state_enter() local
297 sci_remote_node_context_validate_context_buffer(sci_rnc); in sci_remote_node_context_posting_state_enter()
428 enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_event_handler() argument
434 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_event_handler()
439 sci_change_state(&sci_rnc->sm, SCI_RNC_READY); in sci_remote_node_context_event_handler()
447 if (sci_rnc->destination_state == RNC_DEST_FINAL) in sci_remote_node_context_event_handler()
451 sci_change_state(&sci_rnc->sm, next_state); in sci_remote_node_context_event_handler()
458 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
461 "invalidated.\n", __func__, sci_rnc); in sci_remote_node_context_event_handler()
470 sci_change_state(&sci_rnc->sm, SCI_RNC_READY); in sci_remote_node_context_event_handler()
477 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
480 __func__, sci_rnc); in sci_remote_node_context_event_handler()
490 sci_change_state(&sci_rnc->sm, SCI_RNC_TX_SUSPENDED); in sci_remote_node_context_event_handler()
491 sci_rnc->suspend_type = scu_get_event_type(event_code); in sci_remote_node_context_event_handler()
494 sci_change_state(&sci_rnc->sm, SCI_RNC_TX_RX_SUSPENDED); in sci_remote_node_context_event_handler()
495 sci_rnc->suspend_type = scu_get_event_type(event_code); in sci_remote_node_context_event_handler()
512 if (sci_rnc->suspend_type == scu_get_event_type(event_code)) in sci_remote_node_context_event_handler()
513 sci_change_state(&sci_rnc->sm, next_state); in sci_remote_node_context_event_handler()
516 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
524 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
531 enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_destruct() argument
537 state = sci_rnc->sm.current_state_id; 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()
547 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); in sci_remote_node_context_destruct()
548 sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); in sci_remote_node_context_destruct()
551 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); in sci_remote_node_context_destruct()
554 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_destruct()
563 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_destruct()
571 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_suspend() argument
576 = sci_rnc->sm.current_state_id; in sci_remote_node_context_suspend()
577 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_suspend()
585 __func__, rnc_state_name(state), sci_rnc->suspend_type, in sci_remote_node_context_suspend()
586 sci_rnc->destination_state, suspend_reason, in sci_remote_node_context_suspend()
591 (sci_rnc->destination_state == RNC_DEST_FINAL)) in sci_remote_node_context_suspend()
592 dest_param = sci_rnc->destination_state; in sci_remote_node_context_suspend()
598 if (sci_rnc->destination_state == RNC_DEST_FINAL) { in sci_remote_node_context_suspend()
601 __func__, sci_rnc); in sci_remote_node_context_suspend()
612 if (sci_rnc->destination_state != RNC_DEST_FINAL) in sci_remote_node_context_suspend()
613 sci_rnc->destination_state = RNC_DEST_SUSPENDED; in sci_remote_node_context_suspend()
614 sci_rnc->suspend_type = suspend_type; in sci_remote_node_context_suspend()
615 sci_rnc->suspend_reason = suspend_reason; in sci_remote_node_context_suspend()
627 if ((sci_rnc->suspend_type == SCU_EVENT_TL_RNC_SUSPEND_TX_RX) in sci_remote_node_context_suspend()
628 || (suspend_type == sci_rnc->suspend_type)) in sci_remote_node_context_suspend()
632 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_suspend()
637 sci_rnc->destination_state = dest_param; in sci_remote_node_context_suspend()
638 sci_rnc->suspend_type = suspend_type; in sci_remote_node_context_suspend()
639 sci_rnc->suspend_reason = suspend_reason; in sci_remote_node_context_suspend()
657 sci_change_state(&sci_rnc->sm, SCI_RNC_AWAIT_SUSPENSION); in sci_remote_node_context_suspend()
662 enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_resume() argument
667 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_resume()
669 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_resume()
674 sci_rnc->destination_state, in sci_remote_node_context_resume()
680 if (sci_rnc->remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) in sci_remote_node_context_resume()
683 sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
686 sci_remote_node_context_construct_buffer(sci_rnc); in sci_remote_node_context_resume()
687 sci_change_state(&sci_rnc->sm, SCI_RNC_POSTING); in sci_remote_node_context_resume()
697 switch (sci_rnc->destination_state) { in sci_remote_node_context_resume()
704 sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
709 sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
725 sci_rnc, cb_fn, cb_p, RNC_DEST_READY); in sci_remote_node_context_resume()
729 (sci_rnc->destination_state == RNC_DEST_FINAL)) in sci_remote_node_context_resume()
730 sci_change_state(&sci_rnc->sm, in sci_remote_node_context_resume()
733 sci_change_state(&sci_rnc->sm, in sci_remote_node_context_resume()
741 sci_rnc, cb_fn, cb_p, RNC_DEST_SUSPENDED_RESUME); in sci_remote_node_context_resume()
744 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_resume()
751 enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_start_io() argument
756 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_start_io()
764 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_io()
769 dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_io()
777 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_start_task() argument
782 enum sci_status status = sci_remote_node_context_resume(sci_rnc, in sci_remote_node_context_start_task()
785 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_task()
791 struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_is_safe_to_abort() argument
795 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_safe_to_abort()
808 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_is_safe_to_abort()