Lines Matching refs:els

25 #define els_io_printf(els, fmt, ...) \  argument
26 efc_log_err((struct efc *)els->node->efc,\
28 els->node->display_name,\
29 els->display_name, ##__VA_ARGS__)
44 struct efc_els_io_req *els; in efc_els_io_alloc_size() local
54 els = mempool_alloc(efc->els_io_pool, GFP_ATOMIC); in efc_els_io_alloc_size()
55 if (!els) { in efc_els_io_alloc_size()
61 kref_init(&els->ref); in efc_els_io_alloc_size()
62 els->release = _efc_els_io_free; in efc_els_io_alloc_size()
65 els->node = node; in efc_els_io_alloc_size()
68 els->io.req.size = reqlen; in efc_els_io_alloc_size()
69 els->io.req.virt = dma_alloc_coherent(&efc->pci->dev, els->io.req.size, in efc_els_io_alloc_size()
70 &els->io.req.phys, GFP_KERNEL); in efc_els_io_alloc_size()
71 if (!els->io.req.virt) { in efc_els_io_alloc_size()
72 mempool_free(els, efc->els_io_pool); in efc_els_io_alloc_size()
76 els->io.rsp.size = rsplen; in efc_els_io_alloc_size()
77 els->io.rsp.virt = dma_alloc_coherent(&efc->pci->dev, els->io.rsp.size, in efc_els_io_alloc_size()
78 &els->io.rsp.phys, GFP_KERNEL); in efc_els_io_alloc_size()
79 if (!els->io.rsp.virt) { in efc_els_io_alloc_size()
80 dma_free_coherent(&efc->pci->dev, els->io.req.size, in efc_els_io_alloc_size()
81 els->io.req.virt, els->io.req.phys); in efc_els_io_alloc_size()
82 mempool_free(els, efc->els_io_pool); in efc_els_io_alloc_size()
83 els = NULL; in efc_els_io_alloc_size()
86 if (els) { in efc_els_io_alloc_size()
88 els->els_retries_remaining = EFC_FC_ELS_DEFAULT_RETRIES; in efc_els_io_alloc_size()
91 INIT_LIST_HEAD(&els->list_entry); in efc_els_io_alloc_size()
93 list_add_tail(&els->list_entry, &node->els_ios_list); in efc_els_io_alloc_size()
97 return els; in efc_els_io_alloc_size()
101 efc_els_io_free(struct efc_els_io_req *els) in efc_els_io_free() argument
103 kref_put(&els->ref, els->release); in efc_els_io_free()
109 struct efc_els_io_req *els = in _efc_els_io_free() local
116 node = els->node; in _efc_els_io_free()
121 list_del(&els->list_entry); in _efc_els_io_free()
133 dma_free_coherent(&efc->pci->dev, els->io.rsp.size, in _efc_els_io_free()
134 els->io.rsp.virt, els->io.rsp.phys); in _efc_els_io_free()
135 dma_free_coherent(&efc->pci->dev, els->io.req.size, in _efc_els_io_free()
136 els->io.req.virt, els->io.req.phys); in _efc_els_io_free()
138 mempool_free(els, efc->els_io_pool); in _efc_els_io_free()
145 efc_els_retry(struct efc_els_io_req *els);
150 struct efc_els_io_req *els = from_timer(els, t, delay_timer); in efc_els_delay_timer_cb() local
153 efc_els_retry(els); in efc_els_delay_timer_cb()
159 struct efc_els_io_req *els; in efc_els_req_cb() local
165 els = arg; in efc_els_req_cb()
166 node = els->node; in efc_els_req_cb()
170 els_io_printf(els, "status x%x ext x%x\n", status, ext_status); in efc_els_req_cb()
173 els->io.rsp.len = length; in efc_els_req_cb()
178 cbdata.els_rsp = els->io.rsp; in efc_els_req_cb()
187 if (length > els->io.rsp.size) { in efc_els_req_cb()
190 length, els->io.rsp.size); in efc_els_req_cb()
191 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_FAIL, &cbdata); in efc_els_req_cb()
198 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_OK, &cbdata); in efc_els_req_cb()
207 els->node->els_req_cnt--; in efc_els_req_cb()
208 els_io_printf(els, in efc_els_req_cb()
210 timer_setup(&els->delay_timer, in efc_els_req_cb()
212 mod_timer(&els->delay_timer, in efc_els_req_cb()
216 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_RJT, in efc_els_req_cb()
225 efc_els_retry(els); in efc_els_req_cb()
230 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_FAIL, in efc_els_req_cb()
238 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_FAIL, &cbdata); in efc_els_req_cb()
248 struct efc_els_io_req *els = in efc_disc_io_complete() local
251 WARN_ON_ONCE(!els->cb); in efc_disc_io_complete()
253 ((efc_hw_srrs_cb_t)els->cb) (els, len, status, ext_status); in efc_disc_io_complete()
256 static int efc_els_send_req(struct efc_node *node, struct efc_els_io_req *els, in efc_els_send_req() argument
264 els->node->els_req_cnt++; in efc_els_send_req()
267 els->io.io_type = io_type; in efc_els_send_req()
268 els->io.xmit_len = els->io.req.size; in efc_els_send_req()
269 els->io.rsp_len = els->io.rsp.size; in efc_els_send_req()
270 els->io.rpi = node->rnode.indicator; in efc_els_send_req()
271 els->io.vpi = node->nport->indicator; in efc_els_send_req()
272 els->io.s_id = node->nport->fc_id; in efc_els_send_req()
273 els->io.d_id = node->rnode.fc_id; in efc_els_send_req()
276 els->io.rpi_registered = true; in efc_els_send_req()
278 els->cb = efc_els_req_cb; in efc_els_send_req()
280 rc = efc->tt.send_els(efc, &els->io); in efc_els_send_req()
286 cbdata.els_rsp = els->io.rsp; in efc_els_send_req()
288 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_FAIL, &cbdata); in efc_els_send_req()
294 efc_els_retry(struct efc_els_io_req *els) in efc_els_retry() argument
300 efc = els->node->efc; in efc_els_retry()
303 cbdata.els_rsp = els->io.rsp; in efc_els_retry()
305 if (els->els_retries_remaining) { in efc_els_retry()
306 els->els_retries_remaining--; in efc_els_retry()
307 rc = efc->tt.send_els(efc, &els->io); in efc_els_retry()
314 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_REQ_FAIL, &cbdata); in efc_els_retry()
321 struct efc_els_io_req *els; in efc_els_acc_cb() local
326 els = arg; in efc_els_acc_cb()
327 node = els->node; in efc_els_acc_cb()
333 cbdata.els_rsp = els->io.rsp; in efc_els_acc_cb()
338 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_CMPL_OK, &cbdata); in efc_els_acc_cb()
343 node->display_name, els->display_name, in efc_els_acc_cb()
345 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_CMPL_FAIL, &cbdata); in efc_els_acc_cb()
353 efc_els_send_rsp(struct efc_els_io_req *els, u32 rsplen) in efc_els_send_rsp() argument
357 struct efc_node *node = els->node; in efc_els_send_rsp()
363 els->io.io_type = EFC_DISC_IO_ELS_RESP; in efc_els_send_rsp()
364 els->cb = efc_els_acc_cb; in efc_els_send_rsp()
367 els->io.xmit_len = rsplen; in efc_els_send_rsp()
368 els->io.rsp_len = els->io.rsp.size; in efc_els_send_rsp()
369 els->io.rpi = node->rnode.indicator; in efc_els_send_rsp()
370 els->io.vpi = node->nport->indicator; in efc_els_send_rsp()
372 els->io.s_id = node->nport->fc_id; in efc_els_send_rsp()
374 els->io.s_id = els->io.iparam.els.s_id; in efc_els_send_rsp()
375 els->io.d_id = node->rnode.fc_id; in efc_els_send_rsp()
378 els->io.rpi_registered = true; in efc_els_send_rsp()
380 rc = efc->tt.send_els(efc, &els->io); in efc_els_send_rsp()
386 cbdata.els_rsp = els->io.rsp; in efc_els_send_rsp()
387 efc_els_io_cleanup(els, EFC_EVT_SRRS_ELS_CMPL_FAIL, &cbdata); in efc_els_send_rsp()
395 struct efc_els_io_req *els; in efc_send_plogi() local
401 els = efc_els_io_alloc(node, sizeof(*plogi)); in efc_send_plogi()
402 if (!els) { in efc_send_plogi()
406 els->display_name = "plogi"; in efc_send_plogi()
409 plogi = els->io.req.virt; in efc_send_plogi()
416 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_plogi()
422 struct efc_els_io_req *els; in efc_send_flogi() local
430 els = efc_els_io_alloc(node, sizeof(*flogi)); in efc_send_flogi()
431 if (!els) { in efc_send_flogi()
436 els->display_name = "flogi"; in efc_send_flogi()
439 flogi = els->io.req.virt; in efc_send_flogi()
445 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_flogi()
451 struct efc_els_io_req *els; in efc_send_fdisc() local
459 els = efc_els_io_alloc(node, sizeof(*fdisc)); in efc_send_fdisc()
460 if (!els) { in efc_send_fdisc()
465 els->display_name = "fdisc"; in efc_send_fdisc()
468 fdisc = els->io.req.virt; in efc_send_fdisc()
474 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_fdisc()
481 struct efc_els_io_req *els; in efc_send_prli() local
489 els = efc_els_io_alloc(node, sizeof(*pp)); in efc_send_prli()
490 if (!els) { in efc_send_prli()
495 els->display_name = "prli"; in efc_send_prli()
498 pp = els->io.req.virt; in efc_send_prli()
514 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_prli()
521 struct efc_els_io_req *els; in efc_send_logo() local
529 els = efc_els_io_alloc(node, sizeof(*logo)); in efc_send_logo()
530 if (!els) { in efc_send_logo()
535 els->display_name = "logo"; in efc_send_logo()
539 logo = els->io.req.virt; in efc_send_logo()
546 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_logo()
553 struct efc_els_io_req *els; in efc_send_adisc() local
562 els = efc_els_io_alloc(node, sizeof(*adisc)); in efc_send_adisc()
563 if (!els) { in efc_send_adisc()
568 els->display_name = "adisc"; in efc_send_adisc()
572 adisc = els->io.req.virt; in efc_send_adisc()
581 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_adisc()
587 struct efc_els_io_req *els; in efc_send_scr() local
593 els = efc_els_io_alloc(node, sizeof(*req)); in efc_send_scr()
594 if (!els) { in efc_send_scr()
599 els->display_name = "scr"; in efc_send_scr()
601 req = els->io.req.virt; in efc_send_scr()
607 return efc_els_send_req(node, els, EFC_DISC_IO_ELS_REQ); in efc_send_scr()
615 struct efc_els_io_req *els = NULL; in efc_send_ls_rjt() local
618 els = efc_els_io_alloc(node, sizeof(*rjt)); in efc_send_ls_rjt()
619 if (!els) { in efc_send_ls_rjt()
626 els->display_name = "ls_rjt"; in efc_send_ls_rjt()
628 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_ls_rjt()
629 els->io.iparam.els.ox_id = ox_id; in efc_send_ls_rjt()
631 rjt = els->io.req.virt; in efc_send_ls_rjt()
638 return efc_els_send_rsp(els, sizeof(*rjt)); in efc_send_ls_rjt()
645 struct efc_els_io_req *els = NULL; in efc_send_plogi_acc() local
651 els = efc_els_io_alloc(node, sizeof(*plogi)); in efc_send_plogi_acc()
652 if (!els) { in efc_send_plogi_acc()
657 els->display_name = "plogi_acc"; in efc_send_plogi_acc()
659 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_plogi_acc()
660 els->io.iparam.els.ox_id = ox_id; in efc_send_plogi_acc()
662 plogi = els->io.req.virt; in efc_send_plogi_acc()
673 return efc_els_send_rsp(els, sizeof(*plogi)); in efc_send_plogi_acc()
680 struct efc_els_io_req *els = NULL; in efc_send_flogi_p2p_acc() local
685 els = efc_els_io_alloc(node, sizeof(*flogi)); in efc_send_flogi_p2p_acc()
686 if (!els) { in efc_send_flogi_p2p_acc()
691 els->display_name = "flogi_p2p_acc"; in efc_send_flogi_p2p_acc()
693 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_flogi_p2p_acc()
694 els->io.iparam.els.ox_id = ox_id; in efc_send_flogi_p2p_acc()
695 els->io.iparam.els.s_id = s_id; in efc_send_flogi_p2p_acc()
697 flogi = els->io.req.virt; in efc_send_flogi_p2p_acc()
706 return efc_els_send_rsp(els, sizeof(*flogi)); in efc_send_flogi_p2p_acc()
713 struct efc_els_io_req *els = NULL; in efc_send_prli_acc() local
721 els = efc_els_io_alloc(node, sizeof(*pp)); in efc_send_prli_acc()
722 if (!els) { in efc_send_prli_acc()
727 els->display_name = "prli_acc"; in efc_send_prli_acc()
729 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_prli_acc()
730 els->io.iparam.els.ox_id = ox_id; in efc_send_prli_acc()
732 pp = els->io.req.virt; in efc_send_prli_acc()
748 return efc_els_send_rsp(els, sizeof(*pp)); in efc_send_prli_acc()
755 struct efc_els_io_req *els = NULL; in efc_send_prlo_acc() local
763 els = efc_els_io_alloc(node, sizeof(*pp)); in efc_send_prlo_acc()
764 if (!els) { in efc_send_prlo_acc()
769 els->display_name = "prlo_acc"; in efc_send_prlo_acc()
771 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_prlo_acc()
772 els->io.iparam.els.ox_id = ox_id; in efc_send_prlo_acc()
774 pp = els->io.req.virt; in efc_send_prlo_acc()
784 return efc_els_send_rsp(els, sizeof(*pp)); in efc_send_prlo_acc()
791 struct efc_els_io_req *els = NULL; in efc_send_ls_acc() local
796 els = efc_els_io_alloc(node, sizeof(*acc)); in efc_send_ls_acc()
797 if (!els) { in efc_send_ls_acc()
802 els->display_name = "ls_acc"; in efc_send_ls_acc()
804 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_ls_acc()
805 els->io.iparam.els.ox_id = ox_id; in efc_send_ls_acc()
807 acc = els->io.req.virt; in efc_send_ls_acc()
812 return efc_els_send_rsp(els, sizeof(*acc)); in efc_send_ls_acc()
818 struct efc_els_io_req *els = NULL; in efc_send_logo_acc() local
824 els = efc_els_io_alloc(node, sizeof(*logo)); in efc_send_logo_acc()
825 if (!els) { in efc_send_logo_acc()
830 els->display_name = "logo_acc"; in efc_send_logo_acc()
832 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_logo_acc()
833 els->io.iparam.els.ox_id = ox_id; in efc_send_logo_acc()
835 logo = els->io.req.virt; in efc_send_logo_acc()
840 return efc_els_send_rsp(els, sizeof(*logo)); in efc_send_logo_acc()
847 struct efc_els_io_req *els = NULL; in efc_send_adisc_acc() local
853 els = efc_els_io_alloc(node, sizeof(*adisc)); in efc_send_adisc_acc()
854 if (!els) { in efc_send_adisc_acc()
859 els->display_name = "adisc_acc"; in efc_send_adisc_acc()
862 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_adisc_acc()
863 els->io.iparam.els.ox_id = ox_id; in efc_send_adisc_acc()
866 adisc = els->io.req.virt; in efc_send_adisc_acc()
873 return efc_els_send_rsp(els, sizeof(*adisc)); in efc_send_adisc_acc()
895 struct efc_els_io_req *els; in efc_ns_send_rftid() local
903 els = efc_els_io_alloc(node, sizeof(*ct)); in efc_ns_send_rftid()
904 if (!els) { in efc_ns_send_rftid()
909 els->io.iparam.ct.r_ctl = FC_RCTL_ELS_REQ; in efc_ns_send_rftid()
910 els->io.iparam.ct.type = FC_TYPE_CT; in efc_ns_send_rftid()
911 els->io.iparam.ct.df_ctl = 0; in efc_ns_send_rftid()
912 els->io.iparam.ct.timeout = EFC_FC_ELS_SEND_DEFAULT_TIMEOUT; in efc_ns_send_rftid()
914 els->display_name = "rftid"; in efc_ns_send_rftid()
916 ct = els->io.req.virt; in efc_ns_send_rftid()
925 return efc_els_send_req(node, els, EFC_DISC_IO_CT_REQ); in efc_ns_send_rftid()
932 struct efc_els_io_req *els; in efc_ns_send_rffid() local
940 els = efc_els_io_alloc(node, sizeof(*ct)); in efc_ns_send_rffid()
941 if (!els) { in efc_ns_send_rffid()
946 els->io.iparam.ct.r_ctl = FC_RCTL_ELS_REQ; in efc_ns_send_rffid()
947 els->io.iparam.ct.type = FC_TYPE_CT; in efc_ns_send_rffid()
948 els->io.iparam.ct.df_ctl = 0; in efc_ns_send_rffid()
949 els->io.iparam.ct.timeout = EFC_FC_ELS_SEND_DEFAULT_TIMEOUT; in efc_ns_send_rffid()
951 els->display_name = "rffid"; in efc_ns_send_rffid()
952 ct = els->io.req.virt; in efc_ns_send_rffid()
965 return efc_els_send_req(node, els, EFC_DISC_IO_CT_REQ); in efc_ns_send_rffid()
971 struct efc_els_io_req *els = NULL; in efc_ns_send_gidpt() local
980 els = efc_els_io_alloc_size(node, sizeof(*ct), EFC_ELS_GID_PT_RSP_LEN); in efc_ns_send_gidpt()
981 if (!els) { in efc_ns_send_gidpt()
986 els->io.iparam.ct.r_ctl = FC_RCTL_ELS_REQ; in efc_ns_send_gidpt()
987 els->io.iparam.ct.type = FC_TYPE_CT; in efc_ns_send_gidpt()
988 els->io.iparam.ct.df_ctl = 0; in efc_ns_send_gidpt()
989 els->io.iparam.ct.timeout = EFC_FC_ELS_SEND_DEFAULT_TIMEOUT; in efc_ns_send_gidpt()
991 els->display_name = "gidpt"; in efc_ns_send_gidpt()
993 ct = els->io.req.virt; in efc_ns_send_gidpt()
1001 return efc_els_send_req(node, els, EFC_DISC_IO_CT_REQ); in efc_ns_send_gidpt()
1005 efc_els_io_cleanup(struct efc_els_io_req *els, int evt, void *arg) in efc_els_io_cleanup() argument
1010 els->els_req_free = true; in efc_els_io_cleanup()
1011 efc_node_post_els_resp(els->node, evt, arg); in efc_els_io_cleanup()
1013 efc_els_io_free(els); in efc_els_io_cleanup()
1019 struct efc_els_io_req *els = arg; in efc_ct_acc_cb() local
1021 efc_els_io_free(els); in efc_ct_acc_cb()
1031 struct efc_els_io_req *els = NULL; in efc_send_ct_rsp() local
1034 els = efc_els_io_alloc(node, 256); in efc_send_ct_rsp()
1035 if (!els) { in efc_send_ct_rsp()
1040 rsp = els->io.rsp.virt; in efc_send_ct_rsp()
1048 els->display_name = "ct_rsp"; in efc_send_ct_rsp()
1049 els->cb = efc_ct_acc_cb; in efc_send_ct_rsp()
1052 els->io.io_type = EFC_DISC_IO_CT_RESP; in efc_send_ct_rsp()
1053 els->io.xmit_len = sizeof(*rsp); in efc_send_ct_rsp()
1055 els->io.rpi = node->rnode.indicator; in efc_send_ct_rsp()
1056 els->io.d_id = node->rnode.fc_id; in efc_send_ct_rsp()
1058 memset(&els->io.iparam, 0, sizeof(els->io.iparam)); in efc_send_ct_rsp()
1060 els->io.iparam.ct.ox_id = ox_id; in efc_send_ct_rsp()
1061 els->io.iparam.ct.r_ctl = 3; in efc_send_ct_rsp()
1062 els->io.iparam.ct.type = FC_TYPE_CT; in efc_send_ct_rsp()
1063 els->io.iparam.ct.df_ctl = 0; in efc_send_ct_rsp()
1064 els->io.iparam.ct.timeout = 5; in efc_send_ct_rsp()
1066 if (efc->tt.send_els(efc, &els->io)) { in efc_send_ct_rsp()
1067 efc_els_io_free(els); in efc_send_ct_rsp()