diff options
author | Andreas Herrmann <aherrman@de.ibm.com> | 2006-01-12 20:26:11 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-01-14 11:54:52 -0500 |
commit | ad757cdfd2a40c9d5310d00f24427525788341cd (patch) | |
tree | 9353d40be65f6834b5e22c59db17273bb10f051e /drivers/s390 | |
parent | f6cd94b126aa78ebaa21075df3b9577fbf995968 (diff) |
[SCSI] zfcp: transport class adaptations II
Replaced zfcp adapter attributes with fc_host attributes:
fc_topology by port_type, physical_wwpn by permanent_port_name.
Make use of fc_host attribute supported_speeds.
Removed zfcp adapter attribute physical_s_id.
Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 1 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 49 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.h | 1 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_adapter.c | 11 |
6 files changed, 29 insertions, 38 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 3785b3c98a58..9bb511083a26 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -921,7 +921,6 @@ struct zfcp_adapter { | |||
921 | u32 physical_s_id; /* local FC port ID */ | 921 | u32 physical_s_id; /* local FC port ID */ |
922 | struct ccw_device *ccw_device; /* S/390 ccw device */ | 922 | struct ccw_device *ccw_device; /* S/390 ccw device */ |
923 | u8 fc_service_class; | 923 | u8 fc_service_class; |
924 | u32 fc_topology; /* FC topology */ | ||
925 | u32 hydra_version; /* Hydra version */ | 924 | u32 hydra_version; /* Hydra version */ |
926 | u32 fsf_lic_version; | 925 | u32 fsf_lic_version; |
927 | u32 adapter_features; /* FCP channel features */ | 926 | u32 adapter_features; /* FCP channel features */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index ee7314d8c2da..7bdb00b5aeb2 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -2613,7 +2613,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) | |||
2613 | case ZFCP_ERP_STEP_UNINITIALIZED: | 2613 | case ZFCP_ERP_STEP_UNINITIALIZED: |
2614 | case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: | 2614 | case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: |
2615 | case ZFCP_ERP_STEP_PORT_CLOSING: | 2615 | case ZFCP_ERP_STEP_PORT_CLOSING: |
2616 | if (adapter->fc_topology == FSF_TOPO_P2P) { | 2616 | if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) { |
2617 | if (port->wwpn != adapter->peer_wwpn) { | 2617 | if (port->wwpn != adapter->peer_wwpn) { |
2618 | ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " | 2618 | ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " |
2619 | "on adapter %s.\nPeer WWPN " | 2619 | "on adapter %s.\nPeer WWPN " |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index bf859c9982df..cbfab09899c8 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -2043,27 +2043,30 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) | |||
2043 | fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; | 2043 | fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; |
2044 | fc_host_speed(shost) = bottom->fc_link_speed; | 2044 | fc_host_speed(shost) = bottom->fc_link_speed; |
2045 | fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; | 2045 | fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; |
2046 | adapter->fc_topology = bottom->fc_topology; | ||
2047 | adapter->hydra_version = bottom->adapter_type; | 2046 | adapter->hydra_version = bottom->adapter_type; |
2048 | if (adapter->physical_wwpn == 0) | 2047 | if (fc_host_permanent_port_name(shost) == -1) |
2049 | adapter->physical_wwpn = fc_host_port_name(shost); | 2048 | fc_host_permanent_port_name(shost) = |
2050 | if (adapter->physical_s_id == 0) | 2049 | fc_host_port_name(shost); |
2051 | adapter->physical_s_id = fc_host_port_id(shost); | 2050 | if (bottom->fc_topology == FSF_TOPO_P2P) { |
2051 | adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; | ||
2052 | adapter->peer_wwpn = bottom->plogi_payload.wwpn; | ||
2053 | adapter->peer_wwnn = bottom->plogi_payload.wwnn; | ||
2054 | fc_host_port_type(shost) = FC_PORTTYPE_PTP; | ||
2055 | } else if (bottom->fc_topology == FSF_TOPO_FABRIC) | ||
2056 | fc_host_port_type(shost) = FC_PORTTYPE_NPORT; | ||
2057 | else if (bottom->fc_topology == FSF_TOPO_AL) | ||
2058 | fc_host_port_type(shost) = FC_PORTTYPE_NLPORT; | ||
2059 | else | ||
2060 | fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; | ||
2052 | } else { | 2061 | } else { |
2053 | fc_host_node_name(shost) = 0; | 2062 | fc_host_node_name(shost) = 0; |
2054 | fc_host_port_name(shost) = 0; | 2063 | fc_host_port_name(shost) = 0; |
2055 | fc_host_port_id(shost) = 0; | 2064 | fc_host_port_id(shost) = 0; |
2056 | fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; | 2065 | fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; |
2057 | adapter->fc_topology = 0; | 2066 | fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; |
2058 | adapter->hydra_version = 0; | 2067 | adapter->hydra_version = 0; |
2059 | } | 2068 | } |
2060 | 2069 | ||
2061 | if (adapter->fc_topology == FSF_TOPO_P2P) { | ||
2062 | adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; | ||
2063 | adapter->peer_wwpn = bottom->plogi_payload.wwpn; | ||
2064 | adapter->peer_wwnn = bottom->plogi_payload.wwnn; | ||
2065 | } | ||
2066 | |||
2067 | if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { | 2070 | if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { |
2068 | adapter->hardware_version = bottom->hardware_version; | 2071 | adapter->hardware_version = bottom->hardware_version; |
2069 | memcpy(fc_host_serial_number(shost), bottom->serial_number, | 2072 | memcpy(fc_host_serial_number(shost), bottom->serial_number, |
@@ -2132,8 +2135,8 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2132 | if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) | 2135 | if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) |
2133 | return -EIO; | 2136 | return -EIO; |
2134 | 2137 | ||
2135 | switch (adapter->fc_topology) { | 2138 | switch (fc_host_port_type(adapter->scsi_host)) { |
2136 | case FSF_TOPO_P2P: | 2139 | case FC_PORTTYPE_PTP: |
2137 | ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " | 2140 | ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " |
2138 | "configuration detected at adapter %s\n" | 2141 | "configuration detected at adapter %s\n" |
2139 | "Peer WWNN 0x%016llx, " | 2142 | "Peer WWNN 0x%016llx, " |
@@ -2146,7 +2149,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2146 | debug_text_event(fsf_req->adapter->erp_dbf, 0, | 2149 | debug_text_event(fsf_req->adapter->erp_dbf, 0, |
2147 | "top-p-to-p"); | 2150 | "top-p-to-p"); |
2148 | break; | 2151 | break; |
2149 | case FSF_TOPO_AL: | 2152 | case FC_PORTTYPE_NLPORT: |
2150 | ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " | 2153 | ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " |
2151 | "topology detected at adapter %s " | 2154 | "topology detected at adapter %s " |
2152 | "unsupported, shutting down adapter\n", | 2155 | "unsupported, shutting down adapter\n", |
@@ -2155,7 +2158,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2155 | "top-al"); | 2158 | "top-al"); |
2156 | zfcp_erp_adapter_shutdown(adapter, 0); | 2159 | zfcp_erp_adapter_shutdown(adapter, 0); |
2157 | return -EIO; | 2160 | return -EIO; |
2158 | case FSF_TOPO_FABRIC: | 2161 | case FC_PORTTYPE_NPORT: |
2159 | ZFCP_LOG_NORMAL("Switched fabric fibrechannel " | 2162 | ZFCP_LOG_NORMAL("Switched fabric fibrechannel " |
2160 | "network detected at adapter %s.\n", | 2163 | "network detected at adapter %s.\n", |
2161 | zfcp_get_busid_by_adapter(adapter)); | 2164 | zfcp_get_busid_by_adapter(adapter)); |
@@ -2168,7 +2171,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2168 | "of a type known to the zfcp " | 2171 | "of a type known to the zfcp " |
2169 | "driver, shutting down adapter\n", | 2172 | "driver, shutting down adapter\n", |
2170 | zfcp_get_busid_by_adapter(adapter)); | 2173 | zfcp_get_busid_by_adapter(adapter)); |
2171 | adapter->fc_topology = FSF_TOPO_ERROR; | ||
2172 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, | 2174 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, |
2173 | "unknown-topo"); | 2175 | "unknown-topo"); |
2174 | zfcp_erp_adapter_shutdown(adapter, 0); | 2176 | zfcp_erp_adapter_shutdown(adapter, 0); |
@@ -2328,14 +2330,13 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2328 | data = (struct fsf_qtcb_bottom_port*) fsf_req->data; | 2330 | data = (struct fsf_qtcb_bottom_port*) fsf_req->data; |
2329 | if (data) | 2331 | if (data) |
2330 | memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); | 2332 | memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); |
2331 | if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) { | 2333 | if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) |
2332 | adapter->physical_wwpn = bottom->wwpn; | 2334 | fc_host_permanent_port_name(shost) = bottom->wwpn; |
2333 | adapter->physical_s_id = bottom->fc_port_id; | 2335 | else |
2334 | } else { | 2336 | fc_host_permanent_port_name(shost) = |
2335 | adapter->physical_wwpn = fc_host_port_name(shost); | 2337 | fc_host_port_name(shost); |
2336 | adapter->physical_s_id = fc_host_port_id(shost); | ||
2337 | } | ||
2338 | fc_host_maxframe_size(shost) = bottom->maximum_frame_size; | 2338 | fc_host_maxframe_size(shost) = bottom->maximum_frame_size; |
2339 | fc_host_supported_speeds(shost) = bottom->supported_speed; | ||
2339 | break; | 2340 | break; |
2340 | 2341 | ||
2341 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: | 2342 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: |
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h index 39475dbcb614..e734415cae6d 100644 --- a/drivers/s390/scsi/zfcp_fsf.h +++ b/drivers/s390/scsi/zfcp_fsf.h | |||
@@ -199,7 +199,6 @@ | |||
199 | #define FSF_TOPO_P2P 0x00000001 | 199 | #define FSF_TOPO_P2P 0x00000001 |
200 | #define FSF_TOPO_FABRIC 0x00000002 | 200 | #define FSF_TOPO_FABRIC 0x00000002 |
201 | #define FSF_TOPO_AL 0x00000003 | 201 | #define FSF_TOPO_AL 0x00000003 |
202 | #define FSF_TOPO_FABRIC_VIRT 0x00000004 | ||
203 | 202 | ||
204 | /* data direction for FCP commands */ | 203 | /* data direction for FCP commands */ |
205 | #define FSF_DATADIR_WRITE 0x00000001 | 204 | #define FSF_DATADIR_WRITE 0x00000001 |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 5ca0992e97f4..3c2cbcccbf54 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -865,13 +865,16 @@ struct fc_function_template zfcp_transport_functions = { | |||
865 | .show_rport_supported_classes = 1, | 865 | .show_rport_supported_classes = 1, |
866 | .show_host_node_name = 1, | 866 | .show_host_node_name = 1, |
867 | .show_host_port_name = 1, | 867 | .show_host_port_name = 1, |
868 | .show_host_permanent_port_name = 1, | ||
868 | .show_host_supported_classes = 1, | 869 | .show_host_supported_classes = 1, |
870 | .show_host_supported_speeds = 1, | ||
869 | .show_host_maxframe_size = 1, | 871 | .show_host_maxframe_size = 1, |
870 | .show_host_serial_number = 1, | 872 | .show_host_serial_number = 1, |
871 | .get_fc_host_stats = zfcp_get_fc_host_stats, | 873 | .get_fc_host_stats = zfcp_get_fc_host_stats, |
872 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, | 874 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, |
873 | /* no functions registered for following dynamic attributes but | 875 | /* no functions registered for following dynamic attributes but |
874 | directly set by LLDD */ | 876 | directly set by LLDD */ |
877 | .show_host_port_type = 1, | ||
875 | .show_host_speed = 1, | 878 | .show_host_speed = 1, |
876 | .show_host_port_id = 1, | 879 | .show_host_port_id = 1, |
877 | }; | 880 | }; |
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index c85df9c016ae..9f262250043a 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c | |||
@@ -33,14 +33,6 @@ | |||
33 | 33 | ||
34 | #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG | 34 | #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG |
35 | 35 | ||
36 | static const char fc_topologies[5][25] = { | ||
37 | "<error>", | ||
38 | "point-to-point", | ||
39 | "fabric", | ||
40 | "arbitrated loop", | ||
41 | "fabric (virt. adapter)" | ||
42 | }; | ||
43 | |||
44 | /** | 36 | /** |
45 | * ZFCP_DEFINE_ADAPTER_ATTR | 37 | * ZFCP_DEFINE_ADAPTER_ATTR |
46 | * @_name: name of show attribute | 38 | * @_name: name of show attribute |
@@ -69,8 +61,6 @@ ZFCP_DEFINE_ADAPTER_ATTR(physical_wwpn, "0x%016llx\n", adapter->physical_wwpn); | |||
69 | ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); | 61 | ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); |
70 | ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); | 62 | ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); |
71 | ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); | 63 | ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); |
72 | ZFCP_DEFINE_ADAPTER_ATTR(fc_topology, "%s\n", | ||
73 | fc_topologies[adapter->fc_topology]); | ||
74 | ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", | 64 | ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", |
75 | adapter->hardware_version); | 65 | adapter->hardware_version); |
76 | ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask | 66 | ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask |
@@ -257,7 +247,6 @@ static struct attribute *zfcp_adapter_attrs[] = { | |||
257 | &dev_attr_physical_s_id.attr, | 247 | &dev_attr_physical_s_id.attr, |
258 | &dev_attr_card_version.attr, | 248 | &dev_attr_card_version.attr, |
259 | &dev_attr_lic_version.attr, | 249 | &dev_attr_lic_version.attr, |
260 | &dev_attr_fc_topology.attr, | ||
261 | &dev_attr_status.attr, | 250 | &dev_attr_status.attr, |
262 | &dev_attr_hardware_version.attr, | 251 | &dev_attr_hardware_version.attr, |
263 | NULL | 252 | NULL |