zfcp_dbf.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. #define ZFCP_DBF_ID_SIZE 7
  26. struct zfcp_dbf_dump {
  27. u8 tag[ZFCP_DBF_TAG_SIZE];
  28. u32 total_size; /* size of total dump data */
  29. u32 offset; /* how much data has being already dumped */
  30. u32 size; /* how much data comes with this record */
  31. u8 data[]; /* dump data */
  32. } __attribute__ ((packed));
  33. struct zfcp_rec_dbf_record_thread {
  34. u32 total;
  35. u32 ready;
  36. u32 running;
  37. };
  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. };
  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. };
  57. struct zfcp_rec_dbf_record_action {
  58. u32 status;
  59. u32 step;
  60. u64 action;
  61. u64 fsf_req;
  62. };
  63. struct zfcp_rec_dbf_record {
  64. u8 id;
  65. char id2[7];
  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. };
  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_last;
  91. u8 sbal_response;
  92. u8 pool;
  93. u64 erp_action;
  94. union {
  95. struct {
  96. u64 cmnd;
  97. u64 serial;
  98. } 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. } els;
  114. } u;
  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 qdio_error;
  131. u8 sbal_index;
  132. u8 sbal_count;
  133. } __attribute__ ((packed));
  134. struct zfcp_hba_dbf_record {
  135. u8 tag[ZFCP_DBF_TAG_SIZE];
  136. u8 tag2[ZFCP_DBF_TAG_SIZE];
  137. union {
  138. struct zfcp_hba_dbf_record_response response;
  139. struct zfcp_hba_dbf_record_status status;
  140. struct zfcp_hba_dbf_record_qdio qdio;
  141. struct fsf_bit_error_payload berr;
  142. } u;
  143. } __attribute__ ((packed));
  144. struct zfcp_san_dbf_record_ct_request {
  145. u16 cmd_req_code;
  146. u8 revision;
  147. u8 gs_type;
  148. u8 gs_subtype;
  149. u8 options;
  150. u16 max_res_size;
  151. u32 len;
  152. } __attribute__ ((packed));
  153. struct zfcp_san_dbf_record_ct_response {
  154. u16 cmd_rsp_code;
  155. u8 revision;
  156. u8 reason_code;
  157. u8 expl;
  158. u8 vendor_unique;
  159. u16 max_res_size;
  160. u32 len;
  161. } __attribute__ ((packed));
  162. struct zfcp_san_dbf_record_els {
  163. u8 ls_code;
  164. u32 len;
  165. } __attribute__ ((packed));
  166. struct zfcp_san_dbf_record {
  167. u8 tag[ZFCP_DBF_TAG_SIZE];
  168. u64 fsf_reqid;
  169. u32 fsf_seqno;
  170. u32 s_id;
  171. u32 d_id;
  172. union {
  173. struct zfcp_san_dbf_record_ct_request ct_req;
  174. struct zfcp_san_dbf_record_ct_response ct_resp;
  175. struct zfcp_san_dbf_record_els els;
  176. } u;
  177. #define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
  178. u8 payload[32];
  179. } __attribute__ ((packed));
  180. struct zfcp_scsi_dbf_record {
  181. u8 tag[ZFCP_DBF_TAG_SIZE];
  182. u8 tag2[ZFCP_DBF_TAG_SIZE];
  183. u32 scsi_id;
  184. u32 scsi_lun;
  185. u32 scsi_result;
  186. u64 scsi_cmnd;
  187. u64 scsi_serial;
  188. #define ZFCP_DBF_SCSI_OPCODE 16
  189. u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE];
  190. u8 scsi_retries;
  191. u8 scsi_allowed;
  192. u64 fsf_reqid;
  193. u32 fsf_seqno;
  194. u64 fsf_issued;
  195. u64 old_fsf_reqid;
  196. u8 rsp_validity;
  197. u8 rsp_scsi_status;
  198. u32 rsp_resid;
  199. u8 rsp_code;
  200. #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16
  201. #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256
  202. u32 sns_info_len;
  203. u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO];
  204. } __attribute__ ((packed));
  205. #endif /* ZFCP_DBF_H */