aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2010-03-05 22:38:17 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-03-07 02:42:04 -0500
commit25e2934c26f5efaea156c9fda4457d01a8bb44e1 (patch)
tree85329bd822e098c0a1b5fa1a29b4fc4fb4000f4d
parentca8b4327e405820966971236224db0e0724b5673 (diff)
[SCSI] bfa: FCS and include file changes.
MS module did not invoke fdmi offline in all cases, call fdmi offline when ms module receives a port offline, so that fdmi offline is from one place in the ms module. Make changes to handle 10G speed in the conversion routine. Replaced the usage of bfa_adapter_attr_s struct with specific API's. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/bfa/fabric.c8
-rw-r--r--drivers/scsi/bfa/fcbuild.h6
-rw-r--r--drivers/scsi/bfa/fdmi.c33
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_status.h5
-rw-r--r--drivers/scsi/bfa/ms.c5
5 files changed, 22 insertions, 35 deletions
diff --git a/drivers/scsi/bfa/fabric.c b/drivers/scsi/bfa/fabric.c
index b4e05ad1b47e..8166e9745ec0 100644
--- a/drivers/scsi/bfa/fabric.c
+++ b/drivers/scsi/bfa/fabric.c
@@ -562,17 +562,15 @@ void
562bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric) 562bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
563{ 563{
564 struct bfa_port_cfg_s *port_cfg = &fabric->bport.port_cfg; 564 struct bfa_port_cfg_s *port_cfg = &fabric->bport.port_cfg;
565 struct bfa_adapter_attr_s adapter_attr; 565 char model[BFA_ADAPTER_MODEL_NAME_LEN] = {0};
566 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; 566 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info;
567 567
568 bfa_os_memset((void *)&adapter_attr, 0, 568 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
569 sizeof(struct bfa_adapter_attr_s));
570 bfa_ioc_get_adapter_attr(&fabric->fcs->bfa->ioc, &adapter_attr);
571 569
572 /* 570 /*
573 * Model name/number 571 * Model name/number
574 */ 572 */
575 strncpy((char *)&port_cfg->sym_name, adapter_attr.model, 573 strncpy((char *)&port_cfg->sym_name, model,
576 BFA_FCS_PORT_SYMBNAME_MODEL_SZ); 574 BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
577 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR, 575 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
578 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR)); 576 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
diff --git a/drivers/scsi/bfa/fcbuild.h b/drivers/scsi/bfa/fcbuild.h
index 8fa7f270ef7b..981d98d542b9 100644
--- a/drivers/scsi/bfa/fcbuild.h
+++ b/drivers/scsi/bfa/fcbuild.h
@@ -72,6 +72,9 @@ fc_rpsc_operspeed_to_bfa_speed(enum fc_rpsc_op_speed_s speed)
72 case RPSC_OP_SPEED_8G: 72 case RPSC_OP_SPEED_8G:
73 return BFA_PPORT_SPEED_8GBPS; 73 return BFA_PPORT_SPEED_8GBPS;
74 74
75 case RPSC_OP_SPEED_10G:
76 return BFA_PPORT_SPEED_10GBPS;
77
75 default: 78 default:
76 return BFA_PPORT_SPEED_UNKNOWN; 79 return BFA_PPORT_SPEED_UNKNOWN;
77 } 80 }
@@ -97,6 +100,9 @@ fc_bfa_speed_to_rpsc_operspeed(enum bfa_pport_speed op_speed)
97 case BFA_PPORT_SPEED_8GBPS: 100 case BFA_PPORT_SPEED_8GBPS:
98 return RPSC_OP_SPEED_8G; 101 return RPSC_OP_SPEED_8G;
99 102
103 case BFA_PPORT_SPEED_10GBPS:
104 return RPSC_OP_SPEED_10G;
105
100 default: 106 default:
101 return RPSC_OP_SPEED_NOT_EST; 107 return RPSC_OP_SPEED_NOT_EST;
102 } 108 }
diff --git a/drivers/scsi/bfa/fdmi.c b/drivers/scsi/bfa/fdmi.c
index 2c9e7132a368..8f17076d1a87 100644
--- a/drivers/scsi/bfa/fdmi.c
+++ b/drivers/scsi/bfa/fdmi.c
@@ -1114,36 +1114,23 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi,
1114{ 1114{
1115 struct bfa_fcs_port_s *port = fdmi->ms->port; 1115 struct bfa_fcs_port_s *port = fdmi->ms->port;
1116 struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info; 1116 struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info;
1117 struct bfa_adapter_attr_s adapter_attr;
1118 1117
1119 bfa_os_memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s)); 1118 bfa_os_memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s));
1120 bfa_os_memset(&adapter_attr, 0, sizeof(struct bfa_adapter_attr_s));
1121 1119
1122 bfa_ioc_get_adapter_attr(&port->fcs->bfa->ioc, &adapter_attr); 1120 bfa_ioc_get_adapter_manufacturer(&port->fcs->bfa->ioc,
1123 1121 hba_attr->manufacturer);
1124 strncpy(hba_attr->manufacturer, adapter_attr.manufacturer, 1122 bfa_ioc_get_adapter_serial_num(&port->fcs->bfa->ioc,
1125 sizeof(adapter_attr.manufacturer)); 1123 hba_attr->serial_num);
1126 1124 bfa_ioc_get_adapter_model(&port->fcs->bfa->ioc, hba_attr->model);
1127 strncpy(hba_attr->serial_num, adapter_attr.serial_num, 1125 bfa_ioc_get_adapter_model(&port->fcs->bfa->ioc, hba_attr->model_desc);
1128 sizeof(adapter_attr.serial_num)); 1126 bfa_ioc_get_pci_chip_rev(&port->fcs->bfa->ioc, hba_attr->hw_version);
1129 1127 bfa_ioc_get_adapter_optrom_ver(&port->fcs->bfa->ioc,
1130 strncpy(hba_attr->model, adapter_attr.model, sizeof(hba_attr->model)); 1128 hba_attr->option_rom_ver);
1131 1129 bfa_ioc_get_adapter_fw_ver(&port->fcs->bfa->ioc, hba_attr->fw_version);
1132 strncpy(hba_attr->model_desc, adapter_attr.model_descr,
1133 sizeof(hba_attr->model_desc));
1134
1135 strncpy(hba_attr->hw_version, adapter_attr.hw_ver,
1136 sizeof(hba_attr->hw_version));
1137 1130
1138 strncpy(hba_attr->driver_version, (char *)driver_info->version, 1131 strncpy(hba_attr->driver_version, (char *)driver_info->version,
1139 sizeof(hba_attr->driver_version)); 1132 sizeof(hba_attr->driver_version));
1140 1133
1141 strncpy(hba_attr->option_rom_ver, adapter_attr.optrom_ver,
1142 sizeof(hba_attr->option_rom_ver));
1143
1144 strncpy(hba_attr->fw_version, adapter_attr.fw_ver,
1145 sizeof(hba_attr->fw_version));
1146
1147 strncpy(hba_attr->os_name, driver_info->host_os_name, 1134 strncpy(hba_attr->os_name, driver_info->host_os_name,
1148 sizeof(hba_attr->os_name)); 1135 sizeof(hba_attr->os_name));
1149 1136
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h
index d8a74ebfe1ae..4374494bd566 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h
@@ -213,7 +213,7 @@ enum bfa_status {
213 * loaded */ 213 * loaded */
214 BFA_STATUS_CARD_TYPE_MISMATCH = 131, /* Card type mismatch */ 214 BFA_STATUS_CARD_TYPE_MISMATCH = 131, /* Card type mismatch */
215 BFA_STATUS_BAD_ASICBLK = 132, /* Bad ASIC block */ 215 BFA_STATUS_BAD_ASICBLK = 132, /* Bad ASIC block */
216 BFA_STATUS_NO_DRIVER = 133, /* Storage/Ethernet driver not loaded */ 216 BFA_STATUS_NO_DRIVER = 133, /* Brocade adapter/driver not installed or loaded */
217 BFA_STATUS_INVALID_MAC = 134, /* Invalid mac address */ 217 BFA_STATUS_INVALID_MAC = 134, /* Invalid mac address */
218 BFA_STATUS_IM_NO_VLAN = 135, /* No VLANs configured on the adapter */ 218 BFA_STATUS_IM_NO_VLAN = 135, /* No VLANs configured on the adapter */
219 BFA_STATUS_IM_ETH_LB_FAILED = 136, /* Ethernet loopback test failed */ 219 BFA_STATUS_IM_ETH_LB_FAILED = 136, /* Ethernet loopback test failed */
@@ -228,8 +228,7 @@ enum bfa_status {
228 BFA_STATUS_IM_GET_INETCFG_FAILED = 142, /* Acquiring Network Subsytem 228 BFA_STATUS_IM_GET_INETCFG_FAILED = 142, /* Acquiring Network Subsytem
229 * handle Failed. Please try 229 * handle Failed. Please try
230 * after some time */ 230 * after some time */
231 BFA_STATUS_IM_NOT_BOUND = 143, /* Brocade 10G Ethernet Service is not 231 BFA_STATUS_IM_NOT_BOUND = 143, /* IM driver is not active */
232 * Enabled on this port */
233 BFA_STATUS_INSUFFICIENT_PERMS = 144, /* User doesn't have sufficient 232 BFA_STATUS_INSUFFICIENT_PERMS = 144, /* User doesn't have sufficient
234 * permissions to execute the BCU 233 * permissions to execute the BCU
235 * application */ 234 * application */
diff --git a/drivers/scsi/bfa/ms.c b/drivers/scsi/bfa/ms.c
index e6db5fd301f2..5e8c8dee6c97 100644
--- a/drivers/scsi/bfa/ms.c
+++ b/drivers/scsi/bfa/ms.c
@@ -230,10 +230,6 @@ bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
230 switch (event) { 230 switch (event) {
231 case MSSM_EVENT_PORT_OFFLINE: 231 case MSSM_EVENT_PORT_OFFLINE:
232 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline); 232 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
233 /*
234 * now invoke MS related sub-modules
235 */
236 bfa_fcs_port_fdmi_offline(ms);
237 break; 233 break;
238 234
239 case MSSM_EVENT_PORT_FABRIC_RSCN: 235 case MSSM_EVENT_PORT_FABRIC_RSCN:
@@ -735,6 +731,7 @@ bfa_fcs_port_ms_offline(struct bfa_fcs_port_s *port)
735 731
736 ms->port = port; 732 ms->port = port;
737 bfa_sm_send_event(ms, MSSM_EVENT_PORT_OFFLINE); 733 bfa_sm_send_event(ms, MSSM_EVENT_PORT_OFFLINE);
734 bfa_fcs_port_fdmi_offline(ms);
738} 735}
739 736
740void 737void