aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-11-24 10:54:12 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:02:14 -0500
commit800c0cad962dcf630cabf3efdc5983619e73d4c9 (patch)
tree4d593b6ec683b524bb2e503483696218aa1eb167 /drivers/s390/scsi
parentbd0072ecc449fb2ea8f6a2c9f6ff308f3ae0b078 (diff)
[SCSI] zfcp: Remove ZFCP_DID_MASK
Instead of assigning 4 bytes with the highest byte masked out, use a 3 byte array with the ntoh24 and h24ton helper functions, thus eliminating the need for the ZFCP_DID_MASK. Reviewed-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c4
-rw-r--r--drivers/s390/scsi/zfcp_def.h4
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c12
-rw-r--r--drivers/s390/scsi/zfcp_fsf.h15
4 files changed, 17 insertions, 18 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index e945344ff711..517f196b4c52 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -178,7 +178,7 @@ void _zfcp_dbf_hba_fsf_response(const char *tag2, int level,
178 178
179 case FSF_QTCB_SEND_ELS: 179 case FSF_QTCB_SEND_ELS:
180 send_els = (struct zfcp_send_els *)fsf_req->data; 180 send_els = (struct zfcp_send_els *)fsf_req->data;
181 response->u.els.d_id = qtcb->bottom.support.d_id; 181 response->u.els.d_id = ntoh24(qtcb->bottom.support.d_id);
182 response->u.els.ls_code = send_els->ls_code >> 24; 182 response->u.els.ls_code = send_els->ls_code >> 24;
183 break; 183 break;
184 184
@@ -812,7 +812,7 @@ void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *fsf_req)
812 int length = (int)buf->length - 812 int length = (int)buf->length -
813 (int)((void *)&buf->payload - (void *)buf); 813 (int)((void *)&buf->payload - (void *)buf);
814 814
815 zfcp_dbf_san_els("iels", 1, fsf_req, buf->d_id, 815 zfcp_dbf_san_els("iels", 1, fsf_req, ntoh24(buf->d_id),
816 fc_host_port_id(adapter->scsi_host), 816 fc_host_port_id(adapter->scsi_host),
817 buf->payload.data[0], (void *)buf->payload.data, 817 buf->payload.data[0], (void *)buf->payload.data,
818 length); 818 length);
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index c00aa2b174a1..ea11b4e45cdc 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -71,10 +71,6 @@
71/* timeout value for "default timer" for fsf requests */ 71/* timeout value for "default timer" for fsf requests */
72#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ) 72#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ)
73 73
74/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/
75
76#define ZFCP_DID_MASK 0x00FFFFFF
77
78/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/ 74/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
79 75
80/* 76/*
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 9ada555ca5a8..057c93777f92 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -128,7 +128,7 @@ static void zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *req)
128 struct fsf_status_read_buffer *sr_buf = req->data; 128 struct fsf_status_read_buffer *sr_buf = req->data;
129 struct zfcp_adapter *adapter = req->adapter; 129 struct zfcp_adapter *adapter = req->adapter;
130 struct zfcp_port *port; 130 struct zfcp_port *port;
131 int d_id = sr_buf->d_id & ZFCP_DID_MASK; 131 int d_id = ntoh24(sr_buf->d_id);
132 132
133 read_lock_irqsave(&adapter->port_list_lock, flags); 133 read_lock_irqsave(&adapter->port_list_lock, flags);
134 list_for_each_entry(port, &adapter->port_list, list) 134 list_for_each_entry(port, &adapter->port_list, list)
@@ -494,7 +494,7 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
494 494
495 fc_host_port_name(shost) = nsp->fl_wwpn; 495 fc_host_port_name(shost) = nsp->fl_wwpn;
496 fc_host_node_name(shost) = nsp->fl_wwnn; 496 fc_host_node_name(shost) = nsp->fl_wwnn;
497 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; 497 fc_host_port_id(shost) = ntoh24(bottom->s_id);
498 fc_host_speed(shost) = bottom->fc_link_speed; 498 fc_host_speed(shost) = bottom->fc_link_speed;
499 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; 499 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3;
500 500
@@ -506,7 +506,7 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
506 506
507 switch (bottom->fc_topology) { 507 switch (bottom->fc_topology) {
508 case FSF_TOPO_P2P: 508 case FSF_TOPO_P2P:
509 adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; 509 adapter->peer_d_id = ntoh24(bottom->peer_d_id);
510 adapter->peer_wwpn = plogi->fl_wwpn; 510 adapter->peer_wwpn = plogi->fl_wwpn;
511 adapter->peer_wwnn = plogi->fl_wwnn; 511 adapter->peer_wwnn = plogi->fl_wwnn;
512 fc_host_port_type(shost) = FC_PORTTYPE_PTP; 512 fc_host_port_type(shost) = FC_PORTTYPE_PTP;
@@ -1216,7 +1216,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els)
1216 if (ret) 1216 if (ret)
1217 goto failed_send; 1217 goto failed_send;
1218 1218
1219 req->qtcb->bottom.support.d_id = els->d_id; 1219 hton24(req->qtcb->bottom.support.d_id, els->d_id);
1220 req->handler = zfcp_fsf_send_els_handler; 1220 req->handler = zfcp_fsf_send_els_handler;
1221 req->data = els; 1221 req->data = els;
1222 1222
@@ -1522,7 +1522,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1522 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; 1522 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;
1523 1523
1524 req->handler = zfcp_fsf_open_port_handler; 1524 req->handler = zfcp_fsf_open_port_handler;
1525 req->qtcb->bottom.support.d_id = port->d_id; 1525 hton24(req->qtcb->bottom.support.d_id, port->d_id);
1526 req->data = port; 1526 req->data = port;
1527 req->erp_action = erp_action; 1527 req->erp_action = erp_action;
1528 erp_action->fsf_req = req; 1528 erp_action->fsf_req = req;
@@ -1669,7 +1669,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
1669 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; 1669 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;
1670 1670
1671 req->handler = zfcp_fsf_open_wka_port_handler; 1671 req->handler = zfcp_fsf_open_wka_port_handler;
1672 req->qtcb->bottom.support.d_id = wka_port->d_id; 1672 hton24(req->qtcb->bottom.support.d_id, wka_port->d_id);
1673 req->data = wka_port; 1673 req->data = wka_port;
1674 1674
1675 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 1675 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h
index 402e0235a357..206b7eaff5a0 100644
--- a/drivers/s390/scsi/zfcp_fsf.h
+++ b/drivers/s390/scsi/zfcp_fsf.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/pfn.h> 12#include <linux/pfn.h>
13#include <linux/scatterlist.h> 13#include <linux/scatterlist.h>
14#include <scsi/libfc.h>
14 15
15#define FSF_QTCB_CURRENT_VERSION 0x00000001 16#define FSF_QTCB_CURRENT_VERSION 0x00000001
16 17
@@ -228,7 +229,8 @@ struct fsf_status_read_buffer {
228 u32 length; 229 u32 length;
229 u32 res1; 230 u32 res1;
230 struct fsf_queue_designator queue_designator; 231 struct fsf_queue_designator queue_designator;
231 u32 d_id; 232 u8 res2;
233 u8 d_id[3];
232 u32 class; 234 u32 class;
233 u64 fcp_lun; 235 u64 fcp_lun;
234 u8 res3[24]; 236 u8 res3[24];
@@ -327,8 +329,8 @@ struct fsf_qtcb_bottom_io {
327 329
328struct fsf_qtcb_bottom_support { 330struct fsf_qtcb_bottom_support {
329 u32 operation_subtype; 331 u32 operation_subtype;
330 u8 res1[12]; 332 u8 res1[13];
331 u32 d_id; 333 u8 d_id[3];
332 u32 option; 334 u32 option;
333 u64 fcp_lun; 335 u64 fcp_lun;
334 u64 res2; 336 u64 res2;
@@ -357,11 +359,12 @@ struct fsf_qtcb_bottom_config {
357 u32 fc_topology; 359 u32 fc_topology;
358 u32 fc_link_speed; 360 u32 fc_link_speed;
359 u32 adapter_type; 361 u32 adapter_type;
360 u32 peer_d_id; 362 u8 res0;
363 u8 peer_d_id[3];
361 u8 res1[2]; 364 u8 res1[2];
362 u16 timer_interval; 365 u16 timer_interval;
363 u8 res2[8]; 366 u8 res2[9];
364 u32 s_id; 367 u8 s_id[3];
365 u8 nport_serv_param[128]; 368 u8 nport_serv_param[128];
366 u8 res3[8]; 369 u8 res3[8];
367 u32 adapter_ports; 370 u32 adapter_ports;