Lines Matching refs:domain
17 struct efc_domain *domain = NULL; in efc_domain_cb() local
22 domain = data; in efc_domain_cb()
37 domain = efc->domain; in efc_domain_cb()
38 if (!domain) { in efc_domain_cb()
39 domain = efc_domain_alloc(efc, fcf_wwn); in efc_domain_cb()
40 if (!domain) { in efc_domain_cb()
45 efc_sm_transition(&domain->drvsm, __efc_domain_init, in efc_domain_cb()
48 efc_domain_post_event(domain, EFC_EVT_DOMAIN_FOUND, drec); in efc_domain_cb()
53 domain_trace(domain, "EFC_HW_DOMAIN_LOST:\n"); in efc_domain_cb()
55 efc_domain_post_event(domain, EFC_EVT_DOMAIN_LOST, NULL); in efc_domain_cb()
59 domain_trace(domain, "EFC_HW_DOMAIN_ALLOC_OK:\n"); in efc_domain_cb()
60 efc_domain_post_event(domain, EFC_EVT_DOMAIN_ALLOC_OK, NULL); in efc_domain_cb()
64 domain_trace(domain, "EFC_HW_DOMAIN_ALLOC_FAIL:\n"); in efc_domain_cb()
65 efc_domain_post_event(domain, EFC_EVT_DOMAIN_ALLOC_FAIL, in efc_domain_cb()
70 domain_trace(domain, "EFC_HW_DOMAIN_ATTACH_OK:\n"); in efc_domain_cb()
71 efc_domain_post_event(domain, EFC_EVT_DOMAIN_ATTACH_OK, NULL); in efc_domain_cb()
75 domain_trace(domain, "EFC_HW_DOMAIN_ATTACH_FAIL:\n"); in efc_domain_cb()
76 efc_domain_post_event(domain, in efc_domain_cb()
81 domain_trace(domain, "EFC_HW_DOMAIN_FREE_OK:\n"); in efc_domain_cb()
82 efc_domain_post_event(domain, EFC_EVT_DOMAIN_FREE_OK, NULL); in efc_domain_cb()
86 domain_trace(domain, "EFC_HW_DOMAIN_FREE_FAIL:\n"); in efc_domain_cb()
87 efc_domain_post_event(domain, EFC_EVT_DOMAIN_FREE_FAIL, NULL); in efc_domain_cb()
95 if (efc->domain && domain->req_accept_frames) { in efc_domain_cb()
96 domain->req_accept_frames = false; in efc_domain_cb()
106 struct efc_domain *domain = container_of(arg, struct efc_domain, ref); in _efc_domain_free() local
107 struct efc *efc = domain->efc; in _efc_domain_free()
112 kfree(domain); in _efc_domain_free()
116 efc_domain_free(struct efc_domain *domain) in efc_domain_free() argument
120 efc = domain->efc; in efc_domain_free()
125 efc_log_debug(efc, "Domain free: wwn %016llX\n", domain->fcf_wwn); in efc_domain_free()
127 xa_destroy(&domain->lookup); in efc_domain_free()
128 efc->domain = NULL; in efc_domain_free()
129 kref_put(&domain->ref, domain->release); in efc_domain_free()
135 struct efc_domain *domain; in efc_domain_alloc() local
137 domain = kzalloc(sizeof(*domain), GFP_ATOMIC); in efc_domain_alloc()
138 if (!domain) in efc_domain_alloc()
141 domain->efc = efc; in efc_domain_alloc()
142 domain->drvsm.app = domain; in efc_domain_alloc()
145 kref_init(&domain->ref); in efc_domain_alloc()
146 domain->release = _efc_domain_free; in efc_domain_alloc()
148 xa_init(&domain->lookup); in efc_domain_alloc()
150 INIT_LIST_HEAD(&domain->nport_list); in efc_domain_alloc()
151 efc->domain = domain; in efc_domain_alloc()
152 domain->fcf_wwn = fcf_wwn; in efc_domain_alloc()
153 efc_log_debug(efc, "Domain allocated: wwn %016llX\n", domain->fcf_wwn); in efc_domain_alloc()
155 return domain; in efc_domain_alloc()
166 if (!efc->domain && callback) in efc_register_domain_free_cb()
174 struct efc_domain *domain = ctx->app; in __efc_domain_common() local
187 efc_log_warn(domain->efc, "%-20s %-20s not handled\n", in __efc_domain_common()
196 struct efc_domain *domain = ctx->app; in __efc_domain_common_shutdown() local
205 memcpy(&domain->pending_drec, arg, in __efc_domain_common_shutdown()
206 sizeof(domain->pending_drec)); in __efc_domain_common_shutdown()
207 domain->domain_found_pending = true; in __efc_domain_common_shutdown()
211 domain->domain_found_pending = false; in __efc_domain_common_shutdown()
215 efc_log_warn(domain->efc, "%-20s %-20s not handled\n", in __efc_domain_common_shutdown()
221 struct efc_domain *domain = NULL;\
225 domain = ctx->app;\
226 WARN_ON(!domain->efc);\
227 efc = domain->efc
235 domain_sm_trace(domain); in __efc_domain_init()
239 domain->attached = false; in __efc_domain_init()
261 nport = efc_nport_alloc(domain, my_wwpn, my_wwnn, U32_MAX, in __efc_domain_init()
281 domain->is_loop = drec->is_loop; in __efc_domain_init()
291 domain->is_nlport = drec->map.loop[1] == 0x00; in __efc_domain_init()
293 if (!domain->is_loop) { in __efc_domain_init()
295 if (efc_cmd_domain_alloc(efc, domain, drec->index)) { in __efc_domain_init()
306 (domain->is_nlport ? in __efc_domain_init()
343 if (efc_cmd_domain_alloc(efc, domain, drec->index)) { in __efc_domain_init()
362 domain_sm_trace(domain); in __efc_domain_wait_alloc()
369 nport = domain->nport; in __efc_domain_wait_alloc()
376 memcpy(domain->service_params + 4, domain->dma.virt, in __efc_domain_wait_alloc()
378 memcpy(nport->service_params + 4, domain->dma.virt, in __efc_domain_wait_alloc()
392 if (domain->is_loop && !domain->is_nlport) { in __efc_domain_wait_alloc()
405 __efc_domain_attach_internal(domain, nport->fc_id); in __efc_domain_wait_alloc()
428 domain->req_accept_frames = true; in __efc_domain_wait_alloc()
439 domain->req_domain_free = true; in __efc_domain_wait_alloc()
464 domain_sm_trace(domain); in __efc_domain_allocated()
478 rc = xa_err(xa_store(&domain->lookup, fc_id, domain->nport, in __efc_domain_allocated()
486 efc_node_fcid_display(fc_id, domain->nport->display_name, in __efc_domain_allocated()
487 sizeof(domain->nport->display_name)); in __efc_domain_allocated()
490 rc = efc_cmd_domain_attach(efc, domain, fc_id); in __efc_domain_allocated()
511 if (!list_empty(&domain->nport_list)) { in __efc_domain_allocated()
522 &domain->nport_list, in __efc_domain_allocated()
531 if (efc_cmd_domain_free(efc, domain)) in __efc_domain_allocated()
549 domain_sm_trace(domain); in __efc_domain_wait_attach()
561 domain->domain_notify_pend = true; in __efc_domain_wait_attach()
564 domain->attached = true; in __efc_domain_wait_attach()
571 domain->req_accept_frames = true; in __efc_domain_wait_attach()
580 &domain->nport_list, list_entry) { in __efc_domain_wait_attach()
587 domain->domain_notify_pend = false; in __efc_domain_wait_attach()
629 domain_sm_trace(domain); in __efc_domain_ready()
634 if (efc_vport_start(domain)) { in __efc_domain_ready()
635 efc_log_debug(domain->efc, in __efc_domain_ready()
641 if (!list_empty(&domain->nport_list)) { in __efc_domain_ready()
651 &domain->nport_list, in __efc_domain_ready()
660 if (efc_cmd_domain_free(efc, domain)) in __efc_domain_ready()
679 WARN_ON(!domain->attached); in __efc_domain_ready()
685 WARN_ON(domain->nport->fc_id != fc_id); in __efc_domain_ready()
700 domain_sm_trace(domain); in __efc_domain_wait_nports_free()
711 rc = efc_cmd_domain_free(efc, domain); in __efc_domain_wait_nports_free()
729 domain_sm_trace(domain); in __efc_domain_wait_shutdown()
734 if (domain->domain_found_pending) { in __efc_domain_wait_shutdown()
742 u64 fcf_wwn = domain->fcf_wwn; in __efc_domain_wait_shutdown()
743 struct efc_domain_record drec = domain->pending_drec; in __efc_domain_wait_shutdown()
746 domain->req_domain_free = true; in __efc_domain_wait_shutdown()
747 domain = efc_domain_alloc(efc, fcf_wwn); in __efc_domain_wait_shutdown()
749 if (!domain) { in __efc_domain_wait_shutdown()
760 efc_sm_transition(&domain->drvsm, __efc_domain_init, in __efc_domain_wait_shutdown()
762 efc_sm_post_event(&domain->drvsm, in __efc_domain_wait_shutdown()
765 domain->req_domain_free = true; in __efc_domain_wait_shutdown()
779 domain_sm_trace(domain); in __efc_domain_wait_domain_lost()
788 if (!list_empty(&domain->nport_list)) { in __efc_domain_wait_domain_lost()
798 &domain->nport_list, in __efc_domain_wait_domain_lost()
807 if (efc_cmd_domain_free(efc, domain)) in __efc_domain_wait_domain_lost()
824 __efc_domain_attach_internal(struct efc_domain *domain, u32 s_id) in __efc_domain_attach_internal() argument
826 memcpy(domain->dma.virt, in __efc_domain_attach_internal()
827 ((uint8_t *)domain->flogi_service_params) + 4, in __efc_domain_attach_internal()
829 (void)efc_sm_post_event(&domain->drvsm, EFC_EVT_DOMAIN_REQ_ATTACH, in __efc_domain_attach_internal()
834 efc_domain_attach(struct efc_domain *domain, u32 s_id) in efc_domain_attach() argument
836 __efc_domain_attach_internal(domain, s_id); in efc_domain_attach()
840 efc_domain_post_event(struct efc_domain *domain, in efc_domain_post_event() argument
846 rc = efc_sm_post_event(&domain->drvsm, event, arg); in efc_domain_post_event()
848 req_domain_free = domain->req_domain_free; in efc_domain_post_event()
849 domain->req_domain_free = false; in efc_domain_post_event()
852 efc_domain_free(domain); in efc_domain_post_event()
858 efct_domain_process_pending(struct efc_domain *domain) in efct_domain_process_pending() argument
860 struct efc *efc = domain->efc; in efct_domain_process_pending()
893 if (efc_domain_dispatch_frame(domain, seq)) in efct_domain_process_pending()
907 struct efc_domain *domain = efc->domain; in efc_dispatch_frame() local
914 if (!domain || efc->hold_frames || !list_empty(&efc->pend_frames)) { in efc_dispatch_frame()
922 if (domain) { in efc_dispatch_frame()
924 efct_domain_process_pending(domain); in efc_dispatch_frame()
932 if (efc_domain_dispatch_frame(domain, seq)) in efc_dispatch_frame()
940 struct efc_domain *domain = (struct efc_domain *)arg; in efc_domain_dispatch_frame() local
941 struct efc *efc = domain->efc; in efc_domain_dispatch_frame()
961 nport = efc_nport_find(domain, d_id); in efc_domain_dispatch_frame()
971 nport = domain->nport; in efc_domain_dispatch_frame()