• Home
  • Raw
  • Download

Lines Matching refs:req

66 static void zfcp_fsf_class_not_supp(struct zfcp_fsf_req *req)  in zfcp_fsf_class_not_supp()  argument
68 dev_err(&req->adapter->ccw_device->dev, "FCP device not " in zfcp_fsf_class_not_supp()
70 zfcp_erp_adapter_shutdown(req->adapter, 0, "fscns_1"); in zfcp_fsf_class_not_supp()
71 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_class_not_supp()
78 void zfcp_fsf_req_free(struct zfcp_fsf_req *req) in zfcp_fsf_req_free() argument
80 if (likely(req->pool)) { in zfcp_fsf_req_free()
81 if (likely(req->qtcb)) in zfcp_fsf_req_free()
82 mempool_free(req->qtcb, req->adapter->pool.qtcb_pool); in zfcp_fsf_req_free()
83 mempool_free(req, req->pool); in zfcp_fsf_req_free()
87 if (likely(req->qtcb)) in zfcp_fsf_req_free()
88 kmem_cache_free(zfcp_fsf_qtcb_cache, req->qtcb); in zfcp_fsf_req_free()
89 kfree(req); in zfcp_fsf_req_free()
92 static void zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *req) in zfcp_fsf_status_read_port_closed() argument
95 struct fsf_status_read_buffer *sr_buf = req->data; in zfcp_fsf_status_read_port_closed()
96 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_status_read_port_closed()
109 static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, in zfcp_fsf_link_down_info_eval() argument
112 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_link_down_info_eval()
126 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
131 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
136 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
141 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
146 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
151 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
155 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
159 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
164 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
169 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
174 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
179 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
184 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_link_down_info_eval()
192 static void zfcp_fsf_status_read_link_down(struct zfcp_fsf_req *req) in zfcp_fsf_status_read_link_down() argument
194 struct fsf_status_read_buffer *sr_buf = req->data; in zfcp_fsf_status_read_link_down()
200 zfcp_fsf_link_down_info_eval(req, ldi); in zfcp_fsf_status_read_link_down()
203 zfcp_fsf_link_down_info_eval(req, ldi); in zfcp_fsf_status_read_link_down()
206 zfcp_fsf_link_down_info_eval(req, NULL); in zfcp_fsf_status_read_link_down()
210 static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req) in zfcp_fsf_status_read_handler() argument
212 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_status_read_handler()
213 struct fsf_status_read_buffer *sr_buf = req->data; in zfcp_fsf_status_read_handler()
215 if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { in zfcp_fsf_status_read_handler()
216 zfcp_dbf_hba_fsf_uss("fssrh_1", req); in zfcp_fsf_status_read_handler()
218 zfcp_fsf_req_free(req); in zfcp_fsf_status_read_handler()
222 zfcp_dbf_hba_fsf_uss("fssrh_4", req); in zfcp_fsf_status_read_handler()
226 zfcp_fsf_status_read_port_closed(req); in zfcp_fsf_status_read_handler()
229 zfcp_fc_incoming_els(req); in zfcp_fsf_status_read_handler()
237 zfcp_dbf_hba_bit_err("fssrh_3", req); in zfcp_fsf_status_read_handler()
240 zfcp_fsf_status_read_link_down(req); in zfcp_fsf_status_read_handler()
266 zfcp_fsf_req_free(req); in zfcp_fsf_status_read_handler()
272 static void zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *req) in zfcp_fsf_fsfstatus_qual_eval() argument
274 switch (req->qtcb->header.fsf_status_qual.word[0]) { in zfcp_fsf_fsfstatus_qual_eval()
283 dev_err(&req->adapter->ccw_device->dev, in zfcp_fsf_fsfstatus_qual_eval()
286 zfcp_qdio_siosl(req->adapter); in zfcp_fsf_fsfstatus_qual_eval()
287 zfcp_erp_adapter_shutdown(req->adapter, 0, "fsfsqe1"); in zfcp_fsf_fsfstatus_qual_eval()
291 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fsfstatus_qual_eval()
294 static void zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *req) in zfcp_fsf_fsfstatus_eval() argument
296 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) in zfcp_fsf_fsfstatus_eval()
299 switch (req->qtcb->header.fsf_status) { in zfcp_fsf_fsfstatus_eval()
301 dev_err(&req->adapter->ccw_device->dev, in zfcp_fsf_fsfstatus_eval()
303 req->qtcb->header.fsf_command); in zfcp_fsf_fsfstatus_eval()
304 zfcp_erp_adapter_shutdown(req->adapter, 0, "fsfse_1"); in zfcp_fsf_fsfstatus_eval()
305 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fsfstatus_eval()
308 zfcp_fsf_fsfstatus_qual_eval(req); in zfcp_fsf_fsfstatus_eval()
313 static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req) in zfcp_fsf_protstatus_eval() argument
315 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_protstatus_eval()
316 struct fsf_qtcb *qtcb = req->qtcb; in zfcp_fsf_protstatus_eval()
319 zfcp_dbf_hba_fsf_response(req); in zfcp_fsf_protstatus_eval()
321 if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { in zfcp_fsf_protstatus_eval()
322 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_protstatus_eval()
340 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_protstatus_eval()
358 zfcp_fsf_link_down_info_eval(req, &psq->link_down_info); in zfcp_fsf_protstatus_eval()
378 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_protstatus_eval()
390 static void zfcp_fsf_req_complete(struct zfcp_fsf_req *req) in zfcp_fsf_req_complete() argument
392 if (unlikely(req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) { in zfcp_fsf_req_complete()
393 zfcp_fsf_status_read_handler(req); in zfcp_fsf_req_complete()
397 del_timer(&req->timer); in zfcp_fsf_req_complete()
398 zfcp_fsf_protstatus_eval(req); in zfcp_fsf_req_complete()
399 zfcp_fsf_fsfstatus_eval(req); in zfcp_fsf_req_complete()
400 req->handler(req); in zfcp_fsf_req_complete()
402 if (req->erp_action) in zfcp_fsf_req_complete()
403 zfcp_erp_notify(req->erp_action, 0); in zfcp_fsf_req_complete()
405 if (likely(req->status & ZFCP_STATUS_FSFREQ_CLEANUP)) in zfcp_fsf_req_complete()
406 zfcp_fsf_req_free(req); in zfcp_fsf_req_complete()
408 complete(&req->completion); in zfcp_fsf_req_complete()
422 struct zfcp_fsf_req *req, *tmp; in zfcp_fsf_req_dismiss_all() local
428 list_for_each_entry_safe(req, tmp, &remove_queue, list) { in zfcp_fsf_req_dismiss_all()
429 list_del(&req->list); in zfcp_fsf_req_dismiss_all()
430 req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; in zfcp_fsf_req_dismiss_all()
431 zfcp_fsf_req_complete(req); in zfcp_fsf_req_dismiss_all()
463 static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) in zfcp_fsf_exchange_config_evaluate() argument
465 struct fsf_qtcb_bottom_config *bottom = &req->qtcb->bottom.config; in zfcp_fsf_exchange_config_evaluate()
466 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_exchange_config_evaluate()
476 if (req->data) in zfcp_fsf_exchange_config_evaluate()
477 memcpy(req->data, bottom, sizeof(*bottom)); in zfcp_fsf_exchange_config_evaluate()
494 if (req->qtcb->header.fsf_status == FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE) in zfcp_fsf_exchange_config_evaluate()
530 static void zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *req) in zfcp_fsf_exchange_config_data_handler() argument
532 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_exchange_config_data_handler()
533 struct fsf_qtcb *qtcb = req->qtcb; in zfcp_fsf_exchange_config_data_handler()
537 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_exchange_config_data_handler()
549 if (zfcp_fsf_exchange_config_evaluate(req)) in zfcp_fsf_exchange_config_data_handler()
575 zfcp_fsf_link_down_info_eval(req, in zfcp_fsf_exchange_config_data_handler()
577 if (zfcp_fsf_exchange_config_evaluate(req)) in zfcp_fsf_exchange_config_data_handler()
608 static void zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *req) in zfcp_fsf_exchange_port_evaluate() argument
610 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_exchange_port_evaluate()
611 struct fsf_qtcb_bottom_port *bottom = &req->qtcb->bottom.port; in zfcp_fsf_exchange_port_evaluate()
614 if (req->data) in zfcp_fsf_exchange_port_evaluate()
615 memcpy(req->data, bottom, sizeof(*bottom)); in zfcp_fsf_exchange_port_evaluate()
630 static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) in zfcp_fsf_exchange_port_data_handler() argument
632 struct fsf_qtcb *qtcb = req->qtcb; in zfcp_fsf_exchange_port_data_handler()
634 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_exchange_port_data_handler()
639 zfcp_fsf_exchange_port_evaluate(req); in zfcp_fsf_exchange_port_data_handler()
642 zfcp_fsf_exchange_port_evaluate(req); in zfcp_fsf_exchange_port_data_handler()
643 zfcp_fsf_link_down_info_eval(req, in zfcp_fsf_exchange_port_data_handler()
651 struct zfcp_fsf_req *req; in zfcp_fsf_alloc() local
654 req = mempool_alloc(pool, GFP_ATOMIC); in zfcp_fsf_alloc()
656 req = kmalloc(sizeof(*req), GFP_ATOMIC); in zfcp_fsf_alloc()
658 if (unlikely(!req)) in zfcp_fsf_alloc()
661 memset(req, 0, sizeof(*req)); in zfcp_fsf_alloc()
662 req->pool = pool; in zfcp_fsf_alloc()
663 return req; in zfcp_fsf_alloc()
687 struct zfcp_fsf_req *req = zfcp_fsf_alloc(pool); in zfcp_fsf_req_create() local
689 if (unlikely(!req)) in zfcp_fsf_req_create()
695 INIT_LIST_HEAD(&req->list); in zfcp_fsf_req_create()
696 init_timer(&req->timer); in zfcp_fsf_req_create()
697 init_completion(&req->completion); in zfcp_fsf_req_create()
699 req->adapter = adapter; in zfcp_fsf_req_create()
700 req->fsf_command = fsf_cmd; in zfcp_fsf_req_create()
701 req->req_id = adapter->req_no; in zfcp_fsf_req_create()
705 req->qtcb = zfcp_qtcb_alloc(adapter->pool.qtcb_pool); in zfcp_fsf_req_create()
707 req->qtcb = zfcp_qtcb_alloc(NULL); in zfcp_fsf_req_create()
709 if (unlikely(!req->qtcb)) { in zfcp_fsf_req_create()
710 zfcp_fsf_req_free(req); in zfcp_fsf_req_create()
714 req->seq_no = adapter->fsf_req_seq_no; in zfcp_fsf_req_create()
715 req->qtcb->prefix.req_seq_no = adapter->fsf_req_seq_no; in zfcp_fsf_req_create()
716 req->qtcb->prefix.req_id = req->req_id; in zfcp_fsf_req_create()
717 req->qtcb->prefix.ulp_info = 26; in zfcp_fsf_req_create()
718 req->qtcb->prefix.qtcb_type = fsf_qtcb_type[req->fsf_command]; in zfcp_fsf_req_create()
719 req->qtcb->prefix.qtcb_version = FSF_QTCB_CURRENT_VERSION; in zfcp_fsf_req_create()
720 req->qtcb->header.req_handle = req->req_id; in zfcp_fsf_req_create()
721 req->qtcb->header.fsf_command = req->fsf_command; in zfcp_fsf_req_create()
724 zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, in zfcp_fsf_req_create()
725 req->qtcb, sizeof(struct fsf_qtcb)); in zfcp_fsf_req_create()
727 return req; in zfcp_fsf_req_create()
730 static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) in zfcp_fsf_req_send() argument
732 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_req_send()
734 int with_qtcb = (req->qtcb != NULL); in zfcp_fsf_req_send()
735 int req_id = req->req_id; in zfcp_fsf_req_send()
737 zfcp_reqlist_add(adapter->req_list, req); in zfcp_fsf_req_send()
739 req->qdio_req.qdio_outb_usage = atomic_read(&qdio->req_q_free); in zfcp_fsf_req_send()
740 req->issued = get_tod_clock(); in zfcp_fsf_req_send()
741 if (zfcp_qdio_send(qdio, &req->qdio_req)) { in zfcp_fsf_req_send()
742 del_timer(&req->timer); in zfcp_fsf_req_send()
766 struct zfcp_fsf_req *req; in zfcp_fsf_status_read() local
775 req = zfcp_fsf_req_create(qdio, FSF_QTCB_UNSOLICITED_STATUS, in zfcp_fsf_status_read()
778 if (IS_ERR(req)) { in zfcp_fsf_status_read()
779 retval = PTR_ERR(req); in zfcp_fsf_status_read()
790 req->data = sr_buf; in zfcp_fsf_status_read()
792 zfcp_qdio_fill_next(qdio, &req->qdio_req, sr_buf, sizeof(*sr_buf)); in zfcp_fsf_status_read()
793 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_status_read()
795 retval = zfcp_fsf_req_send(req); in zfcp_fsf_status_read()
802 req->data = NULL; in zfcp_fsf_status_read()
805 zfcp_dbf_hba_fsf_uss("fssr__1", req); in zfcp_fsf_status_read()
806 zfcp_fsf_req_free(req); in zfcp_fsf_status_read()
812 static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req) in zfcp_fsf_abort_fcp_command_handler() argument
814 struct scsi_device *sdev = req->data; in zfcp_fsf_abort_fcp_command_handler()
816 union fsf_status_qual *fsq = &req->qtcb->header.fsf_status_qual; in zfcp_fsf_abort_fcp_command_handler()
818 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_abort_fcp_command_handler()
823 switch (req->qtcb->header.fsf_status) { in zfcp_fsf_abort_fcp_command_handler()
828 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_abort_fcp_command_handler()
834 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_abort_fcp_command_handler()
838 req->status |= ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED; in zfcp_fsf_abort_fcp_command_handler()
845 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_abort_fcp_command_handler()
851 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_abort_fcp_command_handler()
859 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_abort_fcp_command_handler()
864 req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED; in zfcp_fsf_abort_fcp_command_handler()
877 struct zfcp_fsf_req *req = NULL; in zfcp_fsf_abort_fcp_cmnd() local
886 req = zfcp_fsf_req_create(qdio, FSF_QTCB_ABORT_FCP_CMND, in zfcp_fsf_abort_fcp_cmnd()
889 if (IS_ERR(req)) { in zfcp_fsf_abort_fcp_cmnd()
890 req = NULL; in zfcp_fsf_abort_fcp_cmnd()
898 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_abort_fcp_cmnd()
900 req->data = sdev; in zfcp_fsf_abort_fcp_cmnd()
901 req->handler = zfcp_fsf_abort_fcp_command_handler; in zfcp_fsf_abort_fcp_cmnd()
902 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; in zfcp_fsf_abort_fcp_cmnd()
903 req->qtcb->header.port_handle = zfcp_sdev->port->handle; in zfcp_fsf_abort_fcp_cmnd()
904 req->qtcb->bottom.support.req_handle = (u64) old_req_id; in zfcp_fsf_abort_fcp_cmnd()
906 zfcp_fsf_start_timer(req, ZFCP_SCSI_ER_TIMEOUT); in zfcp_fsf_abort_fcp_cmnd()
907 if (!zfcp_fsf_req_send(req)) in zfcp_fsf_abort_fcp_cmnd()
911 zfcp_fsf_req_free(req); in zfcp_fsf_abort_fcp_cmnd()
912 req = NULL; in zfcp_fsf_abort_fcp_cmnd()
915 return req; in zfcp_fsf_abort_fcp_cmnd()
918 static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) in zfcp_fsf_send_ct_handler() argument
920 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_send_ct_handler()
921 struct zfcp_fsf_ct_els *ct = req->data; in zfcp_fsf_send_ct_handler()
922 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_send_ct_handler()
926 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_send_ct_handler()
932 zfcp_dbf_san_res("fsscth2", req); in zfcp_fsf_send_ct_handler()
935 zfcp_fsf_class_not_supp(req); in zfcp_fsf_send_ct_handler()
941 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_send_ct_handler()
946 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_send_ct_handler()
956 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_send_ct_handler()
975 static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, in zfcp_fsf_setup_ct_els_sbals() argument
979 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_setup_ct_els_sbals()
981 struct fsf_qtcb *qtcb = req->qtcb; in zfcp_fsf_setup_ct_els_sbals()
985 if (zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, sg_req)) in zfcp_fsf_setup_ct_els_sbals()
989 if (zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, sg_resp)) in zfcp_fsf_setup_ct_els_sbals()
994 zfcp_qdio_set_data_div(qdio, &req->qdio_req, in zfcp_fsf_setup_ct_els_sbals()
996 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_setup_ct_els_sbals()
997 zfcp_qdio_set_scount(qdio, &req->qdio_req); in zfcp_fsf_setup_ct_els_sbals()
1003 zfcp_fsf_setup_ct_els_unchained(qdio, &req->qdio_req, in zfcp_fsf_setup_ct_els_sbals()
1011 if (zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, sg_req)) in zfcp_fsf_setup_ct_els_sbals()
1016 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_setup_ct_els_sbals()
1017 zfcp_qdio_skip_to_last_sbale(qdio, &req->qdio_req); in zfcp_fsf_setup_ct_els_sbals()
1019 if (zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, sg_resp)) in zfcp_fsf_setup_ct_els_sbals()
1024 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_setup_ct_els_sbals()
1029 static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req, in zfcp_fsf_setup_ct_els() argument
1036 ret = zfcp_fsf_setup_ct_els_sbals(req, sg_req, sg_resp); in zfcp_fsf_setup_ct_els()
1043 req->qtcb->bottom.support.service_class = FSF_CLASS_3; in zfcp_fsf_setup_ct_els()
1044 req->qtcb->bottom.support.timeout = timeout; in zfcp_fsf_setup_ct_els()
1045 zfcp_fsf_start_timer(req, (timeout + 10) * HZ); in zfcp_fsf_setup_ct_els()
1060 struct zfcp_fsf_req *req; in zfcp_fsf_send_ct() local
1067 req = zfcp_fsf_req_create(qdio, FSF_QTCB_SEND_GENERIC, in zfcp_fsf_send_ct()
1070 if (IS_ERR(req)) { in zfcp_fsf_send_ct()
1071 ret = PTR_ERR(req); in zfcp_fsf_send_ct()
1075 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_send_ct()
1076 ret = zfcp_fsf_setup_ct_els(req, ct->req, ct->resp, timeout); in zfcp_fsf_send_ct()
1080 req->handler = zfcp_fsf_send_ct_handler; in zfcp_fsf_send_ct()
1081 req->qtcb->header.port_handle = wka_port->handle; in zfcp_fsf_send_ct()
1083 req->data = ct; in zfcp_fsf_send_ct()
1085 zfcp_dbf_san_req("fssct_1", req, wka_port->d_id); in zfcp_fsf_send_ct()
1087 ret = zfcp_fsf_req_send(req); in zfcp_fsf_send_ct()
1094 zfcp_fsf_req_free(req); in zfcp_fsf_send_ct()
1100 static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req) in zfcp_fsf_send_els_handler() argument
1102 struct zfcp_fsf_ct_els *send_els = req->data; in zfcp_fsf_send_els_handler()
1103 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_send_els_handler()
1107 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_send_els_handler()
1113 zfcp_dbf_san_res("fsselh1", req); in zfcp_fsf_send_els_handler()
1116 zfcp_fsf_class_not_supp(req); in zfcp_fsf_send_els_handler()
1123 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_send_els_handler()
1136 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_send_els_handler()
1151 struct zfcp_fsf_req *req; in zfcp_fsf_send_els() local
1159 req = zfcp_fsf_req_create(qdio, FSF_QTCB_SEND_ELS, in zfcp_fsf_send_els()
1162 if (IS_ERR(req)) { in zfcp_fsf_send_els()
1163 ret = PTR_ERR(req); in zfcp_fsf_send_els()
1167 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_send_els()
1170 zfcp_qdio_sbal_limit(qdio, &req->qdio_req, 2); in zfcp_fsf_send_els()
1172 ret = zfcp_fsf_setup_ct_els(req, els->req, els->resp, timeout); in zfcp_fsf_send_els()
1177 hton24(req->qtcb->bottom.support.d_id, d_id); in zfcp_fsf_send_els()
1178 req->handler = zfcp_fsf_send_els_handler; in zfcp_fsf_send_els()
1180 req->data = els; in zfcp_fsf_send_els()
1182 zfcp_dbf_san_req("fssels1", req, d_id); in zfcp_fsf_send_els()
1184 ret = zfcp_fsf_req_send(req); in zfcp_fsf_send_els()
1191 zfcp_fsf_req_free(req); in zfcp_fsf_send_els()
1199 struct zfcp_fsf_req *req; in zfcp_fsf_exchange_config_data() local
1207 req = zfcp_fsf_req_create(qdio, FSF_QTCB_EXCHANGE_CONFIG_DATA, in zfcp_fsf_exchange_config_data()
1211 if (IS_ERR(req)) { in zfcp_fsf_exchange_config_data()
1212 retval = PTR_ERR(req); in zfcp_fsf_exchange_config_data()
1216 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_exchange_config_data()
1217 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_exchange_config_data()
1219 req->qtcb->bottom.config.feature_selection = in zfcp_fsf_exchange_config_data()
1222 req->erp_action = erp_action; in zfcp_fsf_exchange_config_data()
1223 req->handler = zfcp_fsf_exchange_config_data_handler; in zfcp_fsf_exchange_config_data()
1224 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_exchange_config_data()
1226 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_exchange_config_data()
1227 retval = zfcp_fsf_req_send(req); in zfcp_fsf_exchange_config_data()
1229 zfcp_fsf_req_free(req); in zfcp_fsf_exchange_config_data()
1240 struct zfcp_fsf_req *req = NULL; in zfcp_fsf_exchange_config_data_sync() local
1247 req = zfcp_fsf_req_create(qdio, FSF_QTCB_EXCHANGE_CONFIG_DATA, in zfcp_fsf_exchange_config_data_sync()
1250 if (IS_ERR(req)) { in zfcp_fsf_exchange_config_data_sync()
1251 retval = PTR_ERR(req); in zfcp_fsf_exchange_config_data_sync()
1255 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_exchange_config_data_sync()
1256 req->handler = zfcp_fsf_exchange_config_data_handler; in zfcp_fsf_exchange_config_data_sync()
1258 req->qtcb->bottom.config.feature_selection = in zfcp_fsf_exchange_config_data_sync()
1263 req->data = data; in zfcp_fsf_exchange_config_data_sync()
1265 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); in zfcp_fsf_exchange_config_data_sync()
1266 retval = zfcp_fsf_req_send(req); in zfcp_fsf_exchange_config_data_sync()
1269 wait_for_completion(&req->completion); in zfcp_fsf_exchange_config_data_sync()
1271 zfcp_fsf_req_free(req); in zfcp_fsf_exchange_config_data_sync()
1287 struct zfcp_fsf_req *req; in zfcp_fsf_exchange_port_data() local
1297 req = zfcp_fsf_req_create(qdio, FSF_QTCB_EXCHANGE_PORT_DATA, in zfcp_fsf_exchange_port_data()
1301 if (IS_ERR(req)) { in zfcp_fsf_exchange_port_data()
1302 retval = PTR_ERR(req); in zfcp_fsf_exchange_port_data()
1306 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_exchange_port_data()
1307 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_exchange_port_data()
1309 req->handler = zfcp_fsf_exchange_port_data_handler; in zfcp_fsf_exchange_port_data()
1310 req->erp_action = erp_action; in zfcp_fsf_exchange_port_data()
1311 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_exchange_port_data()
1313 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_exchange_port_data()
1314 retval = zfcp_fsf_req_send(req); in zfcp_fsf_exchange_port_data()
1316 zfcp_fsf_req_free(req); in zfcp_fsf_exchange_port_data()
1333 struct zfcp_fsf_req *req = NULL; in zfcp_fsf_exchange_port_data_sync() local
1343 req = zfcp_fsf_req_create(qdio, FSF_QTCB_EXCHANGE_PORT_DATA, in zfcp_fsf_exchange_port_data_sync()
1346 if (IS_ERR(req)) { in zfcp_fsf_exchange_port_data_sync()
1347 retval = PTR_ERR(req); in zfcp_fsf_exchange_port_data_sync()
1352 req->data = data; in zfcp_fsf_exchange_port_data_sync()
1354 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_exchange_port_data_sync()
1356 req->handler = zfcp_fsf_exchange_port_data_handler; in zfcp_fsf_exchange_port_data_sync()
1357 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); in zfcp_fsf_exchange_port_data_sync()
1358 retval = zfcp_fsf_req_send(req); in zfcp_fsf_exchange_port_data_sync()
1362 wait_for_completion(&req->completion); in zfcp_fsf_exchange_port_data_sync()
1364 zfcp_fsf_req_free(req); in zfcp_fsf_exchange_port_data_sync()
1373 static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) in zfcp_fsf_open_port_handler() argument
1375 struct zfcp_port *port = req->data; in zfcp_fsf_open_port_handler()
1376 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_open_port_handler()
1379 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_open_port_handler()
1386 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_open_port_handler()
1392 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_port_handler()
1399 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_port_handler()
1424 plogi = (struct fc_els_flogi *) req->qtcb->bottom.support.els; in zfcp_fsf_open_port_handler()
1425 if (req->qtcb->bottom.support.els1_length >= in zfcp_fsf_open_port_handler()
1430 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_port_handler()
1447 struct zfcp_fsf_req *req; in zfcp_fsf_open_port() local
1454 req = zfcp_fsf_req_create(qdio, FSF_QTCB_OPEN_PORT_WITH_DID, in zfcp_fsf_open_port()
1458 if (IS_ERR(req)) { in zfcp_fsf_open_port()
1459 retval = PTR_ERR(req); in zfcp_fsf_open_port()
1463 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_open_port()
1464 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_open_port()
1466 req->handler = zfcp_fsf_open_port_handler; in zfcp_fsf_open_port()
1467 hton24(req->qtcb->bottom.support.d_id, port->d_id); in zfcp_fsf_open_port()
1468 req->data = port; in zfcp_fsf_open_port()
1469 req->erp_action = erp_action; in zfcp_fsf_open_port()
1470 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_open_port()
1473 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_open_port()
1474 retval = zfcp_fsf_req_send(req); in zfcp_fsf_open_port()
1476 zfcp_fsf_req_free(req); in zfcp_fsf_open_port()
1485 static void zfcp_fsf_close_port_handler(struct zfcp_fsf_req *req) in zfcp_fsf_close_port_handler() argument
1487 struct zfcp_port *port = req->data; in zfcp_fsf_close_port_handler()
1489 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_close_port_handler()
1492 switch (req->qtcb->header.fsf_status) { in zfcp_fsf_close_port_handler()
1495 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_port_handler()
1513 struct zfcp_fsf_req *req; in zfcp_fsf_close_port() local
1520 req = zfcp_fsf_req_create(qdio, FSF_QTCB_CLOSE_PORT, in zfcp_fsf_close_port()
1524 if (IS_ERR(req)) { in zfcp_fsf_close_port()
1525 retval = PTR_ERR(req); in zfcp_fsf_close_port()
1529 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_close_port()
1530 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_close_port()
1532 req->handler = zfcp_fsf_close_port_handler; in zfcp_fsf_close_port()
1533 req->data = erp_action->port; in zfcp_fsf_close_port()
1534 req->erp_action = erp_action; in zfcp_fsf_close_port()
1535 req->qtcb->header.port_handle = erp_action->port->handle; in zfcp_fsf_close_port()
1536 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_close_port()
1538 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_close_port()
1539 retval = zfcp_fsf_req_send(req); in zfcp_fsf_close_port()
1541 zfcp_fsf_req_free(req); in zfcp_fsf_close_port()
1549 static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req) in zfcp_fsf_open_wka_port_handler() argument
1551 struct zfcp_fc_wka_port *wka_port = req->data; in zfcp_fsf_open_wka_port_handler()
1552 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_open_wka_port_handler()
1554 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) { in zfcp_fsf_open_wka_port_handler()
1561 dev_warn(&req->adapter->ccw_device->dev, in zfcp_fsf_open_wka_port_handler()
1565 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_wka_port_handler()
1586 struct zfcp_fsf_req *req; in zfcp_fsf_open_wka_port() local
1593 req = zfcp_fsf_req_create(qdio, FSF_QTCB_OPEN_PORT_WITH_DID, in zfcp_fsf_open_wka_port()
1597 if (IS_ERR(req)) { in zfcp_fsf_open_wka_port()
1598 retval = PTR_ERR(req); in zfcp_fsf_open_wka_port()
1602 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_open_wka_port()
1603 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_open_wka_port()
1605 req->handler = zfcp_fsf_open_wka_port_handler; in zfcp_fsf_open_wka_port()
1606 hton24(req->qtcb->bottom.support.d_id, wka_port->d_id); in zfcp_fsf_open_wka_port()
1607 req->data = wka_port; in zfcp_fsf_open_wka_port()
1609 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); in zfcp_fsf_open_wka_port()
1610 retval = zfcp_fsf_req_send(req); in zfcp_fsf_open_wka_port()
1612 zfcp_fsf_req_free(req); in zfcp_fsf_open_wka_port()
1616 zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id); in zfcp_fsf_open_wka_port()
1620 static void zfcp_fsf_close_wka_port_handler(struct zfcp_fsf_req *req) in zfcp_fsf_close_wka_port_handler() argument
1622 struct zfcp_fc_wka_port *wka_port = req->data; in zfcp_fsf_close_wka_port_handler()
1624 if (req->qtcb->header.fsf_status == FSF_PORT_HANDLE_NOT_VALID) { in zfcp_fsf_close_wka_port_handler()
1625 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_wka_port_handler()
1641 struct zfcp_fsf_req *req; in zfcp_fsf_close_wka_port() local
1648 req = zfcp_fsf_req_create(qdio, FSF_QTCB_CLOSE_PORT, in zfcp_fsf_close_wka_port()
1652 if (IS_ERR(req)) { in zfcp_fsf_close_wka_port()
1653 retval = PTR_ERR(req); in zfcp_fsf_close_wka_port()
1657 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_close_wka_port()
1658 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_close_wka_port()
1660 req->handler = zfcp_fsf_close_wka_port_handler; in zfcp_fsf_close_wka_port()
1661 req->data = wka_port; in zfcp_fsf_close_wka_port()
1662 req->qtcb->header.port_handle = wka_port->handle; in zfcp_fsf_close_wka_port()
1664 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); in zfcp_fsf_close_wka_port()
1665 retval = zfcp_fsf_req_send(req); in zfcp_fsf_close_wka_port()
1667 zfcp_fsf_req_free(req); in zfcp_fsf_close_wka_port()
1671 zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req->req_id); in zfcp_fsf_close_wka_port()
1675 static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) in zfcp_fsf_close_physical_port_handler() argument
1677 struct zfcp_port *port = req->data; in zfcp_fsf_close_physical_port_handler()
1678 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_close_physical_port_handler()
1681 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_close_physical_port_handler()
1687 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_physical_port_handler()
1700 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_physical_port_handler()
1707 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_physical_port_handler()
1732 struct zfcp_fsf_req *req; in zfcp_fsf_close_physical_port() local
1739 req = zfcp_fsf_req_create(qdio, FSF_QTCB_CLOSE_PHYSICAL_PORT, in zfcp_fsf_close_physical_port()
1743 if (IS_ERR(req)) { in zfcp_fsf_close_physical_port()
1744 retval = PTR_ERR(req); in zfcp_fsf_close_physical_port()
1748 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_close_physical_port()
1749 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_close_physical_port()
1751 req->data = erp_action->port; in zfcp_fsf_close_physical_port()
1752 req->qtcb->header.port_handle = erp_action->port->handle; in zfcp_fsf_close_physical_port()
1753 req->erp_action = erp_action; in zfcp_fsf_close_physical_port()
1754 req->handler = zfcp_fsf_close_physical_port_handler; in zfcp_fsf_close_physical_port()
1755 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_close_physical_port()
1757 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_close_physical_port()
1758 retval = zfcp_fsf_req_send(req); in zfcp_fsf_close_physical_port()
1760 zfcp_fsf_req_free(req); in zfcp_fsf_close_physical_port()
1768 static void zfcp_fsf_open_lun_handler(struct zfcp_fsf_req *req) in zfcp_fsf_open_lun_handler() argument
1770 struct zfcp_adapter *adapter = req->adapter; in zfcp_fsf_open_lun_handler()
1771 struct scsi_device *sdev = req->data; in zfcp_fsf_open_lun_handler()
1773 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_open_lun_handler()
1776 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_open_lun_handler()
1797 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_lun_handler()
1811 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_lun_handler()
1822 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_lun_handler()
1830 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_open_lun_handler()
1851 struct zfcp_fsf_req *req; in zfcp_fsf_open_lun() local
1858 req = zfcp_fsf_req_create(qdio, FSF_QTCB_OPEN_LUN, in zfcp_fsf_open_lun()
1862 if (IS_ERR(req)) { in zfcp_fsf_open_lun()
1863 retval = PTR_ERR(req); in zfcp_fsf_open_lun()
1867 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_open_lun()
1868 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_open_lun()
1870 req->qtcb->header.port_handle = erp_action->port->handle; in zfcp_fsf_open_lun()
1871 req->qtcb->bottom.support.fcp_lun = zfcp_scsi_dev_lun(erp_action->sdev); in zfcp_fsf_open_lun()
1872 req->handler = zfcp_fsf_open_lun_handler; in zfcp_fsf_open_lun()
1873 req->data = erp_action->sdev; in zfcp_fsf_open_lun()
1874 req->erp_action = erp_action; in zfcp_fsf_open_lun()
1875 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_open_lun()
1878 req->qtcb->bottom.support.option = FSF_OPEN_LUN_SUPPRESS_BOXING; in zfcp_fsf_open_lun()
1880 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_open_lun()
1881 retval = zfcp_fsf_req_send(req); in zfcp_fsf_open_lun()
1883 zfcp_fsf_req_free(req); in zfcp_fsf_open_lun()
1891 static void zfcp_fsf_close_lun_handler(struct zfcp_fsf_req *req) in zfcp_fsf_close_lun_handler() argument
1893 struct scsi_device *sdev = req->data; in zfcp_fsf_close_lun_handler()
1896 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_close_lun_handler()
1901 switch (req->qtcb->header.fsf_status) { in zfcp_fsf_close_lun_handler()
1904 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_lun_handler()
1908 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_lun_handler()
1915 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_lun_handler()
1918 switch (req->qtcb->header.fsf_status_qual.word[0]) { in zfcp_fsf_close_lun_handler()
1923 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_close_lun_handler()
1942 struct zfcp_fsf_req *req; in zfcp_fsf_close_lun() local
1949 req = zfcp_fsf_req_create(qdio, FSF_QTCB_CLOSE_LUN, in zfcp_fsf_close_lun()
1953 if (IS_ERR(req)) { in zfcp_fsf_close_lun()
1954 retval = PTR_ERR(req); in zfcp_fsf_close_lun()
1958 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_close_lun()
1959 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_close_lun()
1961 req->qtcb->header.port_handle = erp_action->port->handle; in zfcp_fsf_close_lun()
1962 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; in zfcp_fsf_close_lun()
1963 req->handler = zfcp_fsf_close_lun_handler; in zfcp_fsf_close_lun()
1964 req->data = erp_action->sdev; in zfcp_fsf_close_lun()
1965 req->erp_action = erp_action; in zfcp_fsf_close_lun()
1966 erp_action->fsf_req_id = req->req_id; in zfcp_fsf_close_lun()
1968 zfcp_fsf_start_erp_timer(req); in zfcp_fsf_close_lun()
1969 retval = zfcp_fsf_req_send(req); in zfcp_fsf_close_lun()
1971 zfcp_fsf_req_free(req); in zfcp_fsf_close_lun()
1986 static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi) in zfcp_fsf_req_trace() argument
1992 int ticks = req->adapter->timer_ticks; in zfcp_fsf_req_trace()
1994 lat_in = &req->qtcb->prefix.prot_status_qual.latency_info; in zfcp_fsf_req_trace()
1998 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) in zfcp_fsf_req_trace()
2001 blktrc.outb_usage = req->qdio_req.qdio_outb_usage; in zfcp_fsf_req_trace()
2003 if (req->adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA && in zfcp_fsf_req_trace()
2004 !(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { in zfcp_fsf_req_trace()
2010 switch (req->qtcb->bottom.io.data_direction) { in zfcp_fsf_req_trace()
2039 static void zfcp_fsf_fcp_handler_common(struct zfcp_fsf_req *req) in zfcp_fsf_fcp_handler_common() argument
2041 struct scsi_cmnd *scmnd = req->data; in zfcp_fsf_fcp_handler_common()
2044 struct fsf_qtcb_header *header = &req->qtcb->header; in zfcp_fsf_fcp_handler_common()
2046 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) in zfcp_fsf_fcp_handler_common()
2055 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2060 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2063 zfcp_fsf_class_not_supp(req); in zfcp_fsf_fcp_handler_common()
2066 dev_err(&req->adapter->ccw_device->dev, in zfcp_fsf_fcp_handler_common()
2069 req->qtcb->bottom.io.data_direction, in zfcp_fsf_fcp_handler_common()
2074 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2077 dev_err(&req->adapter->ccw_device->dev, in zfcp_fsf_fcp_handler_common()
2080 req->qtcb->bottom.io.fcp_cmnd_length, in zfcp_fsf_fcp_handler_common()
2085 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2092 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2098 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2104 req->status |= ZFCP_STATUS_FSFREQ_ERROR; in zfcp_fsf_fcp_handler_common()
2109 static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req) in zfcp_fsf_fcp_cmnd_handler() argument
2115 read_lock_irqsave(&req->adapter->abort_lock, flags); in zfcp_fsf_fcp_cmnd_handler()
2117 scpnt = req->data; in zfcp_fsf_fcp_cmnd_handler()
2119 read_unlock_irqrestore(&req->adapter->abort_lock, flags); in zfcp_fsf_fcp_cmnd_handler()
2123 zfcp_fsf_fcp_handler_common(req); in zfcp_fsf_fcp_cmnd_handler()
2125 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { in zfcp_fsf_fcp_cmnd_handler()
2130 switch (req->qtcb->header.fsf_status) { in zfcp_fsf_fcp_cmnd_handler()
2145 fcp_rsp = (struct fcp_resp_with_ext *) &req->qtcb->bottom.io.fcp_rsp; in zfcp_fsf_fcp_cmnd_handler()
2149 zfcp_fsf_req_trace(req, scpnt); in zfcp_fsf_fcp_cmnd_handler()
2150 zfcp_dbf_scsi_result(scpnt, req); in zfcp_fsf_fcp_cmnd_handler()
2160 read_unlock_irqrestore(&req->adapter->abort_lock, flags); in zfcp_fsf_fcp_cmnd_handler()
2207 struct zfcp_fsf_req *req; in zfcp_fsf_fcp_cmnd() local
2231 req = zfcp_fsf_req_create(qdio, FSF_QTCB_FCP_CMND, in zfcp_fsf_fcp_cmnd()
2234 if (IS_ERR(req)) { in zfcp_fsf_fcp_cmnd()
2235 retval = PTR_ERR(req); in zfcp_fsf_fcp_cmnd()
2239 scsi_cmnd->host_scribble = (unsigned char *) req->req_id; in zfcp_fsf_fcp_cmnd()
2241 io = &req->qtcb->bottom.io; in zfcp_fsf_fcp_cmnd()
2242 req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; in zfcp_fsf_fcp_cmnd()
2243 req->data = scsi_cmnd; in zfcp_fsf_fcp_cmnd()
2244 req->handler = zfcp_fsf_fcp_cmnd_handler; in zfcp_fsf_fcp_cmnd()
2245 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; in zfcp_fsf_fcp_cmnd()
2246 req->qtcb->header.port_handle = zfcp_sdev->port->handle; in zfcp_fsf_fcp_cmnd()
2258 fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd; in zfcp_fsf_fcp_cmnd()
2263 zfcp_qdio_set_data_div(qdio, &req->qdio_req, in zfcp_fsf_fcp_cmnd()
2265 retval = zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, in zfcp_fsf_fcp_cmnd()
2273 retval = zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req, in zfcp_fsf_fcp_cmnd()
2278 zfcp_qdio_set_sbale_last(adapter->qdio, &req->qdio_req); in zfcp_fsf_fcp_cmnd()
2280 zfcp_qdio_set_scount(qdio, &req->qdio_req); in zfcp_fsf_fcp_cmnd()
2282 retval = zfcp_fsf_req_send(req); in zfcp_fsf_fcp_cmnd()
2289 zfcp_fsf_req_free(req); in zfcp_fsf_fcp_cmnd()
2296 static void zfcp_fsf_fcp_task_mgmt_handler(struct zfcp_fsf_req *req) in zfcp_fsf_fcp_task_mgmt_handler() argument
2301 zfcp_fsf_fcp_handler_common(req); in zfcp_fsf_fcp_task_mgmt_handler()
2303 fcp_rsp = (struct fcp_resp_with_ext *) &req->qtcb->bottom.io.fcp_rsp; in zfcp_fsf_fcp_task_mgmt_handler()
2307 (req->status & ZFCP_STATUS_FSFREQ_ERROR)) in zfcp_fsf_fcp_task_mgmt_handler()
2308 req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED; in zfcp_fsf_fcp_task_mgmt_handler()
2320 struct zfcp_fsf_req *req = NULL; in zfcp_fsf_fcp_task_mgmt() local
2333 req = zfcp_fsf_req_create(qdio, FSF_QTCB_FCP_CMND, in zfcp_fsf_fcp_task_mgmt()
2337 if (IS_ERR(req)) { in zfcp_fsf_fcp_task_mgmt()
2338 req = NULL; in zfcp_fsf_fcp_task_mgmt()
2342 req->data = scmnd; in zfcp_fsf_fcp_task_mgmt()
2343 req->handler = zfcp_fsf_fcp_task_mgmt_handler; in zfcp_fsf_fcp_task_mgmt()
2344 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; in zfcp_fsf_fcp_task_mgmt()
2345 req->qtcb->header.port_handle = zfcp_sdev->port->handle; in zfcp_fsf_fcp_task_mgmt()
2346 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; in zfcp_fsf_fcp_task_mgmt()
2347 req->qtcb->bottom.io.service_class = FSF_CLASS_3; in zfcp_fsf_fcp_task_mgmt()
2348 req->qtcb->bottom.io.fcp_cmnd_length = FCP_CMND_LEN; in zfcp_fsf_fcp_task_mgmt()
2350 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); in zfcp_fsf_fcp_task_mgmt()
2352 fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd; in zfcp_fsf_fcp_task_mgmt()
2355 zfcp_fsf_start_timer(req, ZFCP_SCSI_ER_TIMEOUT); in zfcp_fsf_fcp_task_mgmt()
2356 if (!zfcp_fsf_req_send(req)) in zfcp_fsf_fcp_task_mgmt()
2359 zfcp_fsf_req_free(req); in zfcp_fsf_fcp_task_mgmt()
2360 req = NULL; in zfcp_fsf_fcp_task_mgmt()
2363 return req; in zfcp_fsf_fcp_task_mgmt()