qla_dbg.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /******************************************************************************
  2. * QLOGIC LINUX SOFTWARE
  3. *
  4. * QLogic ISP2x00 device driver for Linux 2.6.x
  5. * Copyright (C) 2003-2004 QLogic Corporation
  6. * (www.qlogic.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2, or (at your option) any
  11. * later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. ******************************************************************************/
  19. /*
  20. * Driver debug definitions.
  21. */
  22. /* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM1 */
  23. /* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM1 */
  24. /* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM1 */
  25. /* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM1 */
  26. /* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM1 */
  27. /* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM1 */
  28. /* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM1 */
  29. /* #define QL_DEBUG_LEVEL_8 */ /* Output ring saturation msgs to COM1 */
  30. /* #define QL_DEBUG_LEVEL_9 */ /* Output IOCTL trace msgs */
  31. /* #define QL_DEBUG_LEVEL_10 */ /* Output IOCTL error msgs */
  32. /* #define QL_DEBUG_LEVEL_11 */ /* Output Mbx Cmd trace msgs */
  33. /* #define QL_DEBUG_LEVEL_12 */ /* Output IP trace msgs */
  34. /* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */
  35. /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */
  36. /*
  37. * Local Macro Definitions.
  38. */
  39. #if defined(QL_DEBUG_LEVEL_1) || defined(QL_DEBUG_LEVEL_2) || \
  40. defined(QL_DEBUG_LEVEL_3) || defined(QL_DEBUG_LEVEL_4) || \
  41. defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_6) || \
  42. defined(QL_DEBUG_LEVEL_7) || defined(QL_DEBUG_LEVEL_8) || \
  43. defined(QL_DEBUG_LEVEL_9) || defined(QL_DEBUG_LEVEL_10) || \
  44. defined(QL_DEBUG_LEVEL_11) || defined(QL_DEBUG_LEVEL_12) || \
  45. defined(QL_DEBUG_LEVEL_13) || defined(QL_DEBUG_LEVEL_14)
  46. #define QL_DEBUG_ROUTINES
  47. #endif
  48. /*
  49. * Macros use for debugging the driver.
  50. */
  51. #undef ENTER_TRACE
  52. #if defined(ENTER_TRACE)
  53. #define ENTER(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
  54. #define LEAVE(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
  55. #define ENTER_INTR(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
  56. #define LEAVE_INTR(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
  57. #else
  58. #define ENTER(x) do {} while (0)
  59. #define LEAVE(x) do {} while (0)
  60. #define ENTER_INTR(x) do {} while (0)
  61. #define LEAVE_INTR(x) do {} while (0)
  62. #endif
  63. #if DEBUG_QLA2100
  64. #define DEBUG(x) do {x;} while (0);
  65. #else
  66. #define DEBUG(x) do {} while (0);
  67. #endif
  68. #if defined(QL_DEBUG_LEVEL_1)
  69. #define DEBUG1(x) do {x;} while (0);
  70. #else
  71. #define DEBUG1(x) do {} while (0);
  72. #endif
  73. #if defined(QL_DEBUG_LEVEL_2)
  74. #define DEBUG2(x) do {x;} while (0);
  75. #define DEBUG2_3(x) do {x;} while (0);
  76. #define DEBUG2_3_11(x) do {x;} while (0);
  77. #define DEBUG2_9_10(x) do {x;} while (0);
  78. #define DEBUG2_11(x) do {x;} while (0);
  79. #else
  80. #define DEBUG2(x) do {} while (0);
  81. #endif
  82. #if defined(QL_DEBUG_LEVEL_3)
  83. #define DEBUG3(x) do {x;} while (0);
  84. #define DEBUG2_3(x) do {x;} while (0);
  85. #define DEBUG2_3_11(x) do {x;} while (0);
  86. #define DEBUG3_11(x) do {x;} while (0);
  87. #else
  88. #define DEBUG3(x) do {} while (0);
  89. #if !defined(QL_DEBUG_LEVEL_2)
  90. #define DEBUG2_3(x) do {} while (0);
  91. #endif
  92. #endif
  93. #if defined(QL_DEBUG_LEVEL_4)
  94. #define DEBUG4(x) do {x;} while (0);
  95. #else
  96. #define DEBUG4(x) do {} while (0);
  97. #endif
  98. #if defined(QL_DEBUG_LEVEL_5)
  99. #define DEBUG5(x) do {x;} while (0);
  100. #else
  101. #define DEBUG5(x) do {} while (0);
  102. #endif
  103. #if defined(QL_DEBUG_LEVEL_7)
  104. #define DEBUG7(x) do {x;} while (0);
  105. #else
  106. #define DEBUG7(x) do {} while (0);
  107. #endif
  108. #if defined(QL_DEBUG_LEVEL_9)
  109. #define DEBUG9(x) do {x;} while (0);
  110. #define DEBUG9_10(x) do {x;} while (0);
  111. #define DEBUG2_9_10(x) do {x;} while (0);
  112. #else
  113. #define DEBUG9(x) do {} while (0);
  114. #endif
  115. #if defined(QL_DEBUG_LEVEL_10)
  116. #define DEBUG10(x) do {x;} while (0);
  117. #define DEBUG2_9_10(x) do {x;} while (0);
  118. #define DEBUG9_10(x) do {x;} while (0);
  119. #else
  120. #define DEBUG10(x) do {} while (0);
  121. #if !defined(DEBUG2_9_10)
  122. #define DEBUG2_9_10(x) do {} while (0);
  123. #endif
  124. #if !defined(DEBUG9_10)
  125. #define DEBUG9_10(x) do {} while (0);
  126. #endif
  127. #endif
  128. #if defined(QL_DEBUG_LEVEL_11)
  129. #define DEBUG11(x) do{x;} while(0);
  130. #if !defined(DEBUG2_11)
  131. #define DEBUG2_11(x) do{x;} while(0);
  132. #endif
  133. #if !defined(DEBUG2_3_11)
  134. #define DEBUG2_3_11(x) do{x;} while(0);
  135. #endif
  136. #if !defined(DEBUG3_11)
  137. #define DEBUG3_11(x) do{x;} while(0);
  138. #endif
  139. #else
  140. #define DEBUG11(x) do{} while(0);
  141. #if !defined(QL_DEBUG_LEVEL_2)
  142. #define DEBUG2_11(x) do{} while(0);
  143. #if !defined(QL_DEBUG_LEVEL_3)
  144. #define DEBUG2_3_11(x) do{} while(0);
  145. #endif
  146. #endif
  147. #if !defined(QL_DEBUG_LEVEL_3)
  148. #define DEBUG3_11(x) do{} while(0);
  149. #endif
  150. #endif
  151. #if defined(QL_DEBUG_LEVEL_12)
  152. #define DEBUG12(x) do {x;} while (0);
  153. #else
  154. #define DEBUG12(x) do {} while (0);
  155. #endif
  156. #if defined(QL_DEBUG_LEVEL_13)
  157. #define DEBUG13(x) do {x;} while (0)
  158. #else
  159. #define DEBUG13(x) do {} while (0)
  160. #endif
  161. #if defined(QL_DEBUG_LEVEL_14)
  162. #define DEBUG14(x) do {x;} while (0)
  163. #else
  164. #define DEBUG14(x) do {} while (0)
  165. #endif
  166. /*
  167. * Firmware Dump structure definition
  168. */
  169. #define FW_DUMP_SIZE_128K 0xBC000
  170. #define FW_DUMP_SIZE_512K 0x2FC000
  171. #define FW_DUMP_SIZE_1M 0x5FC000
  172. struct qla2300_fw_dump {
  173. uint16_t hccr;
  174. uint16_t pbiu_reg[8];
  175. uint16_t risc_host_reg[8];
  176. uint16_t mailbox_reg[32];
  177. uint16_t resp_dma_reg[32];
  178. uint16_t dma_reg[48];
  179. uint16_t risc_hdw_reg[16];
  180. uint16_t risc_gp0_reg[16];
  181. uint16_t risc_gp1_reg[16];
  182. uint16_t risc_gp2_reg[16];
  183. uint16_t risc_gp3_reg[16];
  184. uint16_t risc_gp4_reg[16];
  185. uint16_t risc_gp5_reg[16];
  186. uint16_t risc_gp6_reg[16];
  187. uint16_t risc_gp7_reg[16];
  188. uint16_t frame_buf_hdw_reg[64];
  189. uint16_t fpm_b0_reg[64];
  190. uint16_t fpm_b1_reg[64];
  191. uint16_t risc_ram[0xf800];
  192. uint16_t stack_ram[0x1000];
  193. uint16_t data_ram[1];
  194. };
  195. struct qla2100_fw_dump {
  196. uint16_t hccr;
  197. uint16_t pbiu_reg[8];
  198. uint16_t mailbox_reg[32];
  199. uint16_t dma_reg[48];
  200. uint16_t risc_hdw_reg[16];
  201. uint16_t risc_gp0_reg[16];
  202. uint16_t risc_gp1_reg[16];
  203. uint16_t risc_gp2_reg[16];
  204. uint16_t risc_gp3_reg[16];
  205. uint16_t risc_gp4_reg[16];
  206. uint16_t risc_gp5_reg[16];
  207. uint16_t risc_gp6_reg[16];
  208. uint16_t risc_gp7_reg[16];
  209. uint16_t frame_buf_hdw_reg[16];
  210. uint16_t fpm_b0_reg[64];
  211. uint16_t fpm_b1_reg[64];
  212. uint16_t risc_ram[0xf000];
  213. };