Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2021-03-28 09:55:47 -07:00
4 changed files with 67 additions and 68 deletions

View File

@@ -27,6 +27,14 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || \
defined(CONFIG_SUSE_KERNEL) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
/*
* See also commit 768c72cc34a2 ("scsi: libfc: Replace ->exch_done callback
* with function call") # v4.10
* and commit 9625cc483b8c ("scsi: libfc: Replace ->seq_release callback with
* function call") # v4.10
* and commit c6865b30be7e ("scsi: libfc: Replace ->seq_start_next callback
* with function call") # v4.10.
*/
#define NEW_LIBFC_API
#endif

View File

@@ -152,11 +152,10 @@ qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *vha,
return ret;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job)
#else
static int
qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job)
#endif
{
@@ -285,11 +284,10 @@ exit_fcp_prio_cfg:
return ret;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_process_els(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_process_els(struct bsg_job *bsg_job)
#endif
{
@@ -473,11 +471,10 @@ qla24xx_calc_ct_iocbs(uint16_t dsds)
return iocbs;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_process_ct(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_process_ct(struct bsg_job *bsg_job)
#endif
{
@@ -756,11 +753,10 @@ done_set_internal:
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_process_loopback(struct bsg_job *bsg_job)
#endif
{
@@ -1004,11 +1000,10 @@ done_unmap_req_sg:
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla84xx_reset(struct fc_bsg_job *bsg_job)
#else
static int
qla84xx_reset(struct bsg_job *bsg_job)
#endif
{
@@ -1045,11 +1040,10 @@ qla84xx_reset(struct bsg_job *bsg_job)
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla84xx_updatefw(struct fc_bsg_job *bsg_job)
#else
static int
qla84xx_updatefw(struct bsg_job *bsg_job)
#endif
{
@@ -1160,11 +1154,10 @@ done_unmap_sg:
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
#else
static int
qla84xx_mgmt_cmd(struct bsg_job *bsg_job)
#endif
{
@@ -1361,11 +1354,10 @@ exit_mgmt:
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla24xx_iidma(struct fc_bsg_job *bsg_job)
#else
static int
qla24xx_iidma(struct bsg_job *bsg_job)
#endif
{
@@ -1455,12 +1447,11 @@ qla24xx_iidma(struct bsg_job *bsg_job)
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha,
uint8_t is_update)
#else
static int
qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
uint8_t is_update)
#endif
@@ -1531,11 +1522,10 @@ qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha,
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_read_optrom(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_read_optrom(struct bsg_job *bsg_job)
#endif
{
@@ -1573,11 +1563,10 @@ qla2x00_read_optrom(struct bsg_job *bsg_job)
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_update_optrom(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_update_optrom(struct bsg_job *bsg_job)
#endif
{
@@ -1619,11 +1608,10 @@ qla2x00_update_optrom(struct bsg_job *bsg_job)
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_update_fru_versions(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_update_fru_versions(struct bsg_job *bsg_job)
#endif
{
@@ -1677,11 +1665,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_read_fru_status(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_read_fru_status(struct bsg_job *bsg_job)
#endif
{
@@ -1733,11 +1720,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_write_fru_status(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_write_fru_status(struct bsg_job *bsg_job)
#endif
{
@@ -1785,11 +1771,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_write_i2c(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_write_i2c(struct bsg_job *bsg_job)
#endif
{
@@ -1836,11 +1821,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_read_i2c(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_read_i2c(struct bsg_job *bsg_job)
#endif
{
@@ -1891,11 +1875,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla24xx_process_bidir_cmd(struct fc_bsg_job *bsg_job)
#else
static int
qla24xx_process_bidir_cmd(struct bsg_job *bsg_job)
#endif
{
@@ -2074,11 +2057,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qlafx00_mgmt_cmd(struct fc_bsg_job *bsg_job)
#else
static int
qlafx00_mgmt_cmd(struct bsg_job *bsg_job)
#endif
{
@@ -2202,11 +2184,10 @@ done:
return rval;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla26xx_serdes_op(struct fc_bsg_job *bsg_job)
#else
static int
qla26xx_serdes_op(struct bsg_job *bsg_job)
#endif
{
@@ -2249,11 +2230,10 @@ qla26xx_serdes_op(struct bsg_job *bsg_job)
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla8044_serdes_op(struct fc_bsg_job *bsg_job)
#else
static int
qla8044_serdes_op(struct bsg_job *bsg_job)
#endif
{
@@ -2296,11 +2276,10 @@ qla8044_serdes_op(struct bsg_job *bsg_job)
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla27xx_get_flash_upd_cap(struct fc_bsg_job *bsg_job)
#else
static int
qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job)
#endif
{
@@ -2333,11 +2312,10 @@ qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job)
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla27xx_set_flash_upd_cap(struct fc_bsg_job *bsg_job)
#else
static int
qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job)
#endif
{
@@ -2384,11 +2362,10 @@ qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job)
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job)
#else
static int
qla27xx_get_bbcr_data(struct bsg_job *bsg_job)
#endif
{
@@ -2448,11 +2425,10 @@ done:
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_get_priv_stats(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_get_priv_stats(struct bsg_job *bsg_job)
#endif
{
@@ -2512,11 +2488,10 @@ qla2x00_get_priv_stats(struct bsg_job *bsg_job)
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_do_dport_diagnostics(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job)
#endif
{
@@ -2561,11 +2536,10 @@ qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job)
return 0;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_get_flash_image_status(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_get_flash_image_status(struct bsg_job *bsg_job)
#endif
{
@@ -2606,7 +2580,11 @@ 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
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2675,7 +2653,11 @@ 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
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2776,7 +2758,11 @@ 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
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2865,7 +2851,11 @@ 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
{
scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job));
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
@@ -2922,11 +2912,10 @@ qla2x00_manage_host_port(struct bsg_job *bsg_job)
return ret;
}
#ifndef NEW_LIBFC_API
static int
#ifndef NEW_LIBFC_API
qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job)
#else
static int
qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
#endif
{
@@ -3020,11 +3009,10 @@ qla2x00_process_vendor_specific(struct bsg_job *bsg_job)
}
}
#ifndef NEW_LIBFC_API
int
#ifndef NEW_LIBFC_API
qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
#else
int
qla24xx_bsg_request(struct bsg_job *bsg_job)
#endif
{
@@ -3090,11 +3078,10 @@ skip_chip_chk:
return ret;
}
#ifndef NEW_LIBFC_API
int
#ifndef NEW_LIBFC_API
qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
#else
int
qla24xx_bsg_timeout(struct bsg_job *bsg_job)
#endif
{

View File

@@ -766,6 +766,14 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
return ret;
}
#else
void qla_nvme_unregister_remote_port(struct fc_port *fcport)
{
}
#endif
void qla_nvme_abort_set_option(struct abort_entry_24xx *abt, srb_t *orig_sp)
{
struct qla_hw_data *ha;
@@ -847,11 +855,3 @@ inline void qla_wait_nvme_release_cmd_kref(srb_t *orig_sp)
return;
kref_put(&orig_sp->cmd_kref, orig_sp->put_fn);
}
#else
void qla_nvme_unregister_remote_port(struct fc_port *fcport)
{
}
#endif

View File

@@ -31,10 +31,14 @@
# Convert a kernel version in the x.y.z format into numeric form, just like
# the KERNEL_VERSION() macro.
function version_number(a, b, c) {
return a * 65536 + b * 256 + (c > 255 ? 255 : c);
}
function version_code(kver, array) {
if (!match(kver, "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$", array))
match(kver, "^([0-9]+)\\.([0-9]+)$", array)
return 65536*array[1] + 256*array[2] + array[3]
return version_number(array[1], array[2], array[3]);
}
@@ -172,7 +176,7 @@ function evaluate(stmnt, pattern, arg, op, result) {
pattern="KERNEL_VERSION\\([[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*\\)"
while (match(stmnt, pattern, op) != 0)
{
sub(pattern, op[1] * 65536 + op[2] * 256 + op[3], stmnt)
sub(pattern, version_number(op[1], op[2], op[3]), stmnt)
}
gsub("defined\\(INSIDE_KERNEL_TREE\\)", "1", stmnt)