diff options
author | Andreas Herrmann <aherrman@de.ibm.com> | 2005-09-19 10:56:17 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-19 14:04:15 -0400 |
commit | 13e1e1f08c1c098c7574c1fa72bd8c67792dc89b (patch) | |
tree | aa07ca5b3ac4d21cf76b5f9aa8059334756f4c7f /drivers/s390/scsi/zfcp_fsf.c | |
parent | aef4a983090fa590481a86d9690dc3fa6bb121fa (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>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 65 |
1 files changed, 35 insertions, 30 deletions
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 | |||
2259 | zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) | 2262 | zfcp_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: |