mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-20 22:26:23 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -19,9 +19,15 @@
|
||||
|
||||
#ifdef INSIDE_KERNEL_TREE
|
||||
#include <scst/scst.h>
|
||||
#define NEW_LIBFC_API
|
||||
#else
|
||||
#include <linux/version.h>
|
||||
#include "scst.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || \
|
||||
defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
#define NEW_LIBFC_API
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define FT_VERSION "3.4.0-pre"
|
||||
|
||||
+12
-12
@@ -256,12 +256,12 @@ static void ft_cmd_done(struct ft_cmd *fcmd)
|
||||
{
|
||||
struct fc_frame *fp = fcmd->req_frame;
|
||||
struct fc_seq *sp = fcmd->seq;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_lport *lport = fr_dev(fp);
|
||||
#endif
|
||||
|
||||
if (sp)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fc_exch_done(sp);
|
||||
#else
|
||||
lport->tt.exch_done(sp);
|
||||
@@ -269,7 +269,7 @@ static void ft_cmd_done(struct ft_cmd *fcmd)
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
|
||||
if (fr_seq(fp))
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fc_seq_release(fr_seq(fp));
|
||||
#else
|
||||
lport->tt.seq_release(fr_seq(fp));
|
||||
@@ -395,7 +395,7 @@ int ft_send_response(struct scst_cmd *cmd)
|
||||
/*
|
||||
* Send response.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fcmd->seq = fc_seq_start_next(fcmd->seq);
|
||||
#else
|
||||
fcmd->seq = lport->tt.seq_start_next(fcmd->seq);
|
||||
@@ -403,7 +403,7 @@ int ft_send_response(struct scst_cmd *cmd)
|
||||
fc_fill_fc_hdr(fp, FC_RCTL_DD_CMD_STATUS, ep->did, ep->sid, FC_TYPE_FCP,
|
||||
FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ, 0);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
error = FCST_INJ_SEND_ERR(fc_seq_send(lport, fcmd->seq, fp));
|
||||
#else
|
||||
error = FCST_INJ_SEND_ERR(lport->tt.seq_send(lport, fcmd->seq, fp));
|
||||
@@ -505,14 +505,14 @@ int ft_send_xfer_rdy(struct scst_cmd *cmd)
|
||||
txrdy->ft_data_ro = 0;
|
||||
txrdy->ft_burst_len = htonl(scst_cmd_get_bufflen(cmd));
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fcmd->seq = fc_seq_start_next(fcmd->seq);
|
||||
#else
|
||||
fcmd->seq = lport->tt.seq_start_next(fcmd->seq);
|
||||
#endif
|
||||
fc_fill_fc_hdr(fp, FC_RCTL_DD_DATA_DESC, ep->did, ep->sid, FC_TYPE_FCP,
|
||||
FC_FC_EX_CTX | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
error = FCST_INJ_SEND_ERR(fc_seq_send(lport, fcmd->seq, fp));
|
||||
#else
|
||||
error = FCST_INJ_SEND_ERR(lport->tt.seq_send(lport, fcmd->seq, fp));
|
||||
@@ -586,7 +586,7 @@ out:
|
||||
fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0);
|
||||
sp = fr_seq(fp);
|
||||
if (sp)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fc_seq_send(lport, sp, fp);
|
||||
#else
|
||||
lport->tt.seq_send(lport, sp, fp);
|
||||
@@ -718,7 +718,7 @@ static void ft_recv_cmd(struct ft_sess *sess, struct fc_frame *fp)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
|
||||
sp = fr_seq(fp);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
sp = fc_seq_assign(lport, fp);
|
||||
#else
|
||||
sp = lport->tt.seq_assign(lport, fp);
|
||||
@@ -771,7 +771,7 @@ static void ft_recv_cmd(struct ft_sess *sess, struct fc_frame *fp)
|
||||
cmd->state = FT_STATE_NEW;
|
||||
|
||||
fcmd->seq = sp;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fc_seq_set_resp(sp, ft_recv_seq, cmd);
|
||||
#else
|
||||
lport->tt.seq_set_resp(sp, ft_recv_seq, cmd);
|
||||
@@ -824,7 +824,7 @@ busy:
|
||||
if (fcmd)
|
||||
ft_cmd_done(fcmd);
|
||||
else if (sp)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fc_exch_done(sp);
|
||||
#else
|
||||
lport->tt.exch_done(sp);
|
||||
@@ -867,7 +867,7 @@ static void ft_cmd_ls_rjt(struct fc_frame *rx_fp, enum fc_els_rjt_reason reason,
|
||||
lport = fr_dev(rx_fp);
|
||||
rjt_data.reason = reason;
|
||||
rjt_data.explan = explan;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
|
||||
#else
|
||||
lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ int ft_send_read_data(struct scst_cmd *cmd)
|
||||
mem_len -= tlen;
|
||||
mem_off = tlen;
|
||||
} else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
fcmd->seq = fc_seq_start_next(fcmd->seq);
|
||||
#else
|
||||
fcmd->seq = lport->tt.seq_start_next(fcmd->seq);
|
||||
@@ -179,7 +179,7 @@ int ft_send_read_data(struct scst_cmd *cmd)
|
||||
remaining ? (FC_FC_EX_CTX | FC_FC_REL_OFF) :
|
||||
(FC_FC_EX_CTX | FC_FC_REL_OFF | FC_FC_END_SEQ),
|
||||
fh_off);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
error = FCST_INJ_SEND_ERR(fc_seq_send(lport, fcmd->seq, fp));
|
||||
#else
|
||||
error = FCST_INJ_SEND_ERR(lport->tt.seq_send(lport, fcmd->seq,
|
||||
|
||||
+115
-115
@@ -16,14 +16,14 @@ qla2x00_bsg_job_done(void *data, void *ptr, int res)
|
||||
{
|
||||
srb_t *sp = (srb_t*)ptr;
|
||||
struct scsi_qla_host *vha = (scsi_qla_host_t *)data;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job = sp->u.bsg_job;
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = res;
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
@@ -39,7 +39,7 @@ qla2x00_bsg_sp_free(void *data, void *ptr)
|
||||
{
|
||||
srb_t *sp = (srb_t*)ptr;
|
||||
struct scsi_qla_host *vha = (scsi_qla_host_t *)data;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job = sp->u.bsg_job;
|
||||
@@ -114,13 +114,13 @@ qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *vha,
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
|
||||
@@ -139,7 +139,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
/* Get the sub command */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
#else
|
||||
oper = bsg_request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
@@ -157,14 +157,14 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
ha->fcp_prio_cfg->attributes &=
|
||||
~FCP_PRIO_ATTR_ENABLE;
|
||||
qla24xx_update_all_fcp_prio(vha);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
#endif
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -180,14 +180,14 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
ha->fcp_prio_cfg->attributes |=
|
||||
FCP_PRIO_ATTR_ENABLE;
|
||||
qla24xx_update_all_fcp_prio(vha);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
#endif
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -201,7 +201,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
len = bsg_job->reply_payload.payload_len;
|
||||
if (!len || len > FCP_PRIO_CFG_SIZE) {
|
||||
ret = -EINVAL;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -209,7 +209,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
goto exit_fcp_prio_cfg;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
bsg_job->reply->reply_payload_rcv_len =
|
||||
#else
|
||||
@@ -226,7 +226,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
case QLFC_FCP_PRIO_SET_CONFIG:
|
||||
len = bsg_job->request_payload.payload_len;
|
||||
if (!len || len > FCP_PRIO_CFG_SIZE) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -241,7 +241,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
ql_log(ql_log_warn, vha, 0x7050,
|
||||
"Unable to allocate memory for fcp prio "
|
||||
"config data (%x).\n", FCP_PRIO_CFG_SIZE);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -260,7 +260,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
|
||||
if (!qla24xx_fcp_prio_cfg_valid(vha,
|
||||
(struct qla_fcp_prio_cfg *) ha->fcp_prio_cfg, 1)) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -278,7 +278,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
if (ha->fcp_prio_cfg->attributes & FCP_PRIO_ATTR_ENABLE)
|
||||
ha->flags.fcp_prio_enabled = 1;
|
||||
qla24xx_update_all_fcp_prio(vha);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
@@ -289,7 +289,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
|
||||
break;
|
||||
}
|
||||
exit_fcp_prio_cfg:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
if (!ret)
|
||||
@@ -300,13 +300,13 @@ exit_fcp_prio_cfg:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_process_els(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
#endif
|
||||
struct fc_rport *rport;
|
||||
@@ -321,7 +321,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
uint16_t nextlid = 0;
|
||||
|
||||
#ifdef __COVERITY__
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
BUG_ON(bsg_job->request->msgcode != FC_BSG_RPT_ELS &&
|
||||
bsg_job->request->msgcode != FC_BSG_HST_ELS_NOLOGIN);
|
||||
#else
|
||||
@@ -330,7 +330,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
|
||||
rport = bsg_job->rport;
|
||||
#else
|
||||
@@ -343,7 +343,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
ha = vha->hw;
|
||||
type = "FC_BSG_RPT_ELS";
|
||||
} else {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
host = bsg_job->shost;
|
||||
#else
|
||||
host = fc_bsg_to_shost(bsg_job);
|
||||
@@ -374,7 +374,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
/* ELS request for rport */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
|
||||
#else
|
||||
if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
|
||||
@@ -403,7 +403,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
|
||||
/* Initialize all required fields of fcport */
|
||||
fcport->vha = vha;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
fcport->d_id.b.al_pa =
|
||||
bsg_job->request->rqst_data.h_els.port_id[0];
|
||||
fcport->d_id.b.area =
|
||||
@@ -462,7 +462,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
goto done_unmap_sg;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
sp->type =
|
||||
(bsg_job->request->msgcode == FC_BSG_RPT_ELS ?
|
||||
SRB_ELS_CMD_RPT : SRB_ELS_CMD_HST);
|
||||
@@ -484,7 +484,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
|
||||
ql_dbg(ql_dbg_user, vha, 0x700a,
|
||||
"bsg rqst type: %s els type: %x - loop-id=%x "
|
||||
"portid=%-2x%02x%02x.\n", type,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->request->rqst_data.h_els.command_code, fcport->loop_id,
|
||||
#else
|
||||
bsg_request->rqst_data.h_els.command_code, fcport->loop_id,
|
||||
@@ -509,7 +509,7 @@ done_unmap_sg:
|
||||
goto done_free_fcport;
|
||||
|
||||
done_free_fcport:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
if (bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN)
|
||||
#else
|
||||
if (bsg_request->msgcode == FC_BSG_HST_ELS_NOLOGIN)
|
||||
@@ -534,14 +534,14 @@ qla24xx_calc_ct_iocbs(uint16_t dsds)
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_process_ct(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_process_ct(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
srb_t *sp;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -592,7 +592,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
loop_id =
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
(bsg_job->request->rqst_data.h_ct.preamble_word1 & 0xFF000000)
|
||||
#else
|
||||
(bsg_request->rqst_data.h_ct.preamble_word1 & 0xFF000000)
|
||||
@@ -627,7 +627,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job)
|
||||
|
||||
/* Initialize all required fields of fcport */
|
||||
fcport->vha = vha;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
fcport->d_id.b.al_pa = bsg_job->request->rqst_data.h_ct.port_id[0];
|
||||
fcport->d_id.b.area = bsg_job->request->rqst_data.h_ct.port_id[1];
|
||||
fcport->d_id.b.domain = bsg_job->request->rqst_data.h_ct.port_id[2];
|
||||
@@ -657,7 +657,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job)
|
||||
ql_dbg(ql_dbg_user, vha, 0x7016,
|
||||
"bsg rqst type: %s else type: %x - "
|
||||
"loop-id=%x portid=%02x%02x%02x.\n", type,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
(bsg_job->request->rqst_data.h_ct.preamble_word2 >> 16),
|
||||
#else
|
||||
(bsg_request->rqst_data.h_ct.preamble_word2 >> 16),
|
||||
@@ -777,13 +777,13 @@ done_reset_internal:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -871,7 +871,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
elreq.rcv_dma = rsp_data_dma;
|
||||
elreq.transfer_size = req_data_len;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
elreq.options = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
#else
|
||||
elreq.options = bsg_request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
@@ -894,7 +894,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
if (qla81xx_get_port_config(vha, config)) {
|
||||
ql_log(ql_log_warn, vha, 0x701f,
|
||||
"Get port config failed.\n");
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -911,7 +911,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
new_config)) {
|
||||
ql_log(ql_log_warn, vha, 0x7024,
|
||||
"Internal loopback failed.\n");
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result =
|
||||
#else
|
||||
bsg_reply->result =
|
||||
@@ -926,7 +926,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
*/
|
||||
if (qla81xx_reset_internal_loopback(vha,
|
||||
config, 1)) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result =
|
||||
#else
|
||||
bsg_reply->result =
|
||||
@@ -966,7 +966,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
"MPI reset failed.\n");
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -999,7 +999,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
fw_sts_ptr += sizeof(response);
|
||||
*fw_sts_ptr = command_sent;
|
||||
rval = 0;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -1010,7 +1010,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
|
||||
bsg_job->reply_len = sizeof(struct fc_bsg_reply) +
|
||||
sizeof(response) + sizeof(uint8_t);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len =
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len =
|
||||
@@ -1026,7 +1026,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
memcpy(fw_sts_ptr, response, sizeof(response));
|
||||
fw_sts_ptr += sizeof(response);
|
||||
*fw_sts_ptr = command_sent;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
@@ -1035,7 +1035,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
|
||||
bsg_job->reply_payload.sg_cnt, rsp_data,
|
||||
rsp_data_len);
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
if (!rval)
|
||||
@@ -1060,13 +1060,13 @@ done_unmap_req_sg:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla84xx_reset(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla84xx_reset(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -1083,7 +1083,7 @@ qla84xx_reset(struct bsg_job *bsg_job)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
flag = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
#else
|
||||
flag = bsg_request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
@@ -1095,7 +1095,7 @@ qla84xx_reset(struct bsg_job *bsg_job)
|
||||
ql_log(ql_log_warn, vha, 0x7030,
|
||||
"Vendor request 84xx reset failed.\n");
|
||||
rval = 0;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -1103,14 +1103,14 @@ qla84xx_reset(struct bsg_job *bsg_job)
|
||||
} else {
|
||||
ql_dbg(ql_dbg_user, vha, 0x7031,
|
||||
"Vendor request 84xx reset completed.\n");
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
if (!rval)
|
||||
@@ -1121,13 +1121,13 @@ qla84xx_reset(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla84xx_updatefw(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla84xx_updatefw(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -1190,7 +1190,7 @@ qla84xx_updatefw(struct bsg_job *bsg_job)
|
||||
goto done_free_fw_buf;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
flag = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
#else
|
||||
flag = bsg_request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
@@ -1221,7 +1221,7 @@ qla84xx_updatefw(struct bsg_job *bsg_job)
|
||||
"Vendor request 84xx updatefw failed.\n");
|
||||
|
||||
rval = 0;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -1231,14 +1231,14 @@ qla84xx_updatefw(struct bsg_job *bsg_job)
|
||||
"Vendor request 84xx updatefw completed.\n");
|
||||
|
||||
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
if (!rval)
|
||||
@@ -1258,13 +1258,13 @@ done_unmap_sg:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -1288,7 +1288,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
ql84_mgmt = (struct qla_bsg_a84_mgmt *)((char *)bsg_job->request +
|
||||
sizeof(struct fc_bsg_request));
|
||||
#else
|
||||
@@ -1431,7 +1431,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
|
||||
"Vendor request 84xx mgmt failed.\n");
|
||||
|
||||
rval = 0;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -1441,7 +1441,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
|
||||
"Vendor request 84xx mgmt completed.\n");
|
||||
|
||||
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
@@ -1449,7 +1449,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
|
||||
|
||||
if ((ql84_mgmt->mgmt.cmd == QLA84_MGMT_READ_MEM) ||
|
||||
(ql84_mgmt->mgmt.cmd == QLA84_MGMT_GET_INFO)) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len =
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len =
|
||||
@@ -1462,7 +1462,7 @@ qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
|
||||
}
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
if (!rval)
|
||||
@@ -1488,13 +1488,13 @@ exit_mgmt:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla24xx_iidma(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla24xx_iidma(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -1513,7 +1513,7 @@ qla24xx_iidma(struct bsg_job *bsg_job)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
port_param = (struct qla_port_param *)((char *)bsg_job->request +
|
||||
sizeof(struct fc_bsg_request));
|
||||
#else
|
||||
@@ -1569,7 +1569,7 @@ qla24xx_iidma(struct bsg_job *bsg_job)
|
||||
fcport->port_name[5], fcport->port_name[6],
|
||||
fcport->port_name[7], rval, fcport->fp_speed, mb[0], mb[1]);
|
||||
rval = 0;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
#else
|
||||
bsg_reply->result = (DID_ERROR << 16);
|
||||
@@ -1586,14 +1586,14 @@ qla24xx_iidma(struct bsg_job *bsg_job)
|
||||
sizeof(struct qla_port_param));
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
if (!rval)
|
||||
@@ -1604,14 +1604,14 @@ qla24xx_iidma(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha,
|
||||
#else
|
||||
qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
|
||||
#endif
|
||||
uint8_t is_update)
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
#endif
|
||||
uint32_t start = 0;
|
||||
@@ -1621,7 +1621,7 @@ qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
|
||||
if (unlikely(pci_channel_offline(ha->pdev)))
|
||||
return -EINVAL;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
start = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
#else
|
||||
start = bsg_request->rqst_data.h_vendor.vendor_cmd[1];
|
||||
@@ -1684,13 +1684,13 @@ qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_read_optrom(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_read_optrom(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
@@ -1714,7 +1714,7 @@ qla2x00_read_optrom(struct bsg_job *bsg_job)
|
||||
bsg_job->reply_payload.sg_cnt, ha->optrom_buffer,
|
||||
ha->optrom_region_size);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len = ha->optrom_region_size;
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
@@ -1724,7 +1724,7 @@ qla2x00_read_optrom(struct bsg_job *bsg_job)
|
||||
vfree(ha->optrom_buffer);
|
||||
ha->optrom_buffer = NULL;
|
||||
ha->optrom_state = QLA_SWAITING;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
bsg_job_done(bsg_job, bsg_reply->result,
|
||||
@@ -1734,13 +1734,13 @@ qla2x00_read_optrom(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_update_optrom(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_update_optrom(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
@@ -1764,7 +1764,7 @@ qla2x00_update_optrom(struct bsg_job *bsg_job)
|
||||
ha->isp_ops->write_optrom(vha, ha->optrom_buffer,
|
||||
ha->optrom_region_start, ha->optrom_region_size);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK;
|
||||
#else
|
||||
bsg_reply->result = DID_OK;
|
||||
@@ -1772,7 +1772,7 @@ qla2x00_update_optrom(struct bsg_job *bsg_job)
|
||||
vfree(ha->optrom_buffer);
|
||||
ha->optrom_buffer = NULL;
|
||||
ha->optrom_state = QLA_SWAITING;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
bsg_job_done(bsg_job, bsg_reply->result,
|
||||
@@ -1782,13 +1782,13 @@ qla2x00_update_optrom(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_update_fru_versions(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_update_fru_versions(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
@@ -1804,7 +1804,7 @@ qla2x00_update_fru_versions(struct bsg_job *bsg_job)
|
||||
dma_addr_t sfp_dma;
|
||||
void *sfp = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &sfp_dma);
|
||||
if (!sfp) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
@@ -1824,7 +1824,7 @@ qla2x00_update_fru_versions(struct bsg_job *bsg_job)
|
||||
image->field_address.device, image->field_address.offset,
|
||||
sizeof(image->field_info), image->field_address.option);
|
||||
if (rval) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
@@ -1835,7 +1835,7 @@ qla2x00_update_fru_versions(struct bsg_job *bsg_job)
|
||||
image++;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] = 0;
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 0;
|
||||
@@ -1846,7 +1846,7 @@ dealloc:
|
||||
|
||||
done:
|
||||
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK << 16;
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
@@ -1859,13 +1859,13 @@ done:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_read_fru_status(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_read_fru_status(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
@@ -1879,7 +1879,7 @@ qla2x00_read_fru_status(struct bsg_job *bsg_job)
|
||||
dma_addr_t sfp_dma;
|
||||
uint8_t *sfp = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &sfp_dma);
|
||||
if (!sfp) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
@@ -1897,7 +1897,7 @@ qla2x00_read_fru_status(struct bsg_job *bsg_job)
|
||||
sr->status_reg = *sfp;
|
||||
|
||||
if (rval) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
@@ -1909,7 +1909,7 @@ qla2x00_read_fru_status(struct bsg_job *bsg_job)
|
||||
sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
|
||||
bsg_job->reply_payload.sg_cnt, sr, sizeof(*sr));
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] = 0;
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 0;
|
||||
@@ -1920,7 +1920,7 @@ dealloc:
|
||||
|
||||
done:
|
||||
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len = sizeof(*sr);
|
||||
bsg_job->reply->result = DID_OK << 16;
|
||||
bsg_job->job_done(bsg_job);
|
||||
@@ -1935,13 +1935,13 @@ done:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_write_fru_status(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_write_fru_status(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct Scsi_Host *host = bsg_job->shost;
|
||||
#else
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
@@ -1955,7 +1955,7 @@ qla2x00_write_fru_status(struct bsg_job *bsg_job)
|
||||
dma_addr_t sfp_dma;
|
||||
uint8_t *sfp = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &sfp_dma);
|
||||
if (!sfp) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
@@ -1973,7 +1973,7 @@ qla2x00_write_fru_status(struct bsg_job *bsg_job)
|
||||
sizeof(sr->status_reg), sr->field_address.option);
|
||||
|
||||
if (rval) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] =
|
||||
@@ -1982,7 +1982,7 @@ qla2x00_write_fru_status(struct bsg_job *bsg_job)
|
||||
goto dealloc;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] = 0;
|
||||
#else
|
||||
bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 0;
|
||||
@@ -1993,7 +1993,7 @@ dealloc:
|
||||
|
||||
done:
|
||||
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = DID_OK << 16;
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
@@ -2006,18 +2006,18 @@ done:
|
||||
}
|
||||
|
||||
static int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
switch (bsg_job->request->rqst_data.h_vendor.vendor_cmd[0]) {
|
||||
#else
|
||||
switch (bsg_request->rqst_data.h_vendor.vendor_cmd[0]) {
|
||||
@@ -2056,7 +2056,7 @@ qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
|
||||
return qla2x00_write_fru_status(bsg_job);
|
||||
|
||||
default:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
bsg_job->job_done(bsg_job);
|
||||
#else
|
||||
@@ -2067,13 +2067,13 @@ qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
|
||||
#endif
|
||||
@@ -2084,7 +2084,7 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
scsi_qla_host_t *vha;
|
||||
|
||||
/* In case no data transferred. */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len = 0;
|
||||
|
||||
if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
|
||||
@@ -2099,7 +2099,7 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
host = rport_to_shost(rport);
|
||||
vha = shost_priv(host);
|
||||
} else {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
host = bsg_job->shost;
|
||||
#else
|
||||
host = fc_bsg_to_shost(bsg_job);
|
||||
@@ -2110,7 +2110,7 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
if (qla2x00_reset_active(vha)) {
|
||||
ql_dbg(ql_dbg_user, vha, 0x709f,
|
||||
"BSG: ISP abort active/needed -- cmd=%d.\n",
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->request->msgcode);
|
||||
bsg_job->reply->result = (DID_ERROR << 16);
|
||||
bsg_job->job_done(bsg_job);
|
||||
@@ -2122,13 +2122,13 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
ql_dbg(ql_dbg_user, vha, 0x7000,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
"Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode);
|
||||
#else
|
||||
"Entered %s msgcode=0x%x.\n", __func__, bsg_request->msgcode);
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
switch (bsg_job->request->msgcode) {
|
||||
#else
|
||||
switch (bsg_request->msgcode) {
|
||||
@@ -2148,7 +2148,7 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
case FC_BSG_RPT_CT:
|
||||
default:
|
||||
ql_log(ql_log_warn, vha, 0x705a, "Unsupported BSG request.\n");
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = ret;
|
||||
#else
|
||||
bsg_reply->result = ret;
|
||||
@@ -2159,13 +2159,13 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
|
||||
}
|
||||
|
||||
int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
|
||||
#else
|
||||
qla24xx_bsg_timeout(struct bsg_job *bsg_job)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
scsi_qla_host_t *vha = shost_priv(bsg_job->shost);
|
||||
#else
|
||||
struct fc_bsg_request *bsg_request = bsg_job->request;
|
||||
@@ -2197,7 +2197,7 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
|
||||
"mbx abort_command "
|
||||
"failed.\n");
|
||||
bsg_job->req->errors =
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = -EIO;
|
||||
#else
|
||||
bsg_reply->result = -EIO;
|
||||
@@ -2207,7 +2207,7 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
|
||||
"mbx abort_command "
|
||||
"success.\n");
|
||||
bsg_job->req->errors =
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->result = 0;
|
||||
#else
|
||||
bsg_reply->result = 0;
|
||||
@@ -2221,7 +2221,7 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
|
||||
}
|
||||
spin_unlock_irqrestore(&ha->hardware_lock, flags);
|
||||
ql_log(ql_log_info, vha, 0x708b, "SRB not found to abort.\n");
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->req->errors = bsg_job->reply->result = -ENXIO;
|
||||
#else
|
||||
bsg_job->req->errors = bsg_reply->result = -ENXIO;
|
||||
@@ -2230,7 +2230,7 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
|
||||
|
||||
done:
|
||||
spin_unlock_irqrestore(&ha->hardware_lock, flags);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
if (bsg_job->request->msgcode == FC_BSG_HST_CT)
|
||||
#else
|
||||
if (bsg_request->msgcode == FC_BSG_HST_CT)
|
||||
|
||||
+8
-2
@@ -27,7 +27,13 @@
|
||||
#include <linux/aer.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || \
|
||||
defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
#define NEW_LIBFC_API
|
||||
#endif
|
||||
|
||||
#ifdef NEW_LIBFC_API
|
||||
#include <linux/bsg-lib.h>
|
||||
#endif
|
||||
|
||||
@@ -293,7 +299,7 @@ typedef struct srb {
|
||||
int iocbs;
|
||||
union {
|
||||
struct srb_iocb iocb_cmd;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job;
|
||||
|
||||
+1
-1
@@ -604,7 +604,7 @@ extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
|
||||
extern void qla82xx_clear_pending_mbx(scsi_qla_host_t *);
|
||||
|
||||
/* BSG related functions */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
extern int qla24xx_bsg_request(struct bsg_job *);
|
||||
extern int qla24xx_bsg_timeout(struct bsg_job *);
|
||||
#else
|
||||
|
||||
+4
-4
@@ -2105,7 +2105,7 @@ qla24xx_tm_iocb(srb_t *sp, struct tsk_mgmt_entry *tsk)
|
||||
static void
|
||||
qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job = sp->u.bsg_job;
|
||||
@@ -2125,7 +2125,7 @@ qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
|
||||
|
||||
els_iocb->opcode =
|
||||
sp->type == SRB_ELS_CMD_RPT ?
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->request->rqst_data.r_els.els_code :
|
||||
bsg_job->request->rqst_data.h_els.command_code;
|
||||
#else
|
||||
@@ -2166,7 +2166,7 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb)
|
||||
uint16_t tot_dsds;
|
||||
scsi_qla_host_t *vha = sp->fcport->vha;
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job = sp->u.bsg_job;
|
||||
@@ -2247,7 +2247,7 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
|
||||
uint16_t tot_dsds;
|
||||
scsi_qla_host_t *vha = sp->fcport->vha;
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job = sp->u.bsg_job;
|
||||
|
||||
+13
-13
@@ -1080,7 +1080,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
const char func[] = "CT_IOCB";
|
||||
const char *type;
|
||||
srb_t *sp;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job;
|
||||
@@ -1094,7 +1094,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
return;
|
||||
|
||||
bsg_job = sp->u.bsg_job;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
bsg_reply = bsg_job->reply;
|
||||
#endif
|
||||
|
||||
@@ -1105,7 +1105,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
/* return FC_CTELS_STATUS_OK and leave the decoding of the ELS/CT
|
||||
* fc payload to the caller
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
|
||||
#else
|
||||
bsg_reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
|
||||
@@ -1115,7 +1115,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
if (comp_status != CS_COMPLETE) {
|
||||
if (comp_status == CS_DATA_UNDERRUN) {
|
||||
res = DID_OK << 16;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len =
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len =
|
||||
@@ -1126,7 +1126,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
"CT pass-through-%s error "
|
||||
"comp_status-status=0x%x total_byte = 0x%x.\n",
|
||||
type, comp_status,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len);
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len);
|
||||
@@ -1136,7 +1136,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
"CT pass-through-%s error "
|
||||
"comp_status-status=0x%x.\n", type, comp_status);
|
||||
res = DID_ERROR << 16;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len = 0;
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len = 0;
|
||||
@@ -1146,7 +1146,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
(uint8_t *)pkt, sizeof(*pkt));
|
||||
} else {
|
||||
res = DID_OK << 16;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len =
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len =
|
||||
@@ -1164,7 +1164,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
const char func[] = "ELS_CT_IOCB";
|
||||
const char *type;
|
||||
srb_t *sp;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
struct fc_bsg_job *bsg_job;
|
||||
#else
|
||||
struct bsg_job *bsg_job;
|
||||
@@ -1179,7 +1179,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
if (!sp)
|
||||
return;
|
||||
bsg_job = sp->u.bsg_job;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
#ifdef NEW_LIBFC_API
|
||||
bsg_reply = bsg_job->reply;
|
||||
#endif
|
||||
|
||||
@@ -1205,7 +1205,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
/* return FC_CTELS_STATUS_OK and leave the decoding of the ELS/CT
|
||||
* fc payload to the caller
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
|
||||
#else
|
||||
bsg_reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
|
||||
@@ -1215,7 +1215,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
if (comp_status != CS_COMPLETE) {
|
||||
if (comp_status == CS_DATA_UNDERRUN) {
|
||||
res = DID_OK << 16;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len =
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len =
|
||||
@@ -1246,7 +1246,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
le16_to_cpu(((struct els_sts_entry_24xx *)
|
||||
pkt)->error_subcode_2));
|
||||
res = DID_ERROR << 16;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len = 0;
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len = 0;
|
||||
@@ -1264,7 +1264,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
}
|
||||
else {
|
||||
res = DID_OK << 16;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#ifndef NEW_LIBFC_API
|
||||
bsg_job->reply->reply_payload_rcv_len = bsg_job->reply_payload.payload_len;
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len = bsg_job->reply_payload.payload_len;
|
||||
|
||||
@@ -238,7 +238,9 @@ static inline struct inode *file_inode(const struct file *f)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
static inline ssize_t vfs_readv_backport(struct file *file,
|
||||
const struct iovec __user *vec,
|
||||
unsigned long vlen, loff_t *pos,
|
||||
@@ -430,7 +432,9 @@ static inline bool list_entry_in_list(const struct list_head *entry)
|
||||
|
||||
/* <linux/kernel.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
static inline long get_user_pages_backport(unsigned long start,
|
||||
unsigned long nr_pages,
|
||||
int write, int force,
|
||||
|
||||
@@ -1272,7 +1272,9 @@ static int dev_user_map_buf(struct scst_user_cmd *ucmd, unsigned long ubuff,
|
||||
(ucmd->cmd != NULL) ? ucmd->cmd->bufflen : -1);
|
||||
|
||||
down_read(&tsk->mm->mmap_sem);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
rc = get_user_pages(ubuff, ucmd->num_data_pages, 1/*writable*/,
|
||||
0/*don't force*/, ucmd->data_pages, NULL);
|
||||
#else
|
||||
|
||||
@@ -6601,7 +6601,9 @@ static void blockio_endio(struct bio *bio)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
|
||||
if (bio->bi_rw & (1 << BIO_RW)) {
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#elif (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
if (bio->bi_rw & REQ_WRITE) {
|
||||
#else
|
||||
if (op_is_write(bio_op(bio))) {
|
||||
@@ -6641,7 +6643,9 @@ static void vdisk_bio_set_failfast(struct bio *bio)
|
||||
bio->bi_rw |= (1 << BIO_RW_FAILFAST_DEV) |
|
||||
(1 << BIO_RW_FAILFAST_TRANSPORT) |
|
||||
(1 << BIO_RW_FAILFAST_DRIVER);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#elif (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_rw |= REQ_FAILFAST_DEV |
|
||||
REQ_FAILFAST_TRANSPORT |
|
||||
REQ_FAILFAST_DRIVER;
|
||||
@@ -6654,7 +6658,8 @@ static void vdisk_bio_set_failfast(struct bio *bio)
|
||||
|
||||
static void vdisk_bio_set_hoq(struct bio *bio)
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \
|
||||
defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_opf |= REQ_SYNC;
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) || \
|
||||
(defined(RHEL_MAJOR) && \
|
||||
@@ -6665,7 +6670,8 @@ static void vdisk_bio_set_hoq(struct bio *bio)
|
||||
#else
|
||||
bio->bi_rw |= 1 << BIO_RW_SYNC;
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \
|
||||
defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_opf |= REQ_META;
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) || \
|
||||
(defined(RHEL_MAJOR) && \
|
||||
@@ -6921,7 +6927,9 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua)
|
||||
if (write)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
|
||||
bio->bi_rw |= (1 << BIO_RW);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#elif (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_rw |= REQ_WRITE;
|
||||
#else
|
||||
bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
|
||||
@@ -6936,7 +6944,9 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua)
|
||||
bio->bi_rw |= REQ_SYNC;
|
||||
#endif
|
||||
if (fua)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_rw |= REQ_FUA;
|
||||
#else
|
||||
bio->bi_opf |= REQ_FUA;
|
||||
@@ -6993,7 +7003,9 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua)
|
||||
hbio = hbio->bi_next;
|
||||
bio->bi_next = NULL;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
submit_bio(bio->bi_rw, bio);
|
||||
#else
|
||||
submit_bio(bio);
|
||||
@@ -7092,7 +7104,9 @@ static int vdisk_blockio_flush(struct block_device *bdev, gfp_t gfp_mask,
|
||||
bio->bi_end_io = vdev_flush_end_io;
|
||||
bio->bi_private = cmd;
|
||||
bio->bi_bdev = bdev;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
submit_bio(WRITE_FLUSH, bio);
|
||||
#else
|
||||
bio_set_op_attrs(bio, REQ_OP_FLUSH, 0);
|
||||
@@ -7241,7 +7255,9 @@ static ssize_t blockio_read_sync(struct scst_vdisk_dev *virt_dev, void *buf,
|
||||
if (!bio)
|
||||
goto out;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_rw = READ_SYNC;
|
||||
#else
|
||||
bio_set_op_attrs(bio, REQ_OP_READ, REQ_SYNC);
|
||||
@@ -7272,7 +7288,9 @@ static ssize_t blockio_read_sync(struct scst_vdisk_dev *virt_dev, void *buf,
|
||||
}
|
||||
}
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
submit_bio(bio->bi_rw, bio);
|
||||
#else
|
||||
submit_bio(bio);
|
||||
|
||||
+8
-3
@@ -7955,7 +7955,8 @@ static void bio_kmalloc_destructor(struct bio *bio)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \
|
||||
(defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
static struct request *blk_make_request(struct request_queue *q,
|
||||
struct bio *bio,
|
||||
gfp_t gfp_mask)
|
||||
@@ -8080,7 +8081,9 @@ static struct request *__blk_map_kern_sg(struct request_queue *q,
|
||||
if (!reading)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
|
||||
bio->bi_rw |= 1 << BIO_RW;
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
#elif (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
bio->bi_rw |= REQ_WRITE;
|
||||
#else
|
||||
bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
|
||||
@@ -8146,7 +8149,9 @@ static struct request *__blk_map_kern_sg(struct request_queue *q,
|
||||
|
||||
if (bw != NULL) {
|
||||
atomic_set(&bw->bios_inflight, bios);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
/*
|
||||
* See also patch "block: split out request-only flags into a
|
||||
* new namespace" (commit e806402130c9).
|
||||
|
||||
Reference in New Issue
Block a user