mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 05:06:31 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+19
-1
@@ -2226,17 +2226,35 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
|
||||
return scmd->request;
|
||||
}
|
||||
|
||||
/*
|
||||
* See also commit c611529e7cd3 ("sd: Honor block layer integrity handling
|
||||
* flags"; v3.18).
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
|
||||
static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd)
|
||||
{
|
||||
/* To do: backport this function properly. */
|
||||
WARN_ON_ONCE(true);
|
||||
return 512;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* See also commits 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag()
|
||||
* helper") and ddd0bc756983 ("block: move ref_tag calculation func to the
|
||||
* block layer"; v4.19).
|
||||
*/
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || defined(RHEL_MAJOR)
|
||||
static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
|
||||
{
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7
|
||||
WARN_ON_ONCE(true);
|
||||
return 0;
|
||||
#else
|
||||
struct request *rq = blk_mq_rq_from_pdu(scmd);
|
||||
|
||||
return t10_pi_ref_tag(rq);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user