mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
qla2x00t-32gbit: Backport to older kernel versions
Unbreak the build for the previous commit against kernel versions
before v5.8.
See also commit 72e6329f86c7 ("nvme-fc and nvmet-fc: revise LLDD api for LS
reception and LS request") # v5.8.
This commit is contained in:
@@ -389,11 +389,13 @@ struct name_list_extended {
|
||||
u8 sent;
|
||||
};
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
struct qla_nvme_fc_rjt {
|
||||
struct fcnvme_ls_rjt *c;
|
||||
dma_addr_t cdma;
|
||||
u16 size;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct els_reject {
|
||||
struct fc_els_ls_rjt *c;
|
||||
@@ -552,6 +554,7 @@ struct ct_arg {
|
||||
port_id_t id;
|
||||
};
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
struct qla_nvme_lsrjt_pt_arg {
|
||||
struct fc_port *fcport;
|
||||
u8 opcode;
|
||||
@@ -565,6 +568,7 @@ struct qla_nvme_lsrjt_pt_arg {
|
||||
u32 tx_byte_count, rx_byte_count;
|
||||
dma_addr_t tx_addr, rx_addr;
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SRB extensions.
|
||||
@@ -4890,7 +4894,9 @@ struct qla_hw_data {
|
||||
struct els_reject elsrej;
|
||||
u8 edif_post_stop_cnt_down;
|
||||
struct qla_vp_map *vp_map;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
struct qla_nvme_fc_rjt lsrjt;
|
||||
#endif
|
||||
struct qla_fw_res fwres ____cacheline_aligned;
|
||||
};
|
||||
|
||||
|
||||
@@ -613,7 +613,7 @@ void qla24xx_queue_purex_item(scsi_qla_host_t *, struct purex_item *,
|
||||
void (*process_item)(struct scsi_qla_host *,
|
||||
struct purex_item *));
|
||||
void __qla_consume_iocb(struct scsi_qla_host *, void **, struct rsp_que **);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
void qla2xxx_process_purls_iocb(void **pkt, struct rsp_que **rsp);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3981,7 +3981,9 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
struct purex_entry_24xx *purex_entry;
|
||||
struct purex_item *pure_item;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
struct pt_ls4_rx_unsol *p;
|
||||
#endif
|
||||
u16 rsp_in = 0, cur_ring_index;
|
||||
int is_shadow_hba;
|
||||
|
||||
@@ -4154,6 +4156,7 @@ process_err:
|
||||
qla28xx_sa_update_iocb_entry(vha, rsp->req,
|
||||
(struct sa_update_28xx *)pkt);
|
||||
break;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
case PT_LS4_UNSOL:
|
||||
p = (void *)pkt;
|
||||
if (qla_chk_cont_iocb_avail(vha, rsp, (response_t *)pkt, rsp_in)) {
|
||||
@@ -4167,6 +4170,7 @@ process_err:
|
||||
}
|
||||
qla2xxx_process_purls_iocb((void **)&pkt, &rsp);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* Type Not Supported. */
|
||||
ql_dbg(ql_dbg_async, vha, 0x5042,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/blk-mq.h>
|
||||
|
||||
static struct nvme_fc_port_template qla_nvme_fc_transport;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
static int qla_nvme_ls_reject_iocb(struct scsi_qla_host *vha,
|
||||
struct qla_qpair *qp,
|
||||
struct qla_nvme_lsrjt_pt_arg *a,
|
||||
@@ -37,6 +38,7 @@ struct qla_nvme_unsol_ctx {
|
||||
int comp_status;
|
||||
spinlock_t cmd_lock;
|
||||
};
|
||||
#endif
|
||||
|
||||
int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport)
|
||||
{
|
||||
@@ -251,6 +253,7 @@ static void qla_nvme_sp_ls_done(srb_t *sp, int res)
|
||||
schedule_work(&priv->ls_work);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
static void qla_nvme_release_lsrsp_cmd_kref(struct kref *kref)
|
||||
{
|
||||
struct srb *sp = container_of(kref, struct srb, cmd_kref);
|
||||
@@ -299,6 +302,7 @@ static void qla_nvme_sp_lsrsp_done(srb_t *sp, int res)
|
||||
INIT_WORK(&uctx->lsrsp_work, qla_nvme_lsrsp_complete);
|
||||
schedule_work(&uctx->lsrsp_work);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* it assumed that QPair lock is held. */
|
||||
static void qla_nvme_sp_done(srb_t *sp, int res)
|
||||
@@ -372,6 +376,7 @@ out:
|
||||
kref_put(&sp->cmd_kref, sp->put_fn);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
static int qla_nvme_xmt_ls_rsp(struct nvme_fc_local_port *lport,
|
||||
struct nvme_fc_remote_port *rport,
|
||||
struct nvmefc_ls_rsp *fd_resp)
|
||||
@@ -457,6 +462,7 @@ out:
|
||||
kfree(uctx);
|
||||
return rval;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void qla_nvme_ls_abort(struct nvme_fc_local_port *lport,
|
||||
struct nvme_fc_remote_port *rport, struct nvmefc_ls_req *fd)
|
||||
@@ -896,7 +902,9 @@ static struct nvme_fc_port_template qla_nvme_fc_transport = {
|
||||
.ls_abort = qla_nvme_ls_abort,
|
||||
.fcp_io = qla_nvme_post_cmd,
|
||||
.fcp_abort = qla_nvme_fcp_abort,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
.xmt_ls_rsp = qla_nvme_xmt_ls_rsp,
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
|
||||
.map_queues = qla_nvme_map_queues,
|
||||
#endif
|
||||
@@ -1024,6 +1032,7 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
static void qla_nvme_fc_format_rjt(void *buf, u8 ls_cmd, u8 reason,
|
||||
u8 explanation, u8 vendor)
|
||||
{
|
||||
@@ -1266,6 +1275,7 @@ out:
|
||||
__qla_consume_iocb(vha, pkt, rsp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
#define Q2T_NVME_NUM_TAGS 2048
|
||||
#define QLA_MAX_FC_SEGMENTS 64
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
struct qla_nvme_unsol_ctx;
|
||||
#endif
|
||||
struct scsi_qla_host;
|
||||
struct qla_hw_data;
|
||||
struct req_que;
|
||||
@@ -41,7 +43,9 @@ struct nvme_private {
|
||||
|
||||
struct qla_nvme_rport {
|
||||
struct fc_port *fcport;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
struct qla_nvme_unsol_ctx *uctx;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define COMMAND_NVME 0x88 /* Command Type FC-NVMe IOCB */
|
||||
|
||||
@@ -4538,6 +4538,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
|
||||
ha->elsrej.c->er_reason = ELS_RJT_LOGIC;
|
||||
ha->elsrej.c->er_explan = ELS_EXPL_UNAB_DATA;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
ha->lsrjt.size = sizeof(struct fcnvme_ls_rjt);
|
||||
ha->lsrjt.c = dma_alloc_coherent(&ha->pdev->dev, ha->lsrjt.size,
|
||||
&ha->lsrjt.cdma, GFP_KERNEL);
|
||||
@@ -4546,12 +4547,15 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
|
||||
"Alloc failed for nvme fc reject cmd.\n");
|
||||
goto fail_lsrjt;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
fail_lsrjt:
|
||||
dma_free_coherent(&ha->pdev->dev, ha->elsrej.size,
|
||||
ha->elsrej.c, ha->elsrej.cdma);
|
||||
#endif
|
||||
fail_elsrej:
|
||||
dma_pool_destroy(ha->purex_dma_pool);
|
||||
fail_flt:
|
||||
@@ -5081,11 +5085,13 @@ qla2x00_mem_free(struct qla_hw_data *ha)
|
||||
ha->elsrej.c = NULL;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||
if (ha->lsrjt.c) {
|
||||
dma_free_coherent(&ha->pdev->dev, ha->lsrjt.size, ha->lsrjt.c,
|
||||
ha->lsrjt.cdma);
|
||||
ha->lsrjt.c = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
ha->init_cb = NULL;
|
||||
ha->init_cb_dma = 0;
|
||||
|
||||
Reference in New Issue
Block a user