zfcp_dbf.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. /*
  2. * This file is part of the zfcp device driver for
  3. * FCP adapters for IBM System z9 and zSeries.
  4. *
  5. * (C) Copyright IBM Corp. 2002, 2006
  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. #include <asm/debug.h>
  22. #include <linux/ctype.h>
  23. #include "zfcp_ext.h"
  24. static u32 dbfsize = 4;
  25. module_param(dbfsize, uint, 0400);
  26. MODULE_PARM_DESC(dbfsize,
  27. "number of pages for each debug feature area (default 4)");
  28. #define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
  29. static inline int
  30. zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck)
  31. {
  32. unsigned long long sec;
  33. struct timespec xtime;
  34. int len = 0;
  35. stck -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096);
  36. sec = stck >> 12;
  37. do_div(sec, 1000000);
  38. xtime.tv_sec = sec;
  39. stck -= (sec * 1000000) << 12;
  40. xtime.tv_nsec = ((stck * 1000) >> 12);
  41. len += sprintf(out_buf + len, "%-24s%011lu:%06lu\n",
  42. label, xtime.tv_sec, xtime.tv_nsec);
  43. return len;
  44. }
  45. static int zfcp_dbf_tag(char *out_buf, const char *label, const char *tag)
  46. {
  47. int len = 0, i;
  48. len += sprintf(out_buf + len, "%-24s", label);
  49. for (i = 0; i < ZFCP_DBF_TAG_SIZE; i++)
  50. len += sprintf(out_buf + len, "%c", tag[i]);
  51. len += sprintf(out_buf + len, "\n");
  52. return len;
  53. }
  54. static int
  55. zfcp_dbf_view(char *out_buf, const char *label, const char *format, ...)
  56. {
  57. va_list arg;
  58. int len = 0;
  59. len += sprintf(out_buf + len, "%-24s", label);
  60. va_start(arg, format);
  61. len += vsprintf(out_buf + len, format, arg);
  62. va_end(arg);
  63. len += sprintf(out_buf + len, "\n");
  64. return len;
  65. }
  66. static int
  67. zfcp_dbf_view_dump(char *out_buf, const char *label,
  68. char *buffer, int buflen, int offset, int total_size)
  69. {
  70. int len = 0;
  71. if (offset == 0)
  72. len += sprintf(out_buf + len, "%-24s ", label);
  73. while (buflen--) {
  74. if (offset > 0) {
  75. if ((offset % 32) == 0)
  76. len += sprintf(out_buf + len, "\n%-24c ", ' ');
  77. else if ((offset % 4) == 0)
  78. len += sprintf(out_buf + len, " ");
  79. }
  80. len += sprintf(out_buf + len, "%02x", *buffer++);
  81. if (++offset == total_size) {
  82. len += sprintf(out_buf + len, "\n");
  83. break;
  84. }
  85. }
  86. if (total_size == 0)
  87. len += sprintf(out_buf + len, "\n");
  88. return len;
  89. }
  90. static inline int
  91. zfcp_dbf_view_header(debug_info_t * id, struct debug_view *view, int area,
  92. debug_entry_t * entry, char *out_buf)
  93. {
  94. struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)DEBUG_DATA(entry);
  95. int len = 0;
  96. if (strncmp(dump->tag, "dump", ZFCP_DBF_TAG_SIZE) != 0) {
  97. len += zfcp_dbf_stck(out_buf + len, "timestamp",
  98. entry->id.stck);
  99. len += zfcp_dbf_view(out_buf + len, "cpu", "%02i",
  100. entry->id.fields.cpuid);
  101. } else {
  102. len += zfcp_dbf_view_dump(out_buf + len, NULL,
  103. dump->data,
  104. dump->size,
  105. dump->offset, dump->total_size);
  106. if ((dump->offset + dump->size) == dump->total_size)
  107. len += sprintf(out_buf + len, "\n");
  108. }
  109. return len;
  110. }
  111. inline void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
  112. {
  113. struct zfcp_adapter *adapter = fsf_req->adapter;
  114. struct fsf_qtcb *qtcb = fsf_req->qtcb;
  115. union fsf_prot_status_qual *prot_status_qual =
  116. &qtcb->prefix.prot_status_qual;
  117. union fsf_status_qual *fsf_status_qual = &qtcb->header.fsf_status_qual;
  118. struct scsi_cmnd *scsi_cmnd;
  119. struct zfcp_port *port;
  120. struct zfcp_unit *unit;
  121. struct zfcp_send_els *send_els;
  122. struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf;
  123. struct zfcp_hba_dbf_record_response *response = &rec->type.response;
  124. int level;
  125. unsigned long flags;
  126. spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
  127. memset(rec, 0, sizeof(struct zfcp_hba_dbf_record));
  128. strncpy(rec->tag, "resp", ZFCP_DBF_TAG_SIZE);
  129. if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) &&
  130. (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) {
  131. strncpy(rec->tag2, "perr", ZFCP_DBF_TAG_SIZE);
  132. level = 1;
  133. } else if (qtcb->header.fsf_status != FSF_GOOD) {
  134. strncpy(rec->tag2, "ferr", ZFCP_DBF_TAG_SIZE);
  135. level = 1;
  136. } else if ((fsf_req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
  137. (fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) {
  138. strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE);
  139. level = 4;
  140. } else if ((prot_status_qual->doubleword[0] != 0) ||
  141. (prot_status_qual->doubleword[1] != 0) ||
  142. (fsf_status_qual->doubleword[0] != 0) ||
  143. (fsf_status_qual->doubleword[1] != 0)) {
  144. strncpy(rec->tag2, "qual", ZFCP_DBF_TAG_SIZE);
  145. level = 3;
  146. } else {
  147. strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE);
  148. level = 6;
  149. }
  150. response->fsf_command = fsf_req->fsf_command;
  151. response->fsf_reqid = (unsigned long)fsf_req;
  152. response->fsf_seqno = fsf_req->seq_no;
  153. response->fsf_issued = fsf_req->issued;
  154. response->fsf_prot_status = qtcb->prefix.prot_status;
  155. response->fsf_status = qtcb->header.fsf_status;
  156. memcpy(response->fsf_prot_status_qual,
  157. prot_status_qual, FSF_PROT_STATUS_QUAL_SIZE);
  158. memcpy(response->fsf_status_qual,
  159. fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE);
  160. response->fsf_req_status = fsf_req->status;
  161. response->sbal_first = fsf_req->sbal_first;
  162. response->sbal_curr = fsf_req->sbal_curr;
  163. response->sbal_last = fsf_req->sbal_last;
  164. response->pool = fsf_req->pool != NULL;
  165. response->erp_action = (unsigned long)fsf_req->erp_action;
  166. switch (fsf_req->fsf_command) {
  167. case FSF_QTCB_FCP_CMND:
  168. if (fsf_req->status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT)
  169. break;
  170. scsi_cmnd = (struct scsi_cmnd *)fsf_req->data;
  171. if (scsi_cmnd != NULL) {
  172. response->data.send_fcp.scsi_cmnd
  173. = (unsigned long)scsi_cmnd;
  174. response->data.send_fcp.scsi_serial
  175. = scsi_cmnd->serial_number;
  176. }
  177. break;
  178. case FSF_QTCB_OPEN_PORT_WITH_DID:
  179. case FSF_QTCB_CLOSE_PORT:
  180. case FSF_QTCB_CLOSE_PHYSICAL_PORT:
  181. port = (struct zfcp_port *)fsf_req->data;
  182. response->data.port.wwpn = port->wwpn;
  183. response->data.port.d_id = port->d_id;
  184. response->data.port.port_handle = qtcb->header.port_handle;
  185. break;
  186. case FSF_QTCB_OPEN_LUN:
  187. case FSF_QTCB_CLOSE_LUN:
  188. unit = (struct zfcp_unit *)fsf_req->data;
  189. port = unit->port;
  190. response->data.unit.wwpn = port->wwpn;
  191. response->data.unit.fcp_lun = unit->fcp_lun;
  192. response->data.unit.port_handle = qtcb->header.port_handle;
  193. response->data.unit.lun_handle = qtcb->header.lun_handle;
  194. break;
  195. case FSF_QTCB_SEND_ELS:
  196. send_els = (struct zfcp_send_els *)fsf_req->data;
  197. response->data.send_els.d_id = qtcb->bottom.support.d_id;
  198. response->data.send_els.ls_code = send_els->ls_code >> 24;
  199. break;
  200. case FSF_QTCB_ABORT_FCP_CMND:
  201. case FSF_QTCB_SEND_GENERIC:
  202. case FSF_QTCB_EXCHANGE_CONFIG_DATA:
  203. case FSF_QTCB_EXCHANGE_PORT_DATA:
  204. case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
  205. case FSF_QTCB_UPLOAD_CONTROL_FILE:
  206. break;
  207. }
  208. debug_event(adapter->hba_dbf, level,
  209. rec, sizeof(struct zfcp_hba_dbf_record));
  210. spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
  211. }
  212. inline void
  213. zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter,
  214. struct fsf_status_read_buffer *status_buffer)
  215. {
  216. struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf;
  217. unsigned long flags;
  218. spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
  219. memset(rec, 0, sizeof(struct zfcp_hba_dbf_record));
  220. strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE);
  221. strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE);
  222. rec->type.status.failed = adapter->status_read_failed;
  223. if (status_buffer != NULL) {
  224. rec->type.status.status_type = status_buffer->status_type;
  225. rec->type.status.status_subtype = status_buffer->status_subtype;
  226. memcpy(&rec->type.status.queue_designator,
  227. &status_buffer->queue_designator,
  228. sizeof(struct fsf_queue_designator));
  229. switch (status_buffer->status_type) {
  230. case FSF_STATUS_READ_SENSE_DATA_AVAIL:
  231. rec->type.status.payload_size =
  232. ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL;
  233. break;
  234. case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
  235. rec->type.status.payload_size =
  236. ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD;
  237. break;
  238. case FSF_STATUS_READ_LINK_DOWN:
  239. switch (status_buffer->status_subtype) {
  240. case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK:
  241. case FSF_STATUS_READ_SUB_FDISC_FAILED:
  242. rec->type.status.payload_size =
  243. sizeof(struct fsf_link_down_info);
  244. }
  245. break;
  246. case FSF_STATUS_READ_FEATURE_UPDATE_ALERT:
  247. rec->type.status.payload_size =
  248. ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT;
  249. break;
  250. }
  251. memcpy(&rec->type.status.payload,
  252. &status_buffer->payload, rec->type.status.payload_size);
  253. }
  254. debug_event(adapter->hba_dbf, 2,
  255. rec, sizeof(struct zfcp_hba_dbf_record));
  256. spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
  257. }
  258. inline void
  259. zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status,
  260. unsigned int qdio_error, unsigned int siga_error,
  261. int sbal_index, int sbal_count)
  262. {
  263. struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf;
  264. unsigned long flags;
  265. spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
  266. memset(rec, 0, sizeof(struct zfcp_hba_dbf_record));
  267. strncpy(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE);
  268. rec->type.qdio.status = status;
  269. rec->type.qdio.qdio_error = qdio_error;
  270. rec->type.qdio.siga_error = siga_error;
  271. rec->type.qdio.sbal_index = sbal_index;
  272. rec->type.qdio.sbal_count = sbal_count;
  273. debug_event(adapter->hba_dbf, 0,
  274. rec, sizeof(struct zfcp_hba_dbf_record));
  275. spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
  276. }
  277. static inline int
  278. zfcp_hba_dbf_view_response(char *out_buf,
  279. struct zfcp_hba_dbf_record_response *rec)
  280. {
  281. int len = 0;
  282. len += zfcp_dbf_view(out_buf + len, "fsf_command", "0x%08x",
  283. rec->fsf_command);
  284. len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
  285. rec->fsf_reqid);
  286. len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
  287. rec->fsf_seqno);
  288. len += zfcp_dbf_stck(out_buf + len, "fsf_issued", rec->fsf_issued);
  289. len += zfcp_dbf_view(out_buf + len, "fsf_prot_status", "0x%08x",
  290. rec->fsf_prot_status);
  291. len += zfcp_dbf_view(out_buf + len, "fsf_status", "0x%08x",
  292. rec->fsf_status);
  293. len += zfcp_dbf_view_dump(out_buf + len, "fsf_prot_status_qual",
  294. rec->fsf_prot_status_qual,
  295. FSF_PROT_STATUS_QUAL_SIZE,
  296. 0, FSF_PROT_STATUS_QUAL_SIZE);
  297. len += zfcp_dbf_view_dump(out_buf + len, "fsf_status_qual",
  298. rec->fsf_status_qual,
  299. FSF_STATUS_QUALIFIER_SIZE,
  300. 0, FSF_STATUS_QUALIFIER_SIZE);
  301. len += zfcp_dbf_view(out_buf + len, "fsf_req_status", "0x%08x",
  302. rec->fsf_req_status);
  303. len += zfcp_dbf_view(out_buf + len, "sbal_first", "0x%02x",
  304. rec->sbal_first);
  305. len += zfcp_dbf_view(out_buf + len, "sbal_curr", "0x%02x",
  306. rec->sbal_curr);
  307. len += zfcp_dbf_view(out_buf + len, "sbal_last", "0x%02x",
  308. rec->sbal_last);
  309. len += zfcp_dbf_view(out_buf + len, "pool", "0x%02x", rec->pool);
  310. switch (rec->fsf_command) {
  311. case FSF_QTCB_FCP_CMND:
  312. if (rec->fsf_req_status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT)
  313. break;
  314. len += zfcp_dbf_view(out_buf + len, "scsi_cmnd", "0x%0Lx",
  315. rec->data.send_fcp.scsi_cmnd);
  316. len += zfcp_dbf_view(out_buf + len, "scsi_serial", "0x%016Lx",
  317. rec->data.send_fcp.scsi_serial);
  318. break;
  319. case FSF_QTCB_OPEN_PORT_WITH_DID:
  320. case FSF_QTCB_CLOSE_PORT:
  321. case FSF_QTCB_CLOSE_PHYSICAL_PORT:
  322. len += zfcp_dbf_view(out_buf + len, "wwpn", "0x%016Lx",
  323. rec->data.port.wwpn);
  324. len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x",
  325. rec->data.port.d_id);
  326. len += zfcp_dbf_view(out_buf + len, "port_handle", "0x%08x",
  327. rec->data.port.port_handle);
  328. break;
  329. case FSF_QTCB_OPEN_LUN:
  330. case FSF_QTCB_CLOSE_LUN:
  331. len += zfcp_dbf_view(out_buf + len, "wwpn", "0x%016Lx",
  332. rec->data.unit.wwpn);
  333. len += zfcp_dbf_view(out_buf + len, "fcp_lun", "0x%016Lx",
  334. rec->data.unit.fcp_lun);
  335. len += zfcp_dbf_view(out_buf + len, "port_handle", "0x%08x",
  336. rec->data.unit.port_handle);
  337. len += zfcp_dbf_view(out_buf + len, "lun_handle", "0x%08x",
  338. rec->data.unit.lun_handle);
  339. break;
  340. case FSF_QTCB_SEND_ELS:
  341. len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x",
  342. rec->data.send_els.d_id);
  343. len += zfcp_dbf_view(out_buf + len, "ls_code", "0x%02x",
  344. rec->data.send_els.ls_code);
  345. break;
  346. case FSF_QTCB_ABORT_FCP_CMND:
  347. case FSF_QTCB_SEND_GENERIC:
  348. case FSF_QTCB_EXCHANGE_CONFIG_DATA:
  349. case FSF_QTCB_EXCHANGE_PORT_DATA:
  350. case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
  351. case FSF_QTCB_UPLOAD_CONTROL_FILE:
  352. break;
  353. }
  354. return len;
  355. }
  356. static inline int
  357. zfcp_hba_dbf_view_status(char *out_buf, struct zfcp_hba_dbf_record_status *rec)
  358. {
  359. int len = 0;
  360. len += zfcp_dbf_view(out_buf + len, "failed", "0x%02x", rec->failed);
  361. len += zfcp_dbf_view(out_buf + len, "status_type", "0x%08x",
  362. rec->status_type);
  363. len += zfcp_dbf_view(out_buf + len, "status_subtype", "0x%08x",
  364. rec->status_subtype);
  365. len += zfcp_dbf_view_dump(out_buf + len, "queue_designator",
  366. (char *)&rec->queue_designator,
  367. sizeof(struct fsf_queue_designator),
  368. 0, sizeof(struct fsf_queue_designator));
  369. len += zfcp_dbf_view_dump(out_buf + len, "payload",
  370. (char *)&rec->payload,
  371. rec->payload_size, 0, rec->payload_size);
  372. return len;
  373. }
  374. static inline int
  375. zfcp_hba_dbf_view_qdio(char *out_buf, struct zfcp_hba_dbf_record_qdio *rec)
  376. {
  377. int len = 0;
  378. len += zfcp_dbf_view(out_buf + len, "status", "0x%08x", rec->status);
  379. len += zfcp_dbf_view(out_buf + len, "qdio_error", "0x%08x",
  380. rec->qdio_error);
  381. len += zfcp_dbf_view(out_buf + len, "siga_error", "0x%08x",
  382. rec->siga_error);
  383. len += zfcp_dbf_view(out_buf + len, "sbal_index", "0x%02x",
  384. rec->sbal_index);
  385. len += zfcp_dbf_view(out_buf + len, "sbal_count", "0x%02x",
  386. rec->sbal_count);
  387. return len;
  388. }
  389. static int
  390. zfcp_hba_dbf_view_format(debug_info_t * id, struct debug_view *view,
  391. char *out_buf, const char *in_buf)
  392. {
  393. struct zfcp_hba_dbf_record *rec = (struct zfcp_hba_dbf_record *)in_buf;
  394. int len = 0;
  395. if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
  396. return 0;
  397. len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
  398. if (isalpha(rec->tag2[0]))
  399. len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2);
  400. if (strncmp(rec->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0)
  401. len += zfcp_hba_dbf_view_response(out_buf + len,
  402. &rec->type.response);
  403. else if (strncmp(rec->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0)
  404. len += zfcp_hba_dbf_view_status(out_buf + len,
  405. &rec->type.status);
  406. else if (strncmp(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
  407. len += zfcp_hba_dbf_view_qdio(out_buf + len, &rec->type.qdio);
  408. len += sprintf(out_buf + len, "\n");
  409. return len;
  410. }
  411. struct debug_view zfcp_hba_dbf_view = {
  412. "structured",
  413. NULL,
  414. &zfcp_dbf_view_header,
  415. &zfcp_hba_dbf_view_format,
  416. NULL,
  417. NULL
  418. };
  419. inline void
  420. _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req,
  421. u32 s_id, u32 d_id, void *buffer, int buflen)
  422. {
  423. struct zfcp_send_ct *send_ct = (struct zfcp_send_ct *)fsf_req->data;
  424. struct zfcp_port *port = send_ct->port;
  425. struct zfcp_adapter *adapter = port->adapter;
  426. struct ct_hdr *header = (struct ct_hdr *)buffer;
  427. struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf;
  428. struct zfcp_san_dbf_record_ct *ct = &rec->type.ct;
  429. unsigned long flags;
  430. spin_lock_irqsave(&adapter->san_dbf_lock, flags);
  431. memset(rec, 0, sizeof(struct zfcp_san_dbf_record));
  432. strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
  433. rec->fsf_reqid = (unsigned long)fsf_req;
  434. rec->fsf_seqno = fsf_req->seq_no;
  435. rec->s_id = s_id;
  436. rec->d_id = d_id;
  437. if (strncmp(tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) {
  438. ct->type.request.cmd_req_code = header->cmd_rsp_code;
  439. ct->type.request.revision = header->revision;
  440. ct->type.request.gs_type = header->gs_type;
  441. ct->type.request.gs_subtype = header->gs_subtype;
  442. ct->type.request.options = header->options;
  443. ct->type.request.max_res_size = header->max_res_size;
  444. } else if (strncmp(tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) {
  445. ct->type.response.cmd_rsp_code = header->cmd_rsp_code;
  446. ct->type.response.revision = header->revision;
  447. ct->type.response.reason_code = header->reason_code;
  448. ct->type.response.reason_code_expl = header->reason_code_expl;
  449. ct->type.response.vendor_unique = header->vendor_unique;
  450. }
  451. ct->payload_size =
  452. min(buflen - (int)sizeof(struct ct_hdr), ZFCP_DBF_CT_PAYLOAD);
  453. memcpy(ct->payload, buffer + sizeof(struct ct_hdr), ct->payload_size);
  454. debug_event(adapter->san_dbf, 3,
  455. rec, sizeof(struct zfcp_san_dbf_record));
  456. spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
  457. }
  458. inline void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
  459. {
  460. struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
  461. struct zfcp_port *port = ct->port;
  462. struct zfcp_adapter *adapter = port->adapter;
  463. _zfcp_san_dbf_event_common_ct("octc", fsf_req,
  464. fc_host_port_id(adapter->scsi_host),
  465. port->d_id, zfcp_sg_to_address(ct->req),
  466. ct->req->length);
  467. }
  468. inline void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
  469. {
  470. struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
  471. struct zfcp_port *port = ct->port;
  472. struct zfcp_adapter *adapter = port->adapter;
  473. _zfcp_san_dbf_event_common_ct("rctc", fsf_req, port->d_id,
  474. fc_host_port_id(adapter->scsi_host),
  475. zfcp_sg_to_address(ct->resp),
  476. ct->resp->length);
  477. }
  478. static inline void
  479. _zfcp_san_dbf_event_common_els(const char *tag, int level,
  480. struct zfcp_fsf_req *fsf_req, u32 s_id,
  481. u32 d_id, u8 ls_code, void *buffer, int buflen)
  482. {
  483. struct zfcp_adapter *adapter = fsf_req->adapter;
  484. struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf;
  485. struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
  486. unsigned long flags;
  487. int offset = 0;
  488. spin_lock_irqsave(&adapter->san_dbf_lock, flags);
  489. do {
  490. memset(rec, 0, sizeof(struct zfcp_san_dbf_record));
  491. if (offset == 0) {
  492. strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
  493. rec->fsf_reqid = (unsigned long)fsf_req;
  494. rec->fsf_seqno = fsf_req->seq_no;
  495. rec->s_id = s_id;
  496. rec->d_id = d_id;
  497. rec->type.els.ls_code = ls_code;
  498. buflen = min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD);
  499. rec->type.els.payload_size = buflen;
  500. memcpy(rec->type.els.payload,
  501. buffer, min(buflen, ZFCP_DBF_ELS_PAYLOAD));
  502. offset += min(buflen, ZFCP_DBF_ELS_PAYLOAD);
  503. } else {
  504. strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
  505. dump->total_size = buflen;
  506. dump->offset = offset;
  507. dump->size = min(buflen - offset,
  508. (int)sizeof(struct zfcp_san_dbf_record)
  509. - (int)sizeof(struct zfcp_dbf_dump));
  510. memcpy(dump->data, buffer + offset, dump->size);
  511. offset += dump->size;
  512. }
  513. debug_event(adapter->san_dbf, level,
  514. rec, sizeof(struct zfcp_san_dbf_record));
  515. } while (offset < buflen);
  516. spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
  517. }
  518. inline void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req)
  519. {
  520. struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
  521. _zfcp_san_dbf_event_common_els("oels", 2, fsf_req,
  522. fc_host_port_id(els->adapter->scsi_host),
  523. els->d_id,
  524. *(u8 *) zfcp_sg_to_address(els->req),
  525. zfcp_sg_to_address(els->req),
  526. els->req->length);
  527. }
  528. inline void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req)
  529. {
  530. struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
  531. _zfcp_san_dbf_event_common_els("rels", 2, fsf_req, els->d_id,
  532. fc_host_port_id(els->adapter->scsi_host),
  533. *(u8 *) zfcp_sg_to_address(els->req),
  534. zfcp_sg_to_address(els->resp),
  535. els->resp->length);
  536. }
  537. inline void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req)
  538. {
  539. struct zfcp_adapter *adapter = fsf_req->adapter;
  540. struct fsf_status_read_buffer *status_buffer =
  541. (struct fsf_status_read_buffer *)fsf_req->data;
  542. int length = (int)status_buffer->length -
  543. (int)((void *)&status_buffer->payload - (void *)status_buffer);
  544. _zfcp_san_dbf_event_common_els("iels", 1, fsf_req, status_buffer->d_id,
  545. fc_host_port_id(adapter->scsi_host),
  546. *(u8 *) status_buffer->payload,
  547. (void *)status_buffer->payload, length);
  548. }
  549. static int
  550. zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view,
  551. char *out_buf, const char *in_buf)
  552. {
  553. struct zfcp_san_dbf_record *rec = (struct zfcp_san_dbf_record *)in_buf;
  554. char *buffer = NULL;
  555. int buflen = 0, total = 0;
  556. int len = 0;
  557. if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
  558. return 0;
  559. len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
  560. len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
  561. rec->fsf_reqid);
  562. len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
  563. rec->fsf_seqno);
  564. len += zfcp_dbf_view(out_buf + len, "s_id", "0x%06x", rec->s_id);
  565. len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x", rec->d_id);
  566. if (strncmp(rec->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) {
  567. len += zfcp_dbf_view(out_buf + len, "cmd_req_code", "0x%04x",
  568. rec->type.ct.type.request.cmd_req_code);
  569. len += zfcp_dbf_view(out_buf + len, "revision", "0x%02x",
  570. rec->type.ct.type.request.revision);
  571. len += zfcp_dbf_view(out_buf + len, "gs_type", "0x%02x",
  572. rec->type.ct.type.request.gs_type);
  573. len += zfcp_dbf_view(out_buf + len, "gs_subtype", "0x%02x",
  574. rec->type.ct.type.request.gs_subtype);
  575. len += zfcp_dbf_view(out_buf + len, "options", "0x%02x",
  576. rec->type.ct.type.request.options);
  577. len += zfcp_dbf_view(out_buf + len, "max_res_size", "0x%04x",
  578. rec->type.ct.type.request.max_res_size);
  579. total = rec->type.ct.payload_size;
  580. buffer = rec->type.ct.payload;
  581. buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
  582. } else if (strncmp(rec->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) {
  583. len += zfcp_dbf_view(out_buf + len, "cmd_rsp_code", "0x%04x",
  584. rec->type.ct.type.response.cmd_rsp_code);
  585. len += zfcp_dbf_view(out_buf + len, "revision", "0x%02x",
  586. rec->type.ct.type.response.revision);
  587. len += zfcp_dbf_view(out_buf + len, "reason_code", "0x%02x",
  588. rec->type.ct.type.response.reason_code);
  589. len +=
  590. zfcp_dbf_view(out_buf + len, "reason_code_expl", "0x%02x",
  591. rec->type.ct.type.response.reason_code_expl);
  592. len +=
  593. zfcp_dbf_view(out_buf + len, "vendor_unique", "0x%02x",
  594. rec->type.ct.type.response.vendor_unique);
  595. total = rec->type.ct.payload_size;
  596. buffer = rec->type.ct.payload;
  597. buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
  598. } else if (strncmp(rec->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 ||
  599. strncmp(rec->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 ||
  600. strncmp(rec->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) {
  601. len += zfcp_dbf_view(out_buf + len, "ls_code", "0x%02x",
  602. rec->type.els.ls_code);
  603. total = rec->type.els.payload_size;
  604. buffer = rec->type.els.payload;
  605. buflen = min(total, ZFCP_DBF_ELS_PAYLOAD);
  606. }
  607. len += zfcp_dbf_view_dump(out_buf + len, "payload",
  608. buffer, buflen, 0, total);
  609. if (buflen == total)
  610. len += sprintf(out_buf + len, "\n");
  611. return len;
  612. }
  613. struct debug_view zfcp_san_dbf_view = {
  614. "structured",
  615. NULL,
  616. &zfcp_dbf_view_header,
  617. &zfcp_san_dbf_view_format,
  618. NULL,
  619. NULL
  620. };
  621. static inline void
  622. _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
  623. struct zfcp_adapter *adapter,
  624. struct scsi_cmnd *scsi_cmnd,
  625. struct zfcp_fsf_req *fsf_req,
  626. unsigned long old_req_id)
  627. {
  628. struct zfcp_scsi_dbf_record *rec = &adapter->scsi_dbf_buf;
  629. struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
  630. unsigned long flags;
  631. struct fcp_rsp_iu *fcp_rsp;
  632. char *fcp_rsp_info = NULL, *fcp_sns_info = NULL;
  633. int offset = 0, buflen = 0;
  634. spin_lock_irqsave(&adapter->scsi_dbf_lock, flags);
  635. do {
  636. memset(rec, 0, sizeof(struct zfcp_scsi_dbf_record));
  637. if (offset == 0) {
  638. strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
  639. strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE);
  640. if (scsi_cmnd != NULL) {
  641. if (scsi_cmnd->device) {
  642. rec->scsi_id = scsi_cmnd->device->id;
  643. rec->scsi_lun = scsi_cmnd->device->lun;
  644. }
  645. rec->scsi_result = scsi_cmnd->result;
  646. rec->scsi_cmnd = (unsigned long)scsi_cmnd;
  647. rec->scsi_serial = scsi_cmnd->serial_number;
  648. memcpy(rec->scsi_opcode, &scsi_cmnd->cmnd,
  649. min((int)scsi_cmnd->cmd_len,
  650. ZFCP_DBF_SCSI_OPCODE));
  651. rec->scsi_retries = scsi_cmnd->retries;
  652. rec->scsi_allowed = scsi_cmnd->allowed;
  653. }
  654. if (fsf_req != NULL) {
  655. fcp_rsp = (struct fcp_rsp_iu *)
  656. &(fsf_req->qtcb->bottom.io.fcp_rsp);
  657. fcp_rsp_info =
  658. zfcp_get_fcp_rsp_info_ptr(fcp_rsp);
  659. fcp_sns_info =
  660. zfcp_get_fcp_sns_info_ptr(fcp_rsp);
  661. rec->type.fcp.rsp_validity =
  662. fcp_rsp->validity.value;
  663. rec->type.fcp.rsp_scsi_status =
  664. fcp_rsp->scsi_status;
  665. rec->type.fcp.rsp_resid = fcp_rsp->fcp_resid;
  666. if (fcp_rsp->validity.bits.fcp_rsp_len_valid)
  667. rec->type.fcp.rsp_code =
  668. *(fcp_rsp_info + 3);
  669. if (fcp_rsp->validity.bits.fcp_sns_len_valid) {
  670. buflen = min((int)fcp_rsp->fcp_sns_len,
  671. ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO);
  672. rec->type.fcp.sns_info_len = buflen;
  673. memcpy(rec->type.fcp.sns_info,
  674. fcp_sns_info,
  675. min(buflen,
  676. ZFCP_DBF_SCSI_FCP_SNS_INFO));
  677. offset += min(buflen,
  678. ZFCP_DBF_SCSI_FCP_SNS_INFO);
  679. }
  680. rec->fsf_reqid = (unsigned long)fsf_req;
  681. rec->fsf_seqno = fsf_req->seq_no;
  682. rec->fsf_issued = fsf_req->issued;
  683. }
  684. rec->type.old_fsf_reqid = old_req_id;
  685. } else {
  686. strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
  687. dump->total_size = buflen;
  688. dump->offset = offset;
  689. dump->size = min(buflen - offset,
  690. (int)sizeof(struct
  691. zfcp_scsi_dbf_record) -
  692. (int)sizeof(struct zfcp_dbf_dump));
  693. memcpy(dump->data, fcp_sns_info + offset, dump->size);
  694. offset += dump->size;
  695. }
  696. debug_event(adapter->scsi_dbf, level,
  697. rec, sizeof(struct zfcp_scsi_dbf_record));
  698. } while (offset < buflen);
  699. spin_unlock_irqrestore(&adapter->scsi_dbf_lock, flags);
  700. }
  701. inline void
  702. zfcp_scsi_dbf_event_result(const char *tag, int level,
  703. struct zfcp_adapter *adapter,
  704. struct scsi_cmnd *scsi_cmnd,
  705. struct zfcp_fsf_req *fsf_req)
  706. {
  707. _zfcp_scsi_dbf_event_common("rslt", tag, level,
  708. adapter, scsi_cmnd, fsf_req, 0);
  709. }
  710. inline void
  711. zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter,
  712. struct scsi_cmnd *scsi_cmnd,
  713. struct zfcp_fsf_req *new_fsf_req,
  714. unsigned long old_req_id)
  715. {
  716. _zfcp_scsi_dbf_event_common("abrt", tag, 1,
  717. adapter, scsi_cmnd, new_fsf_req, old_req_id);
  718. }
  719. inline void
  720. zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
  721. struct scsi_cmnd *scsi_cmnd)
  722. {
  723. struct zfcp_adapter *adapter = unit->port->adapter;
  724. _zfcp_scsi_dbf_event_common(flag == FCP_TARGET_RESET ? "trst" : "lrst",
  725. tag, 1, adapter, scsi_cmnd, NULL, 0);
  726. }
  727. static int
  728. zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view,
  729. char *out_buf, const char *in_buf)
  730. {
  731. struct zfcp_scsi_dbf_record *rec =
  732. (struct zfcp_scsi_dbf_record *)in_buf;
  733. int len = 0;
  734. if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
  735. return 0;
  736. len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
  737. len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2);
  738. len += zfcp_dbf_view(out_buf + len, "scsi_id", "0x%08x", rec->scsi_id);
  739. len += zfcp_dbf_view(out_buf + len, "scsi_lun", "0x%08x",
  740. rec->scsi_lun);
  741. len += zfcp_dbf_view(out_buf + len, "scsi_result", "0x%08x",
  742. rec->scsi_result);
  743. len += zfcp_dbf_view(out_buf + len, "scsi_cmnd", "0x%0Lx",
  744. rec->scsi_cmnd);
  745. len += zfcp_dbf_view(out_buf + len, "scsi_serial", "0x%016Lx",
  746. rec->scsi_serial);
  747. len += zfcp_dbf_view_dump(out_buf + len, "scsi_opcode",
  748. rec->scsi_opcode,
  749. ZFCP_DBF_SCSI_OPCODE,
  750. 0, ZFCP_DBF_SCSI_OPCODE);
  751. len += zfcp_dbf_view(out_buf + len, "scsi_retries", "0x%02x",
  752. rec->scsi_retries);
  753. len += zfcp_dbf_view(out_buf + len, "scsi_allowed", "0x%02x",
  754. rec->scsi_allowed);
  755. if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) {
  756. len += zfcp_dbf_view(out_buf + len, "old_fsf_reqid", "0x%0Lx",
  757. rec->type.old_fsf_reqid);
  758. }
  759. len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
  760. rec->fsf_reqid);
  761. len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
  762. rec->fsf_seqno);
  763. len += zfcp_dbf_stck(out_buf + len, "fsf_issued", rec->fsf_issued);
  764. if (strncmp(rec->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) {
  765. len +=
  766. zfcp_dbf_view(out_buf + len, "fcp_rsp_validity", "0x%02x",
  767. rec->type.fcp.rsp_validity);
  768. len +=
  769. zfcp_dbf_view(out_buf + len, "fcp_rsp_scsi_status",
  770. "0x%02x", rec->type.fcp.rsp_scsi_status);
  771. len +=
  772. zfcp_dbf_view(out_buf + len, "fcp_rsp_resid", "0x%08x",
  773. rec->type.fcp.rsp_resid);
  774. len +=
  775. zfcp_dbf_view(out_buf + len, "fcp_rsp_code", "0x%08x",
  776. rec->type.fcp.rsp_code);
  777. len +=
  778. zfcp_dbf_view(out_buf + len, "fcp_sns_info_len", "0x%08x",
  779. rec->type.fcp.sns_info_len);
  780. len +=
  781. zfcp_dbf_view_dump(out_buf + len, "fcp_sns_info",
  782. rec->type.fcp.sns_info,
  783. min((int)rec->type.fcp.sns_info_len,
  784. ZFCP_DBF_SCSI_FCP_SNS_INFO), 0,
  785. rec->type.fcp.sns_info_len);
  786. }
  787. len += sprintf(out_buf + len, "\n");
  788. return len;
  789. }
  790. struct debug_view zfcp_scsi_dbf_view = {
  791. "structured",
  792. NULL,
  793. &zfcp_dbf_view_header,
  794. &zfcp_scsi_dbf_view_format,
  795. NULL,
  796. NULL
  797. };
  798. /**
  799. * zfcp_adapter_debug_register - registers debug feature for an adapter
  800. * @adapter: pointer to adapter for which debug features should be registered
  801. * return: -ENOMEM on error, 0 otherwise
  802. */
  803. int zfcp_adapter_debug_register(struct zfcp_adapter *adapter)
  804. {
  805. char dbf_name[DEBUG_MAX_NAME_LEN];
  806. /* debug feature area which records recovery activity */
  807. sprintf(dbf_name, "zfcp_%s_erp", zfcp_get_busid_by_adapter(adapter));
  808. adapter->erp_dbf = debug_register(dbf_name, dbfsize, 2,
  809. sizeof(struct zfcp_erp_dbf_record));
  810. if (!adapter->erp_dbf)
  811. goto failed;
  812. debug_register_view(adapter->erp_dbf, &debug_hex_ascii_view);
  813. debug_set_level(adapter->erp_dbf, 3);
  814. /* debug feature area which records HBA (FSF and QDIO) conditions */
  815. sprintf(dbf_name, "zfcp_%s_hba", zfcp_get_busid_by_adapter(adapter));
  816. adapter->hba_dbf = debug_register(dbf_name, dbfsize, 1,
  817. sizeof(struct zfcp_hba_dbf_record));
  818. if (!adapter->hba_dbf)
  819. goto failed;
  820. debug_register_view(adapter->hba_dbf, &debug_hex_ascii_view);
  821. debug_register_view(adapter->hba_dbf, &zfcp_hba_dbf_view);
  822. debug_set_level(adapter->hba_dbf, 3);
  823. /* debug feature area which records SAN command failures and recovery */
  824. sprintf(dbf_name, "zfcp_%s_san", zfcp_get_busid_by_adapter(adapter));
  825. adapter->san_dbf = debug_register(dbf_name, dbfsize, 1,
  826. sizeof(struct zfcp_san_dbf_record));
  827. if (!adapter->san_dbf)
  828. goto failed;
  829. debug_register_view(adapter->san_dbf, &debug_hex_ascii_view);
  830. debug_register_view(adapter->san_dbf, &zfcp_san_dbf_view);
  831. debug_set_level(adapter->san_dbf, 6);
  832. /* debug feature area which records SCSI command failures and recovery */
  833. sprintf(dbf_name, "zfcp_%s_scsi", zfcp_get_busid_by_adapter(adapter));
  834. adapter->scsi_dbf = debug_register(dbf_name, dbfsize, 1,
  835. sizeof(struct zfcp_scsi_dbf_record));
  836. if (!adapter->scsi_dbf)
  837. goto failed;
  838. debug_register_view(adapter->scsi_dbf, &debug_hex_ascii_view);
  839. debug_register_view(adapter->scsi_dbf, &zfcp_scsi_dbf_view);
  840. debug_set_level(adapter->scsi_dbf, 3);
  841. return 0;
  842. failed:
  843. zfcp_adapter_debug_unregister(adapter);
  844. return -ENOMEM;
  845. }
  846. /**
  847. * zfcp_adapter_debug_unregister - unregisters debug feature for an adapter
  848. * @adapter: pointer to adapter for which debug features should be unregistered
  849. */
  850. void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter)
  851. {
  852. debug_unregister(adapter->scsi_dbf);
  853. debug_unregister(adapter->san_dbf);
  854. debug_unregister(adapter->hba_dbf);
  855. debug_unregister(adapter->erp_dbf);
  856. adapter->scsi_dbf = NULL;
  857. adapter->san_dbf = NULL;
  858. adapter->hba_dbf = NULL;
  859. adapter->erp_dbf = NULL;
  860. }
  861. #undef ZFCP_LOG_AREA