aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2006-06-23 19:11:10 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-26 17:24:36 -0400
commit0181944fe647cae18d545ac1167df3d15d393701 (patch)
tree6889c9782bf1ce84345a3d128e82797a732f4cf9 /drivers/scsi
parent744f11fdb1118c9306303529263e5ed09b463a0f (diff)
[SCSI] qla2xxx: Add support for extended error logging.
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.h50
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c12
4 files changed, 19 insertions, 46 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
index 2cea0097fbab..533425338e05 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.h
+++ b/drivers/scsi/qla2xxx/qla_dbg.h
@@ -38,11 +38,7 @@
38* Macros use for debugging the driver. 38* Macros use for debugging the driver.
39*/ 39*/
40 40
41#if DEBUG_QLA2100 41#define DEBUG(x) do { if (extended_error_logging) { x; } } while (0)
42#define DEBUG(x) do {x;} while (0)
43#else
44#define DEBUG(x) do {} while (0)
45#endif
46 42
47#if defined(QL_DEBUG_LEVEL_1) 43#if defined(QL_DEBUG_LEVEL_1)
48#define DEBUG1(x) do {x;} while (0) 44#define DEBUG1(x) do {x;} while (0)
@@ -50,27 +46,18 @@
50#define DEBUG1(x) do {} while (0) 46#define DEBUG1(x) do {} while (0)
51#endif 47#endif
52 48
53#if defined(QL_DEBUG_LEVEL_2) 49#define DEBUG2(x) do { if (extended_error_logging) { x; } } while (0)
54#define DEBUG2(x) do {x;} while (0) 50#define DEBUG2_3(x) do { if (extended_error_logging) { x; } } while (0)
55#define DEBUG2_3(x) do {x;} while (0) 51#define DEBUG2_3_11(x) do { if (extended_error_logging) { x; } } while (0)
56#define DEBUG2_3_11(x) do {x;} while (0) 52#define DEBUG2_9_10(x) do { if (extended_error_logging) { x; } } while (0)
57#define DEBUG2_9_10(x) do {x;} while (0) 53#define DEBUG2_11(x) do { if (extended_error_logging) { x; } } while (0)
58#define DEBUG2_11(x) do {x;} while (0) 54#define DEBUG2_13(x) do { if (extended_error_logging) { x; } } while (0)
59#define DEBUG2_13(x) do {x;} while (0)
60#else
61#define DEBUG2(x) do {} while (0)
62#endif
63 55
64#if defined(QL_DEBUG_LEVEL_3) 56#if defined(QL_DEBUG_LEVEL_3)
65#define DEBUG3(x) do {x;} while (0) 57#define DEBUG3(x) do {x;} while (0)
66#define DEBUG2_3(x) do {x;} while (0)
67#define DEBUG2_3_11(x) do {x;} while (0)
68#define DEBUG3_11(x) do {x;} while (0) 58#define DEBUG3_11(x) do {x;} while (0)
69#else 59#else
70#define DEBUG3(x) do {} while (0) 60#define DEBUG3(x) do {} while (0)
71 #if !defined(QL_DEBUG_LEVEL_2)
72 #define DEBUG2_3(x) do {} while (0)
73 #endif
74#endif 61#endif
75 62
76#if defined(QL_DEBUG_LEVEL_4) 63#if defined(QL_DEBUG_LEVEL_4)
@@ -94,20 +81,15 @@
94#if defined(QL_DEBUG_LEVEL_9) 81#if defined(QL_DEBUG_LEVEL_9)
95#define DEBUG9(x) do {x;} while (0) 82#define DEBUG9(x) do {x;} while (0)
96#define DEBUG9_10(x) do {x;} while (0) 83#define DEBUG9_10(x) do {x;} while (0)
97#define DEBUG2_9_10(x) do {x;} while (0)
98#else 84#else
99#define DEBUG9(x) do {} while (0) 85#define DEBUG9(x) do {} while (0)
100#endif 86#endif
101 87
102#if defined(QL_DEBUG_LEVEL_10) 88#if defined(QL_DEBUG_LEVEL_10)
103#define DEBUG10(x) do {x;} while (0) 89#define DEBUG10(x) do {x;} while (0)
104#define DEBUG2_9_10(x) do {x;} while (0)
105#define DEBUG9_10(x) do {x;} while (0) 90#define DEBUG9_10(x) do {x;} while (0)
106#else 91#else
107#define DEBUG10(x) do {} while (0) 92#define DEBUG10(x) do {} while (0)
108 #if !defined(DEBUG2_9_10)
109 #define DEBUG2_9_10(x) do {} while (0)
110 #endif
111 #if !defined(DEBUG9_10) 93 #if !defined(DEBUG9_10)
112 #define DEBUG9_10(x) do {} while (0) 94 #define DEBUG9_10(x) do {} while (0)
113 #endif 95 #endif
@@ -115,23 +97,11 @@
115 97
116#if defined(QL_DEBUG_LEVEL_11) 98#if defined(QL_DEBUG_LEVEL_11)
117#define DEBUG11(x) do{x;} while(0) 99#define DEBUG11(x) do{x;} while(0)
118#if !defined(DEBUG2_11)
119#define DEBUG2_11(x) do{x;} while(0)
120#endif
121#if !defined(DEBUG2_3_11)
122#define DEBUG2_3_11(x) do{x;} while(0)
123#endif
124#if !defined(DEBUG3_11) 100#if !defined(DEBUG3_11)
125#define DEBUG3_11(x) do{x;} while(0) 101#define DEBUG3_11(x) do{x;} while(0)
126#endif 102#endif
127#else 103#else
128#define DEBUG11(x) do{} while(0) 104#define DEBUG11(x) do{} while(0)
129 #if !defined(QL_DEBUG_LEVEL_2)
130 #define DEBUG2_11(x) do{} while(0)
131 #if !defined(QL_DEBUG_LEVEL_3)
132 #define DEBUG2_3_11(x) do{} while(0)
133 #endif
134 #endif
135 #if !defined(QL_DEBUG_LEVEL_3) 105 #if !defined(QL_DEBUG_LEVEL_3)
136 #define DEBUG3_11(x) do{} while(0) 106 #define DEBUG3_11(x) do{} while(0)
137 #endif 107 #endif
@@ -145,14 +115,8 @@
145 115
146#if defined(QL_DEBUG_LEVEL_13) 116#if defined(QL_DEBUG_LEVEL_13)
147#define DEBUG13(x) do {x;} while (0) 117#define DEBUG13(x) do {x;} while (0)
148#if !defined(DEBUG2_13)
149#define DEBUG2_13(x) do {x;} while(0)
150#endif
151#else 118#else
152#define DEBUG13(x) do {} while (0) 119#define DEBUG13(x) do {} while (0)
153#if !defined(QL_DEBUG_LEVEL_2)
154#define DEBUG2_13(x) do {} while(0)
155#endif
156#endif 120#endif
157 121
158#if defined(QL_DEBUG_LEVEL_14) 122#if defined(QL_DEBUG_LEVEL_14)
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 9ff3298405cd..750aef11c2ef 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -64,6 +64,7 @@ extern int ql2xplogiabsentdevice;
64extern int ql2xloginretrycount; 64extern int ql2xloginretrycount;
65extern int ql2xfdmienable; 65extern int ql2xfdmienable;
66extern int ql2xallocfwdump; 66extern int ql2xallocfwdump;
67extern int extended_error_logging;
67 68
68extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *); 69extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
69 70
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 101cf12b9a47..761dd1f7e3f1 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1642,6 +1642,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
1642 /* 1642 /*
1643 * Set host adapter parameters. 1643 * Set host adapter parameters.
1644 */ 1644 */
1645 if (nv->host_p[0] & BIT_7)
1646 extended_error_logging = 1;
1645 ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0); 1647 ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
1646 /* Always load RISC code on non ISP2[12]00 chips. */ 1648 /* Always load RISC code on non ISP2[12]00 chips. */
1647 if (!IS_QLA2100(ha) && !IS_QLA2200(ha)) 1649 if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index fedf2f17808d..a15b60908133 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -61,6 +61,12 @@ MODULE_PARM_DESC(ql2xallocfwdump,
61 "during HBA initialization. Memory allocation requirements " 61 "during HBA initialization. Memory allocation requirements "
62 "vary by ISP type. Default is 1 - allocate memory."); 62 "vary by ISP type. Default is 1 - allocate memory.");
63 63
64int extended_error_logging;
65module_param(extended_error_logging, int, S_IRUGO|S_IRUSR);
66MODULE_PARM_DESC(extended_error_logging,
67 "Option to enable extended error logging, "
68 "Default is 0 - no logging. 1 - log errors.");
69
64static void qla2x00_free_device(scsi_qla_host_t *); 70static void qla2x00_free_device(scsi_qla_host_t *);
65 71
66static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); 72static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@ -2691,9 +2697,9 @@ qla2x00_module_init(void)
2691 2697
2692 /* Derive version string. */ 2698 /* Derive version string. */
2693 strcpy(qla2x00_version_str, QLA2XXX_VERSION); 2699 strcpy(qla2x00_version_str, QLA2XXX_VERSION);
2694#if DEBUG_QLA2100 2700 if (extended_error_logging)
2695 strcat(qla2x00_version_str, "-debug"); 2701 strcat(qla2x00_version_str, "-debug");
2696#endif 2702
2697 qla2xxx_transport_template = 2703 qla2xxx_transport_template =
2698 fc_attach_transport(&qla2xxx_transport_functions); 2704 fc_attach_transport(&qla2xxx_transport_functions);
2699 if (!qla2xxx_transport_template) 2705 if (!qla2xxx_transport_template)