diff options
author | <jejb@titanic.il.steeleye.com> | 2005-04-11 00:04:28 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic> | 2005-04-18 13:34:41 -0400 |
commit | 6f71d9bc025b02a8cbc2be83b0226a7043a507a5 (patch) | |
tree | 01caefa8cdcb986b0a698c640a6a59d89e69db62 /drivers/s390/scsi | |
parent | f4c2c15b930b23edaa633b09fe3f4c01b4ecce9f (diff) |
zfcp: add point-2-point support
From: Andreas Herrmann <aherrman@de.ibm.com>
This patch mainly introduces support for point-2-point
topology.
From: Heiko Carstens <heiko.carstens@de.ibm.com>
From: Maxim Shchetynin <maxim@de.ibm.com>
From: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 5 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 20 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 38 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.h | 6 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_adapter.c | 6 |
6 files changed, 65 insertions, 14 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 6a43322ccb0a..a393cf4d0313 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -89,10 +89,10 @@ MODULE_DESCRIPTION | |||
89 | ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries"); | 89 | ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries"); |
90 | MODULE_LICENSE("GPL"); | 90 | MODULE_LICENSE("GPL"); |
91 | 91 | ||
92 | module_param(device, charp, 0); | 92 | module_param(device, charp, 0400); |
93 | MODULE_PARM_DESC(device, "specify initial device"); | 93 | MODULE_PARM_DESC(device, "specify initial device"); |
94 | 94 | ||
95 | module_param(loglevel, uint, 0); | 95 | module_param(loglevel, uint, 0400); |
96 | MODULE_PARM_DESC(loglevel, | 96 | MODULE_PARM_DESC(loglevel, |
97 | "log levels, 8 nibbles: " | 97 | "log levels, 8 nibbles: " |
98 | "FC ERP QDIO CIO Config FSF SCSI Other, " | 98 | "FC ERP QDIO CIO Config FSF SCSI Other, " |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 53fcccbb424c..0afa1c4696ca 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -70,7 +70,7 @@ | |||
70 | /********************* GENERAL DEFINES *********************************/ | 70 | /********************* GENERAL DEFINES *********************************/ |
71 | 71 | ||
72 | /* zfcp version number, it consists of major, minor, and patch-level number */ | 72 | /* zfcp version number, it consists of major, minor, and patch-level number */ |
73 | #define ZFCP_VERSION "4.2.0" | 73 | #define ZFCP_VERSION "4.3.0" |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * zfcp_sg_to_address - determine kernel address from struct scatterlist | 76 | * zfcp_sg_to_address - determine kernel address from struct scatterlist |
@@ -851,6 +851,9 @@ struct zfcp_adapter { | |||
851 | wwn_t wwnn; /* WWNN */ | 851 | wwn_t wwnn; /* WWNN */ |
852 | wwn_t wwpn; /* WWPN */ | 852 | wwn_t wwpn; /* WWPN */ |
853 | fc_id_t s_id; /* N_Port ID */ | 853 | fc_id_t s_id; /* N_Port ID */ |
854 | wwn_t peer_wwnn; /* P2P peer WWNN */ | ||
855 | wwn_t peer_wwpn; /* P2P peer WWPN */ | ||
856 | fc_id_t peer_d_id; /* P2P peer D_ID */ | ||
854 | struct ccw_device *ccw_device; /* S/390 ccw device */ | 857 | struct ccw_device *ccw_device; /* S/390 ccw device */ |
855 | u8 fc_service_class; | 858 | u8 fc_service_class; |
856 | u32 fc_topology; /* FC topology */ | 859 | u32 fc_topology; /* FC topology */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index cfc0d8c588df..53ebc1cdfe2d 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -2568,6 +2568,23 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) | |||
2568 | case ZFCP_ERP_STEP_UNINITIALIZED: | 2568 | case ZFCP_ERP_STEP_UNINITIALIZED: |
2569 | case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: | 2569 | case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: |
2570 | case ZFCP_ERP_STEP_PORT_CLOSING: | 2570 | case ZFCP_ERP_STEP_PORT_CLOSING: |
2571 | if (adapter->fc_topology == FSF_TOPO_P2P) { | ||
2572 | if (port->wwpn != adapter->peer_wwpn) { | ||
2573 | ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " | ||
2574 | "on adapter %s.\nPeer WWPN " | ||
2575 | "0x%016Lx does not match\n", | ||
2576 | port->wwpn, | ||
2577 | zfcp_get_busid_by_adapter(adapter), | ||
2578 | adapter->peer_wwpn); | ||
2579 | zfcp_erp_port_failed(port); | ||
2580 | retval = ZFCP_ERP_FAILED; | ||
2581 | break; | ||
2582 | } | ||
2583 | port->d_id = adapter->peer_d_id; | ||
2584 | atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status); | ||
2585 | retval = zfcp_erp_port_strategy_open_port(erp_action); | ||
2586 | break; | ||
2587 | } | ||
2571 | if (!(adapter->nameserver_port)) { | 2588 | if (!(adapter->nameserver_port)) { |
2572 | retval = zfcp_nameserver_enqueue(adapter); | 2589 | retval = zfcp_nameserver_enqueue(adapter); |
2573 | if (retval != 0) { | 2590 | if (retval != 0) { |
@@ -3516,8 +3533,9 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) | |||
3516 | debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); | 3533 | debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); |
3517 | debug_event(adapter->erp_dbf, 3, &adapter->name, 8); | 3534 | debug_event(adapter->erp_dbf, 3, &adapter->name, 8); |
3518 | 3535 | ||
3519 | zfcp_erp_port_access_changed(adapter->nameserver_port); | ||
3520 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 3536 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
3537 | if (adapter->nameserver_port) | ||
3538 | zfcp_erp_port_access_changed(adapter->nameserver_port); | ||
3521 | list_for_each_entry(port, &adapter->port_list_head, list) | 3539 | list_for_each_entry(port, &adapter->port_list_head, list) |
3522 | if (port != adapter->nameserver_port) | 3540 | if (port != adapter->nameserver_port) |
3523 | zfcp_erp_port_access_changed(port); | 3541 | zfcp_erp_port_access_changed(port); |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 578b9fbe5206..148b11c822bf 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -2107,6 +2107,9 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) | |||
2107 | bottom->low_qtcb_version, bottom->high_qtcb_version); | 2107 | bottom->low_qtcb_version, bottom->high_qtcb_version); |
2108 | adapter->fsf_lic_version = bottom->lic_version; | 2108 | adapter->fsf_lic_version = bottom->lic_version; |
2109 | adapter->supported_features = bottom->supported_features; | 2109 | adapter->supported_features = bottom->supported_features; |
2110 | adapter->peer_wwpn = 0; | ||
2111 | adapter->peer_wwnn = 0; | ||
2112 | adapter->peer_d_id = 0; | ||
2110 | 2113 | ||
2111 | if (xchg_ok) { | 2114 | if (xchg_ok) { |
2112 | adapter->wwnn = bottom->nport_serv_param.wwnn; | 2115 | adapter->wwnn = bottom->nport_serv_param.wwnn; |
@@ -2124,13 +2127,19 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) | |||
2124 | adapter->hydra_version = 0; | 2127 | adapter->hydra_version = 0; |
2125 | } | 2128 | } |
2126 | 2129 | ||
2130 | if (adapter->fc_topology == FSF_TOPO_P2P) { | ||
2131 | adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; | ||
2132 | adapter->peer_wwpn = bottom->plogi_payload.wwpn; | ||
2133 | adapter->peer_wwnn = bottom->plogi_payload.wwnn; | ||
2134 | } | ||
2135 | |||
2127 | if(adapter->supported_features & FSF_FEATURE_HBAAPI_MANAGEMENT){ | 2136 | if(adapter->supported_features & FSF_FEATURE_HBAAPI_MANAGEMENT){ |
2128 | adapter->hardware_version = bottom->hardware_version; | 2137 | adapter->hardware_version = bottom->hardware_version; |
2129 | memcpy(adapter->serial_number, bottom->serial_number, 17); | 2138 | memcpy(adapter->serial_number, bottom->serial_number, 17); |
2130 | EBCASC(adapter->serial_number, sizeof(adapter->serial_number)); | 2139 | EBCASC(adapter->serial_number, sizeof(adapter->serial_number)); |
2131 | } | 2140 | } |
2132 | 2141 | ||
2133 | ZFCP_LOG_INFO("The adapter %s reported the following characteristics:\n" | 2142 | ZFCP_LOG_NORMAL("The adapter %s reported the following characteristics:\n" |
2134 | "WWNN 0x%016Lx, " | 2143 | "WWNN 0x%016Lx, " |
2135 | "WWPN 0x%016Lx, " | 2144 | "WWPN 0x%016Lx, " |
2136 | "S_ID 0x%08x,\n" | 2145 | "S_ID 0x%08x,\n" |
@@ -2194,14 +2203,18 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2194 | switch (adapter->fc_topology) { | 2203 | switch (adapter->fc_topology) { |
2195 | case FSF_TOPO_P2P: | 2204 | case FSF_TOPO_P2P: |
2196 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n"); | 2205 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n"); |
2197 | ZFCP_LOG_NORMAL("error: Point-to-point fibrechannel " | 2206 | ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " |
2198 | "configuration detected at adapter %s " | 2207 | "configuration detected at adapter %s\n" |
2199 | "unsupported, shutting down adapter\n", | 2208 | "Peer WWNN 0x%016llx, " |
2200 | zfcp_get_busid_by_adapter(adapter)); | 2209 | "peer WWPN 0x%016llx, " |
2210 | "peer d_id 0x%06x\n", | ||
2211 | zfcp_get_busid_by_adapter(adapter), | ||
2212 | adapter->peer_wwnn, | ||
2213 | adapter->peer_wwpn, | ||
2214 | adapter->peer_d_id); | ||
2201 | debug_text_event(fsf_req->adapter->erp_dbf, 0, | 2215 | debug_text_event(fsf_req->adapter->erp_dbf, 0, |
2202 | "top-p-to-p"); | 2216 | "top-p-to-p"); |
2203 | zfcp_erp_adapter_shutdown(adapter, 0); | 2217 | break; |
2204 | return -EIO; | ||
2205 | case FSF_TOPO_AL: | 2218 | case FSF_TOPO_AL: |
2206 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n"); | 2219 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n"); |
2207 | ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " | 2220 | ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " |
@@ -2226,6 +2239,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2226 | "of a type known to the zfcp " | 2239 | "of a type known to the zfcp " |
2227 | "driver, shutting down adapter\n", | 2240 | "driver, shutting down adapter\n", |
2228 | zfcp_get_busid_by_adapter(adapter)); | 2241 | zfcp_get_busid_by_adapter(adapter)); |
2242 | adapter->fc_topology = FSF_TOPO_ERROR; | ||
2229 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, | 2243 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, |
2230 | "unknown-topo"); | 2244 | "unknown-topo"); |
2231 | zfcp_erp_adapter_shutdown(adapter, 0); | 2245 | zfcp_erp_adapter_shutdown(adapter, 0); |
@@ -4281,6 +4295,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) | |||
4281 | bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE); | 4295 | bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE); |
4282 | zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0); | 4296 | zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0); |
4283 | set_host_byte(&scpnt->result, DID_ERROR); | 4297 | set_host_byte(&scpnt->result, DID_ERROR); |
4298 | goto skip_fsfstatus; | ||
4284 | } | 4299 | } |
4285 | } | 4300 | } |
4286 | 4301 | ||
@@ -4334,7 +4349,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) | |||
4334 | 4349 | ||
4335 | scpnt->resid = fcp_rsp_iu->fcp_resid; | 4350 | scpnt->resid = fcp_rsp_iu->fcp_resid; |
4336 | if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) | 4351 | if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) |
4337 | scpnt->result |= DID_ERROR << 16; | 4352 | set_host_byte(&scpnt->result, DID_ERROR); |
4338 | } | 4353 | } |
4339 | 4354 | ||
4340 | skip_fsfstatus: | 4355 | skip_fsfstatus: |
@@ -4607,6 +4622,13 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) | |||
4607 | if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { | 4622 | if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { |
4608 | switch (header->fsf_status_qual.word[0]) { | 4623 | switch (header->fsf_status_qual.word[0]) { |
4609 | 4624 | ||
4625 | case FSF_SQ_CFDC_HARDENED_ON_SE: | ||
4626 | ZFCP_LOG_NORMAL( | ||
4627 | "CFDC on the adapter %s has being " | ||
4628 | "hardened on primary and secondary SE\n", | ||
4629 | zfcp_get_busid_by_adapter(adapter)); | ||
4630 | break; | ||
4631 | |||
4610 | case FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE: | 4632 | case FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE: |
4611 | ZFCP_LOG_NORMAL( | 4633 | ZFCP_LOG_NORMAL( |
4612 | "CFDC of the adapter %s could not " | 4634 | "CFDC of the adapter %s could not " |
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h index 5889956bbf08..07140dfda2a7 100644 --- a/drivers/s390/scsi/zfcp_fsf.h +++ b/drivers/s390/scsi/zfcp_fsf.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 | 129 | #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 |
130 | 130 | ||
131 | /* FSF status qualifier for CFDC commands */ | 131 | /* FSF status qualifier for CFDC commands */ |
132 | #define FSF_SQ_CFDC_HARDENED_ON_SE 0x00000000 | ||
132 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 | 133 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 |
133 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 | 134 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 |
134 | /* CFDC subtable codes */ | 135 | /* CFDC subtable codes */ |
@@ -357,7 +358,6 @@ struct fsf_nport_serv_param { | |||
357 | u8 class3_serv_param[16]; | 358 | u8 class3_serv_param[16]; |
358 | u8 class4_serv_param[16]; | 359 | u8 class4_serv_param[16]; |
359 | u8 vendor_version_level[16]; | 360 | u8 vendor_version_level[16]; |
360 | u8 res1[16]; | ||
361 | } __attribute__ ((packed)); | 361 | } __attribute__ ((packed)); |
362 | 362 | ||
363 | struct fsf_plogi { | 363 | struct fsf_plogi { |
@@ -415,11 +415,13 @@ struct fsf_qtcb_bottom_config { | |||
415 | u8 res2[12]; | 415 | u8 res2[12]; |
416 | u32 s_id; | 416 | u32 s_id; |
417 | struct fsf_nport_serv_param nport_serv_param; | 417 | struct fsf_nport_serv_param nport_serv_param; |
418 | u8 reserved_nport_serv_param[16]; | ||
418 | u8 res3[8]; | 419 | u8 res3[8]; |
419 | u32 adapter_ports; | 420 | u32 adapter_ports; |
420 | u32 hardware_version; | 421 | u32 hardware_version; |
421 | u8 serial_number[32]; | 422 | u8 serial_number[32]; |
422 | u8 res4[272]; | 423 | struct fsf_nport_serv_param plogi_payload; |
424 | u8 res4[160]; | ||
423 | } __attribute__ ((packed)); | 425 | } __attribute__ ((packed)); |
424 | 426 | ||
425 | struct fsf_qtcb_bottom_port { | 427 | struct fsf_qtcb_bottom_port { |
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index ff28ade1dfc7..23e2dca55bb8 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c | |||
@@ -65,6 +65,9 @@ ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status)); | |||
65 | ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn); | 65 | ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn); |
66 | ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn); | 66 | ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn); |
67 | ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id); | 67 | ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id); |
68 | ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn); | ||
69 | ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn); | ||
70 | ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id); | ||
68 | ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); | 71 | ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); |
69 | ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); | 72 | ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); |
70 | ZFCP_DEFINE_ADAPTER_ATTR(fc_link_speed, "%d Gb/s\n", adapter->fc_link_speed); | 73 | ZFCP_DEFINE_ADAPTER_ATTR(fc_link_speed, "%d Gb/s\n", adapter->fc_link_speed); |
@@ -255,6 +258,9 @@ static struct attribute *zfcp_adapter_attrs[] = { | |||
255 | &dev_attr_wwnn.attr, | 258 | &dev_attr_wwnn.attr, |
256 | &dev_attr_wwpn.attr, | 259 | &dev_attr_wwpn.attr, |
257 | &dev_attr_s_id.attr, | 260 | &dev_attr_s_id.attr, |
261 | &dev_attr_peer_wwnn.attr, | ||
262 | &dev_attr_peer_wwpn.attr, | ||
263 | &dev_attr_peer_d_id.attr, | ||
258 | &dev_attr_card_version.attr, | 264 | &dev_attr_card_version.attr, |
259 | &dev_attr_lic_version.attr, | 265 | &dev_attr_lic_version.attr, |
260 | &dev_attr_fc_link_speed.attr, | 266 | &dev_attr_fc_link_speed.attr, |