Commit ad757cdf authored by Andreas Herrmann's avatar Andreas Herrmann Committed by James Bottomley

[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: default avatarAndreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent f6cd94b1
...@@ -921,7 +921,6 @@ struct zfcp_adapter { ...@@ -921,7 +921,6 @@ struct zfcp_adapter {
u32 physical_s_id; /* local FC port ID */ u32 physical_s_id; /* local FC port ID */
struct ccw_device *ccw_device; /* S/390 ccw device */ struct ccw_device *ccw_device; /* S/390 ccw device */
u8 fc_service_class; u8 fc_service_class;
u32 fc_topology; /* FC topology */
u32 hydra_version; /* Hydra version */ u32 hydra_version; /* Hydra version */
u32 fsf_lic_version; u32 fsf_lic_version;
u32 adapter_features; /* FCP channel features */ u32 adapter_features; /* FCP channel features */
......
...@@ -2613,7 +2613,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2613,7 +2613,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
if (adapter->fc_topology == FSF_TOPO_P2P) { if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) {
if (port->wwpn != adapter->peer_wwpn) { if (port->wwpn != adapter->peer_wwpn) {
ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx "
"on adapter %s.\nPeer WWPN " "on adapter %s.\nPeer WWPN "
......
...@@ -2043,27 +2043,30 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) ...@@ -2043,27 +2043,30 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK; fc_host_port_id(shost) = bottom->s_id & ZFCP_DID_MASK;
fc_host_speed(shost) = bottom->fc_link_speed; fc_host_speed(shost) = bottom->fc_link_speed;
fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3;
adapter->fc_topology = bottom->fc_topology;
adapter->hydra_version = bottom->adapter_type; adapter->hydra_version = bottom->adapter_type;
if (adapter->physical_wwpn == 0) if (fc_host_permanent_port_name(shost) == -1)
adapter->physical_wwpn = fc_host_port_name(shost); fc_host_permanent_port_name(shost) =
if (adapter->physical_s_id == 0) fc_host_port_name(shost);
adapter->physical_s_id = fc_host_port_id(shost); if (bottom->fc_topology == FSF_TOPO_P2P) {
adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK;
adapter->peer_wwpn = bottom->plogi_payload.wwpn;
adapter->peer_wwnn = bottom->plogi_payload.wwnn;
fc_host_port_type(shost) = FC_PORTTYPE_PTP;
} else if (bottom->fc_topology == FSF_TOPO_FABRIC)
fc_host_port_type(shost) = FC_PORTTYPE_NPORT;
else if (bottom->fc_topology == FSF_TOPO_AL)
fc_host_port_type(shost) = FC_PORTTYPE_NLPORT;
else
fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
} else { } else {
fc_host_node_name(shost) = 0; fc_host_node_name(shost) = 0;
fc_host_port_name(shost) = 0; fc_host_port_name(shost) = 0;
fc_host_port_id(shost) = 0; fc_host_port_id(shost) = 0;
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
adapter->fc_topology = 0; fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
adapter->hydra_version = 0; adapter->hydra_version = 0;
} }
if (adapter->fc_topology == FSF_TOPO_P2P) {
adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK;
adapter->peer_wwpn = bottom->plogi_payload.wwpn;
adapter->peer_wwnn = bottom->plogi_payload.wwnn;
}
if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) { if (adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT) {
adapter->hardware_version = bottom->hardware_version; adapter->hardware_version = bottom->hardware_version;
memcpy(fc_host_serial_number(shost), bottom->serial_number, 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,8 +2135,8 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1))
return -EIO; return -EIO;
switch (adapter->fc_topology) { switch (fc_host_port_type(adapter->scsi_host)) {
case FSF_TOPO_P2P: case FC_PORTTYPE_PTP:
ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " ZFCP_LOG_NORMAL("Point-to-Point fibrechannel "
"configuration detected at adapter %s\n" "configuration detected at adapter %s\n"
"Peer WWNN 0x%016llx, " "Peer WWNN 0x%016llx, "
...@@ -2146,7 +2149,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2146,7 +2149,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
debug_text_event(fsf_req->adapter->erp_dbf, 0, debug_text_event(fsf_req->adapter->erp_dbf, 0,
"top-p-to-p"); "top-p-to-p");
break; break;
case FSF_TOPO_AL: case FC_PORTTYPE_NLPORT:
ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel "
"topology detected at adapter %s " "topology detected at adapter %s "
"unsupported, shutting down adapter\n", "unsupported, shutting down adapter\n",
...@@ -2155,7 +2158,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2155,7 +2158,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
"top-al"); "top-al");
zfcp_erp_adapter_shutdown(adapter, 0); zfcp_erp_adapter_shutdown(adapter, 0);
return -EIO; return -EIO;
case FSF_TOPO_FABRIC: case FC_PORTTYPE_NPORT:
ZFCP_LOG_NORMAL("Switched fabric fibrechannel " ZFCP_LOG_NORMAL("Switched fabric fibrechannel "
"network detected at adapter %s.\n", "network detected at adapter %s.\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
...@@ -2168,7 +2171,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2168,7 +2171,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
"of a type known to the zfcp " "of a type known to the zfcp "
"driver, shutting down adapter\n", "driver, shutting down adapter\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
adapter->fc_topology = FSF_TOPO_ERROR;
debug_text_exception(fsf_req->adapter->erp_dbf, 0, debug_text_exception(fsf_req->adapter->erp_dbf, 0,
"unknown-topo"); "unknown-topo");
zfcp_erp_adapter_shutdown(adapter, 0); zfcp_erp_adapter_shutdown(adapter, 0);
...@@ -2328,14 +2330,13 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) ...@@ -2328,14 +2330,13 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
data = (struct fsf_qtcb_bottom_port*) fsf_req->data; data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
if (data) if (data)
memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) { if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
adapter->physical_wwpn = bottom->wwpn; fc_host_permanent_port_name(shost) = bottom->wwpn;
adapter->physical_s_id = bottom->fc_port_id; else
} else { fc_host_permanent_port_name(shost) =
adapter->physical_wwpn = fc_host_port_name(shost); fc_host_port_name(shost);
adapter->physical_s_id = fc_host_port_id(shost);
}
fc_host_maxframe_size(shost) = bottom->maximum_frame_size; fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
fc_host_supported_speeds(shost) = bottom->supported_speed;
break; break;
case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
......
...@@ -199,7 +199,6 @@ ...@@ -199,7 +199,6 @@
#define FSF_TOPO_P2P 0x00000001 #define FSF_TOPO_P2P 0x00000001
#define FSF_TOPO_FABRIC 0x00000002 #define FSF_TOPO_FABRIC 0x00000002
#define FSF_TOPO_AL 0x00000003 #define FSF_TOPO_AL 0x00000003
#define FSF_TOPO_FABRIC_VIRT 0x00000004
/* data direction for FCP commands */ /* data direction for FCP commands */
#define FSF_DATADIR_WRITE 0x00000001 #define FSF_DATADIR_WRITE 0x00000001
......
...@@ -865,13 +865,16 @@ struct fc_function_template zfcp_transport_functions = { ...@@ -865,13 +865,16 @@ struct fc_function_template zfcp_transport_functions = {
.show_rport_supported_classes = 1, .show_rport_supported_classes = 1,
.show_host_node_name = 1, .show_host_node_name = 1,
.show_host_port_name = 1, .show_host_port_name = 1,
.show_host_permanent_port_name = 1,
.show_host_supported_classes = 1, .show_host_supported_classes = 1,
.show_host_supported_speeds = 1,
.show_host_maxframe_size = 1, .show_host_maxframe_size = 1,
.show_host_serial_number = 1, .show_host_serial_number = 1,
.get_fc_host_stats = zfcp_get_fc_host_stats, .get_fc_host_stats = zfcp_get_fc_host_stats,
.reset_fc_host_stats = zfcp_reset_fc_host_stats, .reset_fc_host_stats = zfcp_reset_fc_host_stats,
/* no functions registered for following dynamic attributes but /* no functions registered for following dynamic attributes but
directly set by LLDD */ directly set by LLDD */
.show_host_port_type = 1,
.show_host_speed = 1, .show_host_speed = 1,
.show_host_port_id = 1, .show_host_port_id = 1,
}; };
......
...@@ -33,14 +33,6 @@ ...@@ -33,14 +33,6 @@
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
static const char fc_topologies[5][25] = {
"<error>",
"point-to-point",
"fabric",
"arbitrated loop",
"fabric (virt. adapter)"
};
/** /**
* ZFCP_DEFINE_ADAPTER_ATTR * ZFCP_DEFINE_ADAPTER_ATTR
* @_name: name of show attribute * @_name: name of show attribute
...@@ -69,8 +61,6 @@ ZFCP_DEFINE_ADAPTER_ATTR(physical_wwpn, "0x%016llx\n", adapter->physical_wwpn); ...@@ -69,8 +61,6 @@ ZFCP_DEFINE_ADAPTER_ATTR(physical_wwpn, "0x%016llx\n", adapter->physical_wwpn);
ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id); ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id);
ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version);
ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version);
ZFCP_DEFINE_ADAPTER_ATTR(fc_topology, "%s\n",
fc_topologies[adapter->fc_topology]);
ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n", ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n",
adapter->hardware_version); adapter->hardware_version);
ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask
...@@ -257,7 +247,6 @@ static struct attribute *zfcp_adapter_attrs[] = { ...@@ -257,7 +247,6 @@ static struct attribute *zfcp_adapter_attrs[] = {
&dev_attr_physical_s_id.attr, &dev_attr_physical_s_id.attr,
&dev_attr_card_version.attr, &dev_attr_card_version.attr,
&dev_attr_lic_version.attr, &dev_attr_lic_version.attr,
&dev_attr_fc_topology.attr,
&dev_attr_status.attr, &dev_attr_status.attr,
&dev_attr_hardware_version.attr, &dev_attr_hardware_version.attr,
NULL NULL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment