]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/scsi/qla2xxx/qla_def.h
scsi: qla2xxx: Use an on-stack completion in qla24xx_control_vp()
[linux.git] / drivers / scsi / qla2xxx / qla_def.h
index d1fc4958222a47276f8866c0092e03b5fb4bab40..6dd2d41713c9d10b140b236a99920e146912284e 100644 (file)
@@ -314,6 +314,7 @@ struct srb_cmd {
 #define SRB_CRC_PROT_DMA_VALID         BIT_4   /* DIF: prot DMA valid */
 #define SRB_CRC_CTX_DSD_VALID          BIT_5   /* DIF: dsd_list valid */
 #define SRB_WAKEUP_ON_COMP             BIT_6
+#define SRB_DIF_BUNDL_DMA_VALID                BIT_7   /* DIF: DMA list valid */
 
 /* To identify if a srb is of T10-CRC type. @sp => srb_t pointer */
 #define IS_PROT_IO(sp) (sp->flags & SRB_CRC_CTX_DSD_VALID)
@@ -544,7 +545,8 @@ typedef struct srb {
        u32 gen2;       /* scratch */
        int rc;
        int retry_count;
-       struct completion comp;
+       struct completion *comp;
+       wait_queue_head_t *cwaitq;
        union {
                struct srb_iocb iocb_cmd;
                struct bsg_job *bsg_job;
@@ -1032,6 +1034,7 @@ struct mbx_cmd_32 {
 #define MBC_GET_FIRMWARE_VERSION       8       /* Get firmware revision. */
 #define MBC_LOAD_RISC_RAM              9       /* Load RAM command. */
 #define MBC_DUMP_RISC_RAM              0xa     /* Dump RAM command. */
+#define MBC_SECURE_FLASH_UPDATE                0xa     /* Secure Flash Update(28xx) */
 #define MBC_LOAD_RISC_RAM_EXTENDED     0xb     /* Load RAM extended. */
 #define MBC_DUMP_RISC_RAM_EXTENDED     0xc     /* Dump RAM extended. */
 #define MBC_WRITE_RAM_WORD_EXTENDED    0xd     /* Write RAM word extended */
@@ -1202,6 +1205,10 @@ struct mbx_cmd_32 {
 #define QLA27XX_IMG_STATUS_VER_MAJOR   0x01
 #define QLA27XX_IMG_STATUS_VER_MINOR    0x00
 #define QLA27XX_IMG_STATUS_SIGN   0xFACEFADE
+#define QLA28XX_IMG_STATUS_SIGN    0xFACEFADF
+#define QLA28XX_IMG_STATUS_SIGN                0xFACEFADF
+#define QLA28XX_AUX_IMG_STATUS_SIGN    0xFACEFAED
+#define QLA27XX_DEFAULT_IMAGE          0
 #define QLA27XX_PRIMARY_IMAGE  1
 #define QLA27XX_SECONDARY_IMAGE    2
 
@@ -1892,6 +1899,13 @@ struct crc_context {
        /* List of DMA context transfers */
        struct list_head dsd_list;
 
+       /* List of DIF Bundling context DMA address */
+       struct list_head ldif_dsd_list;
+       u8 no_ldif_dsd;
+
+       struct list_head ldif_dma_hndl_list;
+       u32 dif_bundl_len;
+       u8 no_dif_bundl;
        /* This structure should not exceed 512 bytes */
 };
 
@@ -2250,7 +2264,10 @@ typedef enum {
        FCT_BROADCAST,
        FCT_INITIATOR,
        FCT_TARGET,
-       FCT_NVME
+       FCT_NVME_INITIATOR = 0x10,
+       FCT_NVME_TARGET = 0x20,
+       FCT_NVME_DISCOVERY = 0x40,
+       FCT_NVME = 0xf0,
 } fc_port_type_t;
 
 enum qla_sess_deletion {
@@ -2359,7 +2376,9 @@ typedef struct fc_port {
 #define NVME_PRLI_SP_INITIATOR  BIT_5
 #define NVME_PRLI_SP_TARGET     BIT_4
 #define NVME_PRLI_SP_DISCOVERY  BIT_3
+#define NVME_PRLI_SP_FIRST_BURST       BIT_0
        uint8_t nvme_flag;
+       uint32_t nvme_first_burst_size;
 #define NVME_FLAG_REGISTERED 4
 #define NVME_FLAG_DELETING 2
 #define NVME_FLAG_RESETTING 1
@@ -2453,13 +2472,7 @@ struct event_arg {
 #define FCS_DEVICE_LOST                3
 #define FCS_ONLINE             4
 
-static const char * const port_state_str[] = {
-       "Unknown",
-       "UNCONFIGURED",
-       "DEAD",
-       "LOST",
-       "ONLINE"
-};
+extern const char *const port_state_str[5];
 
 /*
  * FC port flags.
@@ -2662,6 +2675,7 @@ struct ct_fdmiv2_hba_attributes {
 #define FDMI_PORT_SPEED_8GB            0x10
 #define FDMI_PORT_SPEED_16GB           0x20
 #define FDMI_PORT_SPEED_32GB           0x40
+#define FDMI_PORT_SPEED_64GB           0x80
 #define FDMI_PORT_SPEED_UNKNOWN                0x8000
 
 #define FC_CLASS_2     0x04
@@ -3120,10 +3134,10 @@ struct rsp_que;
 struct isp_operations {
 
        int (*pci_config) (struct scsi_qla_host *);
-       void (*reset_chip) (struct scsi_qla_host *);
+       int (*reset_chip)(struct scsi_qla_host *);
        int (*chip_diag) (struct scsi_qla_host *);
        void (*config_rings) (struct scsi_qla_host *);
-       void (*reset_adapter) (struct scsi_qla_host *);
+       int (*reset_adapter)(struct scsi_qla_host *);
        int (*nvram_config) (struct scsi_qla_host *);
        void (*update_fw_options) (struct scsi_qla_host *);
        int (*load_risc) (struct scsi_qla_host *, uint32_t *);
@@ -3149,9 +3163,9 @@ struct isp_operations {
        void *(*prep_ms_fdmi_iocb) (struct scsi_qla_host *, uint32_t,
            uint32_t);
 
-       uint8_t *(*read_nvram) (struct scsi_qla_host *, uint8_t *,
+       uint8_t *(*read_nvram)(struct scsi_qla_host *, void *,
                uint32_t, uint32_t);
-       int (*write_nvram) (struct scsi_qla_host *, uint8_t *, uint32_t,
+       int (*write_nvram)(struct scsi_qla_host *, void *, uint32_t,
                uint32_t);
 
        void (*fw_dump) (struct scsi_qla_host *, int);
@@ -3160,16 +3174,16 @@ struct isp_operations {
        int (*beacon_off) (struct scsi_qla_host *);
        void (*beacon_blink) (struct scsi_qla_host *);
 
-       uint8_t * (*read_optrom) (struct scsi_qla_host *, uint8_t *,
+       void *(*read_optrom)(struct scsi_qla_host *, void *,
                uint32_t, uint32_t);
-       int (*write_optrom) (struct scsi_qla_host *, uint8_t *, uint32_t,
+       int (*write_optrom)(struct scsi_qla_host *, void *, uint32_t,
                uint32_t);
 
        int (*get_flash_version) (struct scsi_qla_host *, void *);
        int (*start_scsi) (srb_t *);
        int (*start_scsi_mq) (srb_t *);
        int (*abort_isp) (struct scsi_qla_host *);
-       int (*iospace_config)(struct qla_hw_data*);
+       int (*iospace_config)(struct qla_hw_data *);
        int (*initialize_adapter)(struct scsi_qla_host *);
 };
 
@@ -3358,7 +3372,8 @@ struct qla_tc_param {
 #define QLA_MQ_SIZE 32
 #define QLA_MAX_QUEUES 256
 #define ISP_QUE_REG(ha, id) \
-       ((ha->mqenable || IS_QLA83XX(ha) || IS_QLA27XX(ha)) ? \
+       ((ha->mqenable || IS_QLA83XX(ha) || \
+         IS_QLA27XX(ha) || IS_QLA28XX(ha)) ? \
         ((void __iomem *)ha->mqiobase + (QLA_QUE_PAGE * id)) :\
         ((void __iomem *)ha->iobase))
 #define QLA_REQ_QUE_ID(tag) \
@@ -3611,6 +3626,8 @@ struct qla_hw_data {
                uint32_t        rida_fmt2:1;
                uint32_t        purge_mbox:1;
                uint32_t        n2n_bigger:1;
+               uint32_t        secure_adapter:1;
+               uint32_t        secure_fw:1;
        } flags;
 
        uint16_t max_exchg;
@@ -3688,12 +3705,15 @@ struct qla_hw_data {
 #define PORT_SPEED_UNKNOWN 0xFFFF
 #define PORT_SPEED_1GB  0x00
 #define PORT_SPEED_2GB  0x01
+#define PORT_SPEED_AUTO 0x02
 #define PORT_SPEED_4GB  0x03
 #define PORT_SPEED_8GB  0x04
 #define PORT_SPEED_16GB 0x05
 #define PORT_SPEED_32GB 0x06
+#define PORT_SPEED_64GB 0x07
 #define PORT_SPEED_10GB        0x13
        uint16_t        link_data_rate;         /* F/W operating speed */
+       uint16_t        set_data_rate;          /* Set by user */
 
        uint8_t         current_topology;
        uint8_t         prev_topology;
@@ -3717,6 +3737,11 @@ struct qla_hw_data {
 #define PCI_DEVICE_ID_QLOGIC_ISP2071   0x2071
 #define PCI_DEVICE_ID_QLOGIC_ISP2271   0x2271
 #define PCI_DEVICE_ID_QLOGIC_ISP2261   0x2261
+#define PCI_DEVICE_ID_QLOGIC_ISP2061   0x2061
+#define PCI_DEVICE_ID_QLOGIC_ISP2081   0x2081
+#define PCI_DEVICE_ID_QLOGIC_ISP2089   0x2089
+#define PCI_DEVICE_ID_QLOGIC_ISP2281   0x2281
+#define PCI_DEVICE_ID_QLOGIC_ISP2289   0x2289
 
        uint32_t        isp_type;
 #define DT_ISP2100                      BIT_0
@@ -3741,7 +3766,12 @@ struct qla_hw_data {
 #define DT_ISP2071                     BIT_19
 #define DT_ISP2271                     BIT_20
 #define DT_ISP2261                     BIT_21
-#define DT_ISP_LAST                    (DT_ISP2261 << 1)
+#define DT_ISP2061                     BIT_22
+#define DT_ISP2081                     BIT_23
+#define DT_ISP2089                     BIT_24
+#define DT_ISP2281                     BIT_25
+#define DT_ISP2289                     BIT_26
+#define DT_ISP_LAST                    (DT_ISP2289 << 1)
 
        uint32_t        device_type;
 #define DT_T10_PI                       BIT_25
@@ -3776,6 +3806,8 @@ struct qla_hw_data {
 #define IS_QLA2071(ha) (DT_MASK(ha) & DT_ISP2071)
 #define IS_QLA2271(ha) (DT_MASK(ha) & DT_ISP2271)
 #define IS_QLA2261(ha) (DT_MASK(ha) & DT_ISP2261)
+#define IS_QLA2081(ha) (DT_MASK(ha) & DT_ISP2081)
+#define IS_QLA2281(ha) (DT_MASK(ha) & DT_ISP2281)
 
 #define IS_QLA23XX(ha)  (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \
                        IS_QLA6312(ha) || IS_QLA6322(ha))
@@ -3785,6 +3817,7 @@ struct qla_hw_data {
 #define IS_QLA83XX(ha) (IS_QLA2031(ha) || IS_QLA8031(ha))
 #define IS_QLA84XX(ha)  (IS_QLA8432(ha))
 #define IS_QLA27XX(ha)  (IS_QLA2071(ha) || IS_QLA2271(ha) || IS_QLA2261(ha))
+#define IS_QLA28XX(ha) (IS_QLA2081(ha) || IS_QLA2281(ha))
 #define IS_QLA24XX_TYPE(ha)     (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \
                                IS_QLA84XX(ha))
 #define IS_CNA_CAPABLE(ha)     (IS_QLA81XX(ha) || IS_QLA82XX(ha) || \
@@ -3793,14 +3826,15 @@ struct qla_hw_data {
 #define IS_QLA2XXX_MIDTYPE(ha) (IS_QLA24XX(ha) || IS_QLA84XX(ha) || \
                                IS_QLA25XX(ha) || IS_QLA81XX(ha) || \
                                IS_QLA82XX(ha) || IS_QLA83XX(ha) || \
-                               IS_QLA8044(ha) || IS_QLA27XX(ha))
+                               IS_QLA8044(ha) || IS_QLA27XX(ha) || \
+                               IS_QLA28XX(ha))
 #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha) || \
-                               IS_QLA27XX(ha))
+                               IS_QLA27XX(ha) || IS_QLA28XX(ha))
 #define IS_NOPOLLING_TYPE(ha)  (IS_QLA81XX(ha) && (ha)->flags.msix_enabled)
 #define IS_FAC_REQUIRED(ha)    (IS_QLA81XX(ha) || IS_QLA83XX(ha) || \
-                               IS_QLA27XX(ha))
+                               IS_QLA27XX(ha) || IS_QLA28XX(ha))
 #define IS_NOCACHE_VPD_TYPE(ha)        (IS_QLA81XX(ha) || IS_QLA83XX(ha) || \
-                               IS_QLA27XX(ha))
+                               IS_QLA27XX(ha) || IS_QLA28XX(ha))
 #define IS_ALOGIO_CAPABLE(ha)  (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha))
 
 #define IS_T10_PI_CAPABLE(ha)   ((ha)->device_type & DT_T10_PI)
@@ -3811,28 +3845,34 @@ struct qla_hw_data {
 #define HAS_EXTENDED_IDS(ha)    ((ha)->device_type & DT_EXTENDED_IDS)
 #define IS_CT6_SUPPORTED(ha)   ((ha)->device_type & DT_CT6_SUPPORTED)
 #define IS_MQUE_CAPABLE(ha)    ((ha)->mqenable || IS_QLA83XX(ha) || \
-                               IS_QLA27XX(ha))
-#define IS_BIDI_CAPABLE(ha)    ((IS_QLA25XX(ha) || IS_QLA2031(ha)))
+                               IS_QLA27XX(ha) || IS_QLA28XX(ha))
+#define IS_BIDI_CAPABLE(ha) \
+    (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha))
 /* Bit 21 of fw_attributes decides the MCTP capabilities */
 #define IS_MCTP_CAPABLE(ha)    (IS_QLA2031(ha) && \
                                ((ha)->fw_attributes_ext[0] & BIT_0))
 #define IS_PI_UNINIT_CAPABLE(ha)       (IS_QLA83XX(ha) || IS_QLA27XX(ha))
 #define IS_PI_IPGUARD_CAPABLE(ha)      (IS_QLA83XX(ha) || IS_QLA27XX(ha))
 #define IS_PI_DIFB_DIX0_CAPABLE(ha)    (0)
-#define IS_PI_SPLIT_DET_CAPABLE_HBA(ha)        (IS_QLA83XX(ha) || IS_QLA27XX(ha))
+#define IS_PI_SPLIT_DET_CAPABLE_HBA(ha)        (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
+                                       IS_QLA28XX(ha))
 #define IS_PI_SPLIT_DET_CAPABLE(ha)    (IS_PI_SPLIT_DET_CAPABLE_HBA(ha) && \
     (((ha)->fw_attributes_h << 16 | (ha)->fw_attributes) & BIT_22))
-#define IS_ATIO_MSIX_CAPABLE(ha) (IS_QLA83XX(ha) || IS_QLA27XX(ha))
+#define IS_ATIO_MSIX_CAPABLE(ha) (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
+                               IS_QLA28XX(ha))
 #define IS_TGT_MODE_CAPABLE(ha)        (ha->tgt.atio_q_length)
-#define IS_SHADOW_REG_CAPABLE(ha)  (IS_QLA27XX(ha))
-#define IS_DPORT_CAPABLE(ha)  (IS_QLA83XX(ha) || IS_QLA27XX(ha))
-#define IS_FAWWN_CAPABLE(ha)   (IS_QLA83XX(ha) || IS_QLA27XX(ha))
+#define IS_SHADOW_REG_CAPABLE(ha)  (IS_QLA27XX(ha) || IS_QLA28XX(ha))
+#define IS_DPORT_CAPABLE(ha)  (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
+                               IS_QLA28XX(ha))
+#define IS_FAWWN_CAPABLE(ha)   (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
+                               IS_QLA28XX(ha))
 #define IS_EXCHG_OFFLD_CAPABLE(ha) \
-       (IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha))
+       (IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha))
 #define IS_EXLOGIN_OFFLD_CAPABLE(ha) \
-       (IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha))
+       (IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || \
+        IS_QLA27XX(ha) || IS_QLA28XX(ha))
 #define USE_ASYNC_SCAN(ha) (IS_QLA25XX(ha) || IS_QLA81XX(ha) ||\
-       IS_QLA83XX(ha) || IS_QLA27XX(ha))
+       IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha))
 
        /* HBA serial number */
        uint8_t         serial0;
@@ -3876,6 +3916,9 @@ struct qla_hw_data {
        void            *sfp_data;
        dma_addr_t      sfp_data_dma;
 
+       void            *flt;
+       dma_addr_t      flt_dma;
+
 #define XGMAC_DATA_SIZE        4096
        void            *xgmac_data;
        dma_addr_t      xgmac_data_dma;
@@ -3958,6 +4001,10 @@ struct qla_hw_data {
        uint16_t        fw_subminor_version;
        uint16_t        fw_attributes;
        uint16_t        fw_attributes_h;
+#define FW_ATTR_H_NVME_FBURST  BIT_1
+#define FW_ATTR_H_NVME         BIT_10
+#define FW_ATTR_H_NVME_UPDATED  BIT_14
+
        uint16_t        fw_attributes_ext[2];
        uint32_t        fw_memory_size;
        uint32_t        fw_transfer_size;
@@ -3983,18 +4030,23 @@ struct qla_hw_data {
        uint8_t         fw_seriallink_options[4];
        uint16_t        fw_seriallink_options24[4];
 
+       uint8_t         serdes_version[3];
        uint8_t         mpi_version[3];
        uint32_t        mpi_capabilities;
        uint8_t         phy_version[3];
        uint8_t         pep_version[3];
 
        /* Firmware dump template */
-       void            *fw_dump_template;
-       uint32_t        fw_dump_template_len;
-       /* Firmware dump information. */
+       struct fwdt {
+               void *template;
+               ulong length;
+               ulong dump_size;
+       } fwdt[2];
        struct qla2xxx_fw_dump *fw_dump;
        uint32_t        fw_dump_len;
-       int             fw_dumped;
+       u32             fw_dump_alloc_len;
+       bool            fw_dumped;
+       bool            fw_dump_mpi;
        unsigned long   fw_dump_cap_flags;
 #define RISC_PAUSE_CMPL                0
 #define DMA_SHUTDOWN_CMPL      1
@@ -4033,7 +4085,6 @@ struct qla_hw_data {
        uint16_t        product_id[4];
 
        uint8_t         model_number[16+1];
-#define BINZERO                "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
        char            model_desc[80];
        uint8_t         adapter_id[16+1];
 
@@ -4073,22 +4124,28 @@ struct qla_hw_data {
        uint32_t        fdt_protect_sec_cmd;
        uint32_t        fdt_wrt_sts_reg_cmd;
 
-       uint32_t        flt_region_flt;
-       uint32_t        flt_region_fdt;
-       uint32_t        flt_region_boot;
-       uint32_t        flt_region_boot_sec;
-       uint32_t        flt_region_fw;
-       uint32_t        flt_region_fw_sec;
-       uint32_t        flt_region_vpd_nvram;
-       uint32_t        flt_region_vpd;
-       uint32_t        flt_region_vpd_sec;
-       uint32_t        flt_region_nvram;
-       uint32_t        flt_region_npiv_conf;
-       uint32_t        flt_region_gold_fw;
-       uint32_t        flt_region_fcp_prio;
-       uint32_t        flt_region_bootload;
-       uint32_t        flt_region_img_status_pri;
-       uint32_t        flt_region_img_status_sec;
+       struct {
+               uint32_t        flt_region_flt;
+               uint32_t        flt_region_fdt;
+               uint32_t        flt_region_boot;
+               uint32_t        flt_region_boot_sec;
+               uint32_t        flt_region_fw;
+               uint32_t        flt_region_fw_sec;
+               uint32_t        flt_region_vpd_nvram;
+               uint32_t        flt_region_vpd_nvram_sec;
+               uint32_t        flt_region_vpd;
+               uint32_t        flt_region_vpd_sec;
+               uint32_t        flt_region_nvram;
+               uint32_t        flt_region_nvram_sec;
+               uint32_t        flt_region_npiv_conf;
+               uint32_t        flt_region_gold_fw;
+               uint32_t        flt_region_fcp_prio;
+               uint32_t        flt_region_bootload;
+               uint32_t        flt_region_img_status_pri;
+               uint32_t        flt_region_img_status_sec;
+               uint32_t        flt_region_aux_img_status_pri;
+               uint32_t        flt_region_aux_img_status_sec;
+       };
        uint8_t         active_image;
 
        /* Needed for BEACON */
@@ -4181,15 +4238,46 @@ struct qla_hw_data {
        struct qlt_hw_data tgt;
        int     allow_cna_fw_dump;
        uint32_t fw_ability_mask;
-       uint16_t min_link_speed;
-       uint16_t max_speed_sup;
+       uint16_t min_supported_speed;
+       uint16_t max_supported_speed;
+
+       /* DMA pool for the DIF bundling buffers */
+       struct dma_pool *dif_bundl_pool;
+       #define DIF_BUNDLING_DMA_POOL_SIZE  1024
+       struct {
+               struct {
+                       struct list_head head;
+                       uint count;
+               } good;
+               struct {
+                       struct list_head head;
+                       uint count;
+               } unusable;
+       } pool;
+
+       unsigned long long dif_bundle_crossed_pages;
+       unsigned long long dif_bundle_reads;
+       unsigned long long dif_bundle_writes;
+       unsigned long long dif_bundle_kallocs;
+       unsigned long long dif_bundle_dma_allocs;
 
        atomic_t        nvme_active_aen_cnt;
        uint16_t        nvme_last_rptd_aen;             /* Last recorded aen count */
 
        atomic_t zio_threshold;
        uint16_t last_zio_threshold;
-#define DEFAULT_ZIO_THRESHOLD 64
+
+#define DEFAULT_ZIO_THRESHOLD 5
+};
+
+struct active_regions {
+       uint8_t global;
+       struct {
+               uint8_t board_config;
+               uint8_t vpd_nvram;
+               uint8_t npiv_config_0_1;
+               uint8_t npiv_config_2_3;
+       } aux;
 };
 
 #define FW_ABILITY_MAX_SPEED_MASK      0xFUL
@@ -4198,6 +4286,10 @@ struct qla_hw_data {
 #define FW_ABILITY_MAX_SPEED(ha)       \
        (ha->fw_ability_mask & FW_ABILITY_MAX_SPEED_MASK)
 
+#define QLA_GET_DATA_RATE      0
+#define QLA_SET_DATA_RATE_NOLR 1
+#define QLA_SET_DATA_RATE_LR   2 /* Set speed and initiate LR */
+
 /*
  * Qlogic scsi host structure
  */
@@ -4229,6 +4321,7 @@ typedef struct scsi_qla_host {
                uint32_t        qpairs_req_created:1;
                uint32_t        qpairs_rsp_created:1;
                uint32_t        nvme_enabled:1;
+               uint32_t        nvme_first_burst:1;
        } flags;
 
        atomic_t        loop_state;
@@ -4274,6 +4367,7 @@ typedef struct scsi_qla_host {
 #define N2N_LOGIN_NEEDED       30
 #define IOCB_WORK_ACTIVE       31
 #define SET_ZIO_THRESHOLD_NEEDED 32
+#define ISP_ABORT_TO_ROM       33
 
        unsigned long   pci_flags;
 #define PFLG_DISCONNECTED      0       /* PCI device removed */
@@ -4388,7 +4482,7 @@ typedef struct scsi_qla_host {
        int fcport_count;
        wait_queue_head_t fcport_waitQ;
        wait_queue_head_t vref_waitq;
-       uint8_t min_link_speed_feat;
+       uint8_t min_supported_speed;
        uint8_t n2n_node_name[WWN_SIZE];
        uint8_t n2n_port_name[WWN_SIZE];
        uint16_t        n2n_id;
@@ -4400,14 +4494,21 @@ typedef struct scsi_qla_host {
 
 struct qla27xx_image_status {
        uint8_t image_status_mask;
-       uint16_t generation_number;
-       uint8_t reserved[3];
-       uint8_t ver_minor;
+       uint16_t generation;
        uint8_t ver_major;
+       uint8_t ver_minor;
+       uint8_t bitmap;         /* 28xx only */
+       uint8_t reserved[2];
        uint32_t checksum;
        uint32_t signature;
 } __packed;
 
+/* 28xx aux image status bimap values */
+#define QLA28XX_AUX_IMG_BOARD_CONFIG           BIT_0
+#define QLA28XX_AUX_IMG_VPD_NVRAM              BIT_1
+#define QLA28XX_AUX_IMG_NPIV_CONFIG_0_1                BIT_2
+#define QLA28XX_AUX_IMG_NPIV_CONFIG_2_3                BIT_3
+
 #define SET_VP_IDX     1
 #define SET_AL_PA      2
 #define RESET_VP_IDX   3
@@ -4454,6 +4555,24 @@ struct qla2_sgx {
        }                                       \
 }
 
+
+#define SFUB_CHECKSUM_SIZE     4
+
+struct secure_flash_update_block {
+       uint32_t        block_info;
+       uint32_t        signature_lo;
+       uint32_t        signature_hi;
+       uint32_t        signature_upper[0x3e];
+};
+
+struct secure_flash_update_block_pk {
+       uint32_t        block_info;
+       uint32_t        signature_lo;
+       uint32_t        signature_hi;
+       uint32_t        signature_upper[0x3e];
+       uint32_t        public_key[0x41];
+};
+
 /*
  * Macros to help code, maintain, etc.
  */
@@ -4554,6 +4673,7 @@ struct qla2_sgx {
 #define OPTROM_SIZE_81XX       0x400000
 #define OPTROM_SIZE_82XX       0x800000
 #define OPTROM_SIZE_83XX       0x1000000
+#define OPTROM_SIZE_28XX       0x2000000
 
 #define OPTROM_BURST_SIZE      0x1000
 #define OPTROM_BURST_DWORDS    (OPTROM_BURST_SIZE / 4)
@@ -4650,10 +4770,13 @@ struct sff_8247_a0 {
 #define AUTO_DETECT_SFP_SUPPORT(_vha)\
        (ql2xautodetectsfp && !_vha->vp_idx &&          \
        (IS_QLA25XX(_vha->hw) || IS_QLA81XX(_vha->hw) ||\
-       IS_QLA83XX(_vha->hw) || IS_QLA27XX(_vha->hw)))
+       IS_QLA83XX(_vha->hw) || IS_QLA27XX(_vha->hw) || \
+        IS_QLA28XX(_vha->hw)))
+
+#define FLASH_SEMAPHORE_REGISTER_ADDR   0x00101016
 
 #define USER_CTRL_IRQ(_ha) (ql2xuctrlirq && QLA_TGT_MODE_ENABLED() && \
-       (IS_QLA27XX(_ha) || IS_QLA83XX(_ha)))
+       (IS_QLA27XX(_ha) || IS_QLA28XX(_ha) || IS_QLA83XX(_ha)))
 
 #define SAVE_TOPO(_ha) { \
        if (_ha->current_topology)                              \