etd.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. /*
  2. * Extended Trap data component interface file.
  3. *
  4. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  5. *
  6. * Copyright (C) 1999-2020, Broadcom Corporation
  7. *
  8. * Unless you and Broadcom execute a separate written software license
  9. * agreement governing use of this software, this software is licensed to you
  10. * under the terms of the GNU General Public License version 2 (the "GPL"),
  11. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  12. * following added to such license:
  13. *
  14. * As a special exception, the copyright holders of this software give you
  15. * permission to link this software with independent modules, and to copy and
  16. * distribute the resulting executable under terms of your choice, provided that
  17. * you also meet, for each linked independent module, the terms and conditions of
  18. * the license of that module. An independent module is a module which is not
  19. * derived from this software. The special exception does not apply to any
  20. * modifications of the software.
  21. *
  22. * Notwithstanding the above, under no circumstances may you combine this
  23. * software in any way with any other Broadcom software provided under a license
  24. * other than the GPL, without Broadcom's express prior written consent.
  25. *
  26. *
  27. * <<Broadcom-WL-IPTag/Open:>>
  28. *
  29. * $Id: etd.h 715234 2019-05-24 17:06:50Z $
  30. */
  31. #ifndef _ETD_H_
  32. #define _ETD_H_
  33. #if defined(ETD) && !defined(WLETD)
  34. #include <hnd_trap.h>
  35. #endif // endif
  36. #include <bcmutils.h>
  37. /* Tags for structures being used by etd info iovar.
  38. * Related structures are defined in wlioctl.h.
  39. */
  40. #define ETD_TAG_JOIN_CLASSIFICATION_INFO 10 /* general information about join request */
  41. #define ETD_TAG_JOIN_TARGET_CLASSIFICATION_INFO 11 /* per target (AP) join information */
  42. #define ETD_TAG_ASSOC_STATE 12 /* current state of the Device association state machine */
  43. #define ETD_TAG_CHANNEL 13 /* current channel on which the association was performed */
  44. #define ETD_TAG_TOTAL_NUM_OF_JOIN_ATTEMPTS 14 /* number of join attempts (bss_retries) */
  45. #define PSMDBG_REG_READ_CNT_FOR_PSMWDTRAP_V1 3
  46. #define PSMDBG_REG_READ_CNT_FOR_PSMWDTRAP_V2 6
  47. #ifndef _LANGUAGE_ASSEMBLY
  48. #define HND_EXTENDED_TRAP_VERSION 1
  49. #define HND_EXTENDED_TRAP_BUFLEN 512
  50. typedef struct hnd_ext_trap_hdr {
  51. uint8 version; /* Extended trap version info */
  52. uint8 reserved; /* currently unused */
  53. uint16 len; /* Length of data excluding this header */
  54. uint8 data[]; /* TLV data */
  55. } hnd_ext_trap_hdr_t;
  56. typedef enum {
  57. TAG_TRAP_NONE = 0, /* None trap type */
  58. TAG_TRAP_SIGNATURE = 1, /* Processor register dumps */
  59. TAG_TRAP_STACK = 2, /* Processor stack dump (possible code locations) */
  60. TAG_TRAP_MEMORY = 3, /* Memory subsystem dump */
  61. TAG_TRAP_DEEPSLEEP = 4, /* Deep sleep health check failures */
  62. TAG_TRAP_PSM_WD = 5, /* PSM watchdog information */
  63. TAG_TRAP_PHY = 6, /* Phy related issues */
  64. TAG_TRAP_BUS = 7, /* Bus level issues */
  65. TAG_TRAP_MAC_SUSP = 8, /* Mac level suspend issues */
  66. TAG_TRAP_BACKPLANE = 9, /* Backplane related errors */
  67. /* Values 10 through 14 are in use by etd_data info iovar */
  68. TAG_TRAP_PCIE_Q = 15, /* PCIE Queue state during memory trap */
  69. TAG_TRAP_WLC_STATE = 16, /* WLAN state during memory trap */
  70. TAG_TRAP_MAC_WAKE = 17, /* Mac level wake issues */
  71. TAG_TRAP_PHYTXERR_THRESH = 18, /* Phy Tx Err */
  72. TAG_TRAP_HC_DATA = 19, /* Data collected by HC module */
  73. TAG_TRAP_LOG_DATA = 20,
  74. TAG_TRAP_CODE = 21, /* The trap type */
  75. TAG_TRAP_HMAP = 22, /* HMAP violation Address and Info */
  76. TAG_TRAP_PCIE_ERR_ATTN = 23, /* PCIE error attn log */
  77. TAG_TRAP_AXI_ERROR = 24, /* AXI Error */
  78. TAG_TRAP_AXI_HOST_INFO = 25, /* AXI Host log */
  79. TAG_TRAP_AXI_SR_ERROR = 26, /* AXI SR error log */
  80. TAG_TRAP_LAST /* This must be the last entry */
  81. } hnd_ext_tag_trap_t;
  82. typedef struct hnd_ext_trap_bp_err
  83. {
  84. uint32 error;
  85. uint32 coreid;
  86. uint32 baseaddr;
  87. uint32 ioctrl;
  88. uint32 iostatus;
  89. uint32 resetctrl;
  90. uint32 resetstatus;
  91. uint32 resetreadid;
  92. uint32 resetwriteid;
  93. uint32 errlogctrl;
  94. uint32 errlogdone;
  95. uint32 errlogstatus;
  96. uint32 errlogaddrlo;
  97. uint32 errlogaddrhi;
  98. uint32 errlogid;
  99. uint32 errloguser;
  100. uint32 errlogflags;
  101. uint32 itipoobaout;
  102. uint32 itipoobbout;
  103. uint32 itipoobcout;
  104. uint32 itipoobdout;
  105. } hnd_ext_trap_bp_err_t;
  106. #define HND_EXT_TRAP_AXISR_INFO_VER_1 1
  107. typedef struct hnd_ext_trap_axi_sr_err_v1
  108. {
  109. uint8 version;
  110. uint8 pad[3];
  111. uint32 error;
  112. uint32 coreid;
  113. uint32 baseaddr;
  114. uint32 ioctrl;
  115. uint32 iostatus;
  116. uint32 resetctrl;
  117. uint32 resetstatus;
  118. uint32 resetreadid;
  119. uint32 resetwriteid;
  120. uint32 errlogctrl;
  121. uint32 errlogdone;
  122. uint32 errlogstatus;
  123. uint32 errlogaddrlo;
  124. uint32 errlogaddrhi;
  125. uint32 errlogid;
  126. uint32 errloguser;
  127. uint32 errlogflags;
  128. uint32 itipoobaout;
  129. uint32 itipoobbout;
  130. uint32 itipoobcout;
  131. uint32 itipoobdout;
  132. /* axi_sr_issue_debug */
  133. uint32 sr_pwr_control;
  134. uint32 sr_corereset_wrapper_main;
  135. uint32 sr_corereset_wrapper_aux;
  136. uint32 sr_main_gci_status_0;
  137. uint32 sr_aux_gci_status_0;
  138. uint32 sr_dig_gci_status_0;
  139. } hnd_ext_trap_axi_sr_err_v1_t;
  140. #define HND_EXT_TRAP_PSMWD_INFO_VER 1
  141. typedef struct hnd_ext_trap_psmwd_v1 {
  142. uint16 xtag;
  143. uint16 version; /* version of the information following this */
  144. uint32 i32_maccontrol;
  145. uint32 i32_maccommand;
  146. uint32 i32_macintstatus;
  147. uint32 i32_phydebug;
  148. uint32 i32_clk_ctl_st;
  149. uint32 i32_psmdebug[PSMDBG_REG_READ_CNT_FOR_PSMWDTRAP_V1];
  150. uint16 i16_0x1a8; /* gated clock en */
  151. uint16 i16_0x406; /* Rcv Fifo Ctrl */
  152. uint16 i16_0x408; /* Rx ctrl 1 */
  153. uint16 i16_0x41a; /* Rxe Status 1 */
  154. uint16 i16_0x41c; /* Rxe Status 2 */
  155. uint16 i16_0x424; /* rcv wrd count 0 */
  156. uint16 i16_0x426; /* rcv wrd count 1 */
  157. uint16 i16_0x456; /* RCV_LFIFO_STS */
  158. uint16 i16_0x480; /* PSM_SLP_TMR */
  159. uint16 i16_0x490; /* PSM BRC */
  160. uint16 i16_0x500; /* TXE CTRL */
  161. uint16 i16_0x50e; /* TXE Status */
  162. uint16 i16_0x55e; /* TXE_xmtdmabusy */
  163. uint16 i16_0x566; /* TXE_XMTfifosuspflush */
  164. uint16 i16_0x690; /* IFS Stat */
  165. uint16 i16_0x692; /* IFS_MEDBUSY_CTR */
  166. uint16 i16_0x694; /* IFS_TX_DUR */
  167. uint16 i16_0x6a0; /* SLow_CTL */
  168. uint16 i16_0x838; /* TXE_AQM fifo Ready */
  169. uint16 i16_0x8c0; /* Dagg ctrl */
  170. uint16 shm_prewds_cnt;
  171. uint16 shm_txtplufl_cnt;
  172. uint16 shm_txphyerr_cnt;
  173. uint16 pad;
  174. } hnd_ext_trap_psmwd_v1_t;
  175. typedef struct hnd_ext_trap_psmwd {
  176. uint16 xtag;
  177. uint16 version; /* version of the information following this */
  178. uint32 i32_maccontrol;
  179. uint32 i32_maccommand;
  180. uint32 i32_macintstatus;
  181. uint32 i32_phydebug;
  182. uint32 i32_clk_ctl_st;
  183. uint32 i32_psmdebug[PSMDBG_REG_READ_CNT_FOR_PSMWDTRAP_V2];
  184. uint16 i16_0x4b8; /* psm_brwk_0 */
  185. uint16 i16_0x4ba; /* psm_brwk_1 */
  186. uint16 i16_0x4bc; /* psm_brwk_2 */
  187. uint16 i16_0x4be; /* psm_brwk_2 */
  188. uint16 i16_0x1a8; /* gated clock en */
  189. uint16 i16_0x406; /* Rcv Fifo Ctrl */
  190. uint16 i16_0x408; /* Rx ctrl 1 */
  191. uint16 i16_0x41a; /* Rxe Status 1 */
  192. uint16 i16_0x41c; /* Rxe Status 2 */
  193. uint16 i16_0x424; /* rcv wrd count 0 */
  194. uint16 i16_0x426; /* rcv wrd count 1 */
  195. uint16 i16_0x456; /* RCV_LFIFO_STS */
  196. uint16 i16_0x480; /* PSM_SLP_TMR */
  197. uint16 i16_0x500; /* TXE CTRL */
  198. uint16 i16_0x50e; /* TXE Status */
  199. uint16 i16_0x55e; /* TXE_xmtdmabusy */
  200. uint16 i16_0x566; /* TXE_XMTfifosuspflush */
  201. uint16 i16_0x690; /* IFS Stat */
  202. uint16 i16_0x692; /* IFS_MEDBUSY_CTR */
  203. uint16 i16_0x694; /* IFS_TX_DUR */
  204. uint16 i16_0x6a0; /* SLow_CTL */
  205. uint16 i16_0x490; /* psm_brc */
  206. uint16 i16_0x4da; /* psm_brc_1 */
  207. uint16 i16_0x838; /* TXE_AQM fifo Ready */
  208. uint16 i16_0x8c0; /* Dagg ctrl */
  209. uint16 shm_prewds_cnt;
  210. uint16 shm_txtplufl_cnt;
  211. uint16 shm_txphyerr_cnt;
  212. } hnd_ext_trap_psmwd_t;
  213. #define HEAP_HISTOGRAM_DUMP_LEN 6
  214. #define HEAP_MAX_SZ_BLKS_LEN 2
  215. /* Ignore chunks for which there are fewer than this many instances, irrespective of size */
  216. #define HEAP_HISTOGRAM_INSTANCE_MIN 4
  217. /*
  218. * Use the last two length values for chunks larger than this, or when we run out of
  219. * histogram entries (because we have too many different sized chunks) to store "other"
  220. */
  221. #define HEAP_HISTOGRAM_SPECIAL 0xfffeu
  222. #define HEAP_HISTOGRAM_GRTR256K 0xffffu
  223. typedef struct hnd_ext_trap_heap_err {
  224. uint32 arena_total;
  225. uint32 heap_free;
  226. uint32 heap_inuse;
  227. uint32 mf_count;
  228. uint32 stack_lwm;
  229. uint16 heap_histogm[HEAP_HISTOGRAM_DUMP_LEN * 2]; /* size/number */
  230. uint16 max_sz_free_blk[HEAP_MAX_SZ_BLKS_LEN];
  231. } hnd_ext_trap_heap_err_t;
  232. #define MEM_TRAP_NUM_WLC_TX_QUEUES 6
  233. #define HND_EXT_TRAP_WLC_MEM_ERR_VER_V2 2
  234. typedef struct hnd_ext_trap_wlc_mem_err {
  235. uint8 instance;
  236. uint8 associated;
  237. uint8 soft_ap_client_cnt;
  238. uint8 peer_cnt;
  239. uint16 txqueue_len[MEM_TRAP_NUM_WLC_TX_QUEUES];
  240. } hnd_ext_trap_wlc_mem_err_t;
  241. typedef struct hnd_ext_trap_wlc_mem_err_v2 {
  242. uint16 version;
  243. uint16 pad;
  244. uint8 instance;
  245. uint8 stas_associated;
  246. uint8 aps_associated;
  247. uint8 soft_ap_client_cnt;
  248. uint16 txqueue_len[MEM_TRAP_NUM_WLC_TX_QUEUES];
  249. } hnd_ext_trap_wlc_mem_err_v2_t;
  250. #define HND_EXT_TRAP_WLC_MEM_ERR_VER_V3 3
  251. typedef struct hnd_ext_trap_wlc_mem_err_v3 {
  252. uint8 version;
  253. uint8 instance;
  254. uint8 stas_associated;
  255. uint8 aps_associated;
  256. uint8 soft_ap_client_cnt;
  257. uint8 peer_cnt;
  258. uint16 txqueue_len[MEM_TRAP_NUM_WLC_TX_QUEUES];
  259. } hnd_ext_trap_wlc_mem_err_v3_t;
  260. typedef struct hnd_ext_trap_pcie_mem_err {
  261. uint16 d2h_queue_len;
  262. uint16 d2h_req_queue_len;
  263. } hnd_ext_trap_pcie_mem_err_t;
  264. #define MAX_DMAFIFO_ENTRIES_V1 1
  265. #define MAX_DMAFIFO_DESC_ENTRIES_V1 2
  266. #define HND_EXT_TRAP_AXIERROR_SIGNATURE 0xbabebabe
  267. #define HND_EXT_TRAP_AXIERROR_VERSION_1 1
  268. /* Structure to collect debug info of descriptor entry for dma channel on encountering AXI Error */
  269. /* Below three structures are dependant, any change will bump version of all the three */
  270. typedef struct hnd_ext_trap_desc_entry_v1 {
  271. uint32 ctrl1; /* descriptor entry at din < misc control bits > */
  272. uint32 ctrl2; /* descriptor entry at din <buffer count and address extension> */
  273. uint32 addrlo; /* descriptor entry at din <address of data buffer, bits 31:0> */
  274. uint32 addrhi; /* descriptor entry at din <address of data buffer, bits 63:32> */
  275. } dma_dentry_v1_t;
  276. /* Structure to collect debug info about a dma channel on encountering AXI Error */
  277. typedef struct hnd_ext_trap_dma_fifo_v1 {
  278. uint8 valid; /* no of valid desc entries filled, non zero = fifo entry valid */
  279. uint8 direction; /* TX=1, RX=2, currently only using TX */
  280. uint16 index; /* Index of the DMA channel in system */
  281. uint32 dpa; /* Expected Address of Descriptor table from software state */
  282. uint32 desc_lo; /* Low Address of Descriptor table programmed in DMA register */
  283. uint32 desc_hi; /* High Address of Descriptor table programmed in DMA register */
  284. uint16 din; /* rxin / txin */
  285. uint16 dout; /* rxout / txout */
  286. dma_dentry_v1_t dentry[MAX_DMAFIFO_DESC_ENTRIES_V1]; /* Descriptor Entires */
  287. } dma_fifo_v1_t;
  288. typedef struct hnd_ext_trap_axi_error_v1 {
  289. uint8 version; /* version = 1 */
  290. uint8 dma_fifo_valid_count; /* Number of valid dma_fifo entries */
  291. uint16 length; /* length of whole structure */
  292. uint32 signature; /* indicate that its filled with AXI Error data */
  293. uint32 axi_errorlog_status; /* errlog_status from slave wrapper */
  294. uint32 axi_errorlog_core; /* errlog_core from slave wrapper */
  295. uint32 axi_errorlog_lo; /* errlog_lo from slave wrapper */
  296. uint32 axi_errorlog_hi; /* errlog_hi from slave wrapper */
  297. uint32 axi_errorlog_id; /* errlog_id from slave wrapper */
  298. dma_fifo_v1_t dma_fifo[MAX_DMAFIFO_ENTRIES_V1];
  299. } hnd_ext_trap_axi_error_v1_t;
  300. #define HND_EXT_TRAP_MACSUSP_INFO_VER 1
  301. typedef struct hnd_ext_trap_macsusp {
  302. uint16 xtag;
  303. uint8 version; /* version of the information following this */
  304. uint8 trap_reason;
  305. uint32 i32_maccontrol;
  306. uint32 i32_maccommand;
  307. uint32 i32_macintstatus;
  308. uint32 i32_phydebug[4];
  309. uint32 i32_psmdebug[8];
  310. uint16 i16_0x41a; /* Rxe Status 1 */
  311. uint16 i16_0x41c; /* Rxe Status 2 */
  312. uint16 i16_0x490; /* PSM BRC */
  313. uint16 i16_0x50e; /* TXE Status */
  314. uint16 i16_0x55e; /* TXE_xmtdmabusy */
  315. uint16 i16_0x566; /* TXE_XMTfifosuspflush */
  316. uint16 i16_0x690; /* IFS Stat */
  317. uint16 i16_0x692; /* IFS_MEDBUSY_CTR */
  318. uint16 i16_0x694; /* IFS_TX_DUR */
  319. uint16 i16_0x7c0; /* WEP CTL */
  320. uint16 i16_0x838; /* TXE_AQM fifo Ready */
  321. uint16 i16_0x880; /* MHP_status */
  322. uint16 shm_prewds_cnt;
  323. uint16 shm_ucode_dbgst;
  324. } hnd_ext_trap_macsusp_t;
  325. #define HND_EXT_TRAP_MACENAB_INFO_VER 1
  326. typedef struct hnd_ext_trap_macenab {
  327. uint16 xtag;
  328. uint8 version; /* version of the information following this */
  329. uint8 trap_reason;
  330. uint32 i32_maccontrol;
  331. uint32 i32_maccommand;
  332. uint32 i32_macintstatus;
  333. uint32 i32_psmdebug[8];
  334. uint32 i32_clk_ctl_st;
  335. uint32 i32_powerctl;
  336. uint16 i16_0x1a8; /* gated clock en */
  337. uint16 i16_0x480; /* PSM_SLP_TMR */
  338. uint16 i16_0x490; /* PSM BRC */
  339. uint16 i16_0x600; /* TSF CTL */
  340. uint16 i16_0x690; /* IFS Stat */
  341. uint16 i16_0x692; /* IFS_MEDBUSY_CTR */
  342. uint16 i16_0x6a0; /* SLow_CTL */
  343. uint16 i16_0x6a6; /* SLow_FRAC */
  344. uint16 i16_0x6a8; /* fast power up delay */
  345. uint16 i16_0x6aa; /* SLow_PER */
  346. uint16 shm_ucode_dbgst;
  347. uint16 PAD;
  348. } hnd_ext_trap_macenab_t;
  349. #define HND_EXT_TRAP_PHY_INFO_VER_1 (1)
  350. typedef struct hnd_ext_trap_phydbg {
  351. uint16 err;
  352. uint16 RxFeStatus;
  353. uint16 TxFIFOStatus0;
  354. uint16 TxFIFOStatus1;
  355. uint16 RfseqMode;
  356. uint16 RfseqStatus0;
  357. uint16 RfseqStatus1;
  358. uint16 RfseqStatus_Ocl;
  359. uint16 RfseqStatus_Ocl1;
  360. uint16 OCLControl1;
  361. uint16 TxError;
  362. uint16 bphyTxError;
  363. uint16 TxCCKError;
  364. uint16 TxCtrlWrd0;
  365. uint16 TxCtrlWrd1;
  366. uint16 TxCtrlWrd2;
  367. uint16 TxLsig0;
  368. uint16 TxLsig1;
  369. uint16 TxVhtSigA10;
  370. uint16 TxVhtSigA11;
  371. uint16 TxVhtSigA20;
  372. uint16 TxVhtSigA21;
  373. uint16 txPktLength;
  374. uint16 txPsdulengthCtr;
  375. uint16 gpioClkControl;
  376. uint16 gpioSel;
  377. uint16 pktprocdebug;
  378. uint16 PAD;
  379. uint32 gpioOut[3];
  380. } hnd_ext_trap_phydbg_t;
  381. /* unique IDs for separate cores in SI */
  382. #define REGDUMP_MASK_MAC0 BCM_BIT(1)
  383. #define REGDUMP_MASK_ARM BCM_BIT(2)
  384. #define REGDUMP_MASK_PCIE BCM_BIT(3)
  385. #define REGDUMP_MASK_MAC1 BCM_BIT(4)
  386. #define REGDUMP_MASK_PMU BCM_BIT(5)
  387. typedef struct {
  388. uint16 reg_offset;
  389. uint16 core_mask;
  390. } reg_dump_config_t;
  391. #define HND_EXT_TRAP_PHY_INFO_VER 2
  392. typedef struct hnd_ext_trap_phydbg_v2 {
  393. uint8 version;
  394. uint8 len;
  395. uint16 err;
  396. uint16 RxFeStatus;
  397. uint16 TxFIFOStatus0;
  398. uint16 TxFIFOStatus1;
  399. uint16 RfseqMode;
  400. uint16 RfseqStatus0;
  401. uint16 RfseqStatus1;
  402. uint16 RfseqStatus_Ocl;
  403. uint16 RfseqStatus_Ocl1;
  404. uint16 OCLControl1;
  405. uint16 TxError;
  406. uint16 bphyTxError;
  407. uint16 TxCCKError;
  408. uint16 TxCtrlWrd0;
  409. uint16 TxCtrlWrd1;
  410. uint16 TxCtrlWrd2;
  411. uint16 TxLsig0;
  412. uint16 TxLsig1;
  413. uint16 TxVhtSigA10;
  414. uint16 TxVhtSigA11;
  415. uint16 TxVhtSigA20;
  416. uint16 TxVhtSigA21;
  417. uint16 txPktLength;
  418. uint16 txPsdulengthCtr;
  419. uint16 gpioClkControl;
  420. uint16 gpioSel;
  421. uint16 pktprocdebug;
  422. uint32 gpioOut[3];
  423. uint32 additional_regs[1];
  424. } hnd_ext_trap_phydbg_v2_t;
  425. #define HND_EXT_TRAP_PHY_INFO_VER_3 (3)
  426. typedef struct hnd_ext_trap_phydbg_v3 {
  427. uint8 version;
  428. uint8 len;
  429. uint16 err;
  430. uint16 RxFeStatus;
  431. uint16 TxFIFOStatus0;
  432. uint16 TxFIFOStatus1;
  433. uint16 RfseqMode;
  434. uint16 RfseqStatus0;
  435. uint16 RfseqStatus1;
  436. uint16 RfseqStatus_Ocl;
  437. uint16 RfseqStatus_Ocl1;
  438. uint16 OCLControl1;
  439. uint16 TxError;
  440. uint16 bphyTxError;
  441. uint16 TxCCKError;
  442. uint16 TxCtrlWrd0;
  443. uint16 TxCtrlWrd1;
  444. uint16 TxCtrlWrd2;
  445. uint16 TxLsig0;
  446. uint16 TxLsig1;
  447. uint16 TxVhtSigA10;
  448. uint16 TxVhtSigA11;
  449. uint16 TxVhtSigA20;
  450. uint16 TxVhtSigA21;
  451. uint16 txPktLength;
  452. uint16 txPsdulengthCtr;
  453. uint16 gpioClkControl;
  454. uint16 gpioSel;
  455. uint16 pktprocdebug;
  456. uint32 gpioOut[3];
  457. uint16 HESigURateFlagStatus;
  458. uint16 HESigUsRateFlagStatus;
  459. uint32 additional_regs[1];
  460. } hnd_ext_trap_phydbg_v3_t;
  461. /* Phy TxErr Dump Structure */
  462. #define HND_EXT_TRAP_PHYTXERR_INFO_VER 1
  463. #define HND_EXT_TRAP_PHYTXERR_INFO_VER_V2 2
  464. typedef struct hnd_ext_trap_macphytxerr {
  465. uint8 version; /* version of the information following this */
  466. uint8 trap_reason;
  467. uint16 i16_0x63E; /* tsf_tmr_rx_ts */
  468. uint16 i16_0x640; /* tsf_tmr_tx_ts */
  469. uint16 i16_0x642; /* tsf_tmr_rx_end_ts */
  470. uint16 i16_0x846; /* TDC_FrmLen0 */
  471. uint16 i16_0x848; /* TDC_FrmLen1 */
  472. uint16 i16_0x84a; /* TDC_Txtime */
  473. uint16 i16_0xa5a; /* TXE_BytCntInTxFrmLo */
  474. uint16 i16_0xa5c; /* TXE_BytCntInTxFrmHi */
  475. uint16 i16_0x856; /* TDC_VhtPsduLen0 */
  476. uint16 i16_0x858; /* TDC_VhtPsduLen1 */
  477. uint16 i16_0x490; /* psm_brc */
  478. uint16 i16_0x4d8; /* psm_brc_1 */
  479. uint16 shm_txerr_reason;
  480. uint16 shm_pctl0;
  481. uint16 shm_pctl1;
  482. uint16 shm_pctl2;
  483. uint16 shm_lsig0;
  484. uint16 shm_lsig1;
  485. uint16 shm_plcp0;
  486. uint16 shm_plcp1;
  487. uint16 shm_plcp2;
  488. uint16 shm_vht_sigb0;
  489. uint16 shm_vht_sigb1;
  490. uint16 shm_tx_tst;
  491. uint16 shm_txerr_tm;
  492. uint16 shm_curchannel;
  493. uint16 shm_crx_rxtsf_pos;
  494. uint16 shm_lasttx_tsf;
  495. uint16 shm_s_rxtsftmrval;
  496. uint16 i16_0x29; /* Phy indirect address */
  497. uint16 i16_0x2a; /* Phy indirect address */
  498. } hnd_ext_trap_macphytxerr_t;
  499. typedef struct hnd_ext_trap_macphytxerr_v2 {
  500. uint8 version; /* version of the information following this */
  501. uint8 trap_reason;
  502. uint16 i16_0x63E; /* tsf_tmr_rx_ts */
  503. uint16 i16_0x640; /* tsf_tmr_tx_ts */
  504. uint16 i16_0x642; /* tsf_tmr_rx_end_ts */
  505. uint16 i16_0x846; /* TDC_FrmLen0 */
  506. uint16 i16_0x848; /* TDC_FrmLen1 */
  507. uint16 i16_0x84a; /* TDC_Txtime */
  508. uint16 i16_0xa5a; /* TXE_BytCntInTxFrmLo */
  509. uint16 i16_0xa5c; /* TXE_BytCntInTxFrmHi */
  510. uint16 i16_0x856; /* TDC_VhtPsduLen0 */
  511. uint16 i16_0x858; /* TDC_VhtPsduLen1 */
  512. uint16 i16_0x490; /* psm_brc */
  513. uint16 i16_0x4d8; /* psm_brc_1 */
  514. uint16 shm_txerr_reason;
  515. uint16 shm_pctl0;
  516. uint16 shm_pctl1;
  517. uint16 shm_pctl2;
  518. uint16 shm_lsig0;
  519. uint16 shm_lsig1;
  520. uint16 shm_plcp0;
  521. uint16 shm_plcp1;
  522. uint16 shm_plcp2;
  523. uint16 shm_vht_sigb0;
  524. uint16 shm_vht_sigb1;
  525. uint16 shm_tx_tst;
  526. uint16 shm_txerr_tm;
  527. uint16 shm_curchannel;
  528. uint16 shm_crx_rxtsf_pos;
  529. uint16 shm_lasttx_tsf;
  530. uint16 shm_s_rxtsftmrval;
  531. uint16 i16_0x29; /* Phy indirect address */
  532. uint16 i16_0x2a; /* Phy indirect address */
  533. uint8 phyerr_bmac_cnt; /* number of times bmac raised phy tx err */
  534. uint8 phyerr_bmac_rsn; /* bmac reason for phy tx error */
  535. uint16 pad;
  536. uint32 recv_fifo_status[3][2]; /* Rcv Status0 & Rcv Status1 for 3 Rx fifos */
  537. } hnd_ext_trap_macphytxerr_v2_t;
  538. #define HND_EXT_TRAP_PCIE_ERR_ATTN_VER_1 (1u)
  539. #define MAX_AER_HDR_LOG_REGS (4u)
  540. typedef struct hnd_ext_trap_pcie_err_attn_v1 {
  541. uint8 version;
  542. uint8 pad[3];
  543. uint32 err_hdr_logreg1;
  544. uint32 err_hdr_logreg2;
  545. uint32 err_hdr_logreg3;
  546. uint32 err_hdr_logreg4;
  547. uint32 err_code_logreg;
  548. uint32 err_type;
  549. uint32 err_code_state;
  550. uint32 last_err_attn_ts;
  551. uint32 cfg_tlp_hdr[MAX_AER_HDR_LOG_REGS];
  552. } hnd_ext_trap_pcie_err_attn_v1_t;
  553. #define MAX_EVENTLOG_BUFFERS 48
  554. typedef struct eventlog_trapdata_info {
  555. uint32 num_elements;
  556. uint32 seq_num;
  557. uint32 log_arr_addr;
  558. } eventlog_trapdata_info_t;
  559. typedef struct eventlog_trap_buf_info {
  560. uint32 len;
  561. uint32 buf_addr;
  562. } eventlog_trap_buf_info_t;
  563. #if defined(ETD) && !defined(WLETD)
  564. #define ETD_SW_FLAG_MEM 0x00000001
  565. int etd_init(osl_t *osh);
  566. int etd_register_trap_ext_callback(void *cb, void *arg);
  567. int (etd_register_trap_ext_callback_late)(void *cb, void *arg);
  568. uint32 *etd_get_trap_ext_data(void);
  569. uint32 etd_get_trap_ext_swflags(void);
  570. void etd_set_trap_ext_swflag(uint32 flag);
  571. void etd_notify_trap_ext_callback(trap_t *tr);
  572. reg_dump_config_t *etd_get_reg_dump_config_tbl(void);
  573. uint etd_get_reg_dump_config_len(void);
  574. extern bool _etd_enab;
  575. #define ETD_ENAB(pub) (_etd_enab)
  576. #else
  577. #define ETD_ENAB(pub) (0)
  578. #endif /* WLETD */
  579. #endif /* !LANGUAGE_ASSEMBLY */
  580. #endif /* _ETD_H_ */