| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2005-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: brdc_dbg.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/6 $ |
|---|
| 12 | * $brcm_Date: 10/6/11 2:00p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/commonutils/rdc/7425/brdc_dbg.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/6 10/6/11 2:00p hongtaoz |
|---|
| 21 | * SW7425-1425: added RDC per slot timestamp log; |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/5 3/24/09 5:29p albertl |
|---|
| 24 | * PR52513: Moved RDC debug globals into hList structure. |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/4 3/13/09 11:45a rpan |
|---|
| 27 | * PR52203: Add API for dynamically enable/disable RUL capture. |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/3 2/28/08 5:02p jessem |
|---|
| 30 | * PR 38623: Added RDMA blockout support. |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/2 6/13/05 3:14p pntruong |
|---|
| 33 | * PR15862: Added rdc rul logging for debug. |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/1 2/22/05 5:22p jasonh |
|---|
| 36 | * PR 13937: Adding DBG functions to RDC so that a list can be traversed |
|---|
| 37 | * and displayed. |
|---|
| 38 | * |
|---|
| 39 | ***************************************************************************/ |
|---|
| 40 | #ifndef BRDC_DBG_H__ |
|---|
| 41 | #define BRDC_DBG_H__ |
|---|
| 42 | |
|---|
| 43 | #include "brdc.h" |
|---|
| 44 | |
|---|
| 45 | /* #define BRDC_USE_CAPTURE_BUFFER */ |
|---|
| 46 | |
|---|
| 47 | #ifdef __cplusplus |
|---|
| 48 | extern "C" { |
|---|
| 49 | #endif |
|---|
| 50 | |
|---|
| 51 | /* describes the possible entries in a register DMA list */ |
|---|
| 52 | typedef enum |
|---|
| 53 | { |
|---|
| 54 | BRDC_DBG_ListEntry_eCommand, |
|---|
| 55 | BRDC_DBG_ListEntry_eRegister, |
|---|
| 56 | BRDC_DBG_ListEntry_eData, |
|---|
| 57 | BRDC_DBG_ListEntry_eEnd |
|---|
| 58 | |
|---|
| 59 | } BRDC_DBG_ListEntry; |
|---|
| 60 | |
|---|
| 61 | /* debug functions */ |
|---|
| 62 | |
|---|
| 63 | BERR_Code BRDC_DBG_SetList( |
|---|
| 64 | BRDC_List_Handle hList |
|---|
| 65 | ); |
|---|
| 66 | |
|---|
| 67 | BERR_Code BRDC_DBG_SetList_isr( |
|---|
| 68 | BRDC_List_Handle hList |
|---|
| 69 | ); |
|---|
| 70 | |
|---|
| 71 | BERR_Code BRDC_DBG_GetListEntry( |
|---|
| 72 | BRDC_List_Handle hList, |
|---|
| 73 | BRDC_DBG_ListEntry *peEntry, |
|---|
| 74 | uint32_t aulArgs[4] |
|---|
| 75 | ); |
|---|
| 76 | |
|---|
| 77 | BERR_Code BRDC_DBG_GetListEntry_isr( |
|---|
| 78 | BRDC_List_Handle hList, |
|---|
| 79 | BRDC_DBG_ListEntry *peEntry, |
|---|
| 80 | uint32_t aulArgs[4] |
|---|
| 81 | ); |
|---|
| 82 | |
|---|
| 83 | BERR_Code BRDC_DBG_DumpList( |
|---|
| 84 | BRDC_List_Handle hList |
|---|
| 85 | ); |
|---|
| 86 | |
|---|
| 87 | typedef struct BRDC_DBG_CaptureBuffer { |
|---|
| 88 | uint8_t *mem; |
|---|
| 89 | int size; /* size of mem in bytes */ |
|---|
| 90 | int readptr, writeptr; /* offsets into mem */ |
|---|
| 91 | |
|---|
| 92 | /* stats */ |
|---|
| 93 | int num_ruls; |
|---|
| 94 | int total_bytes; |
|---|
| 95 | |
|---|
| 96 | bool enable; /* enable capture */ |
|---|
| 97 | } BRDC_DBG_CaptureBuffer; |
|---|
| 98 | |
|---|
| 99 | BERR_Code |
|---|
| 100 | BRDC_DBG_CreateCaptureBuffer(BRDC_DBG_CaptureBuffer *buffer, int size); |
|---|
| 101 | void |
|---|
| 102 | BRDC_DBG_DestroyCaptureBuffer(BRDC_DBG_CaptureBuffer *buffer); |
|---|
| 103 | void |
|---|
| 104 | BRDC_DBG_WriteCapture_isr(BRDC_DBG_CaptureBuffer *buffer, BRDC_Slot_Handle hSlot, BRDC_List_Handle hList); |
|---|
| 105 | |
|---|
| 106 | /* prefixes */ |
|---|
| 107 | #define BRDC_DBG_RUL 1 |
|---|
| 108 | #define BRDC_DBG_BVN_ERROR 2 |
|---|
| 109 | #define BRDC_DBG_RUL_TIMESTAMP 3 |
|---|
| 110 | |
|---|
| 111 | /* log errors from throughout the system */ |
|---|
| 112 | void BRDC_DBG_LogErrorCode_isr(BRDC_Handle rdc, uint32_t prefix, const char *str); |
|---|
| 113 | |
|---|
| 114 | /* called by application */ |
|---|
| 115 | void BRDC_DBG_ReadCapture_isr(BRDC_Handle rdc, uint8_t *mem, int size, int *read); |
|---|
| 116 | |
|---|
| 117 | void BRDC_DBG_EnableCapture_isr(BRDC_Handle rdc, bool enable); |
|---|
| 118 | |
|---|
| 119 | #ifdef __cplusplus |
|---|
| 120 | } |
|---|
| 121 | #endif |
|---|
| 122 | |
|---|
| 123 | #endif /* #ifndef BRDC_DBG_H__ */ |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | /* end of file */ |
|---|