aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_fc.c')
-rw-r--r--drivers/s390/scsi/zfcp_fc.c84
1 files changed, 57 insertions, 27 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index ac5e3b7a3576..0f7b493fb105 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -258,7 +258,8 @@ static int zfcp_fc_ns_gid_pn_request(struct zfcp_port *port,
258 gid_pn->gid_pn_req.gid_pn.fn_wwpn = port->wwpn; 258 gid_pn->gid_pn_req.gid_pn.fn_wwpn = port->wwpn;
259 259
260 ret = zfcp_fsf_send_ct(&adapter->gs->ds, &gid_pn->ct, 260 ret = zfcp_fsf_send_ct(&adapter->gs->ds, &gid_pn->ct,
261 adapter->pool.gid_pn_req); 261 adapter->pool.gid_pn_req,
262 ZFCP_FC_CTELS_TMO);
262 if (!ret) { 263 if (!ret) {
263 wait_for_completion(&completion); 264 wait_for_completion(&completion);
264 zfcp_fc_ns_gid_pn_eval(gid_pn); 265 zfcp_fc_ns_gid_pn_eval(gid_pn);
@@ -421,7 +422,8 @@ static int zfcp_fc_adisc(struct zfcp_port *port)
421 hton24(adisc->adisc_req.adisc_port_id, 422 hton24(adisc->adisc_req.adisc_port_id,
422 fc_host_port_id(adapter->scsi_host)); 423 fc_host_port_id(adapter->scsi_host));
423 424
424 ret = zfcp_fsf_send_els(adapter, port->d_id, &adisc->els); 425 ret = zfcp_fsf_send_els(adapter, port->d_id, &adisc->els,
426 ZFCP_FC_CTELS_TMO);
425 if (ret) 427 if (ret)
426 kmem_cache_free(zfcp_data.adisc_cache, adisc); 428 kmem_cache_free(zfcp_data.adisc_cache, adisc);
427 429
@@ -532,7 +534,8 @@ static int zfcp_fc_send_gpn_ft(struct zfcp_fc_gpn_ft *gpn_ft,
532 ct->req = &gpn_ft->sg_req; 534 ct->req = &gpn_ft->sg_req;
533 ct->resp = gpn_ft->sg_resp; 535 ct->resp = gpn_ft->sg_resp;
534 536
535 ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct, NULL); 537 ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct, NULL,
538 ZFCP_FC_CTELS_TMO);
536 if (!ret) 539 if (!ret)
537 wait_for_completion(&completion); 540 wait_for_completion(&completion);
538 return ret; 541 return ret;
@@ -677,6 +680,44 @@ static void zfcp_fc_ct_els_job_handler(void *data)
677 job->job_done(job); 680 job->job_done(job);
678} 681}
679 682
683static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job)
684{
685 u32 preamble_word1;
686 u8 gs_type;
687 struct zfcp_adapter *adapter;
688
689 preamble_word1 = job->request->rqst_data.r_ct.preamble_word1;
690 gs_type = (preamble_word1 & 0xff000000) >> 24;
691
692 adapter = (struct zfcp_adapter *) job->shost->hostdata[0];
693
694 switch (gs_type) {
695 case FC_FST_ALIAS:
696 return &adapter->gs->as;
697 case FC_FST_MGMT:
698 return &adapter->gs->ms;
699 case FC_FST_TIME:
700 return &adapter->gs->ts;
701 break;
702 case FC_FST_DIR:
703 return &adapter->gs->ds;
704 break;
705 default:
706 return NULL;
707 }
708}
709
710static void zfcp_fc_ct_job_handler(void *data)
711{
712 struct fc_bsg_job *job = data;
713 struct zfcp_fc_wka_port *wka_port;
714
715 wka_port = zfcp_fc_job_wka_port(job);
716 zfcp_fc_wka_port_put(wka_port);
717
718 zfcp_fc_ct_els_job_handler(data);
719}
720
680static int zfcp_fc_exec_els_job(struct fc_bsg_job *job, 721static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
681 struct zfcp_adapter *adapter) 722 struct zfcp_adapter *adapter)
682{ 723{
@@ -695,43 +736,27 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
695 } else 736 } else
696 d_id = ntoh24(job->request->rqst_data.h_els.port_id); 737 d_id = ntoh24(job->request->rqst_data.h_els.port_id);
697 738
698 return zfcp_fsf_send_els(adapter, d_id, els); 739 els->handler = zfcp_fc_ct_els_job_handler;
740 return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ);
699} 741}
700 742
701static int zfcp_fc_exec_ct_job(struct fc_bsg_job *job, 743static int zfcp_fc_exec_ct_job(struct fc_bsg_job *job,
702 struct zfcp_adapter *adapter) 744 struct zfcp_adapter *adapter)
703{ 745{
704 int ret; 746 int ret;
705 u8 gs_type;
706 struct zfcp_fsf_ct_els *ct = job->dd_data; 747 struct zfcp_fsf_ct_els *ct = job->dd_data;
707 struct zfcp_fc_wka_port *wka_port; 748 struct zfcp_fc_wka_port *wka_port;
708 u32 preamble_word1;
709 749
710 preamble_word1 = job->request->rqst_data.r_ct.preamble_word1; 750 wka_port = zfcp_fc_job_wka_port(job);
711 gs_type = (preamble_word1 & 0xff000000) >> 24; 751 if (!wka_port)
712 752 return -EINVAL;
713 switch (gs_type) {
714 case FC_FST_ALIAS:
715 wka_port = &adapter->gs->as;
716 break;
717 case FC_FST_MGMT:
718 wka_port = &adapter->gs->ms;
719 break;
720 case FC_FST_TIME:
721 wka_port = &adapter->gs->ts;
722 break;
723 case FC_FST_DIR:
724 wka_port = &adapter->gs->ds;
725 break;
726 default:
727 return -EINVAL; /* no such service */
728 }
729 753
730 ret = zfcp_fc_wka_port_get(wka_port); 754 ret = zfcp_fc_wka_port_get(wka_port);
731 if (ret) 755 if (ret)
732 return ret; 756 return ret;
733 757
734 ret = zfcp_fsf_send_ct(wka_port, ct, NULL); 758 ct->handler = zfcp_fc_ct_job_handler;
759 ret = zfcp_fsf_send_ct(wka_port, ct, NULL, job->req->timeout / HZ);
735 if (ret) 760 if (ret)
736 zfcp_fc_wka_port_put(wka_port); 761 zfcp_fc_wka_port_put(wka_port);
737 762
@@ -752,7 +777,6 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
752 777
753 ct_els->req = job->request_payload.sg_list; 778 ct_els->req = job->request_payload.sg_list;
754 ct_els->resp = job->reply_payload.sg_list; 779 ct_els->resp = job->reply_payload.sg_list;
755 ct_els->handler = zfcp_fc_ct_els_job_handler;
756 ct_els->handler_data = job; 780 ct_els->handler_data = job;
757 781
758 switch (job->request->msgcode) { 782 switch (job->request->msgcode) {
@@ -767,6 +791,12 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
767 } 791 }
768} 792}
769 793
794int zfcp_fc_timeout_bsg_job(struct fc_bsg_job *job)
795{
796 /* hardware tracks timeout, reset bsg timeout to not interfere */
797 return -EAGAIN;
798}
799
770int zfcp_fc_gs_setup(struct zfcp_adapter *adapter) 800int zfcp_fc_gs_setup(struct zfcp_adapter *adapter)
771{ 801{
772 struct zfcp_fc_wka_ports *wka_ports; 802 struct zfcp_fc_wka_ports *wka_ports;