lpfc_debugfs.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*******************************************************************
  2. * This file is part of the Emulex Linux Device Driver for *
  3. * Fibre Channel Host Bus Adapters. *
  4. * Copyright (C) 2007-2011 Emulex. All rights reserved. *
  5. * EMULEX and SLI are trademarks of Emulex. *
  6. * www.emulex.com *
  7. * *
  8. * This program is free software; you can redistribute it and/or *
  9. * modify it under the terms of version 2 of the GNU General *
  10. * Public License as published by the Free Software Foundation. *
  11. * This program is distributed in the hope that it will be useful. *
  12. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
  13. * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
  14. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
  15. * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
  16. * TO BE LEGALLY INVALID. See the GNU General Public License for *
  17. * more details, a copy of which can be found in the file COPYING *
  18. * included with this package. *
  19. *******************************************************************/
  20. #ifndef _H_LPFC_DEBUG_FS
  21. #define _H_LPFC_DEBUG_FS
  22. #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
  23. /* size of output line, for discovery_trace and slow_ring_trace */
  24. #define LPFC_DEBUG_TRC_ENTRY_SIZE 100
  25. /* nodelist output buffer size */
  26. #define LPFC_NODELIST_SIZE 8192
  27. #define LPFC_NODELIST_ENTRY_SIZE 120
  28. /* dumpHBASlim output buffer size */
  29. #define LPFC_DUMPHBASLIM_SIZE 4096
  30. /* dumpHostSlim output buffer size */
  31. #define LPFC_DUMPHOSTSLIM_SIZE 4096
  32. /* hbqinfo output buffer size */
  33. #define LPFC_HBQINFO_SIZE 8192
  34. /* pciConf */
  35. #define LPFC_PCI_CFG_BROWSE 0xffff
  36. #define LPFC_PCI_CFG_RD_CMD_ARG 2
  37. #define LPFC_PCI_CFG_WR_CMD_ARG 3
  38. #define LPFC_PCI_CFG_SIZE 4096
  39. #define LPFC_PCI_CFG_RD_BUF_SIZE (LPFC_PCI_CFG_SIZE/2)
  40. #define LPFC_PCI_CFG_RD_SIZE (LPFC_PCI_CFG_SIZE/4)
  41. /* queue info */
  42. #define LPFC_QUE_INFO_GET_BUF_SIZE 4096
  43. /* queue acc */
  44. #define LPFC_QUE_ACC_BROWSE 0xffff
  45. #define LPFC_QUE_ACC_RD_CMD_ARG 4
  46. #define LPFC_QUE_ACC_WR_CMD_ARG 6
  47. #define LPFC_QUE_ACC_BUF_SIZE 4096
  48. #define LPFC_QUE_ACC_SIZE (LPFC_QUE_ACC_BUF_SIZE/2)
  49. #define LPFC_IDIAG_EQ 1
  50. #define LPFC_IDIAG_CQ 2
  51. #define LPFC_IDIAG_MQ 3
  52. #define LPFC_IDIAG_WQ 4
  53. #define LPFC_IDIAG_RQ 5
  54. /* doorbell acc */
  55. #define LPFC_DRB_ACC_ALL 0xffff
  56. #define LPFC_DRB_ACC_RD_CMD_ARG 1
  57. #define LPFC_DRB_ACC_WR_CMD_ARG 2
  58. #define LPFC_DRB_ACC_BUF_SIZE 256
  59. #define LPFC_DRB_EQCQ 1
  60. #define LPFC_DRB_MQ 2
  61. #define LPFC_DRB_WQ 3
  62. #define LPFC_DRB_RQ 4
  63. #define LPFC_DRB_MAX 4
  64. #define SIZE_U8 sizeof(uint8_t)
  65. #define SIZE_U16 sizeof(uint16_t)
  66. #define SIZE_U32 sizeof(uint32_t)
  67. struct lpfc_debug {
  68. char *i_private;
  69. char op;
  70. #define LPFC_IDIAG_OP_RD 1
  71. #define LPFC_IDIAG_OP_WR 2
  72. char *buffer;
  73. int len;
  74. };
  75. struct lpfc_debugfs_trc {
  76. char *fmt;
  77. uint32_t data1;
  78. uint32_t data2;
  79. uint32_t data3;
  80. uint32_t seq_cnt;
  81. unsigned long jif;
  82. };
  83. struct lpfc_idiag_offset {
  84. uint32_t last_rd;
  85. };
  86. #define LPFC_IDIAG_CMD_DATA_SIZE 8
  87. struct lpfc_idiag_cmd {
  88. uint32_t opcode;
  89. #define LPFC_IDIAG_CMD_PCICFG_RD 0x00000001
  90. #define LPFC_IDIAG_CMD_PCICFG_WR 0x00000002
  91. #define LPFC_IDIAG_CMD_PCICFG_ST 0x00000003
  92. #define LPFC_IDIAG_CMD_PCICFG_CL 0x00000004
  93. #define LPFC_IDIAG_CMD_QUEACC_RD 0x00000011
  94. #define LPFC_IDIAG_CMD_QUEACC_WR 0x00000012
  95. #define LPFC_IDIAG_CMD_QUEACC_ST 0x00000013
  96. #define LPFC_IDIAG_CMD_QUEACC_CL 0x00000014
  97. #define LPFC_IDIAG_CMD_DRBACC_RD 0x00000021
  98. #define LPFC_IDIAG_CMD_DRBACC_WR 0x00000022
  99. #define LPFC_IDIAG_CMD_DRBACC_ST 0x00000023
  100. #define LPFC_IDIAG_CMD_DRBACC_CL 0x00000024
  101. uint32_t data[LPFC_IDIAG_CMD_DATA_SIZE];
  102. };
  103. struct lpfc_idiag {
  104. uint32_t active;
  105. struct lpfc_idiag_cmd cmd;
  106. struct lpfc_idiag_offset offset;
  107. void *ptr_private;
  108. };
  109. #endif
  110. /* Mask for discovery_trace */
  111. #define LPFC_DISC_TRC_ELS_CMD 0x1 /* Trace ELS commands */
  112. #define LPFC_DISC_TRC_ELS_RSP 0x2 /* Trace ELS response */
  113. #define LPFC_DISC_TRC_ELS_UNSOL 0x4 /* Trace ELS rcv'ed */
  114. #define LPFC_DISC_TRC_ELS_ALL 0x7 /* Trace ELS */
  115. #define LPFC_DISC_TRC_MBOX_VPORT 0x8 /* Trace vport MBOXs */
  116. #define LPFC_DISC_TRC_MBOX 0x10 /* Trace other MBOXs */
  117. #define LPFC_DISC_TRC_MBOX_ALL 0x18 /* Trace all MBOXs */
  118. #define LPFC_DISC_TRC_CT 0x20 /* Trace disc CT requests */
  119. #define LPFC_DISC_TRC_DSM 0x40 /* Trace DSM events */
  120. #define LPFC_DISC_TRC_RPORT 0x80 /* Trace rport events */
  121. #define LPFC_DISC_TRC_NODE 0x100 /* Trace ndlp state changes */
  122. #define LPFC_DISC_TRC_DISCOVERY 0xef /* common mask for general
  123. * discovery */
  124. #endif /* H_LPFC_DEBUG_FS */