]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/lpfc/lpfc_sli4.h
[SCSI] lpfc 8.3.25: Add FCF priority failover functionality
[karo-tx-linux.git] / drivers / scsi / lpfc / lpfc_sli4.h
index 03d25a9d3bf6f5a1dcdcd6bf8aeef631100f247f..19bb87ae85975a84bcf060642c7ba93402638766 100644 (file)
@@ -81,6 +81,8 @@
         (fc_hdr)->fh_f_ctl[1] <<  8 | \
         (fc_hdr)->fh_f_ctl[2])
 
+#define LPFC_FW_RESET_MAXIMUM_WAIT_10MS_CNT 12000
+
 enum lpfc_sli4_queue_type {
        LPFC_EQ,
        LPFC_GCQ,
@@ -157,6 +159,25 @@ struct lpfc_fcf_rec {
 #define RECORD_VALID   0x02
 };
 
+struct lpfc_fcf_pri_rec {
+       uint16_t fcf_index;
+#define LPFC_FCF_ON_PRI_LIST 0x0001
+#define LPFC_FCF_FLOGI_FAILED 0x0002
+       uint16_t flag;
+       uint32_t priority;
+};
+
+struct lpfc_fcf_pri {
+       struct list_head list;
+       struct lpfc_fcf_pri_rec fcf_rec;
+};
+
+/*
+ * Maximum FCF table index, it is for driver internal book keeping, it
+ * just needs to be no less than the supported HBA's FCF table size.
+ */
+#define LPFC_SLI4_FCF_TBL_INDX_MAX     32
+
 struct lpfc_fcf {
        uint16_t fcfi;
        uint32_t fcf_flag;
@@ -176,15 +197,13 @@ struct lpfc_fcf {
        uint32_t eligible_fcf_cnt;
        struct lpfc_fcf_rec current_rec;
        struct lpfc_fcf_rec failover_rec;
+       struct list_head fcf_pri_list;
+       struct lpfc_fcf_pri fcf_pri[LPFC_SLI4_FCF_TBL_INDX_MAX];
+       uint32_t current_fcf_scan_pri;
        struct timer_list redisc_wait;
        unsigned long *fcf_rr_bmask; /* Eligible FCF indexes for RR failover */
 };
 
-/*
- * Maximum FCF table index, it is for driver internal book keeping, it
- * just needs to be no less than the supported HBA's FCF table size.
- */
-#define LPFC_SLI4_FCF_TBL_INDX_MAX     32
 
 #define LPFC_REGION23_SIGNATURE "RG23"
 #define LPFC_REGION23_VERSION  1
@@ -310,7 +329,6 @@ struct lpfc_max_cfg_param {
        uint16_t vfi_base;
        uint16_t vfi_used;
        uint16_t max_fcfi;
-       uint16_t fcfi_base;
        uint16_t fcfi_used;
        uint16_t max_eq;
        uint16_t max_rq;
@@ -449,10 +467,13 @@ struct lpfc_sli4_hba {
        uint32_t intr_enable;
        struct lpfc_bmbx bmbx;
        struct lpfc_max_cfg_param max_cfg_param;
+       uint16_t extents_in_use; /* must allocate resource extents. */
+       uint16_t rpi_hdrs_in_use; /* must post rpi hdrs if set. */
        uint16_t next_xri; /* last_xri - max_cfg_param.xri_base = used */
        uint16_t next_rpi;
        uint16_t scsi_xri_max;
        uint16_t scsi_xri_cnt;
+       uint16_t scsi_xri_start;
        struct list_head lpfc_free_sgl_list;
        struct list_head lpfc_sgl_list;
        struct lpfc_sglq **lpfc_els_sgl_array;
@@ -463,7 +484,17 @@ struct lpfc_sli4_hba {
        struct lpfc_sglq **lpfc_sglq_active_list;
        struct list_head lpfc_rpi_hdr_list;
        unsigned long *rpi_bmask;
+       uint16_t *rpi_ids;
        uint16_t rpi_count;
+       struct list_head lpfc_rpi_blk_list;
+       unsigned long *xri_bmask;
+       uint16_t *xri_ids;
+       uint16_t xri_count;
+       struct list_head lpfc_xri_blk_list;
+       unsigned long *vfi_bmask;
+       uint16_t *vfi_ids;
+       uint16_t vfi_count;
+       struct list_head lpfc_vfi_blk_list;
        struct lpfc_sli4_flags sli4_flags;
        struct list_head sp_queue_event;
        struct list_head sp_cqe_event_pool;
@@ -496,6 +527,7 @@ struct lpfc_sglq {
        enum lpfc_sgl_state state;
        struct lpfc_nodelist *ndlp; /* ndlp associated with IO */
        uint16_t iotag;         /* pre-assigned IO tag */
+       uint16_t sli4_lxritag;  /* logical pre-assigned xri. */
        uint16_t sli4_xritag;   /* pre-assigned XRI, (OXID) tag. */
        struct sli4_sge *sgl;   /* pre-assigned SGL */
        void *virt;             /* virtual address. */
@@ -510,6 +542,13 @@ struct lpfc_rpi_hdr {
        uint32_t start_rpi;
 };
 
+struct lpfc_rsrc_blks {
+       struct list_head list;
+       uint16_t rsrc_start;
+       uint16_t rsrc_size;
+       uint16_t rsrc_used;
+};
+
 /*
  * SLI4 specific function prototypes
  */
@@ -549,8 +588,11 @@ int lpfc_sli4_post_sgl(struct lpfc_hba *, dma_addr_t, dma_addr_t, uint16_t);
 int lpfc_sli4_repost_scsi_sgl_list(struct lpfc_hba *);
 uint16_t lpfc_sli4_next_xritag(struct lpfc_hba *);
 int lpfc_sli4_post_async_mbox(struct lpfc_hba *);
-int lpfc_sli4_post_sgl_list(struct lpfc_hba *phba);
+int lpfc_sli4_post_els_sgl_list(struct lpfc_hba *phba);
+int lpfc_sli4_post_els_sgl_list_ext(struct lpfc_hba *phba);
 int lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *, struct list_head *, int);
+int lpfc_sli4_post_scsi_sgl_blk_ext(struct lpfc_hba *, struct list_head *,
+                                   int);
 struct lpfc_cq_event *__lpfc_sli4_cq_event_alloc(struct lpfc_hba *);
 struct lpfc_cq_event *lpfc_sli4_cq_event_alloc(struct lpfc_hba *);
 void __lpfc_sli4_cq_event_release(struct lpfc_hba *, struct lpfc_cq_event *);