Lines Matching refs:fc_req
266 static void zfcp_fc_ns_gid_pn_eval(struct zfcp_fc_req *fc_req) in zfcp_fc_ns_gid_pn_eval() argument
268 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_ns_gid_pn_eval()
269 struct zfcp_fc_gid_pn_rsp *gid_pn_rsp = &fc_req->u.gid_pn.rsp; in zfcp_fc_ns_gid_pn_eval()
295 struct zfcp_fc_req *fc_req) in zfcp_fc_ns_gid_pn_request() argument
299 struct zfcp_fc_gid_pn_req *gid_pn_req = &fc_req->u.gid_pn.req; in zfcp_fc_ns_gid_pn_request()
300 struct zfcp_fc_gid_pn_rsp *gid_pn_rsp = &fc_req->u.gid_pn.rsp; in zfcp_fc_ns_gid_pn_request()
304 fc_req->ct_els.port = port; in zfcp_fc_ns_gid_pn_request()
305 fc_req->ct_els.handler = zfcp_fc_complete; in zfcp_fc_ns_gid_pn_request()
306 fc_req->ct_els.handler_data = &completion; in zfcp_fc_ns_gid_pn_request()
307 fc_req->ct_els.req = &fc_req->sg_req; in zfcp_fc_ns_gid_pn_request()
308 fc_req->ct_els.resp = &fc_req->sg_rsp; in zfcp_fc_ns_gid_pn_request()
309 sg_init_one(&fc_req->sg_req, gid_pn_req, sizeof(*gid_pn_req)); in zfcp_fc_ns_gid_pn_request()
310 sg_init_one(&fc_req->sg_rsp, gid_pn_rsp, sizeof(*gid_pn_rsp)); in zfcp_fc_ns_gid_pn_request()
316 ret = zfcp_fsf_send_ct(&adapter->gs->ds, &fc_req->ct_els, in zfcp_fc_ns_gid_pn_request()
321 zfcp_fc_ns_gid_pn_eval(fc_req); in zfcp_fc_ns_gid_pn_request()
334 struct zfcp_fc_req *fc_req; in zfcp_fc_ns_gid_pn() local
337 fc_req = mempool_alloc(adapter->pool.gid_pn, GFP_ATOMIC); in zfcp_fc_ns_gid_pn()
338 if (!fc_req) in zfcp_fc_ns_gid_pn()
341 memset(fc_req, 0, sizeof(*fc_req)); in zfcp_fc_ns_gid_pn()
347 ret = zfcp_fc_ns_gid_pn_request(port, fc_req); in zfcp_fc_ns_gid_pn()
351 mempool_free(fc_req, adapter->pool.gid_pn); in zfcp_fc_ns_gid_pn()
423 struct zfcp_fc_req *fc_req = data; in zfcp_fc_adisc_handler() local
424 struct zfcp_port *port = fc_req->ct_els.port; in zfcp_fc_adisc_handler()
425 struct fc_els_adisc *adisc_resp = &fc_req->u.adisc.rsp; in zfcp_fc_adisc_handler()
427 if (fc_req->ct_els.status) { in zfcp_fc_adisc_handler()
449 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_adisc_handler()
454 struct zfcp_fc_req *fc_req; in zfcp_fc_adisc() local
459 fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_ATOMIC); in zfcp_fc_adisc()
460 if (!fc_req) in zfcp_fc_adisc()
463 fc_req->ct_els.port = port; in zfcp_fc_adisc()
464 fc_req->ct_els.req = &fc_req->sg_req; in zfcp_fc_adisc()
465 fc_req->ct_els.resp = &fc_req->sg_rsp; in zfcp_fc_adisc()
466 sg_init_one(&fc_req->sg_req, &fc_req->u.adisc.req, in zfcp_fc_adisc()
468 sg_init_one(&fc_req->sg_rsp, &fc_req->u.adisc.rsp, in zfcp_fc_adisc()
471 fc_req->ct_els.handler = zfcp_fc_adisc_handler; in zfcp_fc_adisc()
472 fc_req->ct_els.handler_data = fc_req; in zfcp_fc_adisc()
476 fc_req->u.adisc.req.adisc_wwpn = fc_host_port_name(shost); in zfcp_fc_adisc()
477 fc_req->u.adisc.req.adisc_wwnn = fc_host_node_name(shost); in zfcp_fc_adisc()
478 fc_req->u.adisc.req.adisc_cmd = ELS_ADISC; in zfcp_fc_adisc()
479 hton24(fc_req->u.adisc.req.adisc_port_id, fc_host_port_id(shost)); in zfcp_fc_adisc()
481 ret = zfcp_fsf_send_els(adapter, port->d_id, &fc_req->ct_els, in zfcp_fc_adisc()
484 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_adisc()
534 struct zfcp_fc_req *fc_req; in zfcp_alloc_sg_env() local
536 fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_KERNEL); in zfcp_alloc_sg_env()
537 if (!fc_req) in zfcp_alloc_sg_env()
540 if (zfcp_sg_setup_table(&fc_req->sg_rsp, buf_num)) { in zfcp_alloc_sg_env()
541 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_alloc_sg_env()
545 sg_init_one(&fc_req->sg_req, &fc_req->u.gpn_ft.req, in zfcp_alloc_sg_env()
548 return fc_req; in zfcp_alloc_sg_env()
551 static int zfcp_fc_send_gpn_ft(struct zfcp_fc_req *fc_req, in zfcp_fc_send_gpn_ft() argument
554 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_send_gpn_ft()
555 struct zfcp_fc_gpn_ft_req *req = &fc_req->u.gpn_ft.req; in zfcp_fc_send_gpn_ft()
564 ct_els->req = &fc_req->sg_req; in zfcp_fc_send_gpn_ft()
565 ct_els->resp = &fc_req->sg_rsp; in zfcp_fc_send_gpn_ft()
588 static int zfcp_fc_eval_gpn_ft(struct zfcp_fc_req *fc_req, in zfcp_fc_eval_gpn_ft() argument
591 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_eval_gpn_ft()
592 struct scatterlist *sg = &fc_req->sg_rsp; in zfcp_fc_eval_gpn_ft()
665 struct zfcp_fc_req *fc_req; in zfcp_fc_scan_ports() local
680 fc_req = zfcp_alloc_sg_env(buf_num); in zfcp_fc_scan_ports()
681 if (!fc_req) in zfcp_fc_scan_ports()
685 ret = zfcp_fc_send_gpn_ft(fc_req, adapter, max_bytes); in zfcp_fc_scan_ports()
687 ret = zfcp_fc_eval_gpn_ft(fc_req, adapter, max_entries); in zfcp_fc_scan_ports()
694 zfcp_sg_free_table(&fc_req->sg_rsp, buf_num); in zfcp_fc_scan_ports()
695 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_scan_ports()
701 struct zfcp_fc_req *fc_req) in zfcp_fc_gspn() argument
705 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_gspn()
706 struct zfcp_fc_gspn_req *gspn_req = &fc_req->u.gspn.req; in zfcp_fc_gspn()
707 struct zfcp_fc_gspn_rsp *gspn_rsp = &fc_req->u.gspn.rsp; in zfcp_fc_gspn()
714 sg_init_one(&fc_req->sg_req, gspn_req, sizeof(*gspn_req)); in zfcp_fc_gspn()
715 sg_init_one(&fc_req->sg_rsp, gspn_rsp, sizeof(*gspn_rsp)); in zfcp_fc_gspn()
719 ct_els->req = &fc_req->sg_req; in zfcp_fc_gspn()
720 ct_els->resp = &fc_req->sg_rsp; in zfcp_fc_gspn()
746 struct zfcp_fc_req *fc_req) in zfcp_fc_rspn() argument
750 struct zfcp_fsf_ct_els *ct_els = &fc_req->ct_els; in zfcp_fc_rspn()
751 struct zfcp_fc_rspn_req *rspn_req = &fc_req->u.rspn.req; in zfcp_fc_rspn()
752 struct fc_ct_hdr *rspn_rsp = &fc_req->u.rspn.rsp; in zfcp_fc_rspn()
762 sg_init_one(&fc_req->sg_req, rspn_req, sizeof(*rspn_req)); in zfcp_fc_rspn()
763 sg_init_one(&fc_req->sg_rsp, rspn_rsp, sizeof(*rspn_rsp)); in zfcp_fc_rspn()
767 ct_els->req = &fc_req->sg_req; in zfcp_fc_rspn()
768 ct_els->resp = &fc_req->sg_rsp; in zfcp_fc_rspn()
792 struct zfcp_fc_req *fc_req; in zfcp_fc_sym_name_update() local
798 fc_req = kmem_cache_zalloc(zfcp_fc_req_cache, GFP_KERNEL); in zfcp_fc_sym_name_update()
799 if (!fc_req) in zfcp_fc_sym_name_update()
806 ret = zfcp_fc_gspn(adapter, fc_req); in zfcp_fc_sym_name_update()
810 memset(fc_req, 0, sizeof(*fc_req)); in zfcp_fc_sym_name_update()
811 zfcp_fc_rspn(adapter, fc_req); in zfcp_fc_sym_name_update()
816 kmem_cache_free(zfcp_fc_req_cache, fc_req); in zfcp_fc_sym_name_update()