qla2x00t-32gbit: Unbreak the RHEL 7 and RHEL 8 builds

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2021-09-07 00:45:11 +00:00
parent 3364429a0f
commit ee72166494
4 changed files with 36 additions and 19 deletions

View File

@@ -12,24 +12,6 @@
#ifdef NEW_LIBFC_API
#include <linux/bsg-lib.h>
#else
static inline struct Scsi_Host *fc_bsg_to_shost(struct fc_bsg_job *job)
{
return job->shost;
}
static inline struct fc_rport *fc_bsg_to_rport(struct fc_bsg_job *job)
{
return job->rport;
}
static inline void bsg_job_done_backport(struct fc_bsg_job *job, int result,
unsigned int reply_payload_rcv_len)
{
job->job_done(job);
}
#define bsg_job_done bsg_job_done_backport
#endif
static void qla2xxx_free_fcport_work(struct work_struct *work)

View File

@@ -25,6 +25,9 @@
#include <linux/aer.h>
#include <linux/mutex.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#include <linux/bsg-lib.h> /* struct bsg_job */
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
/*
* See also commit 5db53f3e80de ("[LogFS] add new flash file system") # v2.6.34.
@@ -48,6 +51,24 @@
#define BSG_JOB_TYPE struct bsg_job
#else
#define BSG_JOB_TYPE struct fc_bsg_job
static inline struct Scsi_Host *fc_bsg_to_shost(struct fc_bsg_job *job)
{
return job->shost;
}
static inline struct fc_rport *fc_bsg_to_rport(struct fc_bsg_job *job)
{
return job->rport;
}
static inline void bsg_job_done_backport(struct fc_bsg_job *job, int result,
unsigned int reply_payload_rcv_len)
{
job->job_done(job);
}
#define bsg_job_done bsg_job_done_backport
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && \
@@ -685,7 +706,11 @@ struct iocb_resource {
};
struct bsg_cmd {
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
#endif
union {
struct qla_els_pt_arg els_arg;
} u;

View File

@@ -17,7 +17,7 @@ static uint16_t qla_edif_sadb_get_sa_index(fc_port_t *fcport,
struct qla_sa_update_frame *sa_frame);
static int qla_edif_sadb_delete_sa_index(fc_port_t *fcport, uint16_t nport_handle,
uint16_t sa_index);
static int qla_pur_get_pending(scsi_qla_host_t *, fc_port_t *, struct bsg_job *);
static int qla_pur_get_pending(scsi_qla_host_t *, fc_port_t *, BSG_JOB_TYPE *);
struct edb_node {
struct list_head list;

View File

@@ -165,18 +165,24 @@ qla24xx_configure_prot_mode(srb_t *sp, uint16_t *fw_prot_opts)
break;
case SCSI_PROT_READ_PASS:
case SCSI_PROT_WRITE_PASS:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
if (cmd->prot_flags & SCSI_PROT_IP_CHECKSUM)
*fw_prot_opts |= PO_MODE_DIF_TCP_CKSUM;
else
*fw_prot_opts |= PO_MODE_DIF_PASS;
#endif
break;
default: /* Normal Request */
*fw_prot_opts |= PO_MODE_DIF_PASS;
break;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
if (!(cmd->prot_flags & SCSI_PROT_GUARD_CHECK))
*fw_prot_opts |= PO_DISABLE_GUARD_CHECK;
#else
WARN_ON_ONCE(true);
#endif
return scsi_prot_sg_count(cmd);
}
@@ -776,6 +782,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
pkt->ref_tag = cpu_to_le32(scsi_prot_ref_tag(cmd));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
if (cmd->prot_flags & SCSI_PROT_REF_CHECK &&
qla2x00_hba_err_chk_enabled(sp)) {
pkt->ref_tag_mask[0] = 0xff;
@@ -783,6 +790,9 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
pkt->ref_tag_mask[2] = 0xff;
pkt->ref_tag_mask[3] = 0xff;
}
#else
WARN_ON_ONCE(true);
#endif
pkt->app_tag = cpu_to_le16(0);
pkt->app_tag_mask[0] = 0x0;