aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c2
-rw-r--r--drivers/s390/scsi/zfcp_ext.h6
-rw-r--r--drivers/s390/scsi/zfcp_fc.c51
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c10
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c2
5 files changed, 35 insertions, 36 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index c77686ed938c..23b85a03e26a 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -544,7 +544,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
544 sema_init(&adapter->erp_ready_sem, 0); 544 sema_init(&adapter->erp_ready_sem, 0);
545 545
546 INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler); 546 INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler);
547 INIT_WORK(&adapter->scan_work, _zfcp_scan_ports_later); 547 INIT_WORK(&adapter->scan_work, _zfcp_fc_scan_ports_later);
548 548
549 adapter->service_level.seq_print = zfcp_print_sl; 549 adapter->service_level.seq_print = zfcp_print_sl;
550 550
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index cf09b2838c50..36935bc0818f 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -92,12 +92,12 @@ extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, char *,
92extern void zfcp_erp_timeout_handler(unsigned long); 92extern void zfcp_erp_timeout_handler(unsigned long);
93 93
94/* zfcp_fc.c */ 94/* zfcp_fc.c */
95extern int zfcp_scan_ports(struct zfcp_adapter *); 95extern int zfcp_fc_scan_ports(struct zfcp_adapter *);
96extern void _zfcp_scan_ports_later(struct work_struct *); 96extern void _zfcp_fc_scan_ports_later(struct work_struct *);
97extern void zfcp_fc_incoming_els(struct zfcp_fsf_req *); 97extern void zfcp_fc_incoming_els(struct zfcp_fsf_req *);
98extern void zfcp_fc_port_did_lookup(struct work_struct *); 98extern void zfcp_fc_port_did_lookup(struct work_struct *);
99extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *); 99extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *);
100extern void zfcp_test_link(struct zfcp_port *); 100extern void zfcp_fc_test_link(struct zfcp_port *);
101extern void zfcp_fc_link_test_work(struct work_struct *); 101extern void zfcp_fc_link_test_work(struct work_struct *);
102extern void zfcp_fc_wka_ports_force_offline(struct zfcp_wka_ports *); 102extern void zfcp_fc_wka_ports_force_offline(struct zfcp_wka_ports *);
103extern int zfcp_fc_gs_setup(struct zfcp_adapter *); 103extern int zfcp_fc_gs_setup(struct zfcp_adapter *);
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index db8bb41a7794..7433da900fab 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -57,7 +57,7 @@ struct zfcp_fc_ns_handler_data {
57 unsigned long handler_data; 57 unsigned long handler_data;
58}; 58};
59 59
60static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port) 60static int zfcp_fc_wka_port_get(struct zfcp_wka_port *wka_port)
61{ 61{
62 if (mutex_lock_interruptible(&wka_port->mutex)) 62 if (mutex_lock_interruptible(&wka_port->mutex))
63 return -ERESTARTSYS; 63 return -ERESTARTSYS;
@@ -82,7 +82,7 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port)
82 return -EIO; 82 return -EIO;
83} 83}
84 84
85static void zfcp_wka_port_offline(struct work_struct *work) 85static void zfcp_fc_wka_port_offline(struct work_struct *work)
86{ 86{
87 struct delayed_work *dw = to_delayed_work(work); 87 struct delayed_work *dw = to_delayed_work(work);
88 struct zfcp_wka_port *wka_port = 88 struct zfcp_wka_port *wka_port =
@@ -102,7 +102,7 @@ out:
102 mutex_unlock(&wka_port->mutex); 102 mutex_unlock(&wka_port->mutex);
103} 103}
104 104
105static void zfcp_wka_port_put(struct zfcp_wka_port *wka_port) 105static void zfcp_fc_wka_port_put(struct zfcp_wka_port *wka_port)
106{ 106{
107 if (atomic_dec_return(&wka_port->refcount) != 0) 107 if (atomic_dec_return(&wka_port->refcount) != 0)
108 return; 108 return;
@@ -121,7 +121,7 @@ static void zfcp_fc_wka_port_init(struct zfcp_wka_port *wka_port, u32 d_id,
121 wka_port->status = ZFCP_WKA_PORT_OFFLINE; 121 wka_port->status = ZFCP_WKA_PORT_OFFLINE;
122 atomic_set(&wka_port->refcount, 0); 122 atomic_set(&wka_port->refcount, 0);
123 mutex_init(&wka_port->mutex); 123 mutex_init(&wka_port->mutex);
124 INIT_DELAYED_WORK(&wka_port->work, zfcp_wka_port_offline); 124 INIT_DELAYED_WORK(&wka_port->work, zfcp_fc_wka_port_offline);
125} 125}
126 126
127static void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka) 127static void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka)
@@ -150,7 +150,7 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
150 read_lock_irqsave(&zfcp_data.config_lock, flags); 150 read_lock_irqsave(&zfcp_data.config_lock, flags);
151 list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { 151 list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) {
152 if ((port->d_id & range) == (elem->nport_did & range)) 152 if ((port->d_id & range) == (elem->nport_did & range))
153 zfcp_test_link(port); 153 zfcp_fc_test_link(port);
154 if (!port->d_id) 154 if (!port->d_id)
155 zfcp_erp_port_reopen(port, 155 zfcp_erp_port_reopen(port,
156 ZFCP_STATUS_COMMON_ERP_FAILED, 156 ZFCP_STATUS_COMMON_ERP_FAILED,
@@ -326,13 +326,13 @@ static int zfcp_fc_ns_gid_pn(struct zfcp_port *port)
326 326
327 memset(gid_pn, 0, sizeof(*gid_pn)); 327 memset(gid_pn, 0, sizeof(*gid_pn));
328 328
329 ret = zfcp_wka_port_get(&adapter->gs->ds); 329 ret = zfcp_fc_wka_port_get(&adapter->gs->ds);
330 if (ret) 330 if (ret)
331 goto out; 331 goto out;
332 332
333 ret = zfcp_fc_ns_gid_pn_request(port, gid_pn); 333 ret = zfcp_fc_ns_gid_pn_request(port, gid_pn);
334 334
335 zfcp_wka_port_put(&adapter->gs->ds); 335 zfcp_fc_wka_port_put(&adapter->gs->ds);
336out: 336out:
337 mempool_free(gid_pn, adapter->pool.gid_pn_data); 337 mempool_free(gid_pn, adapter->pool.gid_pn_data);
338 return ret; 338 return ret;
@@ -482,14 +482,14 @@ out:
482} 482}
483 483
484/** 484/**
485 * zfcp_test_link - lightweight link test procedure 485 * zfcp_fc_test_link - lightweight link test procedure
486 * @port: port to be tested 486 * @port: port to be tested
487 * 487 *
488 * Test status of a link to a remote port using the ELS command ADISC. 488 * Test status of a link to a remote port using the ELS command ADISC.
489 * If there is a problem with the remote port, error recovery steps 489 * If there is a problem with the remote port, error recovery steps
490 * will be triggered. 490 * will be triggered.
491 */ 491 */
492void zfcp_test_link(struct zfcp_port *port) 492void zfcp_fc_test_link(struct zfcp_port *port)
493{ 493{
494 zfcp_port_get(port); 494 zfcp_port_get(port);
495 if (!queue_work(port->adapter->work_queue, &port->test_link_work)) 495 if (!queue_work(port->adapter->work_queue, &port->test_link_work))
@@ -532,9 +532,8 @@ out:
532} 532}
533 533
534 534
535static int zfcp_scan_issue_gpn_ft(struct zfcp_gpn_ft *gpn_ft, 535static int zfcp_fc_send_gpn_ft(struct zfcp_gpn_ft *gpn_ft,
536 struct zfcp_adapter *adapter, 536 struct zfcp_adapter *adapter, int max_bytes)
537 int max_bytes)
538{ 537{
539 struct zfcp_send_ct *ct = &gpn_ft->ct; 538 struct zfcp_send_ct *ct = &gpn_ft->ct;
540 struct ct_iu_gpn_ft_req *req = sg_virt(&gpn_ft->sg_req); 539 struct ct_iu_gpn_ft_req *req = sg_virt(&gpn_ft->sg_req);
@@ -569,7 +568,7 @@ static int zfcp_scan_issue_gpn_ft(struct zfcp_gpn_ft *gpn_ft,
569 return ret; 568 return ret;
570} 569}
571 570
572static void zfcp_validate_port(struct zfcp_port *port) 571static void zfcp_fc_validate_port(struct zfcp_port *port)
573{ 572{
574 struct zfcp_adapter *adapter = port->adapter; 573 struct zfcp_adapter *adapter = port->adapter;
575 574
@@ -589,7 +588,7 @@ static void zfcp_validate_port(struct zfcp_port *port)
589 zfcp_port_dequeue(port); 588 zfcp_port_dequeue(port);
590} 589}
591 590
592static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft, int max_entries) 591static int zfcp_fc_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft, int max_entries)
593{ 592{
594 struct zfcp_send_ct *ct = &gpn_ft->ct; 593 struct zfcp_send_ct *ct = &gpn_ft->ct;
595 struct scatterlist *sg = gpn_ft->sg_resp; 594 struct scatterlist *sg = gpn_ft->sg_resp;
@@ -649,16 +648,16 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft, int max_entries)
649 648
650 zfcp_erp_wait(adapter); 649 zfcp_erp_wait(adapter);
651 list_for_each_entry_safe(port, tmp, &adapter->port_list_head, list) 650 list_for_each_entry_safe(port, tmp, &adapter->port_list_head, list)
652 zfcp_validate_port(port); 651 zfcp_fc_validate_port(port);
653 up(&zfcp_data.config_sema); 652 up(&zfcp_data.config_sema);
654 return ret; 653 return ret;
655} 654}
656 655
657/** 656/**
658 * zfcp_scan_ports - scan remote ports and attach new ports 657 * zfcp_fc_scan_ports - scan remote ports and attach new ports
659 * @adapter: pointer to struct zfcp_adapter 658 * @adapter: pointer to struct zfcp_adapter
660 */ 659 */
661int zfcp_scan_ports(struct zfcp_adapter *adapter) 660int zfcp_fc_scan_ports(struct zfcp_adapter *adapter)
662{ 661{
663 int ret, i; 662 int ret, i;
664 struct zfcp_gpn_ft *gpn_ft; 663 struct zfcp_gpn_ft *gpn_ft;
@@ -673,7 +672,7 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
673 fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV) 672 fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV)
674 return 0; 673 return 0;
675 674
676 ret = zfcp_wka_port_get(&adapter->gs->ds); 675 ret = zfcp_fc_wka_port_get(&adapter->gs->ds);
677 if (ret) 676 if (ret)
678 return ret; 677 return ret;
679 678
@@ -684,9 +683,9 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
684 } 683 }
685 684
686 for (i = 0; i < 3; i++) { 685 for (i = 0; i < 3; i++) {
687 ret = zfcp_scan_issue_gpn_ft(gpn_ft, adapter, max_bytes); 686 ret = zfcp_fc_send_gpn_ft(gpn_ft, adapter, max_bytes);
688 if (!ret) { 687 if (!ret) {
689 ret = zfcp_scan_eval_gpn_ft(gpn_ft, max_entries); 688 ret = zfcp_fc_eval_gpn_ft(gpn_ft, max_entries);
690 if (ret == -EAGAIN) 689 if (ret == -EAGAIN)
691 ssleep(1); 690 ssleep(1);
692 else 691 else
@@ -695,14 +694,14 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
695 } 694 }
696 zfcp_free_sg_env(gpn_ft, buf_num); 695 zfcp_free_sg_env(gpn_ft, buf_num);
697out: 696out:
698 zfcp_wka_port_put(&adapter->gs->ds); 697 zfcp_fc_wka_port_put(&adapter->gs->ds);
699 return ret; 698 return ret;
700} 699}
701 700
702 701
703void _zfcp_scan_ports_later(struct work_struct *work) 702void _zfcp_fc_scan_ports_later(struct work_struct *work)
704{ 703{
705 zfcp_scan_ports(container_of(work, struct zfcp_adapter, scan_work)); 704 zfcp_fc_scan_ports(container_of(work, struct zfcp_adapter, scan_work));
706} 705}
707 706
708struct zfcp_els_fc_job { 707struct zfcp_els_fc_job {
@@ -792,7 +791,7 @@ static void zfcp_fc_generic_ct_handler(unsigned long data)
792 job->state_flags = FC_RQST_STATE_DONE; 791 job->state_flags = FC_RQST_STATE_DONE;
793 job->job_done(job); 792 job->job_done(job);
794 793
795 zfcp_wka_port_put(ct_fc_job->ct.wka_port); 794 zfcp_fc_wka_port_put(ct_fc_job->ct.wka_port);
796 795
797 kfree(ct_fc_job); 796 kfree(ct_fc_job);
798} 797}
@@ -838,7 +837,7 @@ int zfcp_fc_execute_ct_fc_job(struct fc_bsg_job *job)
838 return -EINVAL; /* no such service */ 837 return -EINVAL; /* no such service */
839 } 838 }
840 839
841 ret = zfcp_wka_port_get(ct_fc_job->ct.wka_port); 840 ret = zfcp_fc_wka_port_get(ct_fc_job->ct.wka_port);
842 if (ret) { 841 if (ret) {
843 kfree(ct_fc_job); 842 kfree(ct_fc_job);
844 return ret; 843 return ret;
@@ -855,7 +854,7 @@ int zfcp_fc_execute_ct_fc_job(struct fc_bsg_job *job)
855 ret = zfcp_fsf_send_ct(&ct_fc_job->ct, NULL); 854 ret = zfcp_fsf_send_ct(&ct_fc_job->ct, NULL);
856 if (ret) { 855 if (ret) {
857 kfree(ct_fc_job); 856 kfree(ct_fc_job);
858 zfcp_wka_port_put(ct_fc_job->ct.wka_port); 857 zfcp_fc_wka_port_put(ct_fc_job->ct.wka_port);
859 } 858 }
860 return ret; 859 return ret;
861} 860}
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 665967f049a8..c241f032fd49 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -892,7 +892,7 @@ static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req)
892 case FSF_ADAPTER_STATUS_AVAILABLE: 892 case FSF_ADAPTER_STATUS_AVAILABLE:
893 switch (fsq->word[0]) { 893 switch (fsq->word[0]) {
894 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 894 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
895 zfcp_test_link(unit->port); 895 zfcp_fc_test_link(unit->port);
896 /* fall through */ 896 /* fall through */
897 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 897 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
898 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 898 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
@@ -1139,7 +1139,7 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req)
1139 switch (header->fsf_status_qual.word[0]){ 1139 switch (header->fsf_status_qual.word[0]){
1140 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1140 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1141 if (port && (send_els->ls_code != ZFCP_LS_ADISC)) 1141 if (port && (send_els->ls_code != ZFCP_LS_ADISC))
1142 zfcp_test_link(port); 1142 zfcp_fc_test_link(port);
1143 /*fall through */ 1143 /*fall through */
1144 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1144 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1145 case FSF_SQ_RETRY_IF_POSSIBLE: 1145 case FSF_SQ_RETRY_IF_POSSIBLE:
@@ -1889,7 +1889,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1889 case FSF_ADAPTER_STATUS_AVAILABLE: 1889 case FSF_ADAPTER_STATUS_AVAILABLE:
1890 switch (header->fsf_status_qual.word[0]) { 1890 switch (header->fsf_status_qual.word[0]) {
1891 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1891 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1892 zfcp_test_link(unit->port); 1892 zfcp_fc_test_link(unit->port);
1893 /* fall through */ 1893 /* fall through */
1894 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1894 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1895 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1895 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
@@ -2024,7 +2024,7 @@ static void zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *req)
2024 case FSF_ADAPTER_STATUS_AVAILABLE: 2024 case FSF_ADAPTER_STATUS_AVAILABLE:
2025 switch (req->qtcb->header.fsf_status_qual.word[0]) { 2025 switch (req->qtcb->header.fsf_status_qual.word[0]) {
2026 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 2026 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
2027 zfcp_test_link(unit->port); 2027 zfcp_fc_test_link(unit->port);
2028 /* fall through */ 2028 /* fall through */
2029 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 2029 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
2030 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2030 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
@@ -2307,7 +2307,7 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
2307 case FSF_ADAPTER_STATUS_AVAILABLE: 2307 case FSF_ADAPTER_STATUS_AVAILABLE:
2308 if (header->fsf_status_qual.word[0] == 2308 if (header->fsf_status_qual.word[0] ==
2309 FSF_SQ_INVOKE_LINK_TEST_PROCEDURE) 2309 FSF_SQ_INVOKE_LINK_TEST_PROCEDURE)
2310 zfcp_test_link(unit->port); 2310 zfcp_fc_test_link(unit->port);
2311 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2311 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2312 break; 2312 break;
2313 } 2313 }
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index a6cf62636834..c86496bb608b 100644
--- a/drivers/s390/scsi/zfcp_sysfs.c
+++ b/drivers/s390/scsi/zfcp_sysfs.c
@@ -126,7 +126,7 @@ static ssize_t zfcp_sysfs_port_rescan_store(struct device *dev,
126 if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE) 126 if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE)
127 return -EBUSY; 127 return -EBUSY;
128 128
129 ret = zfcp_scan_ports(adapter); 129 ret = zfcp_fc_scan_ports(adapter);
130 return ret ? ret : (ssize_t) count; 130 return ret ? ret : (ssize_t) count;
131} 131}
132static ZFCP_DEV_ATTR(adapter, port_rescan, S_IWUSR, NULL, 132static ZFCP_DEV_ATTR(adapter, port_rescan, S_IWUSR, NULL,