scsi: lpfc: Allow applications to issue Common Set Features mailbox command
authorDick Kennedy <dick.kennedy@broadcom.com>
Tue, 30 Jun 2020 21:49:57 +0000 (14:49 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Jul 2020 03:06:40 +0000 (23:06 -0400)
Currently the driver validates command codes received from the
application. COMMON_SET_FEATURES is not currently being approved.

Add definition of the missing command and allow it to be issued by
applications.

Link: https://lore.kernel.org/r/20200630215001.70793-11-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_bsg.h

index e91466a..1d88fed 100644 (file)
@@ -4304,6 +4304,7 @@ lpfc_bsg_handle_sli_cfg_mbox(struct lpfc_hba *phba, struct bsg_job *job,
                        case COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES:
                        case COMN_OPCODE_GET_CNTL_ATTRIBUTES:
                        case COMN_OPCODE_GET_PROFILE_CONFIG:
+                       case COMN_OPCODE_SET_FEATURES:
                                lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC,
                                                "3106 Handled SLI_CONFIG "
                                                "subsys_comn, opcode:x%x\n",
index d170813..2dc7124 100644 (file)
@@ -225,6 +225,10 @@ struct lpfc_sli_config_hdr {
        uint32_t reserved5;
 };
 
+#define LPFC_CSF_BOOT_DEV              0x1D
+#define LPFC_CSF_QUERY                 0
+#define LPFC_CSF_SAVE                  1
+
 struct lpfc_sli_config_emb0_subsys {
        struct lpfc_sli_config_hdr      sli_config_hdr;
 #define LPFC_MBX_SLI_CONFIG_MAX_MSE     19
@@ -243,6 +247,15 @@ struct lpfc_sli_config_emb0_subsys {
 #define FCOE_OPCODE_ADD_FCF            0x09
 #define FCOE_OPCODE_SET_DPORT_MODE     0x27
 #define FCOE_OPCODE_GET_DPORT_RESULTS  0x28
+       uint32_t timeout;               /* comn_set_feature timeout */
+       uint32_t request_length;        /* comn_set_feature request len */
+       uint32_t version;               /* comn_set_feature version */
+       uint32_t csf_feature;           /* comn_set_feature feature */
+       uint32_t word69;                /* comn_set_feature parameter len */
+       uint32_t word70;                /* comn_set_feature parameter val0 */
+#define lpfc_emb0_subcmnd_csf_p0_SHIFT 0
+#define lpfc_emb0_subcmnd_csf_p0_MASK  0x3
+#define lpfc_emb0_subcmnd_csf_p0_WORD  word70
 };
 
 struct lpfc_sli_config_emb1_subsys {
@@ -261,6 +274,7 @@ struct lpfc_sli_config_emb1_subsys {
 #define COMN_OPCODE_WRITE_OBJECT       0xAC
 #define COMN_OPCODE_READ_OBJECT_LIST   0xAD
 #define COMN_OPCODE_DELETE_OBJECT      0xAE
+#define COMN_OPCODE_SET_FEATURES       0xBF
 #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES   0x79
 #define COMN_OPCODE_GET_CNTL_ATTRIBUTES        0x20
        uint32_t timeout;