Lines Matching refs:fc_req
345 static void zfcp_fc_ns_gid_pn_eval(struct zfcp_fc_req *fc_req) in zfcp_fc_ns_gid_pn_eval() argument
347 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_ns_gid_pn_eval()
348 struct zfcp_fc_gid_pn_rsp *gid_pn_rsp = &fc_req->u.gid_pn.rsp; in zfcp_fc_ns_gid_pn_eval()
374 struct zfcp_fc_req *fc_req) in zfcp_fc_ns_gid_pn_request() argument
378 struct zfcp_fc_gid_pn_req *gid_pn_req = &fc_req->u.gid_pn.req; in zfcp_fc_ns_gid_pn_request()
379 struct zfcp_fc_gid_pn_rsp *gid_pn_rsp = &fc_req->u.gid_pn.rsp; in zfcp_fc_ns_gid_pn_request()
383 fc_req->ct_els.port = port; in zfcp_fc_ns_gid_pn_request()
384 fc_req->ct_els.handler = zfcp_fc_complete; in zfcp_fc_ns_gid_pn_request()
385 fc_req->ct_els.handler_data = &completion; in zfcp_fc_ns_gid_pn_request()
386 fc_req->ct_els.req = &fc_req->sg_req; in zfcp_fc_ns_gid_pn_request()
387 fc_req->ct_els.resp = &fc_req->sg_rsp; in zfcp_fc_ns_gid_pn_request()
388 sg_init_one(&fc_req->sg_req, gid_pn_req, sizeof(*gid_pn_req)); in zfcp_fc_ns_gid_pn_request()
389 sg_init_one(&fc_req->sg_rsp, gid_pn_rsp, sizeof(*gid_pn_rsp)); in zfcp_fc_ns_gid_pn_request()
395 ret = zfcp_fsf_send_ct(&adapter->gs->ds, &fc_req->ct_els, in zfcp_fc_ns_gid_pn_request()
400 zfcp_fc_ns_gid_pn_eval(fc_req); in zfcp_fc_ns_gid_pn_request()
413 struct zfcp_fc_req *fc_req; in zfcp_fc_ns_gid_pn() local
416 fc_req = mempool_alloc(adapter->pool.gid_pn, GFP_ATOMIC); in zfcp_fc_ns_gid_pn()
417 if (!fc_req) in zfcp_fc_ns_gid_pn()
420 memset(fc_req, 0, sizeof(*fc_req)); in zfcp_fc_ns_gid_pn()
426 ret = zfcp_fc_ns_gid_pn_request(port, fc_req); in zfcp_fc_ns_gid_pn()
430 mempool_free(fc_req, adapter->pool.gid_pn); in zfcp_fc_ns_gid_pn()
503 struct zfcp_fc_req *fc_req = data; in zfcp_fc_adisc_handler() local
504 struct zfcp_port *port = fc_req->ct_els.port; in zfcp_fc_adisc_handler()
505 struct fc_els_adisc *adisc_resp = &fc_req->u.adisc.rsp; in zfcp_fc_adisc_handler()
507 if (fc_req->ct_els.status) { in zfcp_fc_adisc_handler()
529 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_adisc_handler()
534 struct zfcp_fc_req *fc_req; in zfcp_fc_adisc() local
539 fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_ATOMIC); in zfcp_fc_adisc()
540 if (!fc_req) in zfcp_fc_adisc()
543 fc_req->ct_els.port = port; in zfcp_fc_adisc()
544 fc_req->ct_els.req = &fc_req->sg_req; in zfcp_fc_adisc()
545 fc_req->ct_els.resp = &fc_req->sg_rsp; in zfcp_fc_adisc()
546 sg_init_one(&fc_req->sg_req, &fc_req->u.adisc.req, in zfcp_fc_adisc()
548 sg_init_one(&fc_req->sg_rsp, &fc_req->u.adisc.rsp, in zfcp_fc_adisc()
551 fc_req->ct_els.handler = zfcp_fc_adisc_handler; in zfcp_fc_adisc()
552 fc_req->ct_els.handler_data = fc_req; in zfcp_fc_adisc()
556 fc_req->u.adisc.req.adisc_wwpn = cpu_to_be64(fc_host_port_name(shost)); in zfcp_fc_adisc()
557 fc_req->u.adisc.req.adisc_wwnn = cpu_to_be64(fc_host_node_name(shost)); in zfcp_fc_adisc()
558 fc_req->u.adisc.req.adisc_cmd = ELS_ADISC; in zfcp_fc_adisc()
559 hton24(fc_req->u.adisc.req.adisc_port_id, fc_host_port_id(shost)); in zfcp_fc_adisc()
561 ret = zfcp_fsf_send_els(adapter, port->d_id, &fc_req->ct_els, in zfcp_fc_adisc()
564 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_adisc()
657 struct zfcp_fc_req *fc_req; in zfcp_fc_alloc_sg_env() local
659 fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_KERNEL); in zfcp_fc_alloc_sg_env()
660 if (!fc_req) in zfcp_fc_alloc_sg_env()
663 if (zfcp_fc_sg_setup_table(&fc_req->sg_rsp, buf_num)) { in zfcp_fc_alloc_sg_env()
664 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_alloc_sg_env()
668 sg_init_one(&fc_req->sg_req, &fc_req->u.gpn_ft.req, in zfcp_fc_alloc_sg_env()
671 return fc_req; in zfcp_fc_alloc_sg_env()
674 static int zfcp_fc_send_gpn_ft(struct zfcp_fc_req *fc_req, in zfcp_fc_send_gpn_ft() argument
677 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_send_gpn_ft()
678 struct zfcp_fc_gpn_ft_req *req = &fc_req->u.gpn_ft.req; in zfcp_fc_send_gpn_ft()
687 ct_els->req = &fc_req->sg_req; in zfcp_fc_send_gpn_ft()
688 ct_els->resp = &fc_req->sg_rsp; in zfcp_fc_send_gpn_ft()
711 static int zfcp_fc_eval_gpn_ft(struct zfcp_fc_req *fc_req, in zfcp_fc_eval_gpn_ft() argument
714 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_eval_gpn_ft()
715 struct scatterlist *sg = &fc_req->sg_rsp; in zfcp_fc_eval_gpn_ft()
790 struct zfcp_fc_req *fc_req; in zfcp_fc_scan_ports() local
807 fc_req = zfcp_fc_alloc_sg_env(buf_num); in zfcp_fc_scan_ports()
808 if (!fc_req) in zfcp_fc_scan_ports()
812 ret = zfcp_fc_send_gpn_ft(fc_req, adapter, max_bytes); in zfcp_fc_scan_ports()
814 ret = zfcp_fc_eval_gpn_ft(fc_req, adapter, max_entries); in zfcp_fc_scan_ports()
821 zfcp_fc_sg_free_table(&fc_req->sg_rsp, buf_num); in zfcp_fc_scan_ports()
822 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_scan_ports()
828 struct zfcp_fc_req *fc_req) in zfcp_fc_gspn() argument
832 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_gspn()
833 struct zfcp_fc_gspn_req *gspn_req = &fc_req->u.gspn.req; in zfcp_fc_gspn()
834 struct zfcp_fc_gspn_rsp *gspn_rsp = &fc_req->u.gspn.rsp; in zfcp_fc_gspn()
841 sg_init_one(&fc_req->sg_req, gspn_req, sizeof(*gspn_req)); in zfcp_fc_gspn()
842 sg_init_one(&fc_req->sg_rsp, gspn_rsp, sizeof(*gspn_rsp)); in zfcp_fc_gspn()
846 ct_els->req = &fc_req->sg_req; in zfcp_fc_gspn()
847 ct_els->resp = &fc_req->sg_rsp; in zfcp_fc_gspn()
873 struct zfcp_fc_req *fc_req) in zfcp_fc_rspn() argument
877 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_rspn()
878 struct zfcp_fc_rspn_req *rspn_req = &fc_req->u.rspn.req; in zfcp_fc_rspn()
879 struct fc_ct_hdr *rspn_rsp = &fc_req->u.rspn.rsp; in zfcp_fc_rspn()
889 sg_init_one(&fc_req->sg_req, rspn_req, sizeof(*rspn_req)); in zfcp_fc_rspn()
890 sg_init_one(&fc_req->sg_rsp, rspn_rsp, sizeof(*rspn_rsp)); in zfcp_fc_rspn()
894 ct_els->req = &fc_req->sg_req; in zfcp_fc_rspn()
895 ct_els->resp = &fc_req->sg_rsp; in zfcp_fc_rspn()
919 struct zfcp_fc_req *fc_req; in zfcp_fc_sym_name_update() local
925 fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_KERNEL); in zfcp_fc_sym_name_update()
926 if (!fc_req) in zfcp_fc_sym_name_update()
933 ret = zfcp_fc_gspn(adapter, fc_req); in zfcp_fc_sym_name_update()
937 memset(fc_req, 0, sizeof(*fc_req)); in zfcp_fc_sym_name_update()
938 zfcp_fc_rspn(adapter, fc_req); in zfcp_fc_sym_name_update()
943 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_sym_name_update()