Lines Matching refs:sci_rnc
82 struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_is_ready() argument
84 u32 current_state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_ready()
93 bool sci_remote_node_context_is_suspended(struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_is_suspended() argument
95 u32 current_state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_suspended()
111 static void sci_remote_node_context_construct_buffer(struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_construct_buffer() argument
113 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_construct_buffer()
115 int rni = sci_rnc->remote_node_index; in sci_remote_node_context_construct_buffer()
174 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_setup_to_resume() argument
179 if (sci_rnc->destination_state != RNC_DEST_FINAL) { in sci_remote_node_context_setup_to_resume()
180 sci_rnc->destination_state = dest_param; in sci_remote_node_context_setup_to_resume()
182 sci_rnc->user_callback = callback; in sci_remote_node_context_setup_to_resume()
183 sci_rnc->user_cookie = callback_parameter; in sci_remote_node_context_setup_to_resume()
189 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_setup_to_destroy() argument
193 struct isci_host *ihost = idev_to_ihost(rnc_to_dev(sci_rnc)); in sci_remote_node_context_setup_to_destroy()
195 sci_rnc->destination_state = RNC_DEST_FINAL; in sci_remote_node_context_setup_to_destroy()
196 sci_rnc->user_callback = callback; in sci_remote_node_context_setup_to_destroy()
197 sci_rnc->user_cookie = callback_parameter; in sci_remote_node_context_setup_to_destroy()
236 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
239 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_validate_context_buffer()
243 rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); in sci_remote_node_context_validate_context_buffer()
254 sci_rnc->remote_node_index); in sci_remote_node_context_validate_context_buffer()
258 …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
261 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_invalidate_context_buffer()
264 rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); in sci_remote_node_context_invalidate_context_buffer()
268 sci_remote_device_post_request(rnc_to_dev(sci_rnc), in sci_remote_node_context_invalidate_context_buffer()
292 struct sci_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); in sci_remote_node_context_posting_state_enter() local
294 sci_remote_node_context_validate_context_buffer(sci_rnc); in sci_remote_node_context_posting_state_enter()
425 enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_event_handler() argument
431 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_event_handler()
436 sci_change_state(&sci_rnc->sm, SCI_RNC_READY); in sci_remote_node_context_event_handler()
444 if (sci_rnc->destination_state == RNC_DEST_FINAL) in sci_remote_node_context_event_handler()
448 sci_change_state(&sci_rnc->sm, next_state); in sci_remote_node_context_event_handler()
455 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
458 "invalidated.\n", __func__, sci_rnc); in sci_remote_node_context_event_handler()
467 sci_change_state(&sci_rnc->sm, SCI_RNC_READY); in sci_remote_node_context_event_handler()
474 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
477 __func__, sci_rnc); in sci_remote_node_context_event_handler()
487 sci_change_state(&sci_rnc->sm, SCI_RNC_TX_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()
491 sci_change_state(&sci_rnc->sm, SCI_RNC_TX_RX_SUSPENDED); in sci_remote_node_context_event_handler()
492 sci_rnc->suspend_type = scu_get_event_type(event_code); in sci_remote_node_context_event_handler()
509 if (sci_rnc->suspend_type == scu_get_event_type(event_code)) in sci_remote_node_context_event_handler()
510 sci_change_state(&sci_rnc->sm, next_state); in sci_remote_node_context_event_handler()
513 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
521 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_event_handler()
528 enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_destruct() argument
534 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_destruct()
537 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); 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()
545 sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); in sci_remote_node_context_destruct()
548 sci_remote_node_context_setup_to_destroy(sci_rnc, cb_fn, cb_p); in sci_remote_node_context_destruct()
551 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_destruct()
560 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_destruct()
568 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_suspend() argument
573 = sci_rnc->sm.current_state_id; in sci_remote_node_context_suspend()
574 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_suspend()
582 __func__, rnc_state_name(state), sci_rnc->suspend_type, in sci_remote_node_context_suspend()
583 sci_rnc->destination_state, suspend_reason, in sci_remote_node_context_suspend()
588 (sci_rnc->destination_state == RNC_DEST_FINAL)) in sci_remote_node_context_suspend()
589 dest_param = sci_rnc->destination_state; in sci_remote_node_context_suspend()
595 if (sci_rnc->destination_state == RNC_DEST_FINAL) { in sci_remote_node_context_suspend()
598 __func__, sci_rnc); in sci_remote_node_context_suspend()
609 if (sci_rnc->destination_state != RNC_DEST_FINAL) in sci_remote_node_context_suspend()
610 sci_rnc->destination_state = RNC_DEST_SUSPENDED; in sci_remote_node_context_suspend()
611 sci_rnc->suspend_type = suspend_type; in sci_remote_node_context_suspend()
612 sci_rnc->suspend_reason = suspend_reason; in sci_remote_node_context_suspend()
624 if ((sci_rnc->suspend_type == SCU_EVENT_TL_RNC_SUSPEND_TX_RX) in sci_remote_node_context_suspend()
625 || (suspend_type == sci_rnc->suspend_type)) in sci_remote_node_context_suspend()
629 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_suspend()
634 sci_rnc->destination_state = dest_param; in sci_remote_node_context_suspend()
635 sci_rnc->suspend_type = suspend_type; in sci_remote_node_context_suspend()
636 sci_rnc->suspend_reason = suspend_reason; in sci_remote_node_context_suspend()
654 sci_change_state(&sci_rnc->sm, SCI_RNC_AWAIT_SUSPENSION); in sci_remote_node_context_suspend()
659 enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_resume() argument
664 struct isci_remote_device *idev = rnc_to_dev(sci_rnc); in sci_remote_node_context_resume()
666 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_resume()
671 sci_rnc->destination_state, in sci_remote_node_context_resume()
677 if (sci_rnc->remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) in sci_remote_node_context_resume()
680 sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
683 sci_remote_node_context_construct_buffer(sci_rnc); in sci_remote_node_context_resume()
684 sci_change_state(&sci_rnc->sm, SCI_RNC_POSTING); in sci_remote_node_context_resume()
694 switch (sci_rnc->destination_state) { in sci_remote_node_context_resume()
701 sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
706 sci_rnc, cb_fn, cb_p, in sci_remote_node_context_resume()
722 sci_rnc, cb_fn, cb_p, RNC_DEST_READY); in sci_remote_node_context_resume()
726 (sci_rnc->destination_state == RNC_DEST_FINAL)) in sci_remote_node_context_resume()
727 sci_change_state(&sci_rnc->sm, in sci_remote_node_context_resume()
730 sci_change_state(&sci_rnc->sm, in sci_remote_node_context_resume()
738 sci_rnc, cb_fn, cb_p, RNC_DEST_SUSPENDED_RESUME); in sci_remote_node_context_resume()
741 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_resume()
748 enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_start_io() argument
753 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_start_io()
761 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_io()
766 dev_dbg(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_io()
774 struct sci_remote_node_context *sci_rnc, in sci_remote_node_context_start_task() argument
779 enum sci_status status = sci_remote_node_context_resume(sci_rnc, in sci_remote_node_context_start_task()
782 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_start_task()
788 struct sci_remote_node_context *sci_rnc) in sci_remote_node_context_is_safe_to_abort() argument
792 state = sci_rnc->sm.current_state_id; in sci_remote_node_context_is_safe_to_abort()
805 dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), in sci_remote_node_context_is_safe_to_abort()