]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/scsi/lpfc/lpfc_ct.c
scsi: lpfc: Correct boot bios information to FDMI registration
[linux.git] / drivers / scsi / lpfc / lpfc_ct.c
index 552da8bf43e41a0fef71815e815845a76b997da3..713f1f070c1501a8801f16afecf79e315a16bd7c 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
- * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term *
+ * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term *
  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
  * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
@@ -1463,7 +1463,7 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
                return n;
 
        /* Note :- OS name is "Linux" */
-       n += snprintf(symbol + n, size - n, " OS:%s\n",
+       n += snprintf(symbol + n, size - n, " OS:%s",
                      init_utsname()->sysname);
        return n;
 }
@@ -1656,16 +1656,16 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
                CtReq->un.rft.PortId = cpu_to_be32(vport->fc_myDID);
 
                /* Register FC4 FCP type if enabled.  */
-               if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
-                   (phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP))
+               if (vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH ||
+                   vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)
                        CtReq->un.rft.fcpReg = 1;
 
                /* Register NVME type if enabled.  Defined LE and swapped.
                 * rsvd[0] is used as word1 because of the hard-coded
                 * word0 usage in the ct_request data structure.
                 */
-               if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
-                   (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME))
+               if (vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH ||
+                   vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)
                        CtReq->un.rft.rsvd[0] =
                                cpu_to_be32(LPFC_FC4_TYPE_BITMASK);
 
@@ -1732,8 +1732,8 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
                 * caller can specify NVME (type x28) as well.  But only
                 * these that FC4 type is supported.
                 */
-               if (((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
-                    (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) &&
+               if (((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
+                    (vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) &&
                    (context == FC_TYPE_NVME)) {
                        if ((vport == phba->pport) && phba->nvmet_support) {
                                CtReq->un.rff.fbits = (FC4_FEATURE_TARGET |
@@ -1744,8 +1744,8 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
                        }
                        CtReq->un.rff.type_code = context;
 
-               } else if (((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
-                           (phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) &&
+               } else if (((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
+                           (vport->cfg_enable_fc4_type == LPFC_ENABLE_FCP)) &&
                           (context == FC_TYPE_FCP))
                        CtReq->un.rff.type_code = context;
 
@@ -2005,8 +2005,11 @@ lpfc_fdmi_hba_attr_manufacturer(struct lpfc_vport *vport,
        ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue;
        memset(ae, 0, 256);
 
+       /* This string MUST be consistent with other FC platforms
+        * supported by Broadcom.
+        */
        strncpy(ae->un.AttrString,
-               "Broadcom Inc.",
+               "Emulex Corporation",
                       sizeof(ae->un.AttrString));
        len = strnlen(ae->un.AttrString,
                          sizeof(ae->un.AttrString));
@@ -2301,7 +2304,8 @@ lpfc_fdmi_hba_attr_bios_ver(struct lpfc_vport *vport,
        ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue;
        memset(ae, 0, 256);
 
-       lpfc_decode_firmware_rev(phba, ae->un.AttrString, 1);
+       strlcat(ae->un.AttrString, phba->BIOSVersion,
+               sizeof(ae->un.AttrString));
        len = strnlen(ae->un.AttrString,
                          sizeof(ae->un.AttrString));
        len += (len & 3) ? (4 - (len & 3)) : 4;
@@ -2360,10 +2364,11 @@ lpfc_fdmi_port_attr_fc4type(struct lpfc_vport *vport,
        ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue;
        memset(ae, 0, 32);
 
-       ae->un.AttrTypes[3] = 0x02; /* Type 1 - ELS */
-       ae->un.AttrTypes[2] = 0x01; /* Type 8 - FCP */
-       ae->un.AttrTypes[6] = 0x01; /* Type 40 - NVME */
-       ae->un.AttrTypes[7] = 0x01; /* Type 32 - CT */
+       ae->un.AttrTypes[3] = 0x02; /* Type 0x1 - ELS */
+       ae->un.AttrTypes[2] = 0x01; /* Type 0x8 - FCP */
+       if (vport->nvmei_support || vport->phba->nvmet_support)
+               ae->un.AttrTypes[6] = 0x01; /* Type 0x28 - NVME */
+       ae->un.AttrTypes[7] = 0x01; /* Type 0x20 - CT */
        size = FOURBYTES + 32;
        ad->AttrLen = cpu_to_be16(size);
        ad->AttrType = cpu_to_be16(RPRT_SUPPORTED_FC4_TYPES);
@@ -2673,9 +2678,11 @@ lpfc_fdmi_port_attr_active_fc4type(struct lpfc_vport *vport,
        ae = (struct lpfc_fdmi_attr_entry *)&ad->AttrValue;
        memset(ae, 0, 32);
 
-       ae->un.AttrTypes[3] = 0x02; /* Type 1 - ELS */
-       ae->un.AttrTypes[2] = 0x01; /* Type 8 - FCP */
-       ae->un.AttrTypes[7] = 0x01; /* Type 32 - CT */
+       ae->un.AttrTypes[3] = 0x02; /* Type 0x1 - ELS */
+       ae->un.AttrTypes[2] = 0x01; /* Type 0x8 - FCP */
+       if (vport->phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME)
+               ae->un.AttrTypes[6] = 0x1; /* Type 0x28 - NVME */
+       ae->un.AttrTypes[7] = 0x01; /* Type 0x20 - CT */
        size = FOURBYTES + 32;
        ad->AttrLen = cpu_to_be16(size);
        ad->AttrType = cpu_to_be16(RPRT_ACTIVE_FC4_TYPES);