aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-11-24 10:54:09 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:02:11 -0500
commit9d05ce2c0a6704ff84df02cbb3baef94fcac4f5d (patch)
tree2388ff365f068511ceb6e9bfbc13fe2425f0ae4c /drivers/s390/scsi/zfcp_fsf.c
parent4318e08c84e4916ac463002ffb7f9901ddb3c385 (diff)
[SCSI] zfcp: Use common code definitions for FC ELS structs
Use common code definitions for FC plogi, logo, rscn and adisc structs instead of inventing private ones. Move the private struct for issuing ELS ADISC inside zfcp to zfcp_fc header file. 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/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 5f4cd03797e9..9d7bf965d398 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -10,6 +10,7 @@
10#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 10#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
11 11
12#include <linux/blktrace_api.h> 12#include <linux/blktrace_api.h>
13#include <scsi/fc/fc_els.h>
13#include "zfcp_ext.h" 14#include "zfcp_ext.h"
14#include "zfcp_fc.h" 15#include "zfcp_fc.h"
15#include "zfcp_dbf.h" 16#include "zfcp_dbf.h"
@@ -477,17 +478,22 @@ void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
477 478
478static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) 479static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
479{ 480{
480 struct fsf_qtcb_bottom_config *bottom; 481 struct fsf_qtcb_bottom_config *bottom = &req->qtcb->bottom.config;
481 struct zfcp_adapter *adapter = req->adapter; 482 struct zfcp_adapter *adapter = req->adapter;
482 struct Scsi_Host *shost = adapter->scsi_host; 483 struct Scsi_Host *shost = adapter->scsi_host;
484 struct fc_els_flogi *nsp, *plogi;
483 485
484 bottom = &req->qtcb->bottom.config; 486 /* adjust pointers for missing command code */
487 nsp = (struct fc_els_flogi *) ((u8 *)&bottom->nport_serv_param
488 - sizeof(u32));
489 plogi = (struct fc_els_flogi *) ((u8 *)&bottom->plogi_payload
490 - sizeof(u32));
485 491
486 if (req->data) 492 if (req->data)
487 memcpy(req->data, bottom, sizeof(*bottom)); 493 memcpy(req->data, bottom, sizeof(*bottom));
488 494
489 fc_host_node_name(shost) = bottom->nport_serv_param.wwnn; 495 fc_host_port_name(shost) = nsp->fl_wwpn;
490 fc_host_port_name(shost) = bottom->nport_serv_param.wwpn; 496 fc_host_node_name(shost) = nsp->fl_wwnn;
491 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; 497 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK;
492 fc_host_speed(shost) = bottom->fc_link_speed; 498 fc_host_speed(shost) = bottom->fc_link_speed;
493 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; 499 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3;
@@ -501,8 +507,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
501 switch (bottom->fc_topology) { 507 switch (bottom->fc_topology) {
502 case FSF_TOPO_P2P: 508 case FSF_TOPO_P2P:
503 adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; 509 adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK;
504 adapter->peer_wwpn = bottom->plogi_payload.wwpn; 510 adapter->peer_wwpn = plogi->fl_wwpn;
505 adapter->peer_wwnn = bottom->plogi_payload.wwnn; 511 adapter->peer_wwnn = plogi->fl_wwnn;
506 fc_host_port_type(shost) = FC_PORTTYPE_PTP; 512 fc_host_port_type(shost) = FC_PORTTYPE_PTP;
507 break; 513 break;
508 case FSF_TOPO_FABRIC: 514 case FSF_TOPO_FABRIC:
@@ -1068,15 +1074,17 @@ static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req,
1068 int max_sbals) 1074 int max_sbals)
1069{ 1075{
1070 int ret; 1076 int ret;
1077 unsigned int fcp_chan_timeout;
1071 1078
1072 ret = zfcp_fsf_setup_ct_els_sbals(req, sg_req, sg_resp, max_sbals); 1079 ret = zfcp_fsf_setup_ct_els_sbals(req, sg_req, sg_resp, max_sbals);
1073 if (ret) 1080 if (ret)
1074 return ret; 1081 return ret;
1075 1082
1076 /* common settings for ct/gs and els requests */ 1083 /* common settings for ct/gs and els requests */
1084 fcp_chan_timeout = 2 * FC_DEF_R_A_TOV / 1000;
1077 req->qtcb->bottom.support.service_class = FSF_CLASS_3; 1085 req->qtcb->bottom.support.service_class = FSF_CLASS_3;
1078 req->qtcb->bottom.support.timeout = 2 * R_A_TOV; 1086 req->qtcb->bottom.support.timeout = fcp_chan_timeout;
1079 zfcp_fsf_start_timer(req, (2 * R_A_TOV + 10) * HZ); 1087 zfcp_fsf_start_timer(req, (fcp_chan_timeout + 10) * HZ);
1080 1088
1081 return 0; 1089 return 0;
1082} 1090}
@@ -1151,7 +1159,7 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req)
1151 case FSF_ADAPTER_STATUS_AVAILABLE: 1159 case FSF_ADAPTER_STATUS_AVAILABLE:
1152 switch (header->fsf_status_qual.word[0]){ 1160 switch (header->fsf_status_qual.word[0]){
1153 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1161 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1154 if (port && (send_els->ls_code != ZFCP_LS_ADISC)) 1162 if (port && (send_els->ls_code != ELS_ADISC))
1155 zfcp_fc_test_link(port); 1163 zfcp_fc_test_link(port);
1156 /*fall through */ 1164 /*fall through */
1157 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1165 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
@@ -1419,7 +1427,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1419{ 1427{
1420 struct zfcp_port *port = req->data; 1428 struct zfcp_port *port = req->data;
1421 struct fsf_qtcb_header *header = &req->qtcb->header; 1429 struct fsf_qtcb_header *header = &req->qtcb->header;
1422 struct fsf_plogi *plogi; 1430 struct fc_els_flogi *plogi;
1423 1431
1424 if (req->status & ZFCP_STATUS_FSFREQ_ERROR) 1432 if (req->status & ZFCP_STATUS_FSFREQ_ERROR)
1425 goto out; 1433 goto out;
@@ -1469,23 +1477,10 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
1469 * another GID_PN straight after a port has been opened. 1477 * another GID_PN straight after a port has been opened.
1470 * Alternately, an ADISC/PDISC ELS should suffice, as well. 1478 * Alternately, an ADISC/PDISC ELS should suffice, as well.
1471 */ 1479 */
1472 plogi = (struct fsf_plogi *) req->qtcb->bottom.support.els; 1480 plogi = (struct fc_els_flogi *) req->qtcb->bottom.support.els;
1473 if (req->qtcb->bottom.support.els1_length >= 1481 if (req->qtcb->bottom.support.els1_length >=
1474 FSF_PLOGI_MIN_LEN) { 1482 FSF_PLOGI_MIN_LEN)
1475 if (plogi->serv_param.wwpn != port->wwpn) {
1476 port->d_id = 0;
1477 dev_warn(&port->adapter->ccw_device->dev,
1478 "A port opened with WWPN 0x%016Lx "
1479 "returned data that identifies it as "
1480 "WWPN 0x%016Lx\n",
1481 (unsigned long long) port->wwpn,
1482 (unsigned long long)
1483 plogi->serv_param.wwpn);
1484 } else {
1485 port->wwnn = plogi->serv_param.wwnn;
1486 zfcp_fc_plogi_evaluate(port, plogi); 1483 zfcp_fc_plogi_evaluate(port, plogi);
1487 }
1488 }
1489 break; 1484 break;
1490 case FSF_UNKNOWN_OP_SUBTYPE: 1485 case FSF_UNKNOWN_OP_SUBTYPE:
1491 req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1486 req->status |= ZFCP_STATUS_FSFREQ_ERROR;