qla_dbg.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /*
  2. * QLogic Fibre Channel HBA Driver
  3. * Copyright (c) 2003-2005 QLogic Corporation
  4. *
  5. * See LICENSE.qla2xxx for copyright and licensing details.
  6. */
  7. /*
  8. * Driver debug definitions.
  9. */
  10. /* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM1 */
  11. /* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM1 */
  12. /* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM1 */
  13. /* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM1 */
  14. /* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM1 */
  15. /* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM1 */
  16. /* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM1 */
  17. /* #define QL_DEBUG_LEVEL_8 */ /* Output ring saturation msgs to COM1 */
  18. /* #define QL_DEBUG_LEVEL_9 */ /* Output IOCTL trace msgs */
  19. /* #define QL_DEBUG_LEVEL_10 */ /* Output IOCTL error msgs */
  20. /* #define QL_DEBUG_LEVEL_11 */ /* Output Mbx Cmd trace msgs */
  21. /* #define QL_DEBUG_LEVEL_12 */ /* Output IP trace msgs */
  22. /* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */
  23. /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */
  24. /*
  25. * Local Macro Definitions.
  26. */
  27. #if defined(QL_DEBUG_LEVEL_1) || defined(QL_DEBUG_LEVEL_2) || \
  28. defined(QL_DEBUG_LEVEL_3) || defined(QL_DEBUG_LEVEL_4) || \
  29. defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_6) || \
  30. defined(QL_DEBUG_LEVEL_7) || defined(QL_DEBUG_LEVEL_8) || \
  31. defined(QL_DEBUG_LEVEL_9) || defined(QL_DEBUG_LEVEL_10) || \
  32. defined(QL_DEBUG_LEVEL_11) || defined(QL_DEBUG_LEVEL_12) || \
  33. defined(QL_DEBUG_LEVEL_13) || defined(QL_DEBUG_LEVEL_14)
  34. #define QL_DEBUG_ROUTINES
  35. #endif
  36. /*
  37. * Macros use for debugging the driver.
  38. */
  39. #undef ENTER_TRACE
  40. #if defined(ENTER_TRACE)
  41. #define ENTER(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
  42. #define LEAVE(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
  43. #define ENTER_INTR(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
  44. #define LEAVE_INTR(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
  45. #else
  46. #define ENTER(x) do {} while (0)
  47. #define LEAVE(x) do {} while (0)
  48. #define ENTER_INTR(x) do {} while (0)
  49. #define LEAVE_INTR(x) do {} while (0)
  50. #endif
  51. #if DEBUG_QLA2100
  52. #define DEBUG(x) do {x;} while (0);
  53. #else
  54. #define DEBUG(x) do {} while (0);
  55. #endif
  56. #if defined(QL_DEBUG_LEVEL_1)
  57. #define DEBUG1(x) do {x;} while (0);
  58. #else
  59. #define DEBUG1(x) do {} while (0);
  60. #endif
  61. #if defined(QL_DEBUG_LEVEL_2)
  62. #define DEBUG2(x) do {x;} while (0);
  63. #define DEBUG2_3(x) do {x;} while (0);
  64. #define DEBUG2_3_11(x) do {x;} while (0);
  65. #define DEBUG2_9_10(x) do {x;} while (0);
  66. #define DEBUG2_11(x) do {x;} while (0);
  67. #define DEBUG2_13(x) do {x;} while (0);
  68. #else
  69. #define DEBUG2(x) do {} while (0);
  70. #endif
  71. #if defined(QL_DEBUG_LEVEL_3)
  72. #define DEBUG3(x) do {x;} while (0);
  73. #define DEBUG2_3(x) do {x;} while (0);
  74. #define DEBUG2_3_11(x) do {x;} while (0);
  75. #define DEBUG3_11(x) do {x;} while (0);
  76. #else
  77. #define DEBUG3(x) do {} while (0);
  78. #if !defined(QL_DEBUG_LEVEL_2)
  79. #define DEBUG2_3(x) do {} while (0);
  80. #endif
  81. #endif
  82. #if defined(QL_DEBUG_LEVEL_4)
  83. #define DEBUG4(x) do {x;} while (0);
  84. #else
  85. #define DEBUG4(x) do {} while (0);
  86. #endif
  87. #if defined(QL_DEBUG_LEVEL_5)
  88. #define DEBUG5(x) do {x;} while (0);
  89. #else
  90. #define DEBUG5(x) do {} while (0);
  91. #endif
  92. #if defined(QL_DEBUG_LEVEL_7)
  93. #define DEBUG7(x) do {x;} while (0);
  94. #else
  95. #define DEBUG7(x) do {} while (0);
  96. #endif
  97. #if defined(QL_DEBUG_LEVEL_9)
  98. #define DEBUG9(x) do {x;} while (0);
  99. #define DEBUG9_10(x) do {x;} while (0);
  100. #define DEBUG2_9_10(x) do {x;} while (0);
  101. #else
  102. #define DEBUG9(x) do {} while (0);
  103. #endif
  104. #if defined(QL_DEBUG_LEVEL_10)
  105. #define DEBUG10(x) do {x;} while (0);
  106. #define DEBUG2_9_10(x) do {x;} while (0);
  107. #define DEBUG9_10(x) do {x;} while (0);
  108. #else
  109. #define DEBUG10(x) do {} while (0);
  110. #if !defined(DEBUG2_9_10)
  111. #define DEBUG2_9_10(x) do {} while (0);
  112. #endif
  113. #if !defined(DEBUG9_10)
  114. #define DEBUG9_10(x) do {} while (0);
  115. #endif
  116. #endif
  117. #if defined(QL_DEBUG_LEVEL_11)
  118. #define DEBUG11(x) do{x;} while(0);
  119. #if !defined(DEBUG2_11)
  120. #define DEBUG2_11(x) do{x;} while(0);
  121. #endif
  122. #if !defined(DEBUG2_3_11)
  123. #define DEBUG2_3_11(x) do{x;} while(0);
  124. #endif
  125. #if !defined(DEBUG3_11)
  126. #define DEBUG3_11(x) do{x;} while(0);
  127. #endif
  128. #else
  129. #define DEBUG11(x) do{} while(0);
  130. #if !defined(QL_DEBUG_LEVEL_2)
  131. #define DEBUG2_11(x) do{} while(0);
  132. #if !defined(QL_DEBUG_LEVEL_3)
  133. #define DEBUG2_3_11(x) do{} while(0);
  134. #endif
  135. #endif
  136. #if !defined(QL_DEBUG_LEVEL_3)
  137. #define DEBUG3_11(x) do{} while(0);
  138. #endif
  139. #endif
  140. #if defined(QL_DEBUG_LEVEL_12)
  141. #define DEBUG12(x) do {x;} while (0);
  142. #else
  143. #define DEBUG12(x) do {} while (0);
  144. #endif
  145. #if defined(QL_DEBUG_LEVEL_13)
  146. #define DEBUG13(x) do {x;} while (0)
  147. #if !defined(DEBUG2_13)
  148. #define DEBUG2_13(x) do {x;} while(0)
  149. #endif
  150. #else
  151. #define DEBUG13(x) do {} while (0)
  152. #if !defined(QL_DEBUG_LEVEL_2)
  153. #define DEBUG2_13(x) do {} while(0)
  154. #endif
  155. #endif
  156. #if defined(QL_DEBUG_LEVEL_14)
  157. #define DEBUG14(x) do {x;} while (0)
  158. #else
  159. #define DEBUG14(x) do {} while (0)
  160. #endif
  161. /*
  162. * Firmware Dump structure definition
  163. */
  164. #define FW_DUMP_SIZE_128K 0xBC000
  165. #define FW_DUMP_SIZE_512K 0x2FC000
  166. #define FW_DUMP_SIZE_1M 0x5FC000
  167. struct qla2300_fw_dump {
  168. uint16_t hccr;
  169. uint16_t pbiu_reg[8];
  170. uint16_t risc_host_reg[8];
  171. uint16_t mailbox_reg[32];
  172. uint16_t resp_dma_reg[32];
  173. uint16_t dma_reg[48];
  174. uint16_t risc_hdw_reg[16];
  175. uint16_t risc_gp0_reg[16];
  176. uint16_t risc_gp1_reg[16];
  177. uint16_t risc_gp2_reg[16];
  178. uint16_t risc_gp3_reg[16];
  179. uint16_t risc_gp4_reg[16];
  180. uint16_t risc_gp5_reg[16];
  181. uint16_t risc_gp6_reg[16];
  182. uint16_t risc_gp7_reg[16];
  183. uint16_t frame_buf_hdw_reg[64];
  184. uint16_t fpm_b0_reg[64];
  185. uint16_t fpm_b1_reg[64];
  186. uint16_t risc_ram[0xf800];
  187. uint16_t stack_ram[0x1000];
  188. uint16_t data_ram[1];
  189. };
  190. struct qla2100_fw_dump {
  191. uint16_t hccr;
  192. uint16_t pbiu_reg[8];
  193. uint16_t mailbox_reg[32];
  194. uint16_t dma_reg[48];
  195. uint16_t risc_hdw_reg[16];
  196. uint16_t risc_gp0_reg[16];
  197. uint16_t risc_gp1_reg[16];
  198. uint16_t risc_gp2_reg[16];
  199. uint16_t risc_gp3_reg[16];
  200. uint16_t risc_gp4_reg[16];
  201. uint16_t risc_gp5_reg[16];
  202. uint16_t risc_gp6_reg[16];
  203. uint16_t risc_gp7_reg[16];
  204. uint16_t frame_buf_hdw_reg[16];
  205. uint16_t fpm_b0_reg[64];
  206. uint16_t fpm_b1_reg[64];
  207. uint16_t risc_ram[0xf000];
  208. };
  209. #define FW_DUMP_SIZE_24XX 0x2B0000
  210. struct qla24xx_fw_dump {
  211. uint32_t host_status;
  212. uint32_t host_reg[32];
  213. uint32_t shadow_reg[7];
  214. uint16_t mailbox_reg[32];
  215. uint32_t xseq_gp_reg[128];
  216. uint32_t xseq_0_reg[16];
  217. uint32_t xseq_1_reg[16];
  218. uint32_t rseq_gp_reg[128];
  219. uint32_t rseq_0_reg[16];
  220. uint32_t rseq_1_reg[16];
  221. uint32_t rseq_2_reg[16];
  222. uint32_t cmd_dma_reg[16];
  223. uint32_t req0_dma_reg[15];
  224. uint32_t resp0_dma_reg[15];
  225. uint32_t req1_dma_reg[15];
  226. uint32_t xmt0_dma_reg[32];
  227. uint32_t xmt1_dma_reg[32];
  228. uint32_t xmt2_dma_reg[32];
  229. uint32_t xmt3_dma_reg[32];
  230. uint32_t xmt4_dma_reg[32];
  231. uint32_t xmt_data_dma_reg[16];
  232. uint32_t rcvt0_data_dma_reg[32];
  233. uint32_t rcvt1_data_dma_reg[32];
  234. uint32_t risc_gp_reg[128];
  235. uint32_t lmc_reg[112];
  236. uint32_t fpm_hdw_reg[192];
  237. uint32_t fb_hdw_reg[176];
  238. uint32_t code_ram[0x2000];
  239. uint32_t ext_mem[1];
  240. };