mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 14:12:33 +00:00
qla2x00t-32gbit: Adjust feature gating in BSG paths for 29xx support
Extend qla2xxx BSG command handling to recognize QLA29xx adapters and align feature availability with hardware capabilities. Allow QLA29xx in paths previously restricted to QLA27xx/28xx: - Flash update capability queries (get/set) - BBCR data retrieval - D-port diagnostics - MPI and PEP version sysfs attributes Restrict unsupported operations on QLA29xx: - Reject flash image status query (no active image tracking) - Block qla28xx_validate_flash_image() Guard the qla27xx_get_active_image() call with an explicit IS_QLA27XX || IS_QLA28XX check so it is not reached from adapters that lack the legacy active-image layout. Signed-off-by: Manish Rangankar <mrangankar@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260723050413.3897522-40-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org> [ commit 0267b4fbaba17664afd9239f52cf26168e70b230 upstream ]
This commit is contained in:
committed by
Gleb Chesnokov
parent
90be72c38f
commit
d1f104bad7
@@ -1633,7 +1633,7 @@ qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr,
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
|
||||
if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha) &&
|
||||
!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
|
||||
!IS_QLA27XX(ha) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha))
|
||||
return scnprintf(buf, PAGE_SIZE, "\n");
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n",
|
||||
@@ -1861,7 +1861,7 @@ qla2x00_pep_version_show(struct device *dev, struct device_attribute *attr,
|
||||
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
|
||||
if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
|
||||
if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha))
|
||||
return scnprintf(buf, PAGE_SIZE, "\n");
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n",
|
||||
|
||||
@@ -1965,7 +1965,7 @@ static int qla2900_bsg_load_mpi(struct bsg_job *bsg_job)
|
||||
bsg_job_done(bsg_job, bsg_reply->result,
|
||||
bsg_reply->reply_payload_rcv_len);
|
||||
|
||||
return rval;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -2609,7 +2609,7 @@ qla27xx_get_flash_upd_cap(BSG_JOB_TYPE *bsg_job)
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
struct qla_flash_update_caps cap;
|
||||
|
||||
if (!(IS_QLA27XX(ha)) && !IS_QLA28XX(ha))
|
||||
if (!(IS_QLA27XX(ha)) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha))
|
||||
return -EPERM;
|
||||
|
||||
memset(&cap, 0, sizeof(cap));
|
||||
@@ -2642,7 +2642,7 @@ qla27xx_set_flash_upd_cap(BSG_JOB_TYPE *bsg_job)
|
||||
uint64_t online_fw_attr = 0;
|
||||
struct qla_flash_update_caps cap;
|
||||
|
||||
if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
|
||||
if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha))
|
||||
return -EPERM;
|
||||
|
||||
memset(&cap, 0, sizeof(cap));
|
||||
@@ -2690,7 +2690,7 @@ qla27xx_get_bbcr_data(BSG_JOB_TYPE *bsg_job)
|
||||
uint8_t domain, area, al_pa, state;
|
||||
int rval;
|
||||
|
||||
if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
|
||||
if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha) && !IS_QLA29XX(ha))
|
||||
return -EPERM;
|
||||
|
||||
memset(&bbcr, 0, sizeof(bbcr));
|
||||
@@ -2806,7 +2806,7 @@ qla2x00_do_dport_diagnostics(BSG_JOB_TYPE *bsg_job)
|
||||
struct qla_dport_diag *dd;
|
||||
|
||||
if (!IS_QLA83XX(vha->hw) && !IS_QLA27XX(vha->hw) &&
|
||||
!IS_QLA28XX(vha->hw))
|
||||
!IS_QLA28XX(vha->hw) && !IS_QLA29XX(vha->hw))
|
||||
return -EPERM;
|
||||
|
||||
dd = kmalloc_obj(*dd);
|
||||
@@ -2932,8 +2932,13 @@ qla2x00_get_flash_image_status(BSG_JOB_TYPE *bsg_job)
|
||||
struct qla_active_regions regions = { };
|
||||
struct active_regions active_regions = { };
|
||||
|
||||
qla27xx_get_active_image(vha, &active_regions);
|
||||
regions.global_image = active_regions.global;
|
||||
if (IS_QLA29XX(ha))
|
||||
return -EPERM;
|
||||
|
||||
if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
|
||||
qla27xx_get_active_image(vha, &active_regions);
|
||||
regions.global_image = active_regions.global;
|
||||
}
|
||||
|
||||
if (IS_QLA27XX(ha))
|
||||
regions.nvme_params = QLA27XX_PRIMARY_IMAGE;
|
||||
|
||||
@@ -4515,7 +4515,7 @@ struct qla_hw_data {
|
||||
#define IS_QLA27XX(ha) (IS_QLA2071(ha) || IS_QLA2271(ha) || IS_QLA2261(ha))
|
||||
#define IS_QLA28XX(ha) (IS_QLA2081(ha) || IS_QLA2281(ha))
|
||||
#define IS_QLA29XX(ha) (IS_QLA2099(ha) || IS_QLA2299(ha) || \
|
||||
IS_QLA2091(ha) || IS_QLA2291(ha))
|
||||
IS_QLA2091(ha) || IS_QLA2291(ha))
|
||||
|
||||
#define IS_QLA24XX_TYPE(ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \
|
||||
IS_QLA84XX(ha))
|
||||
|
||||
@@ -6566,7 +6566,7 @@ qla26xx_dport_diagnostics(scsi_qla_host_t *vha,
|
||||
dma_addr_t dd_dma;
|
||||
|
||||
if (!IS_QLA83XX(vha->hw) && !IS_QLA27XX(vha->hw) &&
|
||||
!IS_QLA28XX(vha->hw))
|
||||
!IS_QLA28XX(vha->hw) && !IS_QLA29XX(vha->hw))
|
||||
return QLA_FUNCTION_FAILED;
|
||||
|
||||
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x119f,
|
||||
|
||||
Reference in New Issue
Block a user