aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c91
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c14
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c10
-rw-r--r--drivers/s390/scsi/zfcp_def.h68
-rw-r--r--drivers/s390/scsi/zfcp_erp.c275
-rw-r--r--drivers/s390/scsi/zfcp_ext.h19
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c142
-rw-r--r--drivers/s390/scsi/zfcp_fsf.h38
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c19
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c89
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_adapter.c14
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_driver.c14
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_port.c15
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_unit.c15
14 files changed, 204 insertions, 619 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 395cfc6a344f..9cd789b8acd4 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -1,18 +1,8 @@
1/* 1/*
2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
2 * 4 *
3 * linux/drivers/s390/scsi/zfcp_aux.c 5 * (C) Copyright IBM Corp. 2002, 2006
4 *
5 * FCP adapter driver for IBM eServer zSeries
6 *
7 * (C) Copyright IBM Corp. 2002, 2004
8 *
9 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
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
@@ -29,6 +19,20 @@
29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 */ 20 */
31 21
22/*
23 * Driver authors:
24 * Martin Peschke (originator of the driver)
25 * Raimund Schroeder
26 * Aron Zeh
27 * Wolfgang Taphorn
28 * Stefan Bader
29 * Heiko Carstens (kernel 2.6 port of the driver)
30 * Andreas Herrmann
31 * Maxim Shchetynin
32 * Volker Sameske
33 * Ralph Wuerthner
34 */
35
32#include "zfcp_ext.h" 36#include "zfcp_ext.h"
33 37
34/* accumulated log level (module parameter) */ 38/* accumulated log level (module parameter) */
@@ -75,15 +79,9 @@ static struct miscdevice zfcp_cfdc_misc = {
75/* declare driver module init/cleanup functions */ 79/* declare driver module init/cleanup functions */
76module_init(zfcp_module_init); 80module_init(zfcp_module_init);
77 81
78MODULE_AUTHOR("Heiko Carstens <heiko.carstens@de.ibm.com>, " 82MODULE_AUTHOR("IBM Deutschland Entwicklung GmbH - linux390@de.ibm.com");
79 "Andreas Herrman <aherrman@de.ibm.com>, "
80 "Martin Peschke <mpeschke@de.ibm.com>, "
81 "Raimund Schroeder <raimund.schroeder@de.ibm.com>, "
82 "Wolfgang Taphorn <taphorn@de.ibm.com>, "
83 "Aron Zeh <arzeh@de.ibm.com>, "
84 "IBM Deutschland Entwicklung GmbH");
85MODULE_DESCRIPTION 83MODULE_DESCRIPTION
86 ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries"); 84 ("FCP (SCSI over Fibre Channel) HBA driver for IBM System z9 and zSeries");
87MODULE_LICENSE("GPL"); 85MODULE_LICENSE("GPL");
88 86
89module_param(device, charp, 0400); 87module_param(device, charp, 0400);
@@ -291,12 +289,11 @@ zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
291 goto out; 289 goto out;
292 } 290 }
293 291
294 sg_list = kmalloc(sizeof(struct zfcp_sg_list), GFP_KERNEL); 292 sg_list = kzalloc(sizeof(struct zfcp_sg_list), GFP_KERNEL);
295 if (sg_list == NULL) { 293 if (sg_list == NULL) {
296 retval = -ENOMEM; 294 retval = -ENOMEM;
297 goto out; 295 goto out;
298 } 296 }
299 memset(sg_list, 0, sizeof(*sg_list));
300 297
301 if (command != ZFCP_CFDC_IOC) { 298 if (command != ZFCP_CFDC_IOC) {
302 ZFCP_LOG_INFO("IOC request code 0x%x invalid\n", command); 299 ZFCP_LOG_INFO("IOC request code 0x%x invalid\n", command);
@@ -478,14 +475,13 @@ zfcp_sg_list_alloc(struct zfcp_sg_list *sg_list, size_t size)
478 sg_list->count = size >> PAGE_SHIFT; 475 sg_list->count = size >> PAGE_SHIFT;
479 if (size & ~PAGE_MASK) 476 if (size & ~PAGE_MASK)
480 sg_list->count++; 477 sg_list->count++;
481 sg_list->sg = kmalloc(sg_list->count * sizeof(struct scatterlist), 478 sg_list->sg = kcalloc(sg_list->count, sizeof(struct scatterlist),
482 GFP_KERNEL); 479 GFP_KERNEL);
483 if (sg_list->sg == NULL) { 480 if (sg_list->sg == NULL) {
484 sg_list->count = 0; 481 sg_list->count = 0;
485 retval = -ENOMEM; 482 retval = -ENOMEM;
486 goto out; 483 goto out;
487 } 484 }
488 memset(sg_list->sg, 0, sg_list->count * sizeof(struct scatterlist));
489 485
490 for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) { 486 for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) {
491 sg->length = min(size, PAGE_SIZE); 487 sg->length = min(size, PAGE_SIZE);
@@ -744,7 +740,7 @@ struct zfcp_unit *
744zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun) 740zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
745{ 741{
746 struct zfcp_unit *unit, *tmp_unit; 742 struct zfcp_unit *unit, *tmp_unit;
747 scsi_lun_t scsi_lun; 743 unsigned int scsi_lun;
748 int found; 744 int found;
749 745
750 /* 746 /*
@@ -758,10 +754,9 @@ zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
758 if (unit) 754 if (unit)
759 return NULL; 755 return NULL;
760 756
761 unit = kmalloc(sizeof (struct zfcp_unit), GFP_KERNEL); 757 unit = kzalloc(sizeof (struct zfcp_unit), GFP_KERNEL);
762 if (!unit) 758 if (!unit)
763 return NULL; 759 return NULL;
764 memset(unit, 0, sizeof (struct zfcp_unit));
765 760
766 /* initialise reference count stuff */ 761 /* initialise reference count stuff */
767 atomic_set(&unit->refcount, 0); 762 atomic_set(&unit->refcount, 0);
@@ -929,13 +924,12 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
929 */ 924 */
930 925
931 /* try to allocate new adapter data structure (zeroed) */ 926 /* try to allocate new adapter data structure (zeroed) */
932 adapter = kmalloc(sizeof (struct zfcp_adapter), GFP_KERNEL); 927 adapter = kzalloc(sizeof (struct zfcp_adapter), GFP_KERNEL);
933 if (!adapter) { 928 if (!adapter) {
934 ZFCP_LOG_INFO("error: allocation of base adapter " 929 ZFCP_LOG_INFO("error: allocation of base adapter "
935 "structure failed\n"); 930 "structure failed\n");
936 goto out; 931 goto out;
937 } 932 }
938 memset(adapter, 0, sizeof (struct zfcp_adapter));
939 933
940 ccw_device->handler = NULL; 934 ccw_device->handler = NULL;
941 935
@@ -997,12 +991,6 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
997 /* intitialise SCSI ER timer */ 991 /* intitialise SCSI ER timer */
998 init_timer(&adapter->scsi_er_timer); 992 init_timer(&adapter->scsi_er_timer);
999 993
1000 /* set FC service class used per default */
1001 adapter->fc_service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
1002
1003 sprintf(adapter->name, "%s", zfcp_get_busid_by_adapter(adapter));
1004 ASCEBC(adapter->name, strlen(adapter->name));
1005
1006 /* mark adapter unusable as long as sysfs registration is not complete */ 994 /* mark adapter unusable as long as sysfs registration is not complete */
1007 atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); 995 atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
1008 996
@@ -1139,10 +1127,9 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status,
1139 return NULL; 1127 return NULL;
1140 } 1128 }
1141 1129
1142 port = kmalloc(sizeof (struct zfcp_port), GFP_KERNEL); 1130 port = kzalloc(sizeof (struct zfcp_port), GFP_KERNEL);
1143 if (!port) 1131 if (!port)
1144 return NULL; 1132 return NULL;
1145 memset(port, 0, sizeof (struct zfcp_port));
1146 1133
1147 /* initialise reference count stuff */ 1134 /* initialise reference count stuff */
1148 atomic_set(&port->refcount, 0); 1135 atomic_set(&port->refcount, 0);
@@ -1354,18 +1341,19 @@ static void
1354zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter, 1341zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter,
1355 struct fsf_status_read_buffer *status_buffer) 1342 struct fsf_status_read_buffer *status_buffer)
1356{ 1343{
1357 logi *els_logi = (logi *) status_buffer->payload; 1344 struct fsf_plogi *els_plogi;
1358 struct zfcp_port *port; 1345 struct zfcp_port *port;
1359 unsigned long flags; 1346 unsigned long flags;
1360 1347
1348 els_plogi = (struct fsf_plogi *) status_buffer->payload;
1361 read_lock_irqsave(&zfcp_data.config_lock, flags); 1349 read_lock_irqsave(&zfcp_data.config_lock, flags);
1362 list_for_each_entry(port, &adapter->port_list_head, list) { 1350 list_for_each_entry(port, &adapter->port_list_head, list) {
1363 if (port->wwpn == (*(wwn_t *) & els_logi->nport_wwn)) 1351 if (port->wwpn == (*(wwn_t *) &els_plogi->serv_param.wwpn))
1364 break; 1352 break;
1365 } 1353 }
1366 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 1354 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
1367 1355
1368 if (!port || (port->wwpn != (*(wwn_t *) & els_logi->nport_wwn))) { 1356 if (!port || (port->wwpn != (*(wwn_t *) &els_plogi->serv_param.wwpn))) {
1369 ZFCP_LOG_DEBUG("ignored incoming PLOGI for nonexisting port " 1357 ZFCP_LOG_DEBUG("ignored incoming PLOGI for nonexisting port "
1370 "with d_id 0x%08x on adapter %s\n", 1358 "with d_id 0x%08x on adapter %s\n",
1371 status_buffer->d_id, 1359 status_buffer->d_id,
@@ -1760,4 +1748,25 @@ zfcp_handle_els_rjt(u32 sq, struct zfcp_ls_rjt_par *rjt_par)
1760 return ret; 1748 return ret;
1761} 1749}
1762 1750
1751/**
1752 * zfcp_plogi_evaluate - evaluate PLOGI playload and copy important fields
1753 * into zfcp_port structure
1754 * @port: zfcp_port structure
1755 * @plogi: plogi payload
1756 */
1757void
1758zfcp_plogi_evaluate(struct zfcp_port *port, struct fsf_plogi *plogi)
1759{
1760 port->maxframe_size = plogi->serv_param.common_serv_param[7] |
1761 ((plogi->serv_param.common_serv_param[6] & 0x0F) << 8);
1762 if (plogi->serv_param.class1_serv_param[0] & 0x80)
1763 port->supported_classes |= FC_COS_CLASS1;
1764 if (plogi->serv_param.class2_serv_param[0] & 0x80)
1765 port->supported_classes |= FC_COS_CLASS2;
1766 if (plogi->serv_param.class3_serv_param[0] & 0x80)
1767 port->supported_classes |= FC_COS_CLASS3;
1768 if (plogi->serv_param.class4_serv_param[0] & 0x80)
1769 port->supported_classes |= FC_COS_CLASS4;
1770}
1771
1763#undef ZFCP_LOG_AREA 1772#undef ZFCP_LOG_AREA
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 241136d0c6eb..57d8e4bfb8d9 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -1,16 +1,8 @@
1/* 1/*
2 * linux/drivers/s390/scsi/zfcp_ccw.c 2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
3 * 4 *
4 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
5 *
6 * CCW driver related routines
7 *
8 * (C) Copyright IBM Corp. 2003, 2004
9 *
10 * Authors:
11 * Martin Peschke <mpeschke@de.ibm.com>
12 * Heiko Carstens <heiko.carstens@de.ibm.com>
13 * Andreas Herrmann <aherrman@de.ibm.com>
14 * 6 *
15 * 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
16 * 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
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index a5f2ba9a8fdb..c033145d0f19 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -1,12 +1,8 @@
1/* 1/*
2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
2 * 4 *
3 * linux/drivers/s390/scsi/zfcp_dbf.c 5 * (C) Copyright IBM Corp. 2002, 2006
4 *
5 * FCP adapter driver for IBM eServer zSeries
6 *
7 * Debugging facilities
8 *
9 * (C) Copyright IBM Corp. 2005
10 * 6 *
11 * 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
12 * 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
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 6eba56cd89ba..2df512a18e2c 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -1,19 +1,8 @@
1/* 1/*
2 * 2 * This file is part of the zfcp device driver for
3 * linux/drivers/s390/scsi/zfcp_def.h 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 * Volker Sameske <sameske@de.ibm.com>
17 * 6 *
18 * 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
19 * 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
@@ -50,7 +39,6 @@
50#include <scsi/scsi_host.h> 39#include <scsi/scsi_host.h>
51#include <scsi/scsi_transport.h> 40#include <scsi/scsi_transport.h>
52#include <scsi/scsi_transport_fc.h> 41#include <scsi/scsi_transport_fc.h>
53#include "../../fc4/fc.h"
54#include "zfcp_fsf.h" 42#include "zfcp_fsf.h"
55#include <asm/ccwdev.h> 43#include <asm/ccwdev.h>
56#include <asm/qdio.h> 44#include <asm/qdio.h>
@@ -64,7 +52,7 @@
64/********************* GENERAL DEFINES *********************************/ 52/********************* GENERAL DEFINES *********************************/
65 53
66/* zfcp version number, it consists of major, minor, and patch-level number */ 54/* zfcp version number, it consists of major, minor, and patch-level number */
67#define ZFCP_VERSION "4.5.0" 55#define ZFCP_VERSION "4.7.0"
68 56
69/** 57/**
70 * zfcp_sg_to_address - determine kernel address from struct scatterlist 58 * zfcp_sg_to_address - determine kernel address from struct scatterlist
@@ -89,13 +77,9 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
89 list->offset = ((unsigned long) address) & (PAGE_SIZE - 1); 77 list->offset = ((unsigned long) address) & (PAGE_SIZE - 1);
90} 78}
91 79
92/********************* SCSI SPECIFIC DEFINES *********************************/ 80#define REQUEST_LIST_SIZE 128
93 81
94/* 32 bit for SCSI ID and LUN as long as the SCSI stack uses this type */ 82/********************* SCSI SPECIFIC DEFINES *********************************/
95typedef u32 scsi_id_t;
96typedef u32 scsi_lun_t;
97
98#define ZFCP_ERP_SCSI_LOW_MEM_TIMEOUT (100*HZ)
99#define ZFCP_SCSI_ER_TIMEOUT (100*HZ) 83#define ZFCP_SCSI_ER_TIMEOUT (100*HZ)
100 84
101/********************* CIO/QDIO SPECIFIC DEFINES *****************************/ 85/********************* CIO/QDIO SPECIFIC DEFINES *****************************/
@@ -233,8 +217,9 @@ struct fcp_rsp_iu {
233#define RSP_CODE_TASKMAN_FAILED 5 217#define RSP_CODE_TASKMAN_FAILED 5
234 218
235/* see fc-fs */ 219/* see fc-fs */
236#define LS_FAN 0x60000000 220#define LS_RSCN 0x61040000
237#define LS_RSCN 0x61040000 221#define LS_LOGO 0x05000000
222#define LS_PLOGI 0x03000000
238 223
239struct fcp_rscn_head { 224struct fcp_rscn_head {
240 u8 command; 225 u8 command;
@@ -263,13 +248,6 @@ struct fcp_rscn_element {
263#define ZFCP_NO_PORTS_PER_DOMAIN 0x10000 248#define ZFCP_NO_PORTS_PER_DOMAIN 0x10000
264#define ZFCP_NO_PORTS_PER_FABRIC 0x1000000 249#define ZFCP_NO_PORTS_PER_FABRIC 0x1000000
265 250
266struct fcp_fan {
267 u32 command;
268 u32 fport_did;
269 wwn_t fport_wwpn;
270 wwn_t fport_wwname;
271} __attribute__((packed));
272
273/* see fc-ph */ 251/* see fc-ph */
274struct fcp_logo { 252struct fcp_logo {
275 u32 command; 253 u32 command;
@@ -507,9 +485,6 @@ struct zfcp_rc_entry {
507 485
508#define ZFCP_NAME "zfcp" 486#define ZFCP_NAME "zfcp"
509 487
510/* read-only LUN sharing switch initial value */
511#define ZFCP_RO_LUN_SHARING_DEFAULTS 0
512
513/* independent log areas */ 488/* independent log areas */
514#define ZFCP_LOG_AREA_OTHER 0 489#define ZFCP_LOG_AREA_OTHER 0
515#define ZFCP_LOG_AREA_SCSI 1 490#define ZFCP_LOG_AREA_SCSI 1
@@ -608,7 +583,6 @@ do { \
608 * and unit 583 * and unit
609 */ 584 */
610#define ZFCP_COMMON_FLAGS 0xfff00000 585#define ZFCP_COMMON_FLAGS 0xfff00000
611#define ZFCP_SPECIFIC_FLAGS 0x000fffff
612 586
613/* common status bits */ 587/* common status bits */
614#define ZFCP_STATUS_COMMON_REMOVE 0x80000000 588#define ZFCP_STATUS_COMMON_REMOVE 0x80000000
@@ -633,11 +607,6 @@ do { \
633#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 607#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200
634#define ZFCP_STATUS_ADAPTER_XPORT_OK 0x00000800 608#define ZFCP_STATUS_ADAPTER_XPORT_OK 0x00000800
635 609
636#define ZFCP_STATUS_ADAPTER_SCSI_UP \
637 (ZFCP_STATUS_COMMON_UNBLOCKED | \
638 ZFCP_STATUS_ADAPTER_REGISTERED)
639
640
641/* FC-PH/FC-GS well-known address identifiers for generic services */ 610/* FC-PH/FC-GS well-known address identifiers for generic services */
642#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA 611#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA
643#define ZFCP_DID_TIME_SERVICE 0xFFFFFB 612#define ZFCP_DID_TIME_SERVICE 0xFFFFFB
@@ -652,7 +621,6 @@ do { \
652#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 621#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
653#define ZFCP_STATUS_PORT_NO_SCSI_ID 0x00000010 622#define ZFCP_STATUS_PORT_NO_SCSI_ID 0x00000010
654#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 623#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
655#define ZFCP_STATUS_PORT_ACCESS_DENIED 0x00000040
656 624
657/* for ports with well known addresses */ 625/* for ports with well known addresses */
658#define ZFCP_STATUS_PORT_WKA \ 626#define ZFCP_STATUS_PORT_WKA \
@@ -908,15 +876,12 @@ struct zfcp_adapter {
908 wwn_t peer_wwpn; /* P2P peer WWPN */ 876 wwn_t peer_wwpn; /* P2P peer WWPN */
909 u32 peer_d_id; /* P2P peer D_ID */ 877 u32 peer_d_id; /* P2P peer D_ID */
910 struct ccw_device *ccw_device; /* S/390 ccw device */ 878 struct ccw_device *ccw_device; /* S/390 ccw device */
911 u8 fc_service_class;
912 u32 hydra_version; /* Hydra version */ 879 u32 hydra_version; /* Hydra version */
913 u32 fsf_lic_version; 880 u32 fsf_lic_version;
914 u32 adapter_features; /* FCP channel features */ 881 u32 adapter_features; /* FCP channel features */
915 u32 connection_features; /* host connection features */ 882 u32 connection_features; /* host connection features */
916 u32 hardware_version; /* of FCP channel */ 883 u32 hardware_version; /* of FCP channel */
917 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */ 884 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */
918 unsigned short scsi_host_no; /* Assigned host number */
919 unsigned char name[9];
920 struct list_head port_list_head; /* remote port list */ 885 struct list_head port_list_head; /* remote port list */
921 struct list_head port_remove_lh; /* head of ports to be 886 struct list_head port_remove_lh; /* head of ports to be
922 removed */ 887 removed */
@@ -994,6 +959,8 @@ struct zfcp_port {
994 u32 handle; /* handle assigned by FSF */ 959 u32 handle; /* handle assigned by FSF */
995 struct zfcp_erp_action erp_action; /* pending error recovery */ 960 struct zfcp_erp_action erp_action; /* pending error recovery */
996 atomic_t erp_counter; 961 atomic_t erp_counter;
962 u32 maxframe_size;
963 u32 supported_classes;
997}; 964};
998 965
999/* the struct device sysfs_device must be at the beginning of this structure. 966/* the struct device sysfs_device must be at the beginning of this structure.
@@ -1008,7 +975,7 @@ struct zfcp_unit {
1008 refcount drop to zero */ 975 refcount drop to zero */
1009 struct zfcp_port *port; /* remote port of unit */ 976 struct zfcp_port *port; /* remote port of unit */
1010 atomic_t status; /* status of this logical unit */ 977 atomic_t status; /* status of this logical unit */
1011 scsi_lun_t scsi_lun; /* own SCSI LUN */ 978 unsigned int scsi_lun; /* own SCSI LUN */
1012 fcp_lun_t fcp_lun; /* own FCP_LUN */ 979 fcp_lun_t fcp_lun; /* own FCP_LUN */
1013 u32 handle; /* handle assigned by FSF */ 980 u32 handle; /* handle assigned by FSF */
1014 struct scsi_device *device; /* scsi device struct pointer */ 981 struct scsi_device *device; /* scsi device struct pointer */
@@ -1052,11 +1019,6 @@ struct zfcp_data {
1052 struct list_head adapter_list_head; /* head of adapter list */ 1019 struct list_head adapter_list_head; /* head of adapter list */
1053 struct list_head adapter_remove_lh; /* head of adapters to be 1020 struct list_head adapter_remove_lh; /* head of adapters to be
1054 removed */ 1021 removed */
1055 rwlock_t status_read_lock; /* for status read thread */
1056 struct list_head status_read_receive_head;
1057 struct list_head status_read_send_head;
1058 struct semaphore status_read_sema;
1059 wait_queue_head_t status_read_thread_wqh;
1060 u32 adapters; /* # of adapters in list */ 1022 u32 adapters; /* # of adapters in list */
1061 rwlock_t config_lock; /* serialises changes 1023 rwlock_t config_lock; /* serialises changes
1062 to adapter/port/unit 1024 to adapter/port/unit
@@ -1095,9 +1057,6 @@ struct zfcp_fsf_req_pool_element {
1095 1057
1096/********************** ZFCP SPECIFIC DEFINES ********************************/ 1058/********************** ZFCP SPECIFIC DEFINES ********************************/
1097 1059
1098#define ZFCP_FSFREQ_CLEANUP_TIMEOUT HZ/10
1099
1100#define ZFCP_KNOWN 0x00000001
1101#define ZFCP_REQ_AUTO_CLEANUP 0x00000002 1060#define ZFCP_REQ_AUTO_CLEANUP 0x00000002
1102#define ZFCP_WAIT_FOR_SBAL 0x00000004 1061#define ZFCP_WAIT_FOR_SBAL 0x00000004
1103#define ZFCP_REQ_NO_QTCB 0x00000008 1062#define ZFCP_REQ_NO_QTCB 0x00000008
@@ -1105,9 +1064,6 @@ struct zfcp_fsf_req_pool_element {
1105#define ZFCP_SET 0x00000100 1064#define ZFCP_SET 0x00000100
1106#define ZFCP_CLEAR 0x00000200 1065#define ZFCP_CLEAR 0x00000200
1107 1066
1108#define ZFCP_INTERRUPTIBLE 1
1109#define ZFCP_UNINTERRUPTIBLE 0
1110
1111#ifndef atomic_test_mask 1067#ifndef atomic_test_mask
1112#define atomic_test_mask(mask, target) \ 1068#define atomic_test_mask(mask, target) \
1113 ((atomic_read(target) & mask) == mask) 1069 ((atomic_read(target) & mask) == mask)
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 57cb628a05aa..4682c8b8bd24 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.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_erp.c 3 * FCP adapters for IBM System z9 and zSeries.
4 * 4 *
5 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
6 *
7 * (C) Copyright IBM Corp. 2002, 2004
8 *
9 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
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
@@ -231,13 +221,6 @@ zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear_mask)
231 return retval; 221 return retval;
232} 222}
233 223
234/*
235 * function:
236 *
237 * purpose:
238 *
239 * returns:
240 */
241int 224int
242zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask) 225zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask)
243{ 226{
@@ -251,13 +234,6 @@ zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask)
251 return retval; 234 return retval;
252} 235}
253 236
254/*
255 * function:
256 *
257 * purpose:
258 *
259 * returns:
260 */
261int 237int
262zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask) 238zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask)
263{ 239{
@@ -271,13 +247,6 @@ zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask)
271 return retval; 247 return retval;
272} 248}
273 249
274/*
275 * function:
276 *
277 * purpose:
278 *
279 * returns:
280 */
281int 250int
282zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask) 251zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask)
283{ 252{
@@ -306,20 +275,17 @@ zfcp_erp_adisc(struct zfcp_port *port)
306 int retval = 0; 275 int retval = 0;
307 struct timer_list *timer; 276 struct timer_list *timer;
308 277
309 send_els = kmalloc(sizeof(struct zfcp_send_els), GFP_ATOMIC); 278 send_els = kzalloc(sizeof(struct zfcp_send_els), GFP_ATOMIC);
310 if (send_els == NULL) 279 if (send_els == NULL)
311 goto nomem; 280 goto nomem;
312 memset(send_els, 0, sizeof(*send_els));
313 281
314 send_els->req = kmalloc(sizeof(struct scatterlist), GFP_ATOMIC); 282 send_els->req = kzalloc(sizeof(struct scatterlist), GFP_ATOMIC);
315 if (send_els->req == NULL) 283 if (send_els->req == NULL)
316 goto nomem; 284 goto nomem;
317 memset(send_els->req, 0, sizeof(*send_els->req));
318 285
319 send_els->resp = kmalloc(sizeof(struct scatterlist), GFP_ATOMIC); 286 send_els->resp = kzalloc(sizeof(struct scatterlist), GFP_ATOMIC);
320 if (send_els->resp == NULL) 287 if (send_els->resp == NULL)
321 goto nomem; 288 goto nomem;
322 memset(send_els->resp, 0, sizeof(*send_els->resp));
323 289
324 address = (void *) get_zeroed_page(GFP_ATOMIC); 290 address = (void *) get_zeroed_page(GFP_ATOMIC);
325 if (address == NULL) 291 if (address == NULL)
@@ -812,13 +778,6 @@ zfcp_erp_unit_unblock(struct zfcp_unit *unit)
812 atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); 778 atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status);
813} 779}
814 780
815/*
816 * function:
817 *
818 * purpose:
819 *
820 * returns:
821 */
822static void 781static void
823zfcp_erp_action_ready(struct zfcp_erp_action *erp_action) 782zfcp_erp_action_ready(struct zfcp_erp_action *erp_action)
824{ 783{
@@ -1356,13 +1315,6 @@ zfcp_erp_strategy_check_action(struct zfcp_erp_action *erp_action, int retval)
1356 return retval; 1315 return retval;
1357} 1316}
1358 1317
1359/*
1360 * function:
1361 *
1362 * purpose:
1363 *
1364 * returns:
1365 */
1366static int 1318static int
1367zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) 1319zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action)
1368{ 1320{
@@ -1538,13 +1490,6 @@ zfcp_erp_strategy_check_target(struct zfcp_erp_action *erp_action, int result)
1538 return result; 1490 return result;
1539} 1491}
1540 1492
1541/*
1542 * function:
1543 *
1544 * purpose:
1545 *
1546 * returns:
1547 */
1548static int 1493static int
1549zfcp_erp_strategy_statechange(int action, 1494zfcp_erp_strategy_statechange(int action,
1550 u32 status, 1495 u32 status,
@@ -1586,13 +1531,6 @@ zfcp_erp_strategy_statechange(int action,
1586 return retval; 1531 return retval;
1587} 1532}
1588 1533
1589/*
1590 * function:
1591 *
1592 * purpose:
1593 *
1594 * returns:
1595 */
1596static inline int 1534static inline int
1597zfcp_erp_strategy_statechange_detected(atomic_t * target_status, u32 erp_status) 1535zfcp_erp_strategy_statechange_detected(atomic_t * target_status, u32 erp_status)
1598{ 1536{
@@ -1605,13 +1543,6 @@ zfcp_erp_strategy_statechange_detected(atomic_t * target_status, u32 erp_status)
1605 !(ZFCP_STATUS_ERP_CLOSE_ONLY & erp_status)); 1543 !(ZFCP_STATUS_ERP_CLOSE_ONLY & erp_status));
1606} 1544}
1607 1545
1608/*
1609 * function:
1610 *
1611 * purpose:
1612 *
1613 * returns:
1614 */
1615static int 1546static int
1616zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) 1547zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result)
1617{ 1548{
@@ -1642,13 +1573,6 @@ zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result)
1642 return result; 1573 return result;
1643} 1574}
1644 1575
1645/*
1646 * function:
1647 *
1648 * purpose:
1649 *
1650 * returns:
1651 */
1652static int 1576static int
1653zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) 1577zfcp_erp_strategy_check_port(struct zfcp_port *port, int result)
1654{ 1578{
@@ -1678,13 +1602,6 @@ zfcp_erp_strategy_check_port(struct zfcp_port *port, int result)
1678 return result; 1602 return result;
1679} 1603}
1680 1604
1681/*
1682 * function:
1683 *
1684 * purpose:
1685 *
1686 * returns:
1687 */
1688static int 1605static int
1689zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result) 1606zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result)
1690{ 1607{
@@ -1764,13 +1681,6 @@ zfcp_erp_strategy_followup_actions(int action,
1764 return 0; 1681 return 0;
1765} 1682}
1766 1683
1767/*
1768 * function:
1769 *
1770 * purpose:
1771 *
1772 * returns:
1773 */
1774static int 1684static int
1775zfcp_erp_strategy_check_queues(struct zfcp_adapter *adapter) 1685zfcp_erp_strategy_check_queues(struct zfcp_adapter *adapter)
1776{ 1686{
@@ -1809,12 +1719,6 @@ zfcp_erp_wait(struct zfcp_adapter *adapter)
1809 return retval; 1719 return retval;
1810} 1720}
1811 1721
1812/*
1813 * function: zfcp_erp_modify_adapter_status
1814 *
1815 * purpose:
1816 *
1817 */
1818void 1722void
1819zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, 1723zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter,
1820 u32 mask, int set_or_clear) 1724 u32 mask, int set_or_clear)
@@ -1919,13 +1823,6 @@ zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, int clear_mask)
1919 return retval; 1823 return retval;
1920} 1824}
1921 1825
1922/*
1923 * function:
1924 *
1925 * purpose:
1926 *
1927 * returns: FIXME
1928 */
1929static int 1826static int
1930zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, int clear_mask) 1827zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, int clear_mask)
1931{ 1828{
@@ -2370,13 +2267,6 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)
2370 return ret; 2267 return ret;
2371} 2268}
2372 2269
2373/*
2374 * function:
2375 *
2376 * purpose:
2377 *
2378 * returns:
2379 */
2380static int 2270static int
2381zfcp_erp_adapter_strategy_open_fsf_statusread(struct zfcp_erp_action 2271zfcp_erp_adapter_strategy_open_fsf_statusread(struct zfcp_erp_action
2382 *erp_action) 2272 *erp_action)
@@ -2545,13 +2435,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action)
2545 return retval; 2435 return retval;
2546} 2436}
2547 2437
2548/*
2549 * function:
2550 *
2551 * purpose:
2552 *
2553 * returns:
2554 */
2555static int 2438static int
2556zfcp_erp_port_strategy_open(struct zfcp_erp_action *erp_action) 2439zfcp_erp_port_strategy_open(struct zfcp_erp_action *erp_action)
2557{ 2440{
@@ -2566,15 +2449,6 @@ zfcp_erp_port_strategy_open(struct zfcp_erp_action *erp_action)
2566 return retval; 2449 return retval;
2567} 2450}
2568 2451
2569/*
2570 * function:
2571 *
2572 * purpose:
2573 *
2574 * returns:
2575 *
2576 * FIXME(design): currently only prepared for fabric (nameserver!)
2577 */
2578static int 2452static int
2579zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) 2453zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
2580{ 2454{
@@ -2690,13 +2564,6 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
2690 return retval; 2564 return retval;
2691} 2565}
2692 2566
2693/*
2694 * function:
2695 *
2696 * purpose:
2697 *
2698 * returns:
2699 */
2700static int 2567static int
2701zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action) 2568zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action)
2702{ 2569{
@@ -2813,13 +2680,6 @@ zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *erp_action)
2813 return retval; 2680 return retval;
2814} 2681}
2815 2682
2816/*
2817 * function:
2818 *
2819 * purpose:
2820 *
2821 * returns:
2822 */
2823static int 2683static int
2824zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) 2684zfcp_erp_port_strategy_clearstati(struct zfcp_port *port)
2825{ 2685{
@@ -3022,13 +2882,6 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action)
3022 return retval; 2882 return retval;
3023} 2883}
3024 2884
3025/*
3026 * function:
3027 *
3028 * purpose:
3029 *
3030 * returns:
3031 */
3032static int 2885static int
3033zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *unit) 2886zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *unit)
3034{ 2887{
@@ -3129,13 +2982,6 @@ zfcp_erp_unit_strategy_open(struct zfcp_erp_action *erp_action)
3129 return retval; 2982 return retval;
3130} 2983}
3131 2984
3132/*
3133 * function:
3134 *
3135 * purpose:
3136 *
3137 * returns:
3138 */
3139static inline void 2985static inline void
3140zfcp_erp_timeout_init(struct zfcp_erp_action *erp_action) 2986zfcp_erp_timeout_init(struct zfcp_erp_action *erp_action)
3141{ 2987{
@@ -3331,13 +3177,6 @@ zfcp_erp_action_enqueue(int action,
3331 return retval; 3177 return retval;
3332} 3178}
3333 3179
3334/*
3335 * function:
3336 *
3337 * purpose:
3338 *
3339 * returns:
3340 */
3341static int 3180static int
3342zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) 3181zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action)
3343{ 3182{
@@ -3402,9 +3241,13 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
3402 break; 3241 break;
3403 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: 3242 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
3404 case ZFCP_ERP_ACTION_REOPEN_PORT: 3243 case ZFCP_ERP_ACTION_REOPEN_PORT:
3244 if (atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN,
3245 &port->status)) {
3246 zfcp_port_put(port);
3247 break;
3248 }
3249
3405 if ((result == ZFCP_ERP_SUCCEEDED) 3250 if ((result == ZFCP_ERP_SUCCEEDED)
3406 && !atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN,
3407 &port->status)
3408 && !port->rport) { 3251 && !port->rport) {
3409 struct fc_rport_identifiers ids; 3252 struct fc_rport_identifiers ids;
3410 ids.node_name = port->wwnn; 3253 ids.node_name = port->wwnn;
@@ -3418,12 +3261,30 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
3418 "(adapter %s, wwpn=0x%016Lx)\n", 3261 "(adapter %s, wwpn=0x%016Lx)\n",
3419 zfcp_get_busid_by_port(port), 3262 zfcp_get_busid_by_port(port),
3420 port->wwpn); 3263 port->wwpn);
3421 else 3264 else {
3422 scsi_flush_work(adapter->scsi_host); 3265 scsi_flush_work(adapter->scsi_host);
3266 port->rport->maxframe_size = port->maxframe_size;
3267 port->rport->supported_classes =
3268 port->supported_classes;
3269 }
3270 }
3271 if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) {
3272 fc_remote_port_delete(port->rport);
3273 port->rport = NULL;
3423 } 3274 }
3424 zfcp_port_put(port); 3275 zfcp_port_put(port);
3425 break; 3276 break;
3426 case ZFCP_ERP_ACTION_REOPEN_ADAPTER: 3277 case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
3278 if (result != ZFCP_ERP_SUCCEEDED) {
3279 struct zfcp_port *port;
3280 list_for_each_entry(port, &adapter->port_list_head, list)
3281 if (port->rport &&
3282 !atomic_test_mask(ZFCP_STATUS_PORT_WKA,
3283 &port->status)) {
3284 fc_remote_port_delete(port->rport);
3285 port->rport = NULL;
3286 }
3287 }
3427 zfcp_adapter_put(adapter); 3288 zfcp_adapter_put(adapter);
3428 break; 3289 break;
3429 default: 3290 default:
@@ -3432,13 +3293,6 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
3432} 3293}
3433 3294
3434 3295
3435/*
3436 * function:
3437 *
3438 * purpose:
3439 *
3440 * returns: FIXME
3441 */
3442static int 3296static int
3443zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter) 3297zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter)
3444{ 3298{
@@ -3455,13 +3309,6 @@ zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter)
3455 return retval; 3309 return retval;
3456} 3310}
3457 3311
3458/*
3459 * function:
3460 *
3461 * purpose:
3462 *
3463 * returns: FIXME
3464 */
3465static int 3312static int
3466zfcp_erp_action_dismiss_port(struct zfcp_port *port) 3313zfcp_erp_action_dismiss_port(struct zfcp_port *port)
3467{ 3314{
@@ -3480,13 +3327,6 @@ zfcp_erp_action_dismiss_port(struct zfcp_port *port)
3480 return retval; 3327 return retval;
3481} 3328}
3482 3329
3483/*
3484 * function:
3485 *
3486 * purpose:
3487 *
3488 * returns: FIXME
3489 */
3490static int 3330static int
3491zfcp_erp_action_dismiss_unit(struct zfcp_unit *unit) 3331zfcp_erp_action_dismiss_unit(struct zfcp_unit *unit)
3492{ 3332{
@@ -3501,13 +3341,6 @@ zfcp_erp_action_dismiss_unit(struct zfcp_unit *unit)
3501 return retval; 3341 return retval;
3502} 3342}
3503 3343
3504/*
3505 * function:
3506 *
3507 * purpose: moves erp_action to 'erp running list'
3508 *
3509 * returns:
3510 */
3511static inline void 3344static inline void
3512zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) 3345zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action)
3513{ 3346{
@@ -3518,13 +3351,6 @@ zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action)
3518 list_move(&erp_action->list, &erp_action->adapter->erp_running_head); 3351 list_move(&erp_action->list, &erp_action->adapter->erp_running_head);
3519} 3352}
3520 3353
3521/*
3522 * function:
3523 *
3524 * purpose: moves erp_action to 'erp ready list'
3525 *
3526 * returns:
3527 */
3528static inline void 3354static inline void
3529zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) 3355zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action)
3530{ 3356{
@@ -3535,11 +3361,6 @@ zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action)
3535 list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); 3361 list_move(&erp_action->list, &erp_action->adapter->erp_ready_head);
3536} 3362}
3537 3363
3538/*
3539 * function: zfcp_erp_port_boxed
3540 *
3541 * purpose:
3542 */
3543void 3364void
3544zfcp_erp_port_boxed(struct zfcp_port *port) 3365zfcp_erp_port_boxed(struct zfcp_port *port)
3545{ 3366{
@@ -3556,11 +3377,6 @@ zfcp_erp_port_boxed(struct zfcp_port *port)
3556 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); 3377 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
3557} 3378}
3558 3379
3559/*
3560 * function: zfcp_erp_unit_boxed
3561 *
3562 * purpose:
3563 */
3564void 3380void
3565zfcp_erp_unit_boxed(struct zfcp_unit *unit) 3381zfcp_erp_unit_boxed(struct zfcp_unit *unit)
3566{ 3382{
@@ -3574,11 +3390,6 @@ zfcp_erp_unit_boxed(struct zfcp_unit *unit)
3574 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); 3390 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED);
3575} 3391}
3576 3392
3577/*
3578 * function: zfcp_erp_port_access_denied
3579 *
3580 * purpose:
3581 */
3582void 3393void
3583zfcp_erp_port_access_denied(struct zfcp_port *port) 3394zfcp_erp_port_access_denied(struct zfcp_port *port)
3584{ 3395{
@@ -3595,11 +3406,6 @@ zfcp_erp_port_access_denied(struct zfcp_port *port)
3595 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3406 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3596} 3407}
3597 3408
3598/*
3599 * function: zfcp_erp_unit_access_denied
3600 *
3601 * purpose:
3602 */
3603void 3409void
3604zfcp_erp_unit_access_denied(struct zfcp_unit *unit) 3410zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
3605{ 3411{
@@ -3613,11 +3419,6 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
3613 ZFCP_SET); 3419 ZFCP_SET);
3614} 3420}
3615 3421
3616/*
3617 * function: zfcp_erp_adapter_access_changed
3618 *
3619 * purpose:
3620 */
3621void 3422void
3622zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) 3423zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
3623{ 3424{
@@ -3628,7 +3429,7 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
3628 return; 3429 return;
3629 3430
3630 debug_text_event(adapter->erp_dbf, 3, "a_access_recover"); 3431 debug_text_event(adapter->erp_dbf, 3, "a_access_recover");
3631 debug_event(adapter->erp_dbf, 3, &adapter->name, 8); 3432 debug_event(adapter->erp_dbf, 3, zfcp_get_busid_by_adapter(adapter), 8);
3632 3433
3633 read_lock_irqsave(&zfcp_data.config_lock, flags); 3434 read_lock_irqsave(&zfcp_data.config_lock, flags);
3634 if (adapter->nameserver_port) 3435 if (adapter->nameserver_port)
@@ -3639,11 +3440,6 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
3639 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3440 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3640} 3441}
3641 3442
3642/*
3643 * function: zfcp_erp_port_access_changed
3644 *
3645 * purpose:
3646 */
3647void 3443void
3648zfcp_erp_port_access_changed(struct zfcp_port *port) 3444zfcp_erp_port_access_changed(struct zfcp_port *port)
3649{ 3445{
@@ -3672,11 +3468,6 @@ zfcp_erp_port_access_changed(struct zfcp_port *port)
3672 zfcp_get_busid_by_adapter(adapter), port->wwpn); 3468 zfcp_get_busid_by_adapter(adapter), port->wwpn);
3673} 3469}
3674 3470
3675/*
3676 * function: zfcp_erp_unit_access_changed
3677 *
3678 * purpose:
3679 */
3680void 3471void
3681zfcp_erp_unit_access_changed(struct zfcp_unit *unit) 3472zfcp_erp_unit_access_changed(struct zfcp_unit *unit)
3682{ 3473{
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 700f5402a978..d02366004cdd 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -1,18 +1,8 @@
1/* 1/*
2 * 2 * This file is part of the zfcp device driver for
3 * linux/drivers/s390/scsi/zfcp_ext.h 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
@@ -125,6 +115,7 @@ extern int zfcp_nameserver_enqueue(struct zfcp_adapter *);
125extern int zfcp_ns_gid_pn_request(struct zfcp_erp_action *); 115extern int zfcp_ns_gid_pn_request(struct zfcp_erp_action *);
126extern int zfcp_check_ct_response(struct ct_hdr *); 116extern int zfcp_check_ct_response(struct ct_hdr *);
127extern int zfcp_handle_els_rjt(u32, struct zfcp_ls_rjt_par *); 117extern int zfcp_handle_els_rjt(u32, struct zfcp_ls_rjt_par *);
118extern void zfcp_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *);
128 119
129/******************************* SCSI ****************************************/ 120/******************************* SCSI ****************************************/
130extern int zfcp_adapter_scsi_register(struct zfcp_adapter *); 121extern int zfcp_adapter_scsi_register(struct zfcp_adapter *);
@@ -141,8 +132,6 @@ extern int zfcp_scsi_command_async(struct zfcp_adapter *,struct zfcp_unit *,
141 struct scsi_cmnd *, struct timer_list *); 132 struct scsi_cmnd *, struct timer_list *);
142extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, 133extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *,
143 struct timer_list *); 134 struct timer_list *);
144extern void zfcp_set_fc_host_attrs(struct zfcp_adapter *);
145extern void zfcp_set_fc_rport_attrs(struct zfcp_port *);
146extern struct scsi_transport_template *zfcp_transport_template; 135extern struct scsi_transport_template *zfcp_transport_template;
147extern struct fc_function_template zfcp_transport_functions; 136extern struct fc_function_template zfcp_transport_functions;
148 137
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 662ec571d73b..6335f9229184 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -1,19 +1,8 @@
1/* 1/*
2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
2 * 4 *
3 * linux/drivers/s390/scsi/zfcp_fsf.c 5 * (C) Copyright IBM Corp. 2002, 2006
4 *
5 * FCP adapter driver for IBM eServer zSeries
6 *
7 * (C) Copyright IBM Corp. 2002, 2004
8 *
9 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
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 * Volker Sameske <sameske@de.ibm.com>
17 * 6 *
18 * 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
19 * 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
@@ -877,6 +866,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
877 struct zfcp_adapter *adapter = fsf_req->adapter; 866 struct zfcp_adapter *adapter = fsf_req->adapter;
878 struct fsf_status_read_buffer *status_buffer = 867 struct fsf_status_read_buffer *status_buffer =
879 (struct fsf_status_read_buffer *) fsf_req->data; 868 (struct fsf_status_read_buffer *) fsf_req->data;
869 struct fsf_bit_error_payload *fsf_bit_error;
880 870
881 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { 871 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
882 zfcp_hba_dbf_event_fsf_unsol("dism", adapter, status_buffer); 872 zfcp_hba_dbf_event_fsf_unsol("dism", adapter, status_buffer);
@@ -903,10 +893,37 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
903 break; 893 break;
904 894
905 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: 895 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
906 ZFCP_LOG_NORMAL("Bit error threshold data received:\n"); 896 fsf_bit_error = (struct fsf_bit_error_payload *)
907 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, 897 status_buffer->payload;
908 (char *) status_buffer, 898 ZFCP_LOG_NORMAL("Warning: bit error threshold data "
909 sizeof (struct fsf_status_read_buffer)); 899 "received (adapter %s, "
900 "link failures = %i, loss of sync errors = %i, "
901 "loss of signal errors = %i, "
902 "primitive sequence errors = %i, "
903 "invalid transmission word errors = %i, "
904 "CRC errors = %i)\n",
905 zfcp_get_busid_by_adapter(adapter),
906 fsf_bit_error->link_failure_error_count,
907 fsf_bit_error->loss_of_sync_error_count,
908 fsf_bit_error->loss_of_signal_error_count,
909 fsf_bit_error->primitive_sequence_error_count,
910 fsf_bit_error->invalid_transmission_word_error_count,
911 fsf_bit_error->crc_error_count);
912 ZFCP_LOG_INFO("Additional bit error threshold data "
913 "(adapter %s, "
914 "primitive sequence event time-outs = %i, "
915 "elastic buffer overrun errors = %i, "
916 "advertised receive buffer-to-buffer credit = %i, "
917 "current receice buffer-to-buffer credit = %i, "
918 "advertised transmit buffer-to-buffer credit = %i, "
919 "current transmit buffer-to-buffer credit = %i)\n",
920 zfcp_get_busid_by_adapter(adapter),
921 fsf_bit_error->primitive_sequence_event_timeout_count,
922 fsf_bit_error->elastic_buffer_overrun_error_count,
923 fsf_bit_error->advertised_receive_b2b_credit,
924 fsf_bit_error->current_receive_b2b_credit,
925 fsf_bit_error->advertised_transmit_b2b_credit,
926 fsf_bit_error->current_transmit_b2b_credit);
910 break; 927 break;
911 928
912 case FSF_STATUS_READ_LINK_DOWN: 929 case FSF_STATUS_READ_LINK_DOWN:
@@ -1427,7 +1444,8 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
1427 1444
1428 /* settings in QTCB */ 1445 /* settings in QTCB */
1429 fsf_req->qtcb->header.port_handle = port->handle; 1446 fsf_req->qtcb->header.port_handle = port->handle;
1430 fsf_req->qtcb->bottom.support.service_class = adapter->fc_service_class; 1447 fsf_req->qtcb->bottom.support.service_class =
1448 ZFCP_FC_SERVICE_CLASS_DEFAULT;
1431 fsf_req->qtcb->bottom.support.timeout = ct->timeout; 1449 fsf_req->qtcb->bottom.support.timeout = ct->timeout;
1432 fsf_req->data = (unsigned long) ct; 1450 fsf_req->data = (unsigned long) ct;
1433 1451
@@ -1496,18 +1514,10 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1496 break; 1514 break;
1497 1515
1498 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1516 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1499 if (adapter->fc_service_class <= 3) { 1517 ZFCP_LOG_INFO("error: adapter %s does not support fc "
1500 ZFCP_LOG_INFO("error: adapter %s does not support fc " 1518 "class %d.\n",
1501 "class %d.\n", 1519 zfcp_get_busid_by_port(port),
1502 zfcp_get_busid_by_port(port), 1520 ZFCP_FC_SERVICE_CLASS_DEFAULT);
1503 adapter->fc_service_class);
1504 } else {
1505 ZFCP_LOG_INFO("bug: The fibre channel class at the "
1506 "adapter %s is invalid. "
1507 "(debug info %d)\n",
1508 zfcp_get_busid_by_port(port),
1509 adapter->fc_service_class);
1510 }
1511 /* stop operation for this adapter */ 1521 /* stop operation for this adapter */
1512 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); 1522 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");
1513 zfcp_erp_adapter_shutdown(adapter, 0); 1523 zfcp_erp_adapter_shutdown(adapter, 0);
@@ -1730,7 +1740,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1730 1740
1731 /* settings in QTCB */ 1741 /* settings in QTCB */
1732 fsf_req->qtcb->bottom.support.d_id = d_id; 1742 fsf_req->qtcb->bottom.support.d_id = d_id;
1733 fsf_req->qtcb->bottom.support.service_class = adapter->fc_service_class; 1743 fsf_req->qtcb->bottom.support.service_class =
1744 ZFCP_FC_SERVICE_CLASS_DEFAULT;
1734 fsf_req->qtcb->bottom.support.timeout = ZFCP_ELS_TIMEOUT; 1745 fsf_req->qtcb->bottom.support.timeout = ZFCP_ELS_TIMEOUT;
1735 fsf_req->data = (unsigned long) els; 1746 fsf_req->data = (unsigned long) els;
1736 1747
@@ -1800,18 +1811,10 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1800 break; 1811 break;
1801 1812
1802 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1813 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1803 if (adapter->fc_service_class <= 3) { 1814 ZFCP_LOG_INFO("error: adapter %s does not support fc "
1804 ZFCP_LOG_INFO("error: adapter %s does " 1815 "class %d.\n",
1805 "not support fibrechannel class %d.\n", 1816 zfcp_get_busid_by_adapter(adapter),
1806 zfcp_get_busid_by_adapter(adapter), 1817 ZFCP_FC_SERVICE_CLASS_DEFAULT);
1807 adapter->fc_service_class);
1808 } else {
1809 ZFCP_LOG_INFO("bug: The fibrechannel class at "
1810 "adapter %s is invalid. "
1811 "(debug info %d)\n",
1812 zfcp_get_busid_by_adapter(adapter),
1813 adapter->fc_service_class);
1814 }
1815 /* stop operation for this adapter */ 1818 /* stop operation for this adapter */
1816 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); 1819 debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");
1817 zfcp_erp_adapter_shutdown(adapter, 0); 1820 zfcp_erp_adapter_shutdown(adapter, 0);
@@ -1940,14 +1943,6 @@ skip_fsfstatus:
1940 return retval; 1943 return retval;
1941} 1944}
1942 1945
1943/*
1944 * function:
1945 *
1946 * purpose:
1947 *
1948 * returns: address of initiated FSF request
1949 * NULL - request could not be initiated
1950 */
1951int 1946int
1952zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) 1947zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
1953{ 1948{
@@ -2565,8 +2560,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2565 if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status)) 2560 if (!atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, &port->status))
2566 { 2561 {
2567 if (fsf_req->qtcb->bottom.support.els1_length < 2562 if (fsf_req->qtcb->bottom.support.els1_length <
2568 ((((unsigned long) &plogi->serv_param.wwpn) - 2563 sizeof (struct fsf_plogi)) {
2569 ((unsigned long) plogi)) + sizeof (u64))) {
2570 ZFCP_LOG_INFO( 2564 ZFCP_LOG_INFO(
2571 "warning: insufficient length of " 2565 "warning: insufficient length of "
2572 "PLOGI payload (%i)\n", 2566 "PLOGI payload (%i)\n",
@@ -2585,8 +2579,10 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2585 atomic_clear_mask( 2579 atomic_clear_mask(
2586 ZFCP_STATUS_PORT_DID_DID, 2580 ZFCP_STATUS_PORT_DID_DID,
2587 &port->status); 2581 &port->status);
2588 } else 2582 } else {
2589 port->wwnn = plogi->serv_param.wwnn; 2583 port->wwnn = plogi->serv_param.wwnn;
2584 zfcp_plogi_evaluate(port, plogi);
2585 }
2590 } 2586 }
2591 } 2587 }
2592 break; 2588 break;
@@ -2993,8 +2989,8 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
2993 erp_action->fsf_req->qtcb->bottom.support.fcp_lun = 2989 erp_action->fsf_req->qtcb->bottom.support.fcp_lun =
2994 erp_action->unit->fcp_lun; 2990 erp_action->unit->fcp_lun;
2995 if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE)) 2991 if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE))
2996 erp_action->fsf_req->qtcb->bottom.support.option = 2992 erp_action->fsf_req->qtcb->bottom.support.option =
2997 FSF_OPEN_LUN_SUPPRESS_BOXING; 2993 FSF_OPEN_LUN_SUPPRESS_BOXING;
2998 atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); 2994 atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status);
2999 erp_action->fsf_req->data = (unsigned long) erp_action->unit; 2995 erp_action->fsf_req->data = (unsigned long) erp_action->unit;
3000 erp_action->fsf_req->erp_action = erp_action; 2996 erp_action->fsf_req->erp_action = erp_action;
@@ -3569,7 +3565,7 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3569 } 3565 }
3570 3566
3571 /* set FC service class in QTCB (3 per default) */ 3567 /* set FC service class in QTCB (3 per default) */
3572 fsf_req->qtcb->bottom.io.service_class = adapter->fc_service_class; 3568 fsf_req->qtcb->bottom.io.service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
3573 3569
3574 /* set FCP_LUN in FCP_CMND IU in QTCB */ 3570 /* set FCP_LUN in FCP_CMND IU in QTCB */
3575 fcp_cmnd_iu->fcp_lun = unit->fcp_lun; 3571 fcp_cmnd_iu->fcp_lun = unit->fcp_lun;
@@ -3667,18 +3663,6 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3667 return retval; 3663 return retval;
3668} 3664}
3669 3665
3670/*
3671 * function: zfcp_fsf_send_fcp_command_task_management
3672 *
3673 * purpose:
3674 *
3675 * returns:
3676 *
3677 * FIXME(design): should be watched by a timeout!!!
3678 * FIXME(design) shouldn't this be modified to return an int
3679 * also...don't know how though
3680 *
3681 */
3682struct zfcp_fsf_req * 3666struct zfcp_fsf_req *
3683zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter, 3667zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
3684 struct zfcp_unit *unit, 3668 struct zfcp_unit *unit,
@@ -3720,7 +3704,7 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
3720 fsf_req->qtcb->header.lun_handle = unit->handle; 3704 fsf_req->qtcb->header.lun_handle = unit->handle;
3721 fsf_req->qtcb->header.port_handle = unit->port->handle; 3705 fsf_req->qtcb->header.port_handle = unit->port->handle;
3722 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 3706 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
3723 fsf_req->qtcb->bottom.io.service_class = adapter->fc_service_class; 3707 fsf_req->qtcb->bottom.io.service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
3724 fsf_req->qtcb->bottom.io.fcp_cmnd_length = 3708 fsf_req->qtcb->bottom.io.fcp_cmnd_length =
3725 sizeof (struct fcp_cmnd_iu) + sizeof (fcp_dl_t); 3709 sizeof (struct fcp_cmnd_iu) + sizeof (fcp_dl_t);
3726 3710
@@ -3843,18 +3827,10 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3843 break; 3827 break;
3844 3828
3845 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 3829 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
3846 if (fsf_req->adapter->fc_service_class <= 3) { 3830 ZFCP_LOG_INFO("error: adapter %s does not support fc "
3847 ZFCP_LOG_NORMAL("error: The adapter %s does " 3831 "class %d.\n",
3848 "not support fibrechannel class %d.\n", 3832 zfcp_get_busid_by_unit(unit),
3849 zfcp_get_busid_by_unit(unit), 3833 ZFCP_FC_SERVICE_CLASS_DEFAULT);
3850 fsf_req->adapter->fc_service_class);
3851 } else {
3852 ZFCP_LOG_NORMAL("bug: The fibrechannel class at "
3853 "adapter %s is invalid. "
3854 "(debug info %d)\n",
3855 zfcp_get_busid_by_unit(unit),
3856 fsf_req->adapter->fc_service_class);
3857 }
3858 /* stop operation for this adapter */ 3834 /* stop operation for this adapter */
3859 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 3835 debug_text_exception(fsf_req->adapter->erp_dbf, 0,
3860 "fsf_s_class_nsup"); 3836 "fsf_s_class_nsup");
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h
index e734415cae6d..71186618947c 100644
--- a/drivers/s390/scsi/zfcp_fsf.h
+++ b/drivers/s390/scsi/zfcp_fsf.h
@@ -1,19 +1,8 @@
1/* 1/*
2 * 2 * This file is part of the zfcp device driver for
3 * linux/drivers/s390/scsi/zfcp_fsf.h 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 * Volker Sameske <sameske@de.ibm.com>
17 * 6 *
18 * 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
19 * 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
@@ -33,8 +22,7 @@
33#ifndef FSF_H 22#ifndef FSF_H
34#define FSF_H 23#define FSF_H
35 24
36#define FSF_QTCB_VERSION1 0x00000001 25#define FSF_QTCB_CURRENT_VERSION 0x00000001
37#define FSF_QTCB_CURRENT_VERSION FSF_QTCB_VERSION1
38 26
39/* FSF commands */ 27/* FSF commands */
40#define FSF_QTCB_FCP_CMND 0x00000001 28#define FSF_QTCB_FCP_CMND 0x00000001
@@ -64,7 +52,7 @@
64#define FSF_CFDC_OPTION_FULL_ACCESS 0x00000002 52#define FSF_CFDC_OPTION_FULL_ACCESS 0x00000002
65#define FSF_CFDC_OPTION_RESTRICTED_ACCESS 0x00000004 53#define FSF_CFDC_OPTION_RESTRICTED_ACCESS 0x00000004
66 54
67/* FSF protocol stati */ 55/* FSF protocol states */
68#define FSF_PROT_GOOD 0x00000001 56#define FSF_PROT_GOOD 0x00000001
69#define FSF_PROT_QTCB_VERSION_ERROR 0x00000010 57#define FSF_PROT_QTCB_VERSION_ERROR 0x00000010
70#define FSF_PROT_SEQ_NUMB_ERROR 0x00000020 58#define FSF_PROT_SEQ_NUMB_ERROR 0x00000020
@@ -76,7 +64,7 @@
76#define FSF_PROT_REEST_QUEUE 0x00000800 64#define FSF_PROT_REEST_QUEUE 0x00000800
77#define FSF_PROT_ERROR_STATE 0x01000000 65#define FSF_PROT_ERROR_STATE 0x01000000
78 66
79/* FSF stati */ 67/* FSF states */
80#define FSF_GOOD 0x00000000 68#define FSF_GOOD 0x00000000
81#define FSF_PORT_ALREADY_OPEN 0x00000001 69#define FSF_PORT_ALREADY_OPEN 0x00000001
82#define FSF_LUN_ALREADY_OPEN 0x00000002 70#define FSF_LUN_ALREADY_OPEN 0x00000002
@@ -269,20 +257,6 @@
269#define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000 257#define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000
270#define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000 258#define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000
271 259
272struct fsf_queue_designator;
273struct fsf_status_read_buffer;
274struct fsf_port_closed_payload;
275struct fsf_bit_error_payload;
276union fsf_prot_status_qual;
277struct fsf_qual_version_error;
278struct fsf_qual_sequence_error;
279struct fsf_qtcb_prefix;
280struct fsf_qtcb_header;
281struct fsf_qtcb_bottom_config;
282struct fsf_qtcb_bottom_support;
283struct fsf_qtcb_bottom_io;
284union fsf_qtcb_bottom;
285
286struct fsf_queue_designator { 260struct fsf_queue_designator {
287 u8 cssid; 261 u8 cssid;
288 u8 chpid; 262 u8 chpid;
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 1c3275163c91..345a191926a4 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -1,18 +1,8 @@
1/* 1/*
2 * linux/drivers/s390/scsi/zfcp_qdio.c 2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
3 * 4 *
4 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
5 *
6 * QDIO related routines
7 *
8 * (C) Copyright IBM Corp. 2002, 2004
9 *
10 * Authors:
11 * Martin Peschke <mpeschke@de.ibm.com>
12 * Raimund Schroeder <raimund.schroeder@de.ibm.com>
13 * Wolfgang Taphorn
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
@@ -178,7 +168,8 @@ zfcp_qdio_allocate(struct zfcp_adapter *adapter)
178 168
179 init_data->cdev = adapter->ccw_device; 169 init_data->cdev = adapter->ccw_device;
180 init_data->q_format = QDIO_SCSI_QFMT; 170 init_data->q_format = QDIO_SCSI_QFMT;
181 memcpy(init_data->adapter_name, &adapter->name, 8); 171 memcpy(init_data->adapter_name, zfcp_get_busid_by_adapter(adapter), 8);
172 ASCEBC(init_data->adapter_name, 8);
182 init_data->qib_param_field_format = 0; 173 init_data->qib_param_field_format = 0;
183 init_data->qib_param_field = NULL; 174 init_data->qib_param_field = NULL;
184 init_data->input_slib_elements = NULL; 175 init_data->input_slib_elements = NULL;
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 9e6d07d7b3c8..46e14f22ec18 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,
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c
index b29ac25e07f3..705c6d4428f3 100644
--- a/drivers/s390/scsi/zfcp_sysfs_adapter.c
+++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c
@@ -1,16 +1,8 @@
1/* 1/*
2 * linux/drivers/s390/scsi/zfcp_sysfs_adapter.c 2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
3 * 4 *
4 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
5 *
6 * sysfs adapter related routines
7 *
8 * (C) Copyright IBM Corp. 2003, 2004
9 *
10 * Authors:
11 * Martin Peschke <mpeschke@de.ibm.com>
12 * Heiko Carstens <heiko.carstens@de.ibm.com>
13 * Andreas Herrmann <aherrman@de.ibm.com>
14 * 6 *
15 * 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
16 * 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
diff --git a/drivers/s390/scsi/zfcp_sysfs_driver.c b/drivers/s390/scsi/zfcp_sysfs_driver.c
index 6622d55e0a45..005e62f8593b 100644
--- a/drivers/s390/scsi/zfcp_sysfs_driver.c
+++ b/drivers/s390/scsi/zfcp_sysfs_driver.c
@@ -1,16 +1,8 @@
1/* 1/*
2 * linux/drivers/s390/scsi/zfcp_sysfs_driver.c 2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
3 * 4 *
4 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
5 *
6 * sysfs driver related routines
7 *
8 * (C) Copyright IBM Corp. 2003, 2004
9 *
10 * Authors:
11 * Martin Peschke <mpeschke@de.ibm.com>
12 * Heiko Carstens <heiko.carstens@de.ibm.com>
13 * Andreas Herrmann <aherrman@de.ibm.com>
14 * 6 *
15 * 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
16 * 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
diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c
index f401d42db21c..1320c0591431 100644
--- a/drivers/s390/scsi/zfcp_sysfs_port.c
+++ b/drivers/s390/scsi/zfcp_sysfs_port.c
@@ -1,17 +1,8 @@
1/* 1/*
2 * linux/drivers/s390/scsi/zfcp_sysfs_port.c 2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
3 * 4 *
4 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
5 *
6 * sysfs port related routines
7 *
8 * (C) Copyright IBM Corp. 2003, 2004
9 *
10 * Authors:
11 * Martin Peschke <mpeschke@de.ibm.com>
12 * Heiko Carstens <heiko.carstens@de.ibm.com>
13 * Andreas Herrmann <aherrman@de.ibm.com>
14 * Volker Sameske <sameske@de.ibm.com>
15 * 6 *
16 * 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
17 * 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
diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c
index ad5dfb889bee..81a484175863 100644
--- a/drivers/s390/scsi/zfcp_sysfs_unit.c
+++ b/drivers/s390/scsi/zfcp_sysfs_unit.c
@@ -1,17 +1,8 @@
1/* 1/*
2 * linux/drivers/s390/scsi/zfcp_sysfs_unit.c 2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
3 * 4 *
4 * FCP adapter driver for IBM eServer zSeries 5 * (C) Copyright IBM Corp. 2002, 2006
5 *
6 * sysfs unit related routines
7 *
8 * (C) Copyright IBM Corp. 2003, 2004
9 *
10 * Authors:
11 * Martin Peschke <mpeschke@de.ibm.com>
12 * Heiko Carstens <heiko.carstens@de.ibm.com>
13 * Andreas Herrmann <aherrman@de.ibm.com>
14 * Volker Sameske <sameske@de.ibm.com>
15 * 6 *
16 * 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
17 * 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