]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
scsi: csiostor: add check for supported fw version
authorVarun Prakash <varun@chelsio.com>
Thu, 1 Jun 2017 07:18:33 +0000 (12:48 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Jun 2017 00:48:05 +0000 (20:48 -0400)
T6 FCoE support is added in fw version 1.16.45.0 so return error if fw
version < 1.16.45.0 for T6 adapters.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/csiostor/csio_hw.c
drivers/scsi/csiostor/csio_hw.h

index c6e18140759c3b1ecf4e1aff10d8dd054ae2737f..2029ad225121162bddfec4ffcce7e38a940385f3 100644 (file)
@@ -2068,6 +2068,17 @@ csio_hw_flash_fw(struct csio_hw *hw, int *reset)
        return ret;
 }
 
+static int csio_hw_check_fwver(struct csio_hw *hw)
+{
+       if (csio_is_t6(hw->pdev->device & CSIO_HW_CHIP_MASK) &&
+           (hw->fwrev < CSIO_MIN_T6_FW)) {
+               csio_hw_print_fw_version(hw, "T6 unsupported fw");
+               return -1;
+       }
+
+       return 0;
+}
+
 /*
  * csio_hw_configure - Configure HW
  * @hw - HW module
@@ -2135,6 +2146,10 @@ csio_hw_configure(struct csio_hw *hw)
                if (rv != 0)
                        goto out;
 
+               rv = csio_hw_check_fwver(hw);
+               if (rv < 0)
+                       goto out;
+
                /* If the firmware doesn't support Configuration Files,
                 * return an error.
                 */
@@ -2162,6 +2177,10 @@ csio_hw_configure(struct csio_hw *hw)
                }
 
        } else {
+               rv = csio_hw_check_fwver(hw);
+               if (rv < 0)
+                       goto out;
+
                if (hw->fw_state == CSIO_DEV_STATE_INIT) {
 
                        hw->flags |= CSIO_HWF_USING_SOFT_PARAMS;
index 62758e830d3bf1562468d45af196fa2a7f8197a2..9acb89538e29f28b9173dcb532cae18c8a54042d 100644 (file)
@@ -71,6 +71,7 @@
 #define CSIO_MAX_CMD_PER_LUN   32
 #define CSIO_MAX_DDP_BUF_SIZE  (1024 * 1024)
 #define CSIO_MAX_SECTOR_SIZE   128
+#define CSIO_MIN_T6_FW         0x01102D00  /* FW 1.16.45.0 */
 
 /* Interrupts */
 #define CSIO_EXTRA_MSI_IQS     2       /* Extra iqs for INTX/MSI mode