aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c89
1 files changed, 17 insertions, 72 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 9e6d07d7b3c..46e14f22ec1 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -1,18 +1,8 @@
1/* 1/*
2 * 2 * This file is part of the zfcp device driver for
3 * linux/drivers/s390/scsi/zfcp_scsi.c 3 * FCP adapters for IBM System z9 and zSeries.
4 *
5 * FCP adapter driver for IBM eServer zSeries
6 *
7 * (C) Copyright IBM Corp. 2002, 2004
8 * 4 *
9 * Author(s): Martin Peschke <mpeschke@de.ibm.com> 5 * (C) Copyright IBM Corp. 2002, 2006
10 * Raimund Schroeder <raimund.schroeder@de.ibm.com>
11 * Aron Zeh
12 * Wolfgang Taphorn
13 * Stefan Bader <stefan.bader@de.ibm.com>
14 * Heiko Carstens <heiko.carstens@de.ibm.com>
15 * Andreas Herrmann <aherrman@de.ibm.com>
16 * 6 *
17 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -45,8 +35,8 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *);
45static int zfcp_task_management_function(struct zfcp_unit *, u8, 35static int zfcp_task_management_function(struct zfcp_unit *, u8,
46 struct scsi_cmnd *); 36 struct scsi_cmnd *);
47 37
48static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *, int, scsi_id_t, 38static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *, int,
49 scsi_lun_t); 39 unsigned int, unsigned int);
50 40
51static struct device_attribute *zfcp_sysfs_sdev_attrs[]; 41static struct device_attribute *zfcp_sysfs_sdev_attrs[];
52 42
@@ -161,14 +151,6 @@ set_driver_byte(u32 * result, char status)
161 set_byte(result, status, 3); 151 set_byte(result, status, 3);
162} 152}
163 153
164/*
165 * function: zfcp_scsi_slave_alloc
166 *
167 * purpose:
168 *
169 * returns:
170 */
171
172static int 154static int
173zfcp_scsi_slave_alloc(struct scsi_device *sdp) 155zfcp_scsi_slave_alloc(struct scsi_device *sdp)
174{ 156{
@@ -195,14 +177,6 @@ zfcp_scsi_slave_alloc(struct scsi_device *sdp)
195 return retval; 177 return retval;
196} 178}
197 179
198/*
199 * function: zfcp_scsi_slave_destroy
200 *
201 * purpose:
202 *
203 * returns:
204 */
205
206static void 180static void
207zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) 181zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
208{ 182{
@@ -374,18 +348,9 @@ zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
374 return zfcp_scsi_command_async(adapter, unit, scpnt, NULL); 348 return zfcp_scsi_command_async(adapter, unit, scpnt, NULL);
375} 349}
376 350
377/*
378 * function: zfcp_unit_lookup
379 *
380 * purpose:
381 *
382 * returns:
383 *
384 * context:
385 */
386static struct zfcp_unit * 351static struct zfcp_unit *
387zfcp_unit_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id, 352zfcp_unit_lookup(struct zfcp_adapter *adapter, int channel, unsigned int id,
388 scsi_lun_t lun) 353 unsigned int lun)
389{ 354{
390 struct zfcp_port *port; 355 struct zfcp_port *port;
391 struct zfcp_unit *unit, *retval = NULL; 356 struct zfcp_unit *unit, *retval = NULL;
@@ -491,13 +456,6 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
491 return retval; 456 return retval;
492} 457}
493 458
494/*
495 * function: zfcp_scsi_eh_device_reset_handler
496 *
497 * purpose:
498 *
499 * returns:
500 */
501int 459int
502zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) 460zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
503{ 461{
@@ -625,13 +583,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
625 return SUCCESS; 583 return SUCCESS;
626} 584}
627 585
628/*
629 * function:
630 *
631 * purpose:
632 *
633 * returns:
634 */
635int 586int
636zfcp_adapter_scsi_register(struct zfcp_adapter *adapter) 587zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
637{ 588{
@@ -657,10 +608,6 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
657 adapter->scsi_host->unique_id = unique_id++; /* FIXME */ 608 adapter->scsi_host->unique_id = unique_id++; /* FIXME */
658 adapter->scsi_host->max_cmd_len = ZFCP_MAX_SCSI_CMND_LENGTH; 609 adapter->scsi_host->max_cmd_len = ZFCP_MAX_SCSI_CMND_LENGTH;
659 adapter->scsi_host->transportt = zfcp_transport_template; 610 adapter->scsi_host->transportt = zfcp_transport_template;
660 /*
661 * Reverse mapping of the host number to avoid race condition
662 */
663 adapter->scsi_host_no = adapter->scsi_host->host_no;
664 611
665 /* 612 /*
666 * save a pointer to our own adapter data structure within 613 * save a pointer to our own adapter data structure within
@@ -678,13 +625,6 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
678 return retval; 625 return retval;
679} 626}
680 627
681/*
682 * function:
683 *
684 * purpose:
685 *
686 * returns:
687 */
688void 628void
689zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter) 629zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
690{ 630{
@@ -703,7 +643,6 @@ zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
703 scsi_remove_host(shost); 643 scsi_remove_host(shost);
704 scsi_host_put(shost); 644 scsi_host_put(shost);
705 adapter->scsi_host = NULL; 645 adapter->scsi_host = NULL;
706 adapter->scsi_host_no = 0;
707 atomic_clear_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status); 646 atomic_clear_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status);
708 647
709 return; 648 return;
@@ -817,10 +756,9 @@ zfcp_get_fc_host_stats(struct Scsi_Host *shost)
817 if (!fc_stats) 756 if (!fc_stats)
818 return NULL; 757 return NULL;
819 758
820 data = kmalloc(sizeof(*data), GFP_KERNEL); 759 data = kzalloc(sizeof(*data), GFP_KERNEL);
821 if (!data) 760 if (!data)
822 return NULL; 761 return NULL;
823 memset(data, 0, sizeof(*data));
824 762
825 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data); 763 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data);
826 if (ret) { 764 if (ret) {
@@ -848,10 +786,9 @@ zfcp_reset_fc_host_stats(struct Scsi_Host *shost)
848 int ret; 786 int ret;
849 787
850 adapter = (struct zfcp_adapter *)shost->hostdata[0]; 788 adapter = (struct zfcp_adapter *)shost->hostdata[0];
851 data = kmalloc(sizeof(*data), GFP_KERNEL); 789 data = kzalloc(sizeof(*data), GFP_KERNEL);
852 if (!data) 790 if (!data)
853 return; 791 return;
854 memset(data, 0, sizeof(*data));
855 792
856 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data); 793 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data);
857 if (ret == 0) { 794 if (ret == 0) {
@@ -863,11 +800,18 @@ zfcp_reset_fc_host_stats(struct Scsi_Host *shost)
863 } 800 }
864} 801}
865 802
803static void zfcp_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout)
804{
805 rport->dev_loss_tmo = timeout;
806}
807
866struct fc_function_template zfcp_transport_functions = { 808struct fc_function_template zfcp_transport_functions = {
867 .show_starget_port_id = 1, 809 .show_starget_port_id = 1,
868 .show_starget_port_name = 1, 810 .show_starget_port_name = 1,
869 .show_starget_node_name = 1, 811 .show_starget_node_name = 1,
870 .show_rport_supported_classes = 1, 812 .show_rport_supported_classes = 1,
813 .show_rport_maxframe_size = 1,
814 .show_rport_dev_loss_tmo = 1,
871 .show_host_node_name = 1, 815 .show_host_node_name = 1,
872 .show_host_port_name = 1, 816 .show_host_port_name = 1,
873 .show_host_permanent_port_name = 1, 817 .show_host_permanent_port_name = 1,
@@ -877,6 +821,7 @@ struct fc_function_template zfcp_transport_functions = {
877 .show_host_serial_number = 1, 821 .show_host_serial_number = 1,
878 .get_fc_host_stats = zfcp_get_fc_host_stats, 822 .get_fc_host_stats = zfcp_get_fc_host_stats,
879 .reset_fc_host_stats = zfcp_reset_fc_host_stats, 823 .reset_fc_host_stats = zfcp_reset_fc_host_stats,
824 .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo,
880 /* no functions registered for following dynamic attributes but 825 /* no functions registered for following dynamic attributes but
881 directly set by LLDD */ 826 directly set by LLDD */
882 .show_host_port_type = 1, 827 .show_host_port_type = 1,