aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:18 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:53 -0400
commit7ba58c9cc16d296290fe645acb11db2b01276544 (patch)
tree7dabe15082a18e3b5e449c6dad37f7d20ba95e64 /drivers/s390
parent5ab944f97e09a3d52951fe903eed9a7b88d810b2 (diff)
[SCSI] zfcp: remove all typedefs and replace them with standards
Remove typedefs from zfcp, use already existing types instead. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c21
-rw-r--r--drivers/s390/scsi/zfcp_def.h39
-rw-r--r--drivers/s390/scsi/zfcp_erp.c10
-rw-r--r--drivers/s390/scsi/zfcp_ext.h11
-rw-r--r--drivers/s390/scsi/zfcp_fc.c2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c53
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c14
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c22
8 files changed, 88 insertions, 84 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 181f88bb53b3..811ce8a28250 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -88,11 +88,13 @@ static int __init zfcp_device_setup(char *devstr)
88 strncpy(zfcp_data.init_busid, token, BUS_ID_SIZE); 88 strncpy(zfcp_data.init_busid, token, BUS_ID_SIZE);
89 89
90 token = strsep(&str, ","); 90 token = strsep(&str, ",");
91 if (!token || strict_strtoull(token, 0, &zfcp_data.init_wwpn)) 91 if (!token || strict_strtoull(token, 0,
92 (unsigned long long *) &zfcp_data.init_wwpn))
92 goto err_out; 93 goto err_out;
93 94
94 token = strsep(&str, ","); 95 token = strsep(&str, ",");
95 if (!token || strict_strtoull(token, 0, &zfcp_data.init_fcp_lun)) 96 if (!token || strict_strtoull(token, 0,
97 (unsigned long long *) &zfcp_data.init_fcp_lun))
96 goto err_out; 98 goto err_out;
97 99
98 kfree(str); 100 kfree(str);
@@ -231,8 +233,7 @@ module_init(zfcp_module_init);
231 * 233 *
232 * Returns: pointer to zfcp_unit or NULL 234 * Returns: pointer to zfcp_unit or NULL
233 */ 235 */
234struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *port, 236struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *port, u64 fcp_lun)
235 fcp_lun_t fcp_lun)
236{ 237{
237 struct zfcp_unit *unit; 238 struct zfcp_unit *unit;
238 239
@@ -251,7 +252,7 @@ struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *port,
251 * Returns: pointer to zfcp_port or NULL 252 * Returns: pointer to zfcp_port or NULL
252 */ 253 */
253struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, 254struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter,
254 wwn_t wwpn) 255 u64 wwpn)
255{ 256{
256 struct zfcp_port *port; 257 struct zfcp_port *port;
257 258
@@ -276,7 +277,7 @@ static void zfcp_sysfs_unit_release(struct device *dev)
276 * 277 *
277 * Sets up some unit internal structures and creates sysfs entry. 278 * Sets up some unit internal structures and creates sysfs entry.
278 */ 279 */
279struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun) 280struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
280{ 281{
281 struct zfcp_unit *unit; 282 struct zfcp_unit *unit;
282 283
@@ -290,7 +291,8 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
290 unit->port = port; 291 unit->port = port;
291 unit->fcp_lun = fcp_lun; 292 unit->fcp_lun = fcp_lun;
292 293
293 snprintf(unit->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx", fcp_lun); 294 snprintf(unit->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx",
295 (unsigned long long) fcp_lun);
294 unit->sysfs_device.parent = &port->sysfs_device; 296 unit->sysfs_device.parent = &port->sysfs_device;
295 unit->sysfs_device.release = zfcp_sysfs_unit_release; 297 unit->sysfs_device.release = zfcp_sysfs_unit_release;
296 dev_set_drvdata(&unit->sysfs_device, unit); 298 dev_set_drvdata(&unit->sysfs_device, unit);
@@ -620,7 +622,7 @@ static void zfcp_sysfs_port_release(struct device *dev)
620 * d_id is used to enqueue ports with a well known address like the Directory 622 * d_id is used to enqueue ports with a well known address like the Directory
621 * Service for nameserver lookup. 623 * Service for nameserver lookup.
622 */ 624 */
623struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, 625struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
624 u32 status, u32 d_id) 626 u32 status, u32 d_id)
625{ 627{
626 struct zfcp_port *port; 628 struct zfcp_port *port;
@@ -644,7 +646,8 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn,
644 atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status); 646 atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status);
645 atomic_set(&port->refcount, 0); 647 atomic_set(&port->refcount, 0);
646 648
647 snprintf(port->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx", wwpn); 649 snprintf(port->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx",
650 (unsigned long long) wwpn);
648 port->sysfs_device.parent = &adapter->ccw_device->dev; 651 port->sysfs_device.parent = &adapter->ccw_device->dev;
649 652
650 port->sysfs_device.release = zfcp_sysfs_port_release; 653 port->sysfs_device.release = zfcp_sysfs_port_release;
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 0d6a388882d4..cbbfd875d939 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -78,11 +78,6 @@
78 78
79/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/ 79/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/
80 80
81typedef unsigned long long wwn_t;
82typedef unsigned long long fcp_lun_t;
83/* data length field may be at variable position in FCP-2 FCP_CMND IU */
84typedef unsigned int fcp_dl_t;
85
86/* timeout for name-server lookup (in seconds) */ 81/* timeout for name-server lookup (in seconds) */
87#define ZFCP_NS_GID_PN_TIMEOUT 10 82#define ZFCP_NS_GID_PN_TIMEOUT 10
88 83
@@ -106,7 +101,7 @@ typedef unsigned int fcp_dl_t;
106 101
107/* FCP(-2) FCP_CMND IU */ 102/* FCP(-2) FCP_CMND IU */
108struct fcp_cmnd_iu { 103struct fcp_cmnd_iu {
109 fcp_lun_t fcp_lun; /* FCP logical unit number */ 104 u64 fcp_lun; /* FCP logical unit number */
110 u8 crn; /* command reference number */ 105 u8 crn; /* command reference number */
111 u8 reserved0:5; /* reserved */ 106 u8 reserved0:5; /* reserved */
112 u8 task_attribute:3; /* task attribute */ 107 u8 task_attribute:3; /* task attribute */
@@ -181,7 +176,7 @@ struct fcp_rscn_element {
181struct fcp_logo { 176struct fcp_logo {
182 u32 command; 177 u32 command;
183 u32 nport_did; 178 u32 nport_did;
184 wwn_t nport_wwpn; 179 u64 nport_wwpn;
185} __attribute__((packed)); 180} __attribute__((packed));
186 181
187/* 182/*
@@ -330,7 +325,7 @@ struct ct_hdr {
330 * a port name is required */ 325 * a port name is required */
331struct ct_iu_gid_pn_req { 326struct ct_iu_gid_pn_req {
332 struct ct_hdr header; 327 struct ct_hdr header;
333 wwn_t wwpn; 328 u64 wwpn;
334} __attribute__ ((packed)); 329} __attribute__ ((packed));
335 330
336/* FS_ACC IU and data unit for GID_PN nameserver request */ 331/* FS_ACC IU and data unit for GID_PN nameserver request */
@@ -339,8 +334,6 @@ struct ct_iu_gid_pn_resp {
339 u32 d_id; 334 u32 d_id;
340} __attribute__ ((packed)); 335} __attribute__ ((packed));
341 336
342typedef void (*zfcp_send_ct_handler_t)(unsigned long);
343
344/** 337/**
345 * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct 338 * struct zfcp_send_ct - used to pass parameters to function zfcp_fsf_send_ct
346 * @wka_port: port where the request is sent to 339 * @wka_port: port where the request is sent to
@@ -360,7 +353,7 @@ struct zfcp_send_ct {
360 struct scatterlist *resp; 353 struct scatterlist *resp;
361 unsigned int req_count; 354 unsigned int req_count;
362 unsigned int resp_count; 355 unsigned int resp_count;
363 zfcp_send_ct_handler_t handler; 356 void (*handler)(unsigned long);
364 unsigned long handler_data; 357 unsigned long handler_data;
365 int timeout; 358 int timeout;
366 struct completion *completion; 359 struct completion *completion;
@@ -377,8 +370,6 @@ struct zfcp_gid_pn_data {
377 struct zfcp_port *port; 370 struct zfcp_port *port;
378}; 371};
379 372
380typedef void (*zfcp_send_els_handler_t)(unsigned long);
381
382/** 373/**
383 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els 374 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els
384 * @adapter: adapter where request is sent from 375 * @adapter: adapter where request is sent from
@@ -402,7 +393,7 @@ struct zfcp_send_els {
402 struct scatterlist *resp; 393 struct scatterlist *resp;
403 unsigned int req_count; 394 unsigned int req_count;
404 unsigned int resp_count; 395 unsigned int resp_count;
405 zfcp_send_els_handler_t handler; 396 void (*handler)(unsigned long);
406 unsigned long handler_data; 397 unsigned long handler_data;
407 struct completion *completion; 398 struct completion *completion;
408 int ls_code; 399 int ls_code;
@@ -468,8 +459,8 @@ struct zfcp_adapter {
468 atomic_t refcount; /* reference count */ 459 atomic_t refcount; /* reference count */
469 wait_queue_head_t remove_wq; /* can be used to wait for 460 wait_queue_head_t remove_wq; /* can be used to wait for
470 refcount drop to zero */ 461 refcount drop to zero */
471 wwn_t peer_wwnn; /* P2P peer WWNN */ 462 u64 peer_wwnn; /* P2P peer WWNN */
472 wwn_t peer_wwpn; /* P2P peer WWPN */ 463 u64 peer_wwpn; /* P2P peer WWPN */
473 u32 peer_d_id; /* P2P peer D_ID */ 464 u32 peer_d_id; /* P2P peer D_ID */
474 struct ccw_device *ccw_device; /* S/390 ccw device */ 465 struct ccw_device *ccw_device; /* S/390 ccw device */
475 u32 hydra_version; /* Hydra version */ 466 u32 hydra_version; /* Hydra version */
@@ -546,8 +537,8 @@ struct zfcp_port {
546 list */ 537 list */
547 u32 units; /* # of logical units in list */ 538 u32 units; /* # of logical units in list */
548 atomic_t status; /* status of this remote port */ 539 atomic_t status; /* status of this remote port */
549 wwn_t wwnn; /* WWNN if known */ 540 u64 wwnn; /* WWNN if known */
550 wwn_t wwpn; /* WWPN */ 541 u64 wwpn; /* WWPN */
551 u32 d_id; /* D_ID */ 542 u32 d_id; /* D_ID */
552 u32 handle; /* handle assigned by FSF */ 543 u32 handle; /* handle assigned by FSF */
553 struct zfcp_erp_action erp_action; /* pending error recovery */ 544 struct zfcp_erp_action erp_action; /* pending error recovery */
@@ -566,7 +557,7 @@ struct zfcp_unit {
566 struct zfcp_port *port; /* remote port of unit */ 557 struct zfcp_port *port; /* remote port of unit */
567 atomic_t status; /* status of this logical unit */ 558 atomic_t status; /* status of this logical unit */
568 unsigned int scsi_lun; /* own SCSI LUN */ 559 unsigned int scsi_lun; /* own SCSI LUN */
569 fcp_lun_t fcp_lun; /* own FCP_LUN */ 560 u64 fcp_lun; /* own FCP_LUN */
570 u32 handle; /* handle assigned by FSF */ 561 u32 handle; /* handle assigned by FSF */
571 struct scsi_device *device; /* scsi device struct pointer */ 562 struct scsi_device *device; /* scsi device struct pointer */
572 struct zfcp_erp_action erp_action; /* pending error recovery */ 563 struct zfcp_erp_action erp_action; /* pending error recovery */
@@ -620,11 +611,11 @@ struct zfcp_data {
620 changes */ 611 changes */
621 atomic_t loglevel; /* current loglevel */ 612 atomic_t loglevel; /* current loglevel */
622 char init_busid[BUS_ID_SIZE]; 613 char init_busid[BUS_ID_SIZE];
623 wwn_t init_wwpn; 614 u64 init_wwpn;
624 fcp_lun_t init_fcp_lun; 615 u64 init_fcp_lun;
625 struct kmem_cache *fsf_req_qtcb_cache; 616 struct kmem_cache *fsf_req_qtcb_cache;
626 struct kmem_cache *sr_buffer_cache; 617 struct kmem_cache *sr_buffer_cache;
627 struct kmem_cache *gid_pn_cache; 618 struct kmem_cache *gid_pn_cache;
628}; 619};
629 620
630/* struct used by memory pools for fsf_requests */ 621/* struct used by memory pools for fsf_requests */
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index e7d3bce51429..07d22f343cc5 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -991,7 +991,8 @@ static int zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result)
991 dev_err(&unit->port->adapter->ccw_device->dev, 991 dev_err(&unit->port->adapter->ccw_device->dev,
992 "ERP failed for unit 0x%016Lx on " 992 "ERP failed for unit 0x%016Lx on "
993 "port 0x%016Lx\n", 993 "port 0x%016Lx\n",
994 unit->fcp_lun, unit->port->wwpn); 994 (unsigned long long)unit->fcp_lun,
995 (unsigned long long)unit->port->wwpn);
995 zfcp_erp_unit_failed(unit, 21, NULL); 996 zfcp_erp_unit_failed(unit, 21, NULL);
996 } 997 }
997 break; 998 break;
@@ -1021,7 +1022,7 @@ static int zfcp_erp_strategy_check_port(struct zfcp_port *port, int result)
1021 if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) { 1022 if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) {
1022 dev_err(&port->adapter->ccw_device->dev, 1023 dev_err(&port->adapter->ccw_device->dev,
1023 "ERP failed for remote port 0x%016Lx\n", 1024 "ERP failed for remote port 0x%016Lx\n",
1024 port->wwpn); 1025 (unsigned long long)port->wwpn);
1025 zfcp_erp_port_failed(port, 22, NULL); 1026 zfcp_erp_port_failed(port, 22, NULL);
1026 } 1027 }
1027 break; 1028 break;
@@ -1199,7 +1200,8 @@ static void zfcp_erp_schedule_work(struct zfcp_unit *unit)
1199 if (!p) { 1200 if (!p) {
1200 dev_err(&unit->port->adapter->ccw_device->dev, 1201 dev_err(&unit->port->adapter->ccw_device->dev,
1201 "Registering unit 0x%016Lx on port 0x%016Lx failed\n", 1202 "Registering unit 0x%016Lx on port 0x%016Lx failed\n",
1202 unit->fcp_lun, unit->port->wwpn); 1203 (unsigned long long)unit->fcp_lun,
1204 (unsigned long long)unit->port->wwpn);
1203 return; 1205 return;
1204 } 1206 }
1205 1207
@@ -1221,7 +1223,7 @@ static void zfcp_erp_rport_register(struct zfcp_port *port)
1221 if (!port->rport) { 1223 if (!port->rport) {
1222 dev_err(&port->adapter->ccw_device->dev, 1224 dev_err(&port->adapter->ccw_device->dev,
1223 "Registering port 0x%016Lx failed\n", 1225 "Registering port 0x%016Lx failed\n",
1224 port->wwpn); 1226 (unsigned long long)port->wwpn);
1225 return; 1227 return;
1226 } 1228 }
1227 1229
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 5c8a703b5ce1..ca1db974fc5c 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -12,16 +12,14 @@
12#include "zfcp_def.h" 12#include "zfcp_def.h"
13 13
14/* zfcp_aux.c */ 14/* zfcp_aux.c */
15extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *, 15extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *, u64);
16 fcp_lun_t); 16extern struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *, u64);
17extern struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *,
18 wwn_t);
19extern int zfcp_adapter_enqueue(struct ccw_device *); 17extern int zfcp_adapter_enqueue(struct ccw_device *);
20extern void zfcp_adapter_dequeue(struct zfcp_adapter *); 18extern void zfcp_adapter_dequeue(struct zfcp_adapter *);
21extern struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *, wwn_t, u32, 19extern struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *, u64, u32,
22 u32); 20 u32);
23extern void zfcp_port_dequeue(struct zfcp_port *); 21extern void zfcp_port_dequeue(struct zfcp_port *);
24extern struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *, fcp_lun_t); 22extern struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *, u64);
25extern void zfcp_unit_dequeue(struct zfcp_unit *); 23extern void zfcp_unit_dequeue(struct zfcp_unit *);
26extern int zfcp_reqlist_isempty(struct zfcp_adapter *); 24extern int zfcp_reqlist_isempty(struct zfcp_adapter *);
27extern void zfcp_sg_free_table(struct scatterlist *, int); 25extern void zfcp_sg_free_table(struct scatterlist *, int);
@@ -150,7 +148,6 @@ extern void zfcp_qdio_close(struct zfcp_adapter *);
150extern struct zfcp_data zfcp_data; 148extern struct zfcp_data zfcp_data;
151extern int zfcp_adapter_scsi_register(struct zfcp_adapter *); 149extern int zfcp_adapter_scsi_register(struct zfcp_adapter *);
152extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *); 150extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *);
153extern void zfcp_set_fcp_dl(struct fcp_cmnd_iu *, fcp_dl_t);
154extern char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *); 151extern char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *);
155extern struct fc_function_template zfcp_transport_functions; 152extern struct fc_function_template zfcp_transport_functions;
156 153
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index 899e45b9e60b..3a573b03eb86 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -178,7 +178,7 @@ static void zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req)
178 schedule_work(&fsf_req->adapter->scan_work); 178 schedule_work(&fsf_req->adapter->scan_work);
179} 179}
180 180
181static void zfcp_fc_incoming_wwpn(struct zfcp_fsf_req *req, wwn_t wwpn) 181static void zfcp_fc_incoming_wwpn(struct zfcp_fsf_req *req, u64 wwpn)
182{ 182{
183 struct zfcp_adapter *adapter = req->adapter; 183 struct zfcp_adapter *adapter = req->adapter;
184 struct zfcp_port *port; 184 struct zfcp_port *port;
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 23dd9088153f..02a570084d88 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -68,7 +68,7 @@ static void zfcp_fsf_access_denied_port(struct zfcp_fsf_req *req,
68 struct fsf_qtcb_header *header = &req->qtcb->header; 68 struct fsf_qtcb_header *header = &req->qtcb->header;
69 dev_warn(&req->adapter->ccw_device->dev, 69 dev_warn(&req->adapter->ccw_device->dev,
70 "Access denied to port 0x%016Lx\n", 70 "Access denied to port 0x%016Lx\n",
71 port->wwpn); 71 (unsigned long long)port->wwpn);
72 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); 72 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]);
73 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); 73 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]);
74 zfcp_erp_port_access_denied(port, 55, req); 74 zfcp_erp_port_access_denied(port, 55, req);
@@ -81,7 +81,8 @@ static void zfcp_fsf_access_denied_unit(struct zfcp_fsf_req *req,
81 struct fsf_qtcb_header *header = &req->qtcb->header; 81 struct fsf_qtcb_header *header = &req->qtcb->header;
82 dev_warn(&req->adapter->ccw_device->dev, 82 dev_warn(&req->adapter->ccw_device->dev,
83 "Access denied to unit 0x%016Lx on port 0x%016Lx\n", 83 "Access denied to unit 0x%016Lx on port 0x%016Lx\n",
84 unit->fcp_lun, unit->port->wwpn); 84 (unsigned long long)unit->fcp_lun,
85 (unsigned long long)unit->port->wwpn);
85 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); 86 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]);
86 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); 87 zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]);
87 zfcp_erp_unit_access_denied(unit, 59, req); 88 zfcp_erp_unit_access_denied(unit, 59, req);
@@ -1390,7 +1391,8 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1390 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: 1391 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
1391 dev_warn(&req->adapter->ccw_device->dev, 1392 dev_warn(&req->adapter->ccw_device->dev,
1392 "Not enough FCP adapter resources to open " 1393 "Not enough FCP adapter resources to open "
1393 "remote port 0x%016Lx\n", port->wwpn); 1394 "remote port 0x%016Lx\n",
1395 (unsigned long long)port->wwpn);
1394 zfcp_erp_port_failed(port, 31, req); 1396 zfcp_erp_port_failed(port, 31, req);
1395 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1397 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1396 break; 1398 break;
@@ -1403,7 +1405,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1403 case FSF_SQ_NO_RETRY_POSSIBLE: 1405 case FSF_SQ_NO_RETRY_POSSIBLE:
1404 dev_warn(&req->adapter->ccw_device->dev, 1406 dev_warn(&req->adapter->ccw_device->dev,
1405 "Remote port 0x%016Lx could not be opened\n", 1407 "Remote port 0x%016Lx could not be opened\n",
1406 port->wwpn); 1408 (unsigned long long)port->wwpn);
1407 zfcp_erp_port_failed(port, 32, req); 1409 zfcp_erp_port_failed(port, 32, req);
1408 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1410 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1409 break; 1411 break;
@@ -1824,8 +1826,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1824 dev_warn(&adapter->ccw_device->dev, 1826 dev_warn(&adapter->ccw_device->dev,
1825 "LUN 0x%Lx on port 0x%Lx is already in " 1827 "LUN 0x%Lx on port 0x%Lx is already in "
1826 "use by CSS%d, MIF Image ID %x\n", 1828 "use by CSS%d, MIF Image ID %x\n",
1827 unit->fcp_lun, 1829 (unsigned long long)unit->fcp_lun,
1828 unit->port->wwpn, 1830 (unsigned long long)unit->port->wwpn,
1829 queue_designator->cssid, 1831 queue_designator->cssid,
1830 queue_designator->hla); 1832 queue_designator->hla);
1831 else 1833 else
@@ -1840,7 +1842,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1840 dev_warn(&adapter->ccw_device->dev, 1842 dev_warn(&adapter->ccw_device->dev,
1841 "No handle is available for LUN " 1843 "No handle is available for LUN "
1842 "0x%016Lx on port 0x%016Lx\n", 1844 "0x%016Lx on port 0x%016Lx\n",
1843 unit->fcp_lun, unit->port->wwpn); 1845 (unsigned long long)unit->fcp_lun,
1846 (unsigned long long)unit->port->wwpn);
1844 zfcp_erp_unit_failed(unit, 34, req); 1847 zfcp_erp_unit_failed(unit, 34, req);
1845 /* fall through */ 1848 /* fall through */
1846 case FSF_INVALID_COMMAND_OPTION: 1849 case FSF_INVALID_COMMAND_OPTION:
@@ -1879,7 +1882,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1879 dev_info(&adapter->ccw_device->dev, 1882 dev_info(&adapter->ccw_device->dev,
1880 "SCSI device at LUN 0x%016Lx on port " 1883 "SCSI device at LUN 0x%016Lx on port "
1881 "0x%016Lx opened read-only\n", 1884 "0x%016Lx opened read-only\n",
1882 unit->fcp_lun, unit->port->wwpn); 1885 (unsigned long long)unit->fcp_lun,
1886 (unsigned long long)unit->port->wwpn);
1883 } 1887 }
1884 1888
1885 if (exclusive && !readwrite) { 1889 if (exclusive && !readwrite) {
@@ -1887,7 +1891,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1887 "Exclusive read-only access not " 1891 "Exclusive read-only access not "
1888 "supported (unit 0x%016Lx, " 1892 "supported (unit 0x%016Lx, "
1889 "port 0x%016Lx)\n", 1893 "port 0x%016Lx)\n",
1890 unit->fcp_lun, unit->port->wwpn); 1894 (unsigned long long)unit->fcp_lun,
1895 (unsigned long long)unit->port->wwpn);
1891 zfcp_erp_unit_failed(unit, 35, req); 1896 zfcp_erp_unit_failed(unit, 35, req);
1892 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1897 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1893 zfcp_erp_unit_shutdown(unit, 0, 80, req); 1898 zfcp_erp_unit_shutdown(unit, 0, 80, req);
@@ -1896,7 +1901,8 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1896 "Shared read-write access not " 1901 "Shared read-write access not "
1897 "supported (unit 0x%016Lx, port " 1902 "supported (unit 0x%016Lx, port "
1898 "0x%016Lx\n)", 1903 "0x%016Lx\n)",
1899 unit->fcp_lun, unit->port->wwpn); 1904 (unsigned long long)unit->fcp_lun,
1905 (unsigned long long)unit->port->wwpn);
1900 zfcp_erp_unit_failed(unit, 36, req); 1906 zfcp_erp_unit_failed(unit, 36, req);
1901 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1907 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1902 zfcp_erp_unit_shutdown(unit, 0, 81, req); 1908 zfcp_erp_unit_shutdown(unit, 0, 81, req);
@@ -2197,7 +2203,8 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
2197 "Incorrect direction %d, unit 0x%016Lx on port " 2203 "Incorrect direction %d, unit 0x%016Lx on port "
2198 "0x%016Lx closed\n", 2204 "0x%016Lx closed\n",
2199 req->qtcb->bottom.io.data_direction, 2205 req->qtcb->bottom.io.data_direction,
2200 unit->fcp_lun, unit->port->wwpn); 2206 (unsigned long long)unit->fcp_lun,
2207 (unsigned long long)unit->port->wwpn);
2201 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, req); 2208 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, req);
2202 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2209 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2203 break; 2210 break;
@@ -2206,7 +2213,8 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
2206 "Incorrect CDB length %d, unit 0x%016Lx on " 2213 "Incorrect CDB length %d, unit 0x%016Lx on "
2207 "port 0x%016Lx closed\n", 2214 "port 0x%016Lx closed\n",
2208 req->qtcb->bottom.io.fcp_cmnd_length, 2215 req->qtcb->bottom.io.fcp_cmnd_length,
2209 unit->fcp_lun, unit->port->wwpn); 2216 (unsigned long long)unit->fcp_lun,
2217 (unsigned long long)unit->port->wwpn);
2210 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, req); 2218 zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, req);
2211 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2219 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2212 break; 2220 break;
@@ -2237,6 +2245,20 @@ skip_fsfstatus:
2237 } 2245 }
2238} 2246}
2239 2247
2248static void zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, u32 fcp_dl)
2249{
2250 u32 *fcp_dl_ptr;
2251
2252 /*
2253 * fcp_dl_addr = start address of fcp_cmnd structure +
2254 * size of fixed part + size of dynamically sized add_dcp_cdb field
2255 * SEE FCP-2 documentation
2256 */
2257 fcp_dl_ptr = (u32 *) ((unsigned char *) &fcp_cmd[1] +
2258 (fcp_cmd->add_fcp_cdb_length << 2));
2259 *fcp_dl_ptr = fcp_dl;
2260}
2261
2240/** 2262/**
2241 * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command) 2263 * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command)
2242 * @adapter: adapter where scsi command is issued 2264 * @adapter: adapter where scsi command is issued
@@ -2322,7 +2344,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
2322 memcpy(fcp_cmnd_iu->fcp_cdb, scsi_cmnd->cmnd, scsi_cmnd->cmd_len); 2344 memcpy(fcp_cmnd_iu->fcp_cdb, scsi_cmnd->cmnd, scsi_cmnd->cmd_len);
2323 2345
2324 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) + 2346 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) +
2325 fcp_cmnd_iu->add_fcp_cdb_length + sizeof(fcp_dl_t); 2347 fcp_cmnd_iu->add_fcp_cdb_length + sizeof(u32);
2326 2348
2327 real_bytes = zfcp_qdio_sbals_from_sg(req, sbtype, 2349 real_bytes = zfcp_qdio_sbals_from_sg(req, sbtype,
2328 scsi_sglist(scsi_cmnd), 2350 scsi_sglist(scsi_cmnd),
@@ -2334,7 +2356,8 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
2334 dev_err(&adapter->ccw_device->dev, 2356 dev_err(&adapter->ccw_device->dev,
2335 "Oversize data package, unit 0x%016Lx " 2357 "Oversize data package, unit 0x%016Lx "
2336 "on port 0x%016Lx closed\n", 2358 "on port 0x%016Lx closed\n",
2337 unit->fcp_lun, unit->port->wwpn); 2359 (unsigned long long)unit->fcp_lun,
2360 (unsigned long long)unit->port->wwpn);
2338 zfcp_erp_unit_shutdown(unit, 0, 131, req); 2361 zfcp_erp_unit_shutdown(unit, 0, 131, req);
2339 retval = -EINVAL; 2362 retval = -EINVAL;
2340 } 2363 }
@@ -2397,7 +2420,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter,
2397 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 2420 req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
2398 req->qtcb->bottom.io.service_class = FSF_CLASS_3; 2421 req->qtcb->bottom.io.service_class = FSF_CLASS_3;
2399 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) + 2422 req->qtcb->bottom.io.fcp_cmnd_length = sizeof(struct fcp_cmnd_iu) +
2400 sizeof(fcp_dl_t); 2423 sizeof(u32);
2401 2424
2402 sbale = zfcp_qdio_sbale_req(req); 2425 sbale = zfcp_qdio_sbale_req(req);
2403 sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE; 2426 sbale[0].flags |= SBAL_FLAGS0_TYPE_WRITE;
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 2095a1e41e80..cf6a14793371 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -21,20 +21,6 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
21 return fcp_sns_info_ptr; 21 return fcp_sns_info_ptr;
22} 22}
23 23
24void zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, fcp_dl_t fcp_dl)
25{
26 fcp_dl_t *fcp_dl_ptr;
27
28 /*
29 * fcp_dl_addr = start address of fcp_cmnd structure +
30 * size of fixed part + size of dynamically sized add_dcp_cdb field
31 * SEE FCP-2 documentation
32 */
33 fcp_dl_ptr = (fcp_dl_t *) ((unsigned char *) &fcp_cmd[1] +
34 (fcp_cmd->add_fcp_cdb_length << 2));
35 *fcp_dl_ptr = fcp_dl;
36}
37
38static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) 24static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
39{ 25{
40 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; 26 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index 430e486e9183..7f7384c02a53 100644
--- a/drivers/s390/scsi/zfcp_sysfs.c
+++ b/drivers/s390/scsi/zfcp_sysfs.c
@@ -26,9 +26,9 @@ static ZFCP_DEV_ATTR(_feat, _name, S_IRUGO, \
26ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, status, "0x%08x\n", 26ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, status, "0x%08x\n",
27 atomic_read(&adapter->status)); 27 atomic_read(&adapter->status));
28ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_wwnn, "0x%016llx\n", 28ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_wwnn, "0x%016llx\n",
29 adapter->peer_wwnn); 29 (unsigned long long) adapter->peer_wwnn);
30ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_wwpn, "0x%016llx\n", 30ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_wwpn, "0x%016llx\n",
31 adapter->peer_wwpn); 31 (unsigned long long) adapter->peer_wwpn);
32ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_d_id, "0x%06x\n", 32ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, peer_d_id, "0x%06x\n",
33 adapter->peer_d_id); 33 adapter->peer_d_id);
34ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, card_version, "0x%04x\n", 34ZFCP_DEFINE_ATTR(zfcp_adapter, adapter, card_version, "0x%04x\n",
@@ -135,7 +135,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev,
135{ 135{
136 struct zfcp_adapter *adapter = dev_get_drvdata(dev); 136 struct zfcp_adapter *adapter = dev_get_drvdata(dev);
137 struct zfcp_port *port; 137 struct zfcp_port *port;
138 wwn_t wwpn; 138 u64 wwpn;
139 int retval = 0; 139 int retval = 0;
140 140
141 down(&zfcp_data.config_sema); 141 down(&zfcp_data.config_sema);
@@ -144,7 +144,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev,
144 goto out; 144 goto out;
145 } 145 }
146 146
147 if (strict_strtoull(buf, 0, &wwpn)) { 147 if (strict_strtoull(buf, 0, (unsigned long long *) &wwpn)) {
148 retval = -EINVAL; 148 retval = -EINVAL;
149 goto out; 149 goto out;
150 } 150 }
@@ -200,7 +200,7 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev,
200{ 200{
201 struct zfcp_port *port = dev_get_drvdata(dev); 201 struct zfcp_port *port = dev_get_drvdata(dev);
202 struct zfcp_unit *unit; 202 struct zfcp_unit *unit;
203 fcp_lun_t fcp_lun; 203 u64 fcp_lun;
204 int retval = -EINVAL; 204 int retval = -EINVAL;
205 205
206 down(&zfcp_data.config_sema); 206 down(&zfcp_data.config_sema);
@@ -209,7 +209,7 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev,
209 goto out; 209 goto out;
210 } 210 }
211 211
212 if (strict_strtoull(buf, 0, &fcp_lun)) 212 if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun))
213 goto out; 213 goto out;
214 214
215 unit = zfcp_unit_enqueue(port, fcp_lun); 215 unit = zfcp_unit_enqueue(port, fcp_lun);
@@ -233,7 +233,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev,
233{ 233{
234 struct zfcp_port *port = dev_get_drvdata(dev); 234 struct zfcp_port *port = dev_get_drvdata(dev);
235 struct zfcp_unit *unit; 235 struct zfcp_unit *unit;
236 fcp_lun_t fcp_lun; 236 u64 fcp_lun;
237 int retval = 0; 237 int retval = 0;
238 238
239 down(&zfcp_data.config_sema); 239 down(&zfcp_data.config_sema);
@@ -242,7 +242,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev,
242 goto out; 242 goto out;
243 } 243 }
244 244
245 if (strict_strtoull(buf, 0, &fcp_lun)) { 245 if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) {
246 retval = -EINVAL; 246 retval = -EINVAL;
247 goto out; 247 goto out;
248 } 248 }
@@ -380,8 +380,10 @@ static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_scsi_##_name##_show, NULL);
380 380
381ZFCP_DEFINE_SCSI_ATTR(hba_id, "%s\n", 381ZFCP_DEFINE_SCSI_ATTR(hba_id, "%s\n",
382 unit->port->adapter->ccw_device->dev.bus_id); 382 unit->port->adapter->ccw_device->dev.bus_id);
383ZFCP_DEFINE_SCSI_ATTR(wwpn, "0x%016llx\n", unit->port->wwpn); 383ZFCP_DEFINE_SCSI_ATTR(wwpn, "0x%016llx\n",
384ZFCP_DEFINE_SCSI_ATTR(fcp_lun, "0x%016llx\n", unit->fcp_lun); 384 (unsigned long long) unit->port->wwpn);
385ZFCP_DEFINE_SCSI_ATTR(fcp_lun, "0x%016llx\n",
386 (unsigned long long) unit->fcp_lun);
385 387
386struct device_attribute *zfcp_sysfs_sdev_attrs[] = { 388struct device_attribute *zfcp_sysfs_sdev_attrs[] = {
387 &dev_attr_fcp_lun, 389 &dev_attr_fcp_lun,