linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chad Dupuis <chad.dupuis@qlogic.com>
To: jbottomley@parallels.com
Cc: giridhar.malavali@qlogic.com, chad.dupuis@qlogic.com,
	andrew.vasquez@qlogic.com, linux-scsi@vger.kernel.org
Subject: [PATCH 22/42] qla2xxx: Use #defines instead of hardcoded values for intr status.
Date: Wed, 22 Aug 2012 14:21:16 -0400	[thread overview]
Message-ID: <1345659696-3670-23-git-send-email-chad.dupuis@qlogic.com> (raw)
In-Reply-To: <1345659696-3670-1-git-send-email-chad.dupuis@qlogic.com>

From: Arun Easi <arun.easi@qlogic.com>

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_def.h |   11 +++++++++++
 drivers/scsi/qla2xxx/qla_isr.c |   36 ++++++++++++++++++------------------
 2 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 9feb54c..a970dbf 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -675,6 +675,17 @@ typedef struct {
 /* 83XX FCoE specific */
 #define MBA_IDC_AEN		0x8200  /* FCoE: NIC Core state change AEN */
 
+/* Interrupt type codes */
+#define INTR_ROM_MB_SUCCESS		0x1
+#define INTR_ROM_MB_FAILED		0x2
+#define INTR_MB_SUCCESS			0x10
+#define INTR_MB_FAILED			0x11
+#define INTR_ASYNC_EVENT		0x12
+#define INTR_RSP_QUE_UPDATE		0x13
+#define INTR_RSP_QUE_UPDATE_83XX	0x14
+#define INTR_ATIO_QUE_UPDATE		0x1C
+#define INTR_ATIO_RSP_QUE_UPDATE	0x1D
+
 /* ISP mailbox loopback echo diagnostic error code */
 #define MBS_LB_RESET	0x17
 /*
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 6860992..a551827 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2522,29 +2522,29 @@ qla24xx_intr_handler(int irq, void *dev_id)
 			break;
 
 		switch (stat & 0xff) {
-		case 0x1:
-		case 0x2:
-		case 0x10:
-		case 0x11:
+		case INTR_ROM_MB_SUCCESS:
+		case INTR_ROM_MB_FAILED:
+		case INTR_MB_SUCCESS:
+		case INTR_MB_FAILED:
 			qla24xx_mbx_completion(vha, MSW(stat));
 			status |= MBX_INTERRUPT;
 
 			break;
-		case 0x12:
+		case INTR_ASYNC_EVENT:
 			mb[0] = MSW(stat);
 			mb[1] = RD_REG_WORD(&reg->mailbox1);
 			mb[2] = RD_REG_WORD(&reg->mailbox2);
 			mb[3] = RD_REG_WORD(&reg->mailbox3);
 			qla2x00_async_event(vha, rsp, mb);
 			break;
-		case 0x13:
-		case 0x14:
+		case INTR_RSP_QUE_UPDATE:
+		case INTR_RSP_QUE_UPDATE_83XX:
 			qla24xx_process_response_queue(vha, rsp);
 			break;
-		case 0x1C: /* ATIO queue updated */
+		case INTR_ATIO_QUE_UPDATE:
 			qlt_24xx_process_atio_queue(vha);
 			break;
-		case 0x1D: /* ATIO and response queues updated */
+		case INTR_ATIO_RSP_QUE_UPDATE:
 			qlt_24xx_process_atio_queue(vha);
 			qla24xx_process_response_queue(vha, rsp);
 			break;
@@ -2673,29 +2673,29 @@ qla24xx_msix_default(int irq, void *dev_id)
 			break;
 
 		switch (stat & 0xff) {
-		case 0x1:
-		case 0x2:
-		case 0x10:
-		case 0x11:
+		case INTR_ROM_MB_SUCCESS:
+		case INTR_ROM_MB_FAILED:
+		case INTR_MB_SUCCESS:
+		case INTR_MB_FAILED:
 			qla24xx_mbx_completion(vha, MSW(stat));
 			status |= MBX_INTERRUPT;
 
 			break;
-		case 0x12:
+		case INTR_ASYNC_EVENT:
 			mb[0] = MSW(stat);
 			mb[1] = RD_REG_WORD(&reg->mailbox1);
 			mb[2] = RD_REG_WORD(&reg->mailbox2);
 			mb[3] = RD_REG_WORD(&reg->mailbox3);
 			qla2x00_async_event(vha, rsp, mb);
 			break;
-		case 0x13:
-		case 0x14:
+		case INTR_RSP_QUE_UPDATE:
+		case INTR_RSP_QUE_UPDATE_83XX:
 			qla24xx_process_response_queue(vha, rsp);
 			break;
-		case 0x1C: /* ATIO queue updated */
+		case INTR_ATIO_QUE_UPDATE:
 			qlt_24xx_process_atio_queue(vha);
 			break;
-		case 0x1D: /* ATIO and response queues updated */
+		case INTR_ATIO_RSP_QUE_UPDATE:
 			qlt_24xx_process_atio_queue(vha);
 			qla24xx_process_response_queue(vha, rsp);
 			break;
-- 
1.7.7


  parent reply	other threads:[~2012-08-22 18:38 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 18:20 [PATCH 00/42] qla2xxx: Patches for scsi "misc" branch Chad Dupuis
2012-08-22 18:20 ` [PATCH 01/42] qla2xxx: Bind to ISP8031 devices Chad Dupuis
2012-08-22 18:20 ` [PATCH 02/42] qla2xxx: Add I2C BSG interface Chad Dupuis
2012-08-22 18:20 ` [PATCH 03/42] qla2xxx: Add check in qla82xx_watchdog for failed hardware state Chad Dupuis
2012-08-22 18:20 ` [PATCH 04/42] qla2xxx: Fix typo in qla2xxx files Chad Dupuis
2012-08-22 18:20 ` [PATCH 05/42] qla2xxx: Display mailbox failure by default Chad Dupuis
2012-08-22 18:21 ` [PATCH 06/42] qla2xxx: Use bitmap to store loop_id's for fcports Chad Dupuis
2012-08-22 18:21 ` [PATCH 07/42] qla2xxx: Implementation of bidirectional Chad Dupuis
2012-08-22 18:21 ` [PATCH 08/42] qla2xxx: Add FW DUMP SIZE sysfs attribute Chad Dupuis
2012-08-22 18:21 ` [PATCH 09/42] qla2xxx: IDC implementation for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 10/42] qla2xxx: Implemetation of mctp Chad Dupuis
2012-09-14 16:28   ` James Bottomley
2012-08-22 18:21 ` [PATCH 11/42] qla2xxx: Add bit to identify adapters for thermal temp Chad Dupuis
2012-08-22 18:21 ` [PATCH 12/42] qla2xxx: Changes for ISP83xx loopback support Chad Dupuis
2012-08-22 18:21 ` [PATCH 13/42] qla2xxx: Don't register to legacy interrupt for ISP82xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 14/42] qla2xxx: Update the driver license Chad Dupuis
2012-09-14 16:36   ` James Bottomley
2012-08-22 18:21 ` [PATCH 15/42] qla2xxx: Only enable link up on the correct interrupt event Chad Dupuis
2012-08-22 18:21 ` [PATCH 16/42] qla2xxx: Fix for continuous rescan attempts in arbitrated loop topology Chad Dupuis
2012-08-22 18:21 ` [PATCH 17/42] qla2xxx: Implement beacon support for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 18/42] qla2xxx: Fix rval may be used uninitialized in this function warning Chad Dupuis
2012-08-22 18:21 ` [PATCH 19/42] qla2xxx: Perform ROM mbx cmd access only after ISP soft-reset during f/w recovery Chad Dupuis
2012-08-22 18:21 ` [PATCH 20/42] qla2xxx: Wrong PCIe(2.5Gb/s x8) speed in the kerenel message for ISP82xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 21/42] qla2xxx: Dont call nic restart firmware if it is already active and running Chad Dupuis
2012-08-22 18:21 ` Chad Dupuis [this message]
2012-08-22 18:21 ` [PATCH 23/42] qla2xxx: Remove setting Scsi_host->this_id during adapter probe Chad Dupuis
2012-08-22 18:21 ` [PATCH 24/42] qla2xxx: Ensure PLOGI is sent to Fabric Management-Server upon request Chad Dupuis
2012-08-22 18:21 ` [PATCH 25/42] qla2xxx: Fail initialization if unable to load RISC code Chad Dupuis
2012-08-22 18:21 ` [PATCH 26/42] qla2xxx: Do PCI fundamental reset for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 27/42] qla2xxx: Do not restrict the number of NPIV ports " Chad Dupuis
2012-08-22 18:21 ` [PATCH 28/42] qla2xxx: set idc version if function is first one to come Chad Dupuis
2012-08-22 18:21 ` [PATCH 29/42] qla2xxx: Fix description of qla2xmaxqdepth parameter Chad Dupuis
2012-08-22 18:21 ` [PATCH 30/42] qla2xxx: Fix for handling some error conditions in loopback Chad Dupuis
2012-08-22 18:21 ` [PATCH 31/42] qla2xxx: Enclose adapter related calls in adapter check in failed state handler Chad Dupuis
2012-08-22 18:21 ` [PATCH 32/42] qla2xxx: Set Maximum Read Request Size to 4K Chad Dupuis
2012-08-22 18:21 ` [PATCH 33/42] qla2xxx: Get fcal position map should not be called for p2p topology Chad Dupuis
2012-08-22 18:21 ` [PATCH 34/42] qla2xxx: Enable fw attributes for ISP24xx and above Chad Dupuis
2012-08-22 18:21 ` [PATCH 35/42] qla2xxx: Restrict nic core reset to one function for mctp Chad Dupuis
2012-08-22 18:21 ` [PATCH 36/42] qla2xxx: Fix for legacy interrupts for ISP83xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 37/42] qla2xxx: T10 DIF - ISP83xx changes Chad Dupuis
2012-08-22 18:21 ` [PATCH 38/42] qla2xxx: Fix incorrect status reporting on DIF errors Chad Dupuis
2012-08-22 18:21 ` [PATCH 39/42] qla2xxx: Don't toggle RISC interrupt bits after IRQ lines are attached Chad Dupuis
2012-08-22 18:21 ` [PATCH 40/42] qla2xxx: Allow MSI interrupt registration for ISP82xx Chad Dupuis
2012-08-22 18:21 ` [PATCH 41/42] qla2xxx: Use the right field for container_of Chad Dupuis
2012-08-22 18:21 ` [PATCH 42/42] qla2xxx: Update version number to 8.04.00.07-k Chad Dupuis
2012-09-14 17:20   ` James Bottomley
2012-09-14 17:27     ` Chad Dupuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345659696-3670-23-git-send-email-chad.dupuis@qlogic.com \
    --to=chad.dupuis@qlogic.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).