Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-microblaze.git] / drivers / scsi / lpfc / lpfc.h
index 98cabe0..f0cf8ff 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-2021 Broadcom. All Rights Reserved. The term *
+ * Copyright (C) 2017-2022 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.                        *
@@ -917,6 +917,10 @@ struct lpfc_hba {
                (struct lpfc_vport *vport,
                 struct lpfc_io_buf *lpfc_cmd,
                 uint8_t tmo);
+       int (*lpfc_scsi_prep_task_mgmt_cmd)
+               (struct lpfc_vport *vport,
+                struct lpfc_io_buf *lpfc_cmd,
+                u64 lun, u8 task_mgmt_cmd);
 
        /* IOCB interface function jump table entries */
        int (*__lpfc_sli_issue_iocb)
@@ -928,8 +932,6 @@ struct lpfc_hba {
        void (*__lpfc_sli_release_iocbq)(struct lpfc_hba *,
                         struct lpfc_iocbq *);
        int (*lpfc_hba_down_post)(struct lpfc_hba *phba);
-       IOCB_t * (*lpfc_get_iocb_from_iocbq)
-               (struct lpfc_iocbq *);
        void (*lpfc_scsi_cmd_iocb_cmpl)
                (struct lpfc_hba *, struct lpfc_iocbq *, struct lpfc_iocbq *);
 
@@ -962,7 +964,23 @@ struct lpfc_hba {
 
        int (*lpfc_bg_scsi_prep_dma_buf)
                (struct lpfc_hba *, struct lpfc_io_buf *);
-       /* Add new entries here */
+
+       /* Prep SLI WQE/IOCB jump table entries */
+       void (*__lpfc_sli_prep_els_req_rsp)(struct lpfc_iocbq *cmdiocbq,
+                                           struct lpfc_vport *vport,
+                                           struct lpfc_dmabuf *bmp,
+                                           u16 cmd_size, u32 did, u32 elscmd,
+                                           u8 tmo, u8 expect_rsp);
+       void (*__lpfc_sli_prep_gen_req)(struct lpfc_iocbq *cmdiocbq,
+                                       struct lpfc_dmabuf *bmp, u16 rpi,
+                                       u32 num_entry, u8 tmo);
+       void (*__lpfc_sli_prep_xmit_seq64)(struct lpfc_iocbq *cmdiocbq,
+                                          struct lpfc_dmabuf *bmp, u16 rpi,
+                                          u16 ox_id, u32 num_entry, u8 rctl,
+                                          u8 last_seq, u8 cr_cx_cmd);
+       void (*__lpfc_sli_prep_abort_xri)(struct lpfc_iocbq *cmdiocbq,
+                                         u16 ulp_context, u16 iotag,
+                                         u8 ulp_class, u16 cqid, bool ia);
 
        /* expedite pool */
        struct lpfc_epd_pool epd_pool;
@@ -1136,8 +1154,6 @@ struct lpfc_hba {
        uint32_t cfg_nvme_seg_cnt;
        uint32_t cfg_scsi_seg_cnt;
        uint32_t cfg_sg_dma_buf_size;
-       uint64_t cfg_soft_wwnn;
-       uint64_t cfg_soft_wwpn;
        uint32_t cfg_hba_queue_depth;
        uint32_t cfg_enable_hba_reset;
        uint32_t cfg_enable_hba_heartbeat;
@@ -1269,7 +1285,6 @@ struct lpfc_hba {
 #define VPD_PORT            0x8         /* valid vpd port data */
 #define VPD_MASK            0xf         /* mask for any vpd data */
 
-       uint8_t soft_wwn_enable;
 
        struct timer_list fcp_poll_timer;
        struct timer_list eratt_poll;
@@ -1801,3 +1816,75 @@ static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba)
 {
        return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging;
 }
+
+static inline
+u8 get_job_ulpstatus(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return bf_get(lpfc_wcqe_c_status, &iocbq->wcqe_cmpl);
+       else
+               return iocbq->iocb.ulpStatus;
+}
+
+static inline
+u32 get_job_word4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return iocbq->wcqe_cmpl.parameter;
+       else
+               return iocbq->iocb.un.ulpWord[4];
+}
+
+static inline
+u8 get_job_cmnd(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return bf_get(wqe_cmnd, &iocbq->wqe.generic.wqe_com);
+       else
+               return iocbq->iocb.ulpCommand;
+}
+
+static inline
+u16 get_job_ulpcontext(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return bf_get(wqe_ctxt_tag, &iocbq->wqe.generic.wqe_com);
+       else
+               return iocbq->iocb.ulpContext;
+}
+
+static inline
+u16 get_job_rcvoxid(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return bf_get(wqe_rcvoxid, &iocbq->wqe.generic.wqe_com);
+       else
+               return iocbq->iocb.unsli3.rcvsli3.ox_id;
+}
+
+static inline
+u32 get_job_data_placed(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return iocbq->wcqe_cmpl.total_data_placed;
+       else
+               return iocbq->iocb.un.genreq64.bdl.bdeSize;
+}
+
+static inline
+u32 get_job_abtsiotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return iocbq->wqe.abort_cmd.wqe_com.abort_tag;
+       else
+               return iocbq->iocb.un.acxri.abortIoTag;
+}
+
+static inline
+u32 get_job_els_rsp64_did(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
+{
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return bf_get(wqe_els_did, &iocbq->wqe.els_req.wqe_dest);
+       else
+               return iocbq->iocb.un.elsreq64.remoteID;
+}