aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Herrmann <aherrman@de.ibm.com>2005-09-19 10:56:17 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-09-19 14:04:15 -0400
commit13e1e1f08c1c098c7574c1fa72bd8c67792dc89b (patch)
treeaa07ca5b3ac4d21cf76b5f9aa8059334756f4c7f
parentaef4a983090fa590481a86d9690dc3fa6bb121fa (diff)
[SCSI] zfcp: add additional fc_host attributes
this patch adds some fc host attributes and removes its equivalents from the zfcp_adapter structure and zfcp specific sysfs subtree. Furthermore it removes superfluous calls to fc_remort_port_delete when an adapter is set offline because rports will be removed by fc_remove_host anyway. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c10
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c32
-rw-r--r--drivers/s390/scsi/zfcp_def.h16
-rw-r--r--drivers/s390/scsi/zfcp_erp.c16
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c65
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c21
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_adapter.c10
7 files changed, 72 insertions, 98 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index b30abab77da3..0fc46381fc22 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -202,19 +202,9 @@ static int
202zfcp_ccw_set_offline(struct ccw_device *ccw_device) 202zfcp_ccw_set_offline(struct ccw_device *ccw_device)
203{ 203{
204 struct zfcp_adapter *adapter; 204 struct zfcp_adapter *adapter;
205 struct zfcp_port *port;
206 struct fc_rport *rport;
207 205
208 down(&zfcp_data.config_sema); 206 down(&zfcp_data.config_sema);
209 adapter = dev_get_drvdata(&ccw_device->dev); 207 adapter = dev_get_drvdata(&ccw_device->dev);
210 /* might be racy, but we cannot take config_lock due to the fact that
211 fc_remote_port_delete might sleep */
212 list_for_each_entry(port, &adapter->port_list_head, list)
213 if (port->rport) {
214 rport = port->rport;
215 port->rport = NULL;
216 fc_remote_port_delete(rport);
217 }
218 zfcp_erp_adapter_shutdown(adapter, 0); 208 zfcp_erp_adapter_shutdown(adapter, 0);
219 zfcp_erp_wait(adapter); 209 zfcp_erp_wait(adapter);
220 zfcp_adapter_scsi_unregister(adapter); 210 zfcp_adapter_scsi_unregister(adapter);
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 64d9b90373fe..826fb3b00605 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -486,8 +486,7 @@ struct debug_view zfcp_hba_dbf_view = {
486 486
487inline void 487inline void
488_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, 488_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req,
489 fc_id_t s_id, fc_id_t d_id, 489 u32 s_id, u32 d_id, void *buffer, int buflen)
490 void *buffer, int buflen)
491{ 490{
492 struct zfcp_send_ct *send_ct = (struct zfcp_send_ct *)fsf_req->data; 491 struct zfcp_send_ct *send_ct = (struct zfcp_send_ct *)fsf_req->data;
493 struct zfcp_port *port = send_ct->port; 492 struct zfcp_port *port = send_ct->port;
@@ -532,9 +531,9 @@ inline void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
532 struct zfcp_port *port = ct->port; 531 struct zfcp_port *port = ct->port;
533 struct zfcp_adapter *adapter = port->adapter; 532 struct zfcp_adapter *adapter = port->adapter;
534 533
535 _zfcp_san_dbf_event_common_ct("octc", 534 _zfcp_san_dbf_event_common_ct("octc", fsf_req,
536 fsf_req, adapter->s_id, port->d_id, 535 fc_host_port_id(adapter->scsi_host),
537 zfcp_sg_to_address(ct->req), 536 port->d_id, zfcp_sg_to_address(ct->req),
538 ct->req->length); 537 ct->req->length);
539} 538}
540 539
@@ -544,17 +543,16 @@ inline void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
544 struct zfcp_port *port = ct->port; 543 struct zfcp_port *port = ct->port;
545 struct zfcp_adapter *adapter = port->adapter; 544 struct zfcp_adapter *adapter = port->adapter;
546 545
547 _zfcp_san_dbf_event_common_ct("rctc", 546 _zfcp_san_dbf_event_common_ct("rctc", fsf_req, port->d_id,
548 fsf_req, port->d_id, adapter->s_id, 547 fc_host_port_id(adapter->scsi_host),
549 zfcp_sg_to_address(ct->resp), 548 zfcp_sg_to_address(ct->resp),
550 ct->resp->length); 549 ct->resp->length);
551} 550}
552 551
553static inline void 552static inline void
554_zfcp_san_dbf_event_common_els(const char *tag, int level, 553_zfcp_san_dbf_event_common_els(const char *tag, int level,
555 struct zfcp_fsf_req *fsf_req, 554 struct zfcp_fsf_req *fsf_req, u32 s_id,
556 fc_id_t s_id, fc_id_t d_id, u8 ls_code, 555 u32 d_id, u8 ls_code, void *buffer, int buflen)
557 void *buffer, int buflen)
558{ 556{
559 struct zfcp_adapter *adapter = fsf_req->adapter; 557 struct zfcp_adapter *adapter = fsf_req->adapter;
560 struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf; 558 struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf;
@@ -597,8 +595,9 @@ inline void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req)
597{ 595{
598 struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; 596 struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
599 597
600 _zfcp_san_dbf_event_common_els("oels", 2, 598 _zfcp_san_dbf_event_common_els("oels", 2, fsf_req,
601 fsf_req, els->adapter->s_id, els->d_id, 599 fc_host_port_id(els->adapter->scsi_host),
600 els->d_id,
602 *(u8 *) zfcp_sg_to_address(els->req), 601 *(u8 *) zfcp_sg_to_address(els->req),
603 zfcp_sg_to_address(els->req), 602 zfcp_sg_to_address(els->req),
604 els->req->length); 603 els->req->length);
@@ -608,8 +607,8 @@ inline void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req)
608{ 607{
609 struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; 608 struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
610 609
611 _zfcp_san_dbf_event_common_els("rels", 2, 610 _zfcp_san_dbf_event_common_els("rels", 2, fsf_req, els->d_id,
612 fsf_req, els->d_id, els->adapter->s_id, 611 fc_host_port_id(els->adapter->scsi_host),
613 *(u8 *) zfcp_sg_to_address(els->req), 612 *(u8 *) zfcp_sg_to_address(els->req),
614 zfcp_sg_to_address(els->resp), 613 zfcp_sg_to_address(els->resp),
615 els->resp->length); 614 els->resp->length);
@@ -623,9 +622,8 @@ inline void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req)
623 int length = (int)status_buffer->length - 622 int length = (int)status_buffer->length -
624 (int)((void *)&status_buffer->payload - (void *)status_buffer); 623 (int)((void *)&status_buffer->payload - (void *)status_buffer);
625 624
626 _zfcp_san_dbf_event_common_els("iels", 1, 625 _zfcp_san_dbf_event_common_els("iels", 1, fsf_req, status_buffer->d_id,
627 fsf_req, status_buffer->d_id, 626 fc_host_port_id(adapter->scsi_host),
628 adapter->s_id,
629 *(u8 *) status_buffer->payload, 627 *(u8 *) status_buffer->payload,
630 (void *)status_buffer->payload, length); 628 (void *)status_buffer->payload, length);
631} 629}
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 4b6af8e07e8d..d81b737d68cc 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -165,7 +165,6 @@ typedef u32 scsi_lun_t;
165/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/ 165/*************** FIBRE CHANNEL PROTOCOL SPECIFIC DEFINES ********************/
166 166
167typedef unsigned long long wwn_t; 167typedef unsigned long long wwn_t;
168typedef unsigned int fc_id_t;
169typedef unsigned long long fcp_lun_t; 168typedef unsigned long long fcp_lun_t;
170/* data length field may be at variable position in FCP-2 FCP_CMND IU */ 169/* data length field may be at variable position in FCP-2 FCP_CMND IU */
171typedef unsigned int fcp_dl_t; 170typedef unsigned int fcp_dl_t;
@@ -806,7 +805,7 @@ struct ct_iu_gid_pn_req {
806/* FS_ACC IU and data unit for GID_PN nameserver request */ 805/* FS_ACC IU and data unit for GID_PN nameserver request */
807struct ct_iu_gid_pn_resp { 806struct ct_iu_gid_pn_resp {
808 struct ct_hdr header; 807 struct ct_hdr header;
809 fc_id_t d_id; 808 u32 d_id;
810} __attribute__ ((packed)); 809} __attribute__ ((packed));
811 810
812typedef void (*zfcp_send_ct_handler_t)(unsigned long); 811typedef void (*zfcp_send_ct_handler_t)(unsigned long);
@@ -872,7 +871,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long);
872struct zfcp_send_els { 871struct zfcp_send_els {
873 struct zfcp_adapter *adapter; 872 struct zfcp_adapter *adapter;
874 struct zfcp_port *port; 873 struct zfcp_port *port;
875 fc_id_t d_id; 874 u32 d_id;
876 struct scatterlist *req; 875 struct scatterlist *req;
877 struct scatterlist *resp; 876 struct scatterlist *resp;
878 unsigned int req_count; 877 unsigned int req_count;
@@ -915,24 +914,19 @@ struct zfcp_adapter {
915 atomic_t refcount; /* reference count */ 914 atomic_t refcount; /* reference count */
916 wait_queue_head_t remove_wq; /* can be used to wait for 915 wait_queue_head_t remove_wq; /* can be used to wait for
917 refcount drop to zero */ 916 refcount drop to zero */
918 wwn_t wwnn; /* WWNN */
919 wwn_t wwpn; /* WWPN */
920 fc_id_t s_id; /* N_Port ID */
921 wwn_t peer_wwnn; /* P2P peer WWNN */ 917 wwn_t peer_wwnn; /* P2P peer WWNN */
922 wwn_t peer_wwpn; /* P2P peer WWPN */ 918 wwn_t peer_wwpn; /* P2P peer WWPN */
923 fc_id_t peer_d_id; /* P2P peer D_ID */ 919 u32 peer_d_id; /* P2P peer D_ID */
924 wwn_t physical_wwpn; /* WWPN of physical port */ 920 wwn_t physical_wwpn; /* WWPN of physical port */
925 fc_id_t physical_s_id; /* local FC port ID */ 921 u32 physical_s_id; /* local FC port ID */
926 struct ccw_device *ccw_device; /* S/390 ccw device */ 922 struct ccw_device *ccw_device; /* S/390 ccw device */
927 u8 fc_service_class; 923 u8 fc_service_class;
928 u32 fc_topology; /* FC topology */ 924 u32 fc_topology; /* FC topology */
929 u32 fc_link_speed; /* FC interface speed */
930 u32 hydra_version; /* Hydra version */ 925 u32 hydra_version; /* Hydra version */
931 u32 fsf_lic_version; 926 u32 fsf_lic_version;
932 u32 adapter_features; /* FCP channel features */ 927 u32 adapter_features; /* FCP channel features */
933 u32 connection_features; /* host connection features */ 928 u32 connection_features; /* host connection features */
934 u32 hardware_version; /* of FCP channel */ 929 u32 hardware_version; /* of FCP channel */
935 u8 serial_number[32]; /* of hardware */
936 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */ 930 struct Scsi_Host *scsi_host; /* Pointer to mid-layer */
937 unsigned short scsi_host_no; /* Assigned host number */ 931 unsigned short scsi_host_no; /* Assigned host number */
938 unsigned char name[9]; 932 unsigned char name[9];
@@ -1006,7 +1000,7 @@ struct zfcp_port {
1006 atomic_t status; /* status of this remote port */ 1000 atomic_t status; /* status of this remote port */
1007 wwn_t wwnn; /* WWNN if known */ 1001 wwn_t wwnn; /* WWNN if known */
1008 wwn_t wwpn; /* WWPN */ 1002 wwn_t wwpn; /* WWPN */
1009 fc_id_t d_id; /* D_ID */ 1003 u32 d_id; /* D_ID */
1010 u32 handle; /* handle assigned by FSF */ 1004 u32 handle; /* handle assigned by FSF */
1011 struct zfcp_erp_action erp_action; /* pending error recovery */ 1005 struct zfcp_erp_action erp_action; /* pending error recovery */
1012 atomic_t erp_counter; 1006 atomic_t erp_counter;
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index c4a6799aed44..023f4e558ae4 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -346,13 +346,13 @@ zfcp_erp_adisc(struct zfcp_port *port)
346 346
347 /* acc. to FC-FS, hard_nport_id in ADISC should not be set for ports 347 /* acc. to FC-FS, hard_nport_id in ADISC should not be set for ports
348 without FC-AL-2 capability, so we don't set it */ 348 without FC-AL-2 capability, so we don't set it */
349 adisc->wwpn = adapter->wwpn; 349 adisc->wwpn = fc_host_port_name(adapter->scsi_host);
350 adisc->wwnn = adapter->wwnn; 350 adisc->wwnn = fc_host_node_name(adapter->scsi_host);
351 adisc->nport_id = adapter->s_id; 351 adisc->nport_id = fc_host_port_id(adapter->scsi_host);
352 ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x " 352 ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x "
353 "(wwpn=0x%016Lx, wwnn=0x%016Lx, " 353 "(wwpn=0x%016Lx, wwnn=0x%016Lx, "
354 "hard_nport_id=0x%08x, nport_id=0x%08x)\n", 354 "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
355 adapter->s_id, send_els->d_id, (wwn_t) adisc->wwpn, 355 adisc->nport_id, send_els->d_id, (wwn_t) adisc->wwpn,
356 (wwn_t) adisc->wwnn, adisc->hard_nport_id, 356 (wwn_t) adisc->wwnn, adisc->hard_nport_id,
357 adisc->nport_id); 357 adisc->nport_id);
358 358
@@ -405,7 +405,7 @@ zfcp_erp_adisc_handler(unsigned long data)
405 struct zfcp_send_els *send_els; 405 struct zfcp_send_els *send_els;
406 struct zfcp_port *port; 406 struct zfcp_port *port;
407 struct zfcp_adapter *adapter; 407 struct zfcp_adapter *adapter;
408 fc_id_t d_id; 408 u32 d_id;
409 struct zfcp_ls_adisc_acc *adisc; 409 struct zfcp_ls_adisc_acc *adisc;
410 410
411 send_els = (struct zfcp_send_els *) data; 411 send_els = (struct zfcp_send_els *) data;
@@ -436,9 +436,9 @@ zfcp_erp_adisc_handler(unsigned long data)
436 ZFCP_LOG_INFO("ADISC response from d_id 0x%08x to s_id " 436 ZFCP_LOG_INFO("ADISC response from d_id 0x%08x to s_id "
437 "0x%08x (wwpn=0x%016Lx, wwnn=0x%016Lx, " 437 "0x%08x (wwpn=0x%016Lx, wwnn=0x%016Lx, "
438 "hard_nport_id=0x%08x, nport_id=0x%08x)\n", 438 "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
439 d_id, adapter->s_id, (wwn_t) adisc->wwpn, 439 d_id, fc_host_port_id(adapter->scsi_host),
440 (wwn_t) adisc->wwnn, adisc->hard_nport_id, 440 (wwn_t) adisc->wwpn, (wwn_t) adisc->wwnn,
441 adisc->nport_id); 441 adisc->hard_nport_id, adisc->nport_id);
442 442
443 /* set wwnn for port */ 443 /* set wwnn for port */
444 if (port->wwnn == 0) 444 if (port->wwnn == 0)
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index f994f453e2d2..3b0fc1163f5f 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -1617,7 +1617,7 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1617{ 1617{
1618 volatile struct qdio_buffer_element *sbale; 1618 volatile struct qdio_buffer_element *sbale;
1619 struct zfcp_fsf_req *fsf_req; 1619 struct zfcp_fsf_req *fsf_req;
1620 fc_id_t d_id; 1620 u32 d_id;
1621 struct zfcp_adapter *adapter; 1621 struct zfcp_adapter *adapter;
1622 unsigned long lock_flags; 1622 unsigned long lock_flags;
1623 int bytes; 1623 int bytes;
@@ -1740,7 +1740,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1740{ 1740{
1741 struct zfcp_adapter *adapter; 1741 struct zfcp_adapter *adapter;
1742 struct zfcp_port *port; 1742 struct zfcp_port *port;
1743 fc_id_t d_id; 1743 u32 d_id;
1744 struct fsf_qtcb_header *header; 1744 struct fsf_qtcb_header *header;
1745 struct fsf_qtcb_bottom_support *bottom; 1745 struct fsf_qtcb_bottom_support *bottom;
1746 struct zfcp_send_els *send_els; 1746 struct zfcp_send_els *send_els;
@@ -1978,6 +1978,7 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
1978{ 1978{
1979 struct fsf_qtcb_bottom_config *bottom; 1979 struct fsf_qtcb_bottom_config *bottom;
1980 struct zfcp_adapter *adapter = fsf_req->adapter; 1980 struct zfcp_adapter *adapter = fsf_req->adapter;
1981 struct Scsi_Host *shost = adapter->scsi_host;
1981 1982
1982 bottom = &fsf_req->qtcb->bottom.config; 1983 bottom = &fsf_req->qtcb->bottom.config;
1983 ZFCP_LOG_DEBUG("low/high QTCB version 0x%x/0x%x of FSF\n", 1984 ZFCP_LOG_DEBUG("low/high QTCB version 0x%x/0x%x of FSF\n",
@@ -1990,22 +1991,23 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
1990 adapter->peer_d_id = 0; 1991 adapter->peer_d_id = 0;
1991 1992
1992 if (xchg_ok) { 1993 if (xchg_ok) {
1993 adapter->wwnn = bottom->nport_serv_param.wwnn; 1994 fc_host_node_name(shost) = bottom->nport_serv_param.wwnn;
1994 adapter->wwpn = bottom->nport_serv_param.wwpn; 1995 fc_host_port_name(shost) = bottom->nport_serv_param.wwpn;
1995 adapter->s_id = bottom->s_id & ZFCP_DID_MASK; 1996 fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK;
1997 fc_host_speed(shost) = bottom->fc_link_speed;
1998 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3;
1996 adapter->fc_topology = bottom->fc_topology; 1999 adapter->fc_topology = bottom->fc_topology;
1997 adapter->fc_link_speed = bottom->fc_link_speed;
1998 adapter->hydra_version = bottom->adapter_type; 2000 adapter->hydra_version = bottom->adapter_type;
1999 if (adapter->physical_wwpn == 0) 2001 if (adapter->physical_wwpn == 0)
2000 adapter->physical_wwpn = adapter->wwpn; 2002 adapter->physical_wwpn = fc_host_port_name(shost);
2001 if (adapter->physical_s_id == 0) 2003 if (adapter->physical_s_id == 0)
2002 adapter->physical_s_id = adapter->s_id; 2004 adapter->physical_s_id = fc_host_port_id(shost);
2003 } else { 2005 } else {
2004 adapter->wwnn = 0; 2006 fc_host_node_name(shost) = 0;
2005 adapter->wwpn = 0; 2007 fc_host_port_name(shost) = 0;
2006 adapter->s_id = 0; 2008 fc_host_port_id(shost) = 0;
2009 fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
2007 adapter->fc_topology = 0; 2010 adapter->fc_topology = 0;
2008 adapter->fc_link_speed = 0;
2009 adapter->hydra_version = 0; 2011 adapter->hydra_version = 0;
2010 } 2012 }
2011 2013
@@ -2017,24 +2019,26 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
2017 2019
2018 if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { 2020 if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) {
2019 adapter->hardware_version = bottom->hardware_version; 2021 adapter->hardware_version = bottom->hardware_version;
2020 memcpy(adapter->serial_number, bottom->serial_number, 17); 2022 memcpy(fc_host_serial_number(shost), bottom->serial_number,
2021 EBCASC(adapter->serial_number, sizeof(adapter->serial_number)); 2023 min(FC_SERIAL_NUMBER_SIZE, 17));
2024 EBCASC(fc_host_serial_number(shost),
2025 min(FC_SERIAL_NUMBER_SIZE, 17));
2022 } 2026 }
2023 2027
2024 ZFCP_LOG_NORMAL("The adapter %s reported the following characteristics:\n" 2028 ZFCP_LOG_NORMAL("The adapter %s reported the following characteristics:\n"
2025 "WWNN 0x%016Lx, " 2029 "WWNN 0x%016Lx, "
2026 "WWPN 0x%016Lx, " 2030 "WWPN 0x%016Lx, "
2027 "S_ID 0x%08x,\n" 2031 "S_ID 0x%08x,\n"
2028 "adapter version 0x%x, " 2032 "adapter version 0x%x, "
2029 "LIC version 0x%x, " 2033 "LIC version 0x%x, "
2030 "FC link speed %d Gb/s\n", 2034 "FC link speed %d Gb/s\n",
2031 zfcp_get_busid_by_adapter(adapter), 2035 zfcp_get_busid_by_adapter(adapter),
2032 adapter->wwnn, 2036 (wwn_t) fc_host_node_name(shost),
2033 adapter->wwpn, 2037 (wwn_t) fc_host_port_name(shost),
2034 (unsigned int) adapter->s_id, 2038 fc_host_port_id(shost),
2035 adapter->hydra_version, 2039 adapter->hydra_version,
2036 adapter->fsf_lic_version, 2040 adapter->fsf_lic_version,
2037 adapter->fc_link_speed); 2041 fc_host_speed(shost));
2038 if (ZFCP_QTCB_VERSION < bottom->low_qtcb_version) { 2042 if (ZFCP_QTCB_VERSION < bottom->low_qtcb_version) {
2039 ZFCP_LOG_NORMAL("error: the adapter %s " 2043 ZFCP_LOG_NORMAL("error: the adapter %s "
2040 "only supports newer control block " 2044 "only supports newer control block "
@@ -2055,7 +2059,6 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
2055 zfcp_erp_adapter_shutdown(adapter, 0); 2059 zfcp_erp_adapter_shutdown(adapter, 0);
2056 return -EIO; 2060 return -EIO;
2057 } 2061 }
2058 zfcp_set_fc_host_attrs(adapter);
2059 return 0; 2062 return 0;
2060} 2063}
2061 2064
@@ -2259,6 +2262,7 @@ static void
2259zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) 2262zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
2260{ 2263{
2261 struct zfcp_adapter *adapter = fsf_req->adapter; 2264 struct zfcp_adapter *adapter = fsf_req->adapter;
2265 struct Scsi_Host *shost = adapter->scsi_host;
2262 struct fsf_qtcb *qtcb = fsf_req->qtcb; 2266 struct fsf_qtcb *qtcb = fsf_req->qtcb;
2263 struct fsf_qtcb_bottom_port *bottom, *data; 2267 struct fsf_qtcb_bottom_port *bottom, *data;
2264 2268
@@ -2277,9 +2281,10 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
2277 adapter->physical_wwpn = bottom->wwpn; 2281 adapter->physical_wwpn = bottom->wwpn;
2278 adapter->physical_s_id = bottom->fc_port_id; 2282 adapter->physical_s_id = bottom->fc_port_id;
2279 } else { 2283 } else {
2280 adapter->physical_wwpn = adapter->wwpn; 2284 adapter->physical_wwpn = fc_host_port_name(shost);
2281 adapter->physical_s_id = adapter->s_id; 2285 adapter->physical_s_id = fc_host_port_id(shost);
2282 } 2286 }
2287 fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
2283 break; 2288 break;
2284 2289
2285 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: 2290 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index c1403a23174f..3dcd1bfba3b4 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -698,10 +698,16 @@ void
698zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter) 698zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
699{ 699{
700 struct Scsi_Host *shost; 700 struct Scsi_Host *shost;
701 struct zfcp_port *port;
701 702
702 shost = adapter->scsi_host; 703 shost = adapter->scsi_host;
703 if (!shost) 704 if (!shost)
704 return; 705 return;
706 read_lock_irq(&zfcp_data.config_lock);
707 list_for_each_entry(port, &adapter->port_list_head, list)
708 if (port->rport)
709 port->rport = NULL;
710 read_unlock_irq(&zfcp_data.config_lock);
705 fc_remove_host(shost); 711 fc_remove_host(shost);
706 scsi_remove_host(shost); 712 scsi_remove_host(shost);
707 scsi_host_put(shost); 713 scsi_host_put(shost);
@@ -776,18 +782,6 @@ zfcp_get_node_name(struct scsi_target *starget)
776 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 782 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
777} 783}
778 784
779void
780zfcp_set_fc_host_attrs(struct zfcp_adapter *adapter)
781{
782 struct Scsi_Host *shost = adapter->scsi_host;
783
784 fc_host_node_name(shost) = adapter->wwnn;
785 fc_host_port_name(shost) = adapter->wwpn;
786 strncpy(fc_host_serial_number(shost), adapter->serial_number,
787 min(FC_SERIAL_NUMBER_SIZE, 32));
788 fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3;
789}
790
791struct fc_function_template zfcp_transport_functions = { 785struct fc_function_template zfcp_transport_functions = {
792 .get_starget_port_id = zfcp_get_port_id, 786 .get_starget_port_id = zfcp_get_port_id,
793 .get_starget_port_name = zfcp_get_port_name, 787 .get_starget_port_name = zfcp_get_port_name,
@@ -799,7 +793,10 @@ struct fc_function_template zfcp_transport_functions = {
799 .show_host_node_name = 1, 793 .show_host_node_name = 1,
800 .show_host_port_name = 1, 794 .show_host_port_name = 1,
801 .show_host_supported_classes = 1, 795 .show_host_supported_classes = 1,
796 .show_host_maxframe_size = 1,
802 .show_host_serial_number = 1, 797 .show_host_serial_number = 1,
798 .show_host_speed = 1,
799 .show_host_port_id = 1,
803}; 800};
804 801
805/** 802/**
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c
index c406ea5c5e95..0cd435280e7d 100644
--- a/drivers/s390/scsi/zfcp_sysfs_adapter.c
+++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c
@@ -62,9 +62,6 @@ static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, struct devi
62static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_adapter_##_name##_show, NULL); 62static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_adapter_##_name##_show, NULL);
63 63
64ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status)); 64ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status));
65ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn);
66ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn);
67ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id);
68ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn); 65ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn);
69ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn); 66ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn);
70ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id); 67ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id);
@@ -72,13 +69,11 @@ ZFCP_DEFINE_ADAPTER_ATTR(physical_wwpn, "0x%016llx\n", adapter->physical_wwpn);
72ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); 69ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id);
73ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); 70ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version);
74ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); 71ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version);
75ZFCP_DEFINE_ADAPTER_ATTR(fc_link_speed, "%d Gb/s\n", adapter->fc_link_speed);
76ZFCP_DEFINE_ADAPTER_ATTR(fc_service_class, "%d\n", adapter->fc_service_class); 72ZFCP_DEFINE_ADAPTER_ATTR(fc_service_class, "%d\n", adapter->fc_service_class);
77ZFCP_DEFINE_ADAPTER_ATTR(fc_topology, "%s\n", 73ZFCP_DEFINE_ADAPTER_ATTR(fc_topology, "%s\n",
78 fc_topologies[adapter->fc_topology]); 74 fc_topologies[adapter->fc_topology]);
79ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", 75ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n",
80 adapter->hardware_version); 76 adapter->hardware_version);
81ZFCP_DEFINE_ADAPTER_ATTR(serial_number, "%17s\n", adapter->serial_number);
82ZFCP_DEFINE_ADAPTER_ATTR(scsi_host_no, "0x%x\n", adapter->scsi_host_no); 77ZFCP_DEFINE_ADAPTER_ATTR(scsi_host_no, "0x%x\n", adapter->scsi_host_no);
83ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask 78ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask
84 (ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status)); 79 (ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status));
@@ -257,9 +252,6 @@ static struct attribute *zfcp_adapter_attrs[] = {
257 &dev_attr_in_recovery.attr, 252 &dev_attr_in_recovery.attr,
258 &dev_attr_port_remove.attr, 253 &dev_attr_port_remove.attr,
259 &dev_attr_port_add.attr, 254 &dev_attr_port_add.attr,
260 &dev_attr_wwnn.attr,
261 &dev_attr_wwpn.attr,
262 &dev_attr_s_id.attr,
263 &dev_attr_peer_wwnn.attr, 255 &dev_attr_peer_wwnn.attr,
264 &dev_attr_peer_wwpn.attr, 256 &dev_attr_peer_wwpn.attr,
265 &dev_attr_peer_d_id.attr, 257 &dev_attr_peer_d_id.attr,
@@ -267,13 +259,11 @@ static struct attribute *zfcp_adapter_attrs[] = {
267 &dev_attr_physical_s_id.attr, 259 &dev_attr_physical_s_id.attr,
268 &dev_attr_card_version.attr, 260 &dev_attr_card_version.attr,
269 &dev_attr_lic_version.attr, 261 &dev_attr_lic_version.attr,
270 &dev_attr_fc_link_speed.attr,
271 &dev_attr_fc_service_class.attr, 262 &dev_attr_fc_service_class.attr,
272 &dev_attr_fc_topology.attr, 263 &dev_attr_fc_topology.attr,
273 &dev_attr_scsi_host_no.attr, 264 &dev_attr_scsi_host_no.attr,
274 &dev_attr_status.attr, 265 &dev_attr_status.attr,
275 &dev_attr_hardware_version.attr, 266 &dev_attr_hardware_version.attr,
276 &dev_attr_serial_number.attr,
277 NULL 267 NULL
278}; 268};
279 269