zfcp_dbf.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 total;
  34. u32 ready;
  35. u32 running;
  36. };
  37. struct zfcp_rec_dbf_record_target {
  38. u64 ref;
  39. u32 status;
  40. u32 d_id;
  41. u64 wwpn;
  42. u64 fcp_lun;
  43. u32 erp_count;
  44. };
  45. struct zfcp_rec_dbf_record_trigger {
  46. u8 want;
  47. u8 need;
  48. u32 as;
  49. u32 ps;
  50. u32 us;
  51. u64 ref;
  52. u64 action;
  53. u64 wwpn;
  54. u64 fcp_lun;
  55. };
  56. struct zfcp_rec_dbf_record_action {
  57. u32 status;
  58. u32 step;
  59. u64 action;
  60. u64 fsf_req;
  61. };
  62. struct zfcp_rec_dbf_record {
  63. u8 id;
  64. u8 id2;
  65. union {
  66. struct zfcp_rec_dbf_record_action action;
  67. struct zfcp_rec_dbf_record_thread thread;
  68. struct zfcp_rec_dbf_record_target target;
  69. struct zfcp_rec_dbf_record_trigger trigger;
  70. } u;
  71. };
  72. enum {
  73. ZFCP_REC_DBF_ID_ACTION,
  74. ZFCP_REC_DBF_ID_THREAD,
  75. ZFCP_REC_DBF_ID_TARGET,
  76. ZFCP_REC_DBF_ID_TRIGGER,
  77. };
  78. struct zfcp_hba_dbf_record_response {
  79. u32 fsf_command;
  80. u64 fsf_reqid;
  81. u32 fsf_seqno;
  82. u64 fsf_issued;
  83. u32 fsf_prot_status;
  84. u32 fsf_status;
  85. u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE];
  86. u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE];
  87. u32 fsf_req_status;
  88. u8 sbal_first;
  89. u8 sbal_last;
  90. u8 sbal_response;
  91. u8 pool;
  92. u64 erp_action;
  93. union {
  94. struct {
  95. u64 cmnd;
  96. u64 serial;
  97. } fcp;
  98. struct {
  99. u64 wwpn;
  100. u32 d_id;
  101. u32 port_handle;
  102. } port;
  103. struct {
  104. u64 wwpn;
  105. u64 fcp_lun;
  106. u32 port_handle;
  107. u32 lun_handle;
  108. } unit;
  109. struct {
  110. u32 d_id;
  111. u8 ls_code;
  112. } els;
  113. } u;
  114. } __attribute__ ((packed));
  115. struct zfcp_hba_dbf_record_status {
  116. u8 failed;
  117. u32 status_type;
  118. u32 status_subtype;
  119. struct fsf_queue_designator
  120. queue_designator;
  121. u32 payload_size;
  122. #define ZFCP_DBF_UNSOL_PAYLOAD 80
  123. #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32
  124. #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56
  125. #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32)
  126. u8 payload[ZFCP_DBF_UNSOL_PAYLOAD];
  127. } __attribute__ ((packed));
  128. struct zfcp_hba_dbf_record_qdio {
  129. u32 qdio_error;
  130. u8 sbal_index;
  131. u8 sbal_count;
  132. } __attribute__ ((packed));
  133. struct zfcp_hba_dbf_record {
  134. u8 tag[ZFCP_DBF_TAG_SIZE];
  135. u8 tag2[ZFCP_DBF_TAG_SIZE];
  136. union {
  137. struct zfcp_hba_dbf_record_response response;
  138. struct zfcp_hba_dbf_record_status status;
  139. struct zfcp_hba_dbf_record_qdio qdio;
  140. struct fsf_bit_error_payload berr;
  141. } u;
  142. } __attribute__ ((packed));
  143. struct zfcp_san_dbf_record_ct_request {
  144. u16 cmd_req_code;
  145. u8 revision;
  146. u8 gs_type;
  147. u8 gs_subtype;
  148. u8 options;
  149. u16 max_res_size;
  150. u32 len;
  151. } __attribute__ ((packed));
  152. struct zfcp_san_dbf_record_ct_response {
  153. u16 cmd_rsp_code;
  154. u8 revision;
  155. u8 reason_code;
  156. u8 expl;
  157. u8 vendor_unique;
  158. u16 max_res_size;
  159. u32 len;
  160. } __attribute__ ((packed));
  161. struct zfcp_san_dbf_record_els {
  162. u8 ls_code;
  163. u32 len;
  164. } __attribute__ ((packed));
  165. struct zfcp_san_dbf_record {
  166. u8 tag[ZFCP_DBF_TAG_SIZE];
  167. u64 fsf_reqid;
  168. u32 fsf_seqno;
  169. u32 s_id;
  170. u32 d_id;
  171. union {
  172. struct zfcp_san_dbf_record_ct_request ct_req;
  173. struct zfcp_san_dbf_record_ct_response ct_resp;
  174. struct zfcp_san_dbf_record_els els;
  175. } u;
  176. #define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
  177. u8 payload[32];
  178. } __attribute__ ((packed));
  179. struct zfcp_scsi_dbf_record {
  180. u8 tag[ZFCP_DBF_TAG_SIZE];
  181. u8 tag2[ZFCP_DBF_TAG_SIZE];
  182. u32 scsi_id;
  183. u32 scsi_lun;
  184. u32 scsi_result;
  185. u64 scsi_cmnd;
  186. u64 scsi_serial;
  187. #define ZFCP_DBF_SCSI_OPCODE 16
  188. u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE];
  189. u8 scsi_retries;
  190. u8 scsi_allowed;
  191. u64 fsf_reqid;
  192. u32 fsf_seqno;
  193. u64 fsf_issued;
  194. u64 old_fsf_reqid;
  195. u8 rsp_validity;
  196. u8 rsp_scsi_status;
  197. u32 rsp_resid;
  198. u8 rsp_code;
  199. #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16
  200. #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256
  201. u32 sns_info_len;
  202. u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO];
  203. } __attribute__ ((packed));
  204. #endif /* ZFCP_DBF_H */