zfcp_dbf.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*
  2. * This file is part of the zfcp device driver for
  3. * FCP adapters for IBM System z9 and zSeries.
  4. *
  5. * Copyright IBM Corp. 2008, 2008
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2, or (at your option)
  10. * any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef ZFCP_DBF_H
  22. #define ZFCP_DBF_H
  23. #include "zfcp_fsf.h"
  24. #define ZFCP_DBF_TAG_SIZE 4
  25. struct zfcp_dbf_dump {
  26. u8 tag[ZFCP_DBF_TAG_SIZE];
  27. u32 total_size; /* size of total dump data */
  28. u32 offset; /* how much data has being already dumped */
  29. u32 size; /* how much data comes with this record */
  30. u8 data[]; /* dump data */
  31. } __attribute__ ((packed));
  32. struct zfcp_rec_dbf_record_thread {
  33. u32 sema;
  34. u32 total;
  35. u32 ready;
  36. u32 running;
  37. } __attribute__ ((packed));
  38. struct zfcp_rec_dbf_record_target {
  39. u64 ref;
  40. u32 status;
  41. u32 d_id;
  42. u64 wwpn;
  43. u64 fcp_lun;
  44. u32 erp_count;
  45. } __attribute__ ((packed));
  46. struct zfcp_rec_dbf_record_trigger {
  47. u8 want;
  48. u8 need;
  49. u32 as;
  50. u32 ps;
  51. u32 us;
  52. u64 ref;
  53. u64 action;
  54. u64 wwpn;
  55. u64 fcp_lun;
  56. } __attribute__ ((packed));
  57. struct zfcp_rec_dbf_record_action {
  58. u32 status;
  59. u32 step;
  60. u64 action;
  61. u64 fsf_req;
  62. } __attribute__ ((packed));
  63. struct zfcp_rec_dbf_record {
  64. u8 id;
  65. u8 id2;
  66. union {
  67. struct zfcp_rec_dbf_record_action action;
  68. struct zfcp_rec_dbf_record_thread thread;
  69. struct zfcp_rec_dbf_record_target target;
  70. struct zfcp_rec_dbf_record_trigger trigger;
  71. } u;
  72. } __attribute__ ((packed));
  73. enum {
  74. ZFCP_REC_DBF_ID_ACTION,
  75. ZFCP_REC_DBF_ID_THREAD,
  76. ZFCP_REC_DBF_ID_TARGET,
  77. ZFCP_REC_DBF_ID_TRIGGER,
  78. };
  79. struct zfcp_hba_dbf_record_response {
  80. u32 fsf_command;
  81. u64 fsf_reqid;
  82. u32 fsf_seqno;
  83. u64 fsf_issued;
  84. u32 fsf_prot_status;
  85. u32 fsf_status;
  86. u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE];
  87. u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE];
  88. u32 fsf_req_status;
  89. u8 sbal_first;
  90. u8 sbal_curr;
  91. u8 sbal_last;
  92. u8 pool;
  93. u64 erp_action;
  94. union {
  95. struct {
  96. u64 scsi_cmnd;
  97. u64 scsi_serial;
  98. } send_fcp;
  99. struct {
  100. u64 wwpn;
  101. u32 d_id;
  102. u32 port_handle;
  103. } port;
  104. struct {
  105. u64 wwpn;
  106. u64 fcp_lun;
  107. u32 port_handle;
  108. u32 lun_handle;
  109. } unit;
  110. struct {
  111. u32 d_id;
  112. u8 ls_code;
  113. } send_els;
  114. } data;
  115. } __attribute__ ((packed));
  116. struct zfcp_hba_dbf_record_status {
  117. u8 failed;
  118. u32 status_type;
  119. u32 status_subtype;
  120. struct fsf_queue_designator
  121. queue_designator;
  122. u32 payload_size;
  123. #define ZFCP_DBF_UNSOL_PAYLOAD 80
  124. #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32
  125. #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56
  126. #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32)
  127. u8 payload[ZFCP_DBF_UNSOL_PAYLOAD];
  128. } __attribute__ ((packed));
  129. struct zfcp_hba_dbf_record_qdio {
  130. u32 status;
  131. u32 qdio_error;
  132. u32 siga_error;
  133. u8 sbal_index;
  134. u8 sbal_count;
  135. } __attribute__ ((packed));
  136. struct zfcp_hba_dbf_record {
  137. u8 tag[ZFCP_DBF_TAG_SIZE];
  138. u8 tag2[ZFCP_DBF_TAG_SIZE];
  139. union {
  140. struct zfcp_hba_dbf_record_response response;
  141. struct zfcp_hba_dbf_record_status status;
  142. struct zfcp_hba_dbf_record_qdio qdio;
  143. } type;
  144. } __attribute__ ((packed));
  145. struct zfcp_san_dbf_record_ct {
  146. union {
  147. struct {
  148. u16 cmd_req_code;
  149. u8 revision;
  150. u8 gs_type;
  151. u8 gs_subtype;
  152. u8 options;
  153. u16 max_res_size;
  154. } request;
  155. struct {
  156. u16 cmd_rsp_code;
  157. u8 revision;
  158. u8 reason_code;
  159. u8 reason_code_expl;
  160. u8 vendor_unique;
  161. } response;
  162. } type;
  163. u32 payload_size;
  164. #define ZFCP_DBF_CT_PAYLOAD 24
  165. u8 payload[ZFCP_DBF_CT_PAYLOAD];
  166. } __attribute__ ((packed));
  167. struct zfcp_san_dbf_record_els {
  168. u8 ls_code;
  169. u32 payload_size;
  170. #define ZFCP_DBF_ELS_PAYLOAD 32
  171. #define ZFCP_DBF_ELS_MAX_PAYLOAD 1024
  172. u8 payload[ZFCP_DBF_ELS_PAYLOAD];
  173. } __attribute__ ((packed));
  174. struct zfcp_san_dbf_record {
  175. u8 tag[ZFCP_DBF_TAG_SIZE];
  176. u64 fsf_reqid;
  177. u32 fsf_seqno;
  178. u32 s_id;
  179. u32 d_id;
  180. union {
  181. struct zfcp_san_dbf_record_ct ct;
  182. struct zfcp_san_dbf_record_els els;
  183. } type;
  184. } __attribute__ ((packed));
  185. struct zfcp_scsi_dbf_record {
  186. u8 tag[ZFCP_DBF_TAG_SIZE];
  187. u8 tag2[ZFCP_DBF_TAG_SIZE];
  188. u32 scsi_id;
  189. u32 scsi_lun;
  190. u32 scsi_result;
  191. u64 scsi_cmnd;
  192. u64 scsi_serial;
  193. #define ZFCP_DBF_SCSI_OPCODE 16
  194. u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE];
  195. u8 scsi_retries;
  196. u8 scsi_allowed;
  197. u64 fsf_reqid;
  198. u32 fsf_seqno;
  199. u64 fsf_issued;
  200. union {
  201. u64 old_fsf_reqid;
  202. struct {
  203. u8 rsp_validity;
  204. u8 rsp_scsi_status;
  205. u32 rsp_resid;
  206. u8 rsp_code;
  207. #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16
  208. #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256
  209. u32 sns_info_len;
  210. u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO];
  211. } fcp;
  212. } type;
  213. } __attribute__ ((packed));
  214. #endif /* ZFCP_DBF_H */