[SCSI] bfa: FCS and include file changes.
authorKrishna Gudipati <kgudipat@brocade.com>
Sat, 6 Mar 2010 03:38:17 +0000 (19:38 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 7 Mar 2010 07:42:04 +0000 (13:12 +0530)
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>
drivers/scsi/bfa/fabric.c
drivers/scsi/bfa/fcbuild.h
drivers/scsi/bfa/fdmi.c
drivers/scsi/bfa/include/defs/bfa_defs_status.h
drivers/scsi/bfa/ms.c

index b4e05ad1b47e105fb31056687e41452a4d50bbdb..8166e9745ec07a21f7b43abb451a02809c620d78 100644 (file)
@@ -562,17 +562,15 @@ void
 bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
 {
        struct bfa_port_cfg_s *port_cfg = &fabric->bport.port_cfg;
-       struct bfa_adapter_attr_s adapter_attr;
+       char            model[BFA_ADAPTER_MODEL_NAME_LEN] = {0};
        struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info;
 
-       bfa_os_memset((void *)&adapter_attr, 0,
-                     sizeof(struct bfa_adapter_attr_s));
-       bfa_ioc_get_adapter_attr(&fabric->fcs->bfa->ioc, &adapter_attr);
+       bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
 
        /*
         * Model name/number
         */
-       strncpy((char *)&port_cfg->sym_name, adapter_attr.model,
+       strncpy((char *)&port_cfg->sym_name, model,
                BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
        strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
                sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
index 8fa7f270ef7b85c9a938a4051c90fb343efd10a8..981d98d542b90ece26acd3dcf5a634f4bedc699a 100644 (file)
@@ -72,6 +72,9 @@ fc_rpsc_operspeed_to_bfa_speed(enum fc_rpsc_op_speed_s speed)
        case RPSC_OP_SPEED_8G:
                return BFA_PPORT_SPEED_8GBPS;
 
+       case RPSC_OP_SPEED_10G:
+               return BFA_PPORT_SPEED_10GBPS;
+
        default:
                return BFA_PPORT_SPEED_UNKNOWN;
        }
@@ -97,6 +100,9 @@ fc_bfa_speed_to_rpsc_operspeed(enum bfa_pport_speed op_speed)
        case BFA_PPORT_SPEED_8GBPS:
                return RPSC_OP_SPEED_8G;
 
+       case BFA_PPORT_SPEED_10GBPS:
+               return RPSC_OP_SPEED_10G;
+
        default:
                return RPSC_OP_SPEED_NOT_EST;
        }
index 2c9e7132a3682149e8a788ae6bb9ef545b0ce0c6..8f17076d1a8786589d4a92dfbfbc86da2a42a2ba 100644 (file)
@@ -1114,36 +1114,23 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi,
 {
        struct bfa_fcs_port_s *port = fdmi->ms->port;
        struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info;
-       struct bfa_adapter_attr_s adapter_attr;
 
        bfa_os_memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s));
-       bfa_os_memset(&adapter_attr, 0, sizeof(struct bfa_adapter_attr_s));
 
-       bfa_ioc_get_adapter_attr(&port->fcs->bfa->ioc, &adapter_attr);
-
-       strncpy(hba_attr->manufacturer, adapter_attr.manufacturer,
-               sizeof(adapter_attr.manufacturer));
-
-       strncpy(hba_attr->serial_num, adapter_attr.serial_num,
-               sizeof(adapter_attr.serial_num));
-
-       strncpy(hba_attr->model, adapter_attr.model, sizeof(hba_attr->model));
-
-       strncpy(hba_attr->model_desc, adapter_attr.model_descr,
-               sizeof(hba_attr->model_desc));
-
-       strncpy(hba_attr->hw_version, adapter_attr.hw_ver,
-               sizeof(hba_attr->hw_version));
+       bfa_ioc_get_adapter_manufacturer(&port->fcs->bfa->ioc,
+               hba_attr->manufacturer);
+       bfa_ioc_get_adapter_serial_num(&port->fcs->bfa->ioc,
+                                               hba_attr->serial_num);
+       bfa_ioc_get_adapter_model(&port->fcs->bfa->ioc, hba_attr->model);
+       bfa_ioc_get_adapter_model(&port->fcs->bfa->ioc, hba_attr->model_desc);
+       bfa_ioc_get_pci_chip_rev(&port->fcs->bfa->ioc, hba_attr->hw_version);
+       bfa_ioc_get_adapter_optrom_ver(&port->fcs->bfa->ioc,
+               hba_attr->option_rom_ver);
+       bfa_ioc_get_adapter_fw_ver(&port->fcs->bfa->ioc, hba_attr->fw_version);
 
        strncpy(hba_attr->driver_version, (char *)driver_info->version,
                sizeof(hba_attr->driver_version));
 
-       strncpy(hba_attr->option_rom_ver, adapter_attr.optrom_ver,
-               sizeof(hba_attr->option_rom_ver));
-
-       strncpy(hba_attr->fw_version, adapter_attr.fw_ver,
-               sizeof(hba_attr->fw_version));
-
        strncpy(hba_attr->os_name, driver_info->host_os_name,
                sizeof(hba_attr->os_name));
 
index d8a74ebfe1ae1a28a7eea710080ad243e4becbae..4374494bd5661b5aa0048216a2005007fd0b0410 100644 (file)
@@ -213,7 +213,7 @@ enum bfa_status {
                                             * loaded */
        BFA_STATUS_CARD_TYPE_MISMATCH = 131, /*  Card type mismatch */
        BFA_STATUS_BAD_ASICBLK = 132, /*  Bad ASIC block */
-       BFA_STATUS_NO_DRIVER = 133, /*  Storage/Ethernet driver not loaded */
+       BFA_STATUS_NO_DRIVER = 133, /*  Brocade adapter/driver not installed or loaded */
        BFA_STATUS_INVALID_MAC = 134, /*  Invalid mac address */
        BFA_STATUS_IM_NO_VLAN = 135, /*  No VLANs configured on the adapter */
        BFA_STATUS_IM_ETH_LB_FAILED = 136, /*  Ethernet loopback test failed */
@@ -228,8 +228,7 @@ enum bfa_status {
        BFA_STATUS_IM_GET_INETCFG_FAILED = 142, /*  Acquiring Network Subsytem
                                                 * handle Failed. Please try
                                                 * after some time */
-       BFA_STATUS_IM_NOT_BOUND = 143, /*  Brocade 10G Ethernet Service is not
-                                       * Enabled on this port */
+       BFA_STATUS_IM_NOT_BOUND = 143, /*  IM driver is not active */
        BFA_STATUS_INSUFFICIENT_PERMS = 144, /*  User doesn't have sufficient
                                              * permissions to execute the BCU
                                              * application */
index e6db5fd301f228c336dd1a9f897991d31820fcdb..5e8c8dee6c97dc946d716eb57a0bee1d4d6436e5 100644 (file)
@@ -230,10 +230,6 @@ bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
        switch (event) {
        case MSSM_EVENT_PORT_OFFLINE:
                bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
-               /*
-                * now invoke MS related sub-modules
-                */
-               bfa_fcs_port_fdmi_offline(ms);
                break;
 
        case MSSM_EVENT_PORT_FABRIC_RSCN:
@@ -735,6 +731,7 @@ bfa_fcs_port_ms_offline(struct bfa_fcs_port_s *port)
 
        ms->port = port;
        bfa_sm_send_event(ms, MSSM_EVENT_PORT_OFFLINE);
+       bfa_fcs_port_fdmi_offline(ms);
 }
 
 void