Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2021-09-04 20:08:45 -07:00
13 changed files with 94 additions and 429 deletions

View File

@@ -3,37 +3,38 @@
ABT_DETAILS="x86_64"
ABT_JOBS=5
ABT_KERNELS=" \
5.13.11 \
5.14.1 \
5.13.14 \
5.12.19-nc \
5.11.22-nc \
5.10.59-nc \
5.10.62-nc \
5.9.16-nc \
5.8.18-nc \
5.7.19-nc \
5.6.19-nc \
5.5.19-nc \
5.4.141-nc \
5.4.144-nc \
5.3.18-nc \
5.2.21-nc \
5.1.21-nc \
5.0.21-nc \
4.20.17-nc \
4.19.204-nc \
4.19.206-nc \
4.18.20-nc \
4.17.19-nc \
4.16.18-nc \
4.15.18-nc \
4.14.244-nc \
4.14.246-nc \
4.13.16-nc \
4.12.14-nc \
4.11.12-nc \
4.10.17-nc \
4.9.280-nc \
4.9.282-nc \
4.8.17-nc \
4.7.10-nc \
4.6.7-nc \
4.5.7-nc \
4.4.281-nc \
4.4.283-nc \
4.3.6-nc \
4.2.8-nc \
4.1.52-nc \

View File

@@ -43,11 +43,7 @@ static void qla2xxx_free_fcport_work(struct work_struct *work)
/* BSG support for ELS/CT pass through */
void qla2x00_bsg_job_done(srb_t *sp, int res)
{
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
sp->free(sp);
@@ -60,11 +56,7 @@ void qla2x00_bsg_job_done(srb_t *sp, int res)
void qla2x00_bsg_sp_free(srb_t *sp)
{
struct qla_hw_data *ha = sp->vha->hw;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
struct fc_bsg_request *bsg_request = bsg_job->request;
struct qla_mt_iocb_rqst_fx00 *piocb_rqst;
@@ -154,11 +146,7 @@ qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *vha,
}
static int
#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
qla24xx_proc_fcp_prio_cfg_cmd(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -286,11 +274,7 @@ exit_fcp_prio_cfg:
}
static int
#ifndef NEW_LIBFC_API
qla2x00_process_els(struct fc_bsg_job *bsg_job)
#else
qla2x00_process_els(struct bsg_job *bsg_job)
#endif
qla2x00_process_els(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_rport *rport;
@@ -473,11 +457,7 @@ qla24xx_calc_ct_iocbs(uint16_t dsds)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_process_ct(struct fc_bsg_job *bsg_job)
#else
qla2x00_process_ct(struct bsg_job *bsg_job)
#endif
qla2x00_process_ct(BSG_JOB_TYPE *bsg_job)
{
srb_t *sp;
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -755,11 +735,7 @@ done_set_internal:
}
static int
#ifndef NEW_LIBFC_API
qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
#else
qla2x00_process_loopback(struct bsg_job *bsg_job)
#endif
qla2x00_process_loopback(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1002,11 +978,7 @@ done_unmap_req_sg:
}
static int
#ifndef NEW_LIBFC_API
qla84xx_reset(struct fc_bsg_job *bsg_job)
#else
qla84xx_reset(struct bsg_job *bsg_job)
#endif
qla84xx_reset(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1042,11 +1014,7 @@ qla84xx_reset(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla84xx_updatefw(struct fc_bsg_job *bsg_job)
#else
qla84xx_updatefw(struct bsg_job *bsg_job)
#endif
qla84xx_updatefw(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1156,11 +1124,7 @@ done_unmap_sg:
}
static int
#ifndef NEW_LIBFC_API
qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
#else
qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
#endif
qla84xx_mgmt_cmd(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1356,11 +1320,7 @@ exit_mgmt:
}
static int
#ifndef NEW_LIBFC_API
qla24xx_iidma(struct fc_bsg_job *bsg_job)
#else
qla24xx_iidma(struct bsg_job *bsg_job)
#endif
qla24xx_iidma(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1449,13 +1409,8 @@ qla24xx_iidma(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha,
qla2x00_optrom_setup(BSG_JOB_TYPE *bsg_job, scsi_qla_host_t *vha,
uint8_t is_update)
#else
qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
uint8_t is_update)
#endif
{
struct fc_bsg_request *bsg_request = bsg_job->request;
uint32_t start = 0;
@@ -1524,11 +1479,7 @@ qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
}
static int
#ifndef NEW_LIBFC_API
qla2x00_read_optrom(struct fc_bsg_job *bsg_job)
#else
qla2x00_read_optrom(struct bsg_job *bsg_job)
#endif
qla2x00_read_optrom(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1565,11 +1516,7 @@ qla2x00_read_optrom(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_update_optrom(struct fc_bsg_job *bsg_job)
#else
qla2x00_update_optrom(struct bsg_job *bsg_job)
#endif
qla2x00_update_optrom(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1610,11 +1557,7 @@ qla2x00_update_optrom(struct bsg_job *bsg_job)
}
static int
#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
qla2x00_update_fru_versions(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1667,11 +1610,7 @@ done:
}
static int
#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
qla2x00_read_fru_status(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1722,11 +1661,7 @@ done:
}
static int
#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
qla2x00_write_fru_status(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1773,11 +1708,7 @@ done:
}
static int
#ifndef NEW_LIBFC_API
qla2x00_write_i2c(struct fc_bsg_job *bsg_job)
#else
qla2x00_write_i2c(struct bsg_job *bsg_job)
#endif
qla2x00_write_i2c(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1823,11 +1754,7 @@ done:
}
static int
#ifndef NEW_LIBFC_API
qla2x00_read_i2c(struct fc_bsg_job *bsg_job)
#else
qla2x00_read_i2c(struct bsg_job *bsg_job)
#endif
qla2x00_read_i2c(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1877,11 +1804,7 @@ done:
}
static int
#ifndef NEW_LIBFC_API
qla24xx_process_bidir_cmd(struct fc_bsg_job *bsg_job)
#else
qla24xx_process_bidir_cmd(struct bsg_job *bsg_job)
#endif
qla24xx_process_bidir_cmd(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2059,11 +1982,7 @@ done:
}
static int
#ifndef NEW_LIBFC_API
qlafx00_mgmt_cmd(struct fc_bsg_job *bsg_job)
#else
qlafx00_mgmt_cmd(struct bsg_job *bsg_job)
#endif
qlafx00_mgmt_cmd(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2186,11 +2105,7 @@ done:
}
static int
#ifndef NEW_LIBFC_API
qla26xx_serdes_op(struct fc_bsg_job *bsg_job)
#else
qla26xx_serdes_op(struct bsg_job *bsg_job)
#endif
qla26xx_serdes_op(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2232,11 +2147,7 @@ qla26xx_serdes_op(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla8044_serdes_op(struct fc_bsg_job *bsg_job)
#else
qla8044_serdes_op(struct bsg_job *bsg_job)
#endif
qla8044_serdes_op(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2278,11 +2189,7 @@ qla8044_serdes_op(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla27xx_get_flash_upd_cap(struct fc_bsg_job *bsg_job)
#else
qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job)
#endif
qla27xx_get_flash_upd_cap(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2314,11 +2221,7 @@ qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla27xx_set_flash_upd_cap(struct fc_bsg_job *bsg_job)
#else
qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job)
#endif
qla27xx_set_flash_upd_cap(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2364,11 +2267,7 @@ qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job)
#else
qla27xx_get_bbcr_data(struct bsg_job *bsg_job)
#endif
qla27xx_get_bbcr_data(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2427,11 +2326,7 @@ done:
}
static int
#ifndef NEW_LIBFC_API
qla2x00_get_priv_stats(struct fc_bsg_job *bsg_job)
#else
qla2x00_get_priv_stats(struct bsg_job *bsg_job)
#endif
qla2x00_get_priv_stats(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2490,11 +2385,7 @@ qla2x00_get_priv_stats(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_do_dport_diagnostics(struct fc_bsg_job *bsg_job)
#else
qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job)
#endif
qla2x00_do_dport_diagnostics(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -2538,11 +2429,7 @@ qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_get_flash_image_status(struct fc_bsg_job *bsg_job)
#else
qla2x00_get_flash_image_status(struct bsg_job *bsg_job)
#endif
qla2x00_get_flash_image_status(BSG_JOB_TYPE *bsg_job)
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2581,11 +2468,7 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_manage_host_stats(struct fc_bsg_job *bsg_job)
#else
qla2x00_manage_host_stats(struct bsg_job *bsg_job)
#endif
qla2x00_manage_host_stats(BSG_JOB_TYPE *bsg_job)
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2654,11 +2537,7 @@ qla2x00_manage_host_stats(struct bsg_job *bsg_job)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_get_host_stats(struct fc_bsg_job *bsg_job)
#else
qla2x00_get_host_stats(struct bsg_job *bsg_job)
#endif
qla2x00_get_host_stats(BSG_JOB_TYPE *bsg_job)
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2763,11 +2642,7 @@ qla2xxx_find_rport(scsi_qla_host_t *vha, uint32_t tgt_num)
}
static int
#ifndef NEW_LIBFC_API
qla2x00_get_tgt_stats(struct fc_bsg_job *bsg_job)
#else
qla2x00_get_tgt_stats(struct bsg_job *bsg_job)
#endif
qla2x00_get_tgt_stats(BSG_JOB_TYPE *bsg_job)
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2856,11 +2731,7 @@ tgt_stat_out:
}
static int
#ifndef NEW_LIBFC_API
qla2x00_manage_host_port(struct fc_bsg_job *bsg_job)
#else
qla2x00_manage_host_port(struct bsg_job *bsg_job)
#endif
qla2x00_manage_host_port(BSG_JOB_TYPE *bsg_job)
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2918,11 +2789,7 @@ qla2x00_manage_host_port(struct bsg_job *bsg_job)
}
static int
#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
qla2x00_process_vendor_specific(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -3015,11 +2882,7 @@ qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
}
int
#ifndef NEW_LIBFC_API
qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
#else
qla24xx_bsg_request(struct bsg_job *bsg_job)
#endif
qla24xx_bsg_request(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -3084,11 +2947,7 @@ skip_chip_chk:
}
int
#ifndef NEW_LIBFC_API
qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
#else
qla24xx_bsg_timeout(struct bsg_job *bsg_job)
#endif
qla24xx_bsg_timeout(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));

View File

@@ -45,6 +45,9 @@
defined(CONFIG_SUSE_KERNEL) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
#define NEW_LIBFC_API
#define BSG_JOB_TYPE struct bsg_job
#else
#define BSG_JOB_TYPE struct fc_bsg_job
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && \

View File

@@ -879,13 +879,8 @@ extern int qla2x00_read_sfp_dev(struct scsi_qla_host *, char *, int);
extern int ql26xx_led_config(scsi_qla_host_t *, uint16_t, uint16_t *);
/* BSG related functions */
#ifndef NEW_LIBFC_API
extern int qla24xx_bsg_request(struct fc_bsg_job *);
extern int qla24xx_bsg_timeout(struct fc_bsg_job *);
#else
extern int qla24xx_bsg_request(struct bsg_job *);
extern int qla24xx_bsg_timeout(struct bsg_job *);
#endif
extern int qla24xx_bsg_request(BSG_JOB_TYPE *);
extern int qla24xx_bsg_timeout(BSG_JOB_TYPE *);
extern int qla84xx_reset_chip(scsi_qla_host_t *, uint16_t);
extern int qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *,
dma_addr_t, size_t, uint32_t);

View File

@@ -3111,11 +3111,7 @@ done:
static void
qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
{
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
struct fc_bsg_request *bsg_request = bsg_job->request;
els_iocb->entry_type = ELS_IOCB_TYPE;
@@ -3165,11 +3161,7 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb)
uint16_t tot_dsds;
scsi_qla_host_t *vha = sp->vha;
struct qla_hw_data *ha = vha->hw;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
int entry_count = 1;
memset(ct_iocb, 0, sizeof(ms_iocb_entry_t));
@@ -3236,11 +3228,7 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
uint16_t cmd_dsds, rsp_dsds;
scsi_qla_host_t *vha = sp->vha;
struct qla_hw_data *ha = vha->hw;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
int entry_count = 1;
cont_a64_entry_t *cont_pkt = NULL;
@@ -3890,11 +3878,7 @@ qla25xx_build_bidir_iocb(srb_t *sp, struct scsi_qla_host *vha,
struct scatterlist *sg;
int index;
int entry_count = 1;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
/*Update entry type to indicate bidir command */
put_unaligned_le32(COMMAND_BIDIRECTIONAL, &cmd_pkt->entry_type);

View File

@@ -1917,11 +1917,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
const char func[] = "CT_IOCB";
const char *type;
srb_t *sp;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
#endif
BSG_JOB_TYPE *bsg_job;
struct fc_bsg_reply *bsg_reply;
uint16_t comp_status;
int res = 0;
@@ -1994,11 +1990,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;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
#endif
BSG_JOB_TYPE *bsg_job;
struct fc_bsg_reply *bsg_reply;
uint16_t comp_status;
uint32_t fw_status[3];
@@ -2766,11 +2758,7 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt,
uint16_t scsi_status;
uint16_t thread_id;
uint32_t rval = EXT_STATUS_OK;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = NULL;
#else
struct bsg_job *bsg_job = NULL;
#endif
BSG_JOB_TYPE *bsg_job = NULL;
struct fc_bsg_request *bsg_request;
struct fc_bsg_reply *bsg_reply;
sts_entry_t *sts = pkt;

View File

@@ -2215,11 +2215,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
{
const char func[] = "IOSB_IOCB";
srb_t *sp;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
#endif
BSG_JOB_TYPE *bsg_job;
struct fc_bsg_reply *bsg_reply;
struct srb_iocb *iocb_job;
int res = 0;
@@ -3257,11 +3253,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
{
struct srb_iocb *fxio = &sp->u.iocb_cmd;
struct qla_mt_iocb_rqst_fx00 *piocb_rqst;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
#endif
BSG_JOB_TYPE *bsg_job;
struct fc_bsg_request *bsg_request;
struct fxdisc_entry_fx00 fx_iocb;
uint8_t entry_cnt = 1;

View File

@@ -64,11 +64,7 @@ qla2x00_bsg_job_done(void *data, void *ptr, int res)
{
srb_t *sp = ptr;
struct scsi_qla_host *vha = (scsi_qla_host_t *)data;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
bsg_reply->result = res;
@@ -81,11 +77,7 @@ qla2x00_bsg_sp_free(void *data, void *ptr)
{
srb_t *sp = ptr;
struct scsi_qla_host *vha = (scsi_qla_host_t *)data;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
struct qla_hw_data *ha = vha->hw;
dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list,
@@ -155,12 +147,7 @@ qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *vha,
return ret;
}
static int
#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
static int qla24xx_proc_fcp_prio_cfg_cmd(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -292,12 +279,7 @@ exit_fcp_prio_cfg:
return ret;
}
static int
#ifndef NEW_LIBFC_API
qla2x00_process_els(struct fc_bsg_job *bsg_job)
#else
qla2x00_process_els(struct bsg_job *bsg_job)
#endif
static int qla2x00_process_els(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_rport *rport;
@@ -479,12 +461,7 @@ static uint16_t qla24xx_calc_ct_iocbs(uint16_t dsds)
return iocbs;
}
static int
#ifndef NEW_LIBFC_API
qla2x00_process_ct(struct fc_bsg_job *bsg_job)
#else
qla2x00_process_ct(struct bsg_job *bsg_job)
#endif
static int qla2x00_process_ct(BSG_JOB_TYPE *bsg_job)
{
srb_t *sp;
#ifndef NEW_LIBFC_API
@@ -708,12 +685,7 @@ done_reset_internal:
return rval;
}
static int
#ifndef NEW_LIBFC_API
qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
#else
qla2x00_process_loopback(struct bsg_job *bsg_job)
#endif
static int qla2x00_process_loopback(BSG_JOB_TYPE *bsg_job)
{
#ifndef NEW_LIBFC_API
struct Scsi_Host *host = bsg_job->shost;
@@ -949,12 +921,7 @@ done_unmap_req_sg:
return rval;
}
static int
#ifndef NEW_LIBFC_API
qla84xx_reset(struct fc_bsg_job *bsg_job)
#else
qla84xx_reset(struct bsg_job *bsg_job)
#endif
static int qla84xx_reset(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -994,12 +961,7 @@ qla84xx_reset(struct bsg_job *bsg_job)
return rval;
}
static int
#ifndef NEW_LIBFC_API
qla84xx_updatefw(struct fc_bsg_job *bsg_job)
#else
qla84xx_updatefw(struct bsg_job *bsg_job)
#endif
static int qla84xx_updatefw(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -1115,12 +1077,7 @@ done_unmap_sg:
return rval;
}
static int
#ifndef NEW_LIBFC_API
qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
#else
qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
#endif
static int qla84xx_mgmt_cmd(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -1324,12 +1281,7 @@ exit_mgmt:
return rval;
}
static int
#ifndef NEW_LIBFC_API
qla24xx_iidma(struct fc_bsg_job *bsg_job)
#else
qla24xx_iidma(struct bsg_job *bsg_job)
#endif
static int qla24xx_iidma(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_request *bsg_request = bsg_job->request;
@@ -1423,13 +1375,8 @@ qla24xx_iidma(struct bsg_job *bsg_job)
return rval;
}
static int
#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)
static int qla2x00_optrom_setup(BSG_JOB_TYPE *bsg_job, scsi_qla_host_t *vha,
uint8_t is_update)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
uint32_t start = 0;
@@ -1497,12 +1444,7 @@ qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
return 0;
}
static int
#ifndef NEW_LIBFC_API
qla2x00_read_optrom(struct fc_bsg_job *bsg_job)
#else
qla2x00_read_optrom(struct bsg_job *bsg_job)
#endif
static int qla2x00_read_optrom(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1534,12 +1476,7 @@ qla2x00_read_optrom(struct bsg_job *bsg_job)
return rval;
}
static int
#ifndef NEW_LIBFC_API
qla2x00_update_optrom(struct fc_bsg_job *bsg_job)
#else
qla2x00_update_optrom(struct bsg_job *bsg_job)
#endif
static int qla2x00_update_optrom(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1570,12 +1507,7 @@ qla2x00_update_optrom(struct bsg_job *bsg_job)
return rval;
}
static int
#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
static int qla2x00_update_fru_versions(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1626,12 +1558,7 @@ done:
return 0;
}
static int
#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
static int qla2x00_read_fru_status(BSG_JOB_TYPE *bsg_job)
{
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1680,12 +1607,7 @@ done:
return 0;
}
static int
#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
static int qla2x00_write_fru_status(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
struct Scsi_Host *host = fc_bsg_to_shost(bsg_job);
@@ -1730,12 +1652,7 @@ done:
return 0;
}
static int
#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
static int qla2x00_process_vendor_specific(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1783,12 +1700,7 @@ qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
}
}
int
#ifndef NEW_LIBFC_API
qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
#else
qla24xx_bsg_request(struct bsg_job *bsg_job)
#endif
int qla24xx_bsg_request(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -1849,12 +1761,7 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
return ret;
}
int
#ifndef NEW_LIBFC_API
qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
#else
qla24xx_bsg_timeout(struct bsg_job *bsg_job)
#endif
int qla24xx_bsg_timeout(BSG_JOB_TYPE *bsg_job)
{
struct fc_bsg_request *bsg_request = bsg_job->request;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;

View File

@@ -31,6 +31,9 @@
defined(CONFIG_SUSE_KERNEL) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
#define NEW_LIBFC_API
#define BSG_JOB_TYPE struct bsg_job
#else
#define BSG_JOB_TYPE struct fc_bsg_job
#endif
#ifdef NEW_LIBFC_API

View File

@@ -605,13 +605,8 @@ extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
extern void qla82xx_clear_pending_mbx(scsi_qla_host_t *);
/* BSG related functions */
#ifdef NEW_LIBFC_API
extern int qla24xx_bsg_request(struct bsg_job *);
extern int qla24xx_bsg_timeout(struct bsg_job *);
#else
extern int qla24xx_bsg_request(struct fc_bsg_job *);
extern int qla24xx_bsg_timeout(struct fc_bsg_job *);
#endif
extern int qla24xx_bsg_request(BSG_JOB_TYPE *);
extern int qla24xx_bsg_timeout(BSG_JOB_TYPE *);
extern int qla84xx_reset_chip(scsi_qla_host_t *, uint16_t);
extern int qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *,
dma_addr_t, size_t, uint32_t);

View File

@@ -2099,12 +2099,8 @@ 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)
{
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
struct fc_bsg_request *bsg_request = bsg_job->request;
#endif
els_iocb->entry_type = ELS_IOCB_TYPE;
els_iocb->entry_count = 1;
@@ -2119,13 +2115,8 @@ qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
els_iocb->opcode =
sp->type == SRB_ELS_CMD_RPT ?
#ifndef NEW_LIBFC_API
bsg_job->request->rqst_data.r_els.els_code :
bsg_job->request->rqst_data.h_els.command_code;
#else
bsg_request->rqst_data.r_els.els_code :
bsg_request->rqst_data.h_els.command_code;
#endif
els_iocb->port_id[0] = sp->fcport->d_id.b.al_pa;
els_iocb->port_id[1] = sp->fcport->d_id.b.area;
els_iocb->port_id[2] = sp->fcport->d_id.b.domain;
@@ -2160,11 +2151,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;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
int loop_iterartion = 0;
int entry_count = 1;
@@ -2239,11 +2226,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;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job = sp->u.bsg_job;
#else
struct bsg_job *bsg_job = sp->u.bsg_job;
#endif
BSG_JOB_TYPE *bsg_job = sp->u.bsg_job;
int loop_iterartion = 0;
int entry_count = 1;

View File

@@ -1083,12 +1083,8 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
const char func[] = "CT_IOCB";
const char *type;
srb_t *sp;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
BSG_JOB_TYPE *bsg_job;
struct fc_bsg_reply *bsg_reply;
#endif
uint16_t comp_status;
int res;
@@ -1097,9 +1093,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
return;
bsg_job = sp->u.bsg_job;
#ifdef NEW_LIBFC_API
bsg_reply = bsg_job->reply;
#endif
type = "ct pass-through";
@@ -1108,52 +1102,32 @@ 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
*/
#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;
#endif
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
if (comp_status != CS_COMPLETE) {
if (comp_status == CS_DATA_UNDERRUN) {
res = DID_OK << 16;
#ifndef NEW_LIBFC_API
bsg_job->reply->reply_payload_rcv_len =
#else
bsg_reply->reply_payload_rcv_len =
#endif
le16_to_cpu(((sts_entry_t *)pkt)->rsp_info_len);
ql_log(ql_log_warn, vha, 0x5048,
"CT pass-through-%s error "
"comp_status-status=0x%x total_byte = 0x%x.\n",
type, comp_status,
#ifndef NEW_LIBFC_API
bsg_job->reply->reply_payload_rcv_len);
#else
bsg_reply->reply_payload_rcv_len);
#endif
} else {
ql_log(ql_log_warn, vha, 0x5049,
"CT pass-through-%s error "
"comp_status-status=0x%x.\n", type, comp_status);
res = DID_ERROR << 16;
#ifndef NEW_LIBFC_API
bsg_job->reply->reply_payload_rcv_len = 0;
#else
bsg_reply->reply_payload_rcv_len = 0;
#endif
}
ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5035,
(uint8_t *)pkt, sizeof(*pkt));
} else {
res = DID_OK << 16;
#ifndef NEW_LIBFC_API
bsg_job->reply->reply_payload_rcv_len =
#else
bsg_reply->reply_payload_rcv_len =
#endif
bsg_job->reply_payload.payload_len;
bsg_job->reply_len = 0;
}
@@ -1167,12 +1141,8 @@ 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;
#ifndef NEW_LIBFC_API
struct fc_bsg_job *bsg_job;
#else
struct bsg_job *bsg_job;
BSG_JOB_TYPE *bsg_job;
struct fc_bsg_reply *bsg_reply;
#endif
uint16_t comp_status;
uint32_t fw_status[3];
uint8_t *fw_sts_ptr;
@@ -1181,9 +1151,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
if (!sp)
return;
bsg_job = sp->u.bsg_job;
#ifdef NEW_LIBFC_API
bsg_reply = bsg_job->reply;
#endif
type = NULL;
switch (sp->type) {
@@ -1207,20 +1175,12 @@ 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
*/
#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;
#endif
bsg_job->reply_len = sizeof(struct fc_bsg_reply) + sizeof(fw_status);
if (comp_status != CS_COMPLETE) {
if (comp_status == CS_DATA_UNDERRUN) {
#ifndef NEW_LIBFC_API
bsg_job->reply->reply_payload_rcv_len =
#else
bsg_reply->reply_payload_rcv_len =
#endif
le16_to_cpu(((struct els_sts_entry_24xx *)pkt)->total_byte_count);
ql_dbg(ql_dbg_user, vha, 0x503f,
@@ -1241,11 +1201,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
pkt)->error_subcode_1),
le16_to_cpu(((struct els_sts_entry_24xx *)
pkt)->error_subcode_2));
#ifndef NEW_LIBFC_API
bsg_job->reply->reply_payload_rcv_len = 0;
#else
bsg_reply->reply_payload_rcv_len = 0;
#endif
fw_sts_ptr = bsg_job_sense(bsg_job) +
sizeof(struct fc_bsg_reply);
memcpy(fw_sts_ptr, fw_status, sizeof(fw_status));
@@ -1253,11 +1209,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
ql_dump_buffer(ql_dbg_user + ql_dbg_buffer, vha, 0x5056,
(uint8_t *)pkt, sizeof(*pkt));
} else {
#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;
#endif
bsg_job->reply_len = 0;
}
sp->done(vha, sp, 0);

View File

@@ -52,7 +52,7 @@
#include <rdma/ib_verbs.h>
#include <scsi/scsi_cmnd.h> /* struct scsi_cmnd */
struct scsi_target;
#include <scsi/scsi_transport_fc.h> /* struct fc_bsg_job */
#include <scsi/scsi_transport_fc.h> /* struct bsg_job */
#include <asm/unaligned.h> /* get_unaligned_be64() */
/* <asm-generic/barrier.h> */
@@ -2205,13 +2205,15 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
*/
static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
{
return blk_mq_rq_from_pdu(scmd);
return scmd->request;
}
/*
* See also commit 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag()
* helper").
* 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)
static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
{
struct request *rq = blk_mq_rq_from_pdu(scmd);
@@ -2219,6 +2221,7 @@ static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
return t10_pi_ref_tag(rq);
}
#endif
#endif
/* <scsi/scsi_request.h> */