diff --git a/qla2x00t-32gbit/qla_bsg.c b/qla2x00t-32gbit/qla_bsg.c index f6f094ac5..fcd747971 100644 --- a/qla2x00t-32gbit/qla_bsg.c +++ b/qla2x00t-32gbit/qla_bsg.c @@ -12,24 +12,6 @@ #ifdef NEW_LIBFC_API #include -#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) diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index d462f5246..d2000abe5 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -25,6 +25,9 @@ #include #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) +#include /* 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; diff --git a/qla2x00t-32gbit/qla_edif.c b/qla2x00t-32gbit/qla_edif.c index 9e911e12c..9d6a954ac 100644 --- a/qla2x00t-32gbit/qla_edif.c +++ b/qla2x00t-32gbit/qla_edif.c @@ -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; diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index 2166dbc0b..97f3dedf7 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -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;