qla2x00t-32gbit: Backport to older kernel versions

Unbreak the build for the previous commit against kernel versions
before v4.15.

See also commit ac7fe82b6fcf ("nvme-fc: add a dev_loss_tmo field
to the remoteport") v4.15.
This commit is contained in:
Gleb Chesnokov
2022-02-04 15:03:08 +03:00
parent 29d73d7d7c
commit 6d353e0a06
2 changed files with 7 additions and 1 deletions

View File

@@ -2768,13 +2768,17 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
static inline void
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
#endif
rport->dev_loss_tmo = timeout ? timeout : 1;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
if (IS_ENABLED(CONFIG_NVME_FC) && fcport && fcport->nvme_remote_port)
nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port,
rport->dev_loss_tmo);
#endif
}
static void

View File

@@ -83,8 +83,10 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport)
return ret;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port,
fcport->dev_loss_tmo);
#endif
if (fcport->nvme_prli_service_param & NVME_PRLI_SP_SLER)
ql_log(ql_log_info, vha, 0x212a,
@@ -752,7 +754,7 @@ void qla_nvme_unregister_remote_port(struct fc_port *fcport)
"%s: unregister remoteport on %p %8phN\n",
__func__, fcport, fcport->port_name);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
if (test_bit(PFLG_DRIVER_REMOVING, &fcport->vha->pci_flags))
nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0);
#endif