summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_def.h
diff options
context:
space:
mode:
authorQuinn Tran <qutran@marvell.com>2024-07-10 19:10:55 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2024-07-11 04:44:10 +0200
commitbeafd692461443e0fb1d61aa56886bf85ef6f5e4 (patch)
tree44a4d9e60d08bf91dbd4a06693993f77be0c0110 /drivers/scsi/qla2xxx/qla_def.h
parentscsi: qla2xxx: Fix optrom version displayed in FDMI (diff)
downloadlinux-beafd692461443e0fb1d61aa56886bf85ef6f5e4.tar.xz
linux-beafd692461443e0fb1d61aa56886bf85ef6f5e4.zip
scsi: qla2xxx: Reduce fabric scan duplicate code
For fabric scan, current code uses switch scan opcode and flags as the method to iterate through different commands to carry out the process. This makes it hard to read. This patch convert those opcode and flags into steps. In addition, this help reduce some duplicate code. Consolidate routines that handle GPNFT & GNNFT. Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Link: https://lore.kernel.org/r/20240710171057.35066-10-njavali@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index ba134f6237b8..7cf998e3cc68 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3309,11 +3309,20 @@ struct fab_scan_rp {
u8 node_name[8];
};
+enum scan_step {
+ FAB_SCAN_START,
+ FAB_SCAN_GPNFT_FCP,
+ FAB_SCAN_GNNFT_FCP,
+ FAB_SCAN_GPNFT_NVME,
+ FAB_SCAN_GNNFT_NVME,
+};
+
struct fab_scan {
struct fab_scan_rp *l;
u32 size;
u32 rscn_gen_start;
u32 rscn_gen_end;
+ enum scan_step step;
u16 scan_retry;
#define MAX_SCAN_RETRIES 5
enum scan_flags_t scan_flags;
@@ -3539,9 +3548,8 @@ enum qla_work_type {
QLA_EVT_RELOGIN,
QLA_EVT_ASYNC_PRLO,
QLA_EVT_ASYNC_PRLO_DONE,
- QLA_EVT_GPNFT,
- QLA_EVT_GPNFT_DONE,
- QLA_EVT_GNNFT_DONE,
+ QLA_EVT_SCAN_CMD,
+ QLA_EVT_SCAN_FINISH,
QLA_EVT_GFPNID,
QLA_EVT_SP_RETRY,
QLA_EVT_IIDMA,