]> Pileus Git - ~andy/linux/commitdiff
[SCSI] qla2xxx: Add support for extended error logging.
authorAndrew Vasquez <andrew.vasquez@qlogic.com>
Fri, 23 Jun 2006 23:11:10 +0000 (16:11 -0700)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Mon, 26 Jun 2006 21:24:36 +0000 (16:24 -0500)
Similar in form to QLogic's standard offering -- via
the 'extended_error_logging' module parameter.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/qla2xxx/qla_dbg.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_os.c

index 2cea0097fbabcc9d4ce6114d73ea8defa77a4a3d..533425338e05ec5fb43e54b54d37c2875ac08f8f 100644 (file)
 * Macros use for debugging the driver.
 */
 
-#if  DEBUG_QLA2100
-#define DEBUG(x)       do {x;} while (0)
-#else
-#define DEBUG(x)       do {} while (0)
-#endif
+#define DEBUG(x)       do { if (extended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_1)
 #define DEBUG1(x)      do {x;} while (0)
 #define DEBUG1(x)      do {} while (0)
 #endif
 
-#if defined(QL_DEBUG_LEVEL_2)
-#define DEBUG2(x)       do {x;} while (0)
-#define DEBUG2_3(x)     do {x;} while (0)
-#define DEBUG2_3_11(x)  do {x;} while (0)
-#define DEBUG2_9_10(x)    do {x;} while (0)
-#define DEBUG2_11(x)    do {x;} while (0)
-#define DEBUG2_13(x)    do {x;} while (0)
-#else
-#define DEBUG2(x)      do {} while (0)
-#endif
+#define DEBUG2(x)      do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_3(x)    do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_3_11(x) do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_9_10(x) do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_11(x)   do { if (extended_error_logging) { x; } } while (0)
+#define DEBUG2_13(x)   do { if (extended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_3)
 #define DEBUG3(x)      do {x;} while (0)
-#define DEBUG2_3(x)    do {x;} while (0)
-#define DEBUG2_3_11(x) do {x;} while (0)
 #define DEBUG3_11(x)   do {x;} while (0)
 #else
 #define DEBUG3(x)      do {} while (0)
-  #if !defined(QL_DEBUG_LEVEL_2)
-  #define DEBUG2_3(x)  do {} while (0)
-  #endif
 #endif
 
 #if defined(QL_DEBUG_LEVEL_4)
 #if defined(QL_DEBUG_LEVEL_9)
 #define DEBUG9(x)       do {x;} while (0)
 #define DEBUG9_10(x)    do {x;} while (0)
-#define DEBUG2_9_10(x) do {x;} while (0)
 #else
 #define DEBUG9(x)      do {} while (0)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_10)
 #define DEBUG10(x)      do {x;} while (0)
-#define DEBUG2_9_10(x) do {x;} while (0)
 #define DEBUG9_10(x)   do {x;} while (0)
 #else
 #define DEBUG10(x)     do {} while (0)
-  #if !defined(DEBUG2_9_10)
-  #define DEBUG2_9_10(x)       do {} while (0)
-  #endif
   #if !defined(DEBUG9_10)
   #define DEBUG9_10(x) do {} while (0)
   #endif
 
 #if defined(QL_DEBUG_LEVEL_11)
 #define DEBUG11(x)      do{x;} while(0)
-#if !defined(DEBUG2_11)
-#define DEBUG2_11(x)    do{x;} while(0)
-#endif
-#if !defined(DEBUG2_3_11)
-#define DEBUG2_3_11(x)  do{x;} while(0)
-#endif
 #if !defined(DEBUG3_11)
 #define DEBUG3_11(x)    do{x;} while(0)
 #endif
 #else
 #define DEBUG11(x)     do{} while(0)
-  #if !defined(QL_DEBUG_LEVEL_2)
-  #define DEBUG2_11(x) do{} while(0)
-    #if !defined(QL_DEBUG_LEVEL_3)
-    #define DEBUG2_3_11(x) do{} while(0)
-    #endif
-  #endif
   #if !defined(QL_DEBUG_LEVEL_3)
   #define DEBUG3_11(x) do{} while(0)
   #endif
 
 #if defined(QL_DEBUG_LEVEL_13)
 #define DEBUG13(x)      do {x;} while (0)
-#if !defined(DEBUG2_13)
-#define DEBUG2_13(x)    do {x;} while(0)
-#endif
 #else
 #define DEBUG13(x)     do {} while (0)
-#if !defined(QL_DEBUG_LEVEL_2)
-#define DEBUG2_13(x)   do {} while(0)
-#endif
 #endif
 
 #if defined(QL_DEBUG_LEVEL_14)
index 9ff3298405cdbf26606455357d4469fbb9ed689f..750aef11c2ef3ea26f3eb0dbd5fe20f0bd43467f 100644 (file)
@@ -64,6 +64,7 @@ extern int ql2xplogiabsentdevice;
 extern int ql2xloginretrycount;
 extern int ql2xfdmienable;
 extern int ql2xallocfwdump;
+extern int extended_error_logging;
 
 extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
 
index 101cf12b9a47c43c7bf7ba3a64dd51797a6fc13d..761dd1f7e3f1c1c4de5d9198b23af2f37c6ba358 100644 (file)
@@ -1642,6 +1642,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
        /*
         * Set host adapter parameters.
         */
+       if (nv->host_p[0] & BIT_7)
+               extended_error_logging = 1;
        ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
        /* Always load RISC code on non ISP2[12]00 chips. */
        if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
index fedf2f17808d0eeed7813feb68c294ffcc9064d8..a15b6090813381a5db84f09073070c4f3bda46d9 100644 (file)
@@ -61,6 +61,12 @@ MODULE_PARM_DESC(ql2xallocfwdump,
                "during HBA initialization.  Memory allocation requirements "
                "vary by ISP type.  Default is 1 - allocate memory.");
 
+int extended_error_logging;
+module_param(extended_error_logging, int, S_IRUGO|S_IRUSR);
+MODULE_PARM_DESC(extended_error_logging,
+               "Option to enable extended error logging, "
+               "Default is 0 - no logging. 1 - log errors.");
+
 static void qla2x00_free_device(scsi_qla_host_t *);
 
 static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@ -2691,9 +2697,9 @@ qla2x00_module_init(void)
 
        /* Derive version string. */
        strcpy(qla2x00_version_str, QLA2XXX_VERSION);
-#if DEBUG_QLA2100
-       strcat(qla2x00_version_str, "-debug");
-#endif
+       if (extended_error_logging)
+               strcat(qla2x00_version_str, "-debug");
+
        qla2xxx_transport_template =
            fc_attach_transport(&qla2xxx_transport_functions);
        if (!qla2xxx_transport_template)