summaryrefslogtreecommitdiff
path: root/drivers/scsi/aacraid/aacraid.h
diff options
context:
space:
mode:
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>2017-12-26 20:34:41 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2018-01-03 23:26:43 -0500
commit2290678fed775194ef84d65949d93a4f524765b0 (patch)
tree4dfd9803c106c1df8e0ff04f9dca6dc619dc1256 /drivers/scsi/aacraid/aacraid.h
parentf2d2cabadba00f13786a5962a9813079a3767ce4 (diff)
downloadlwn-2290678fed775194ef84d65949d93a4f524765b0.tar.gz
lwn-2290678fed775194ef84d65949d93a4f524765b0.zip
scsi: aacraid: Added macros to help loop through known buses and targets
Added macros to loop through the MAX SUPPORTED Buses and Targets. This will make the code a bit easier to read. Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid/aacraid.h')
-rw-r--r--drivers/scsi/aacraid/aacraid.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 17c6cdd52806..a8fe1e1272c1 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -117,9 +117,13 @@ enum {
/* Thor: 5 phys. buses: #0: empty, 1-4: 256 targets each */
#define AAC_MAX_BUSES 5
#define AAC_MAX_TARGETS 256
+#define AAC_BUS_TARGET_LOOP (AAC_MAX_BUSES * AAC_MAX_TARGETS)
#define AAC_MAX_NATIVE_SIZE 2048
#define FW_ERROR_BUFFER_SIZE 512
+#define get_bus_number(x) (x/AAC_MAX_TARGETS)
+#define get_target_number(x) (x%AAC_MAX_TARGETS)
+
/* Thor AIF events */
#define SA_AIF_HOTPLUG (1<<1)
#define SA_AIF_HARDWARE (1<<2)