1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: Device pkt diagnose interface. 15 */ 16 17 #ifndef DMAC_PKT_DEBUG_ROM_H 18 #define DMAC_PKT_DEBUG_ROM_H 19 20 #include "osal_types.h" 21 #include "frw_rom_cb_rom.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif 28 29 typedef enum { 30 DBG_DIR_RX = 0, 31 DBG_DIR_TX, 32 DBG_DIR_NUM 33 } dmac_pkt_dbg_dir_enum; 34 35 typedef enum { 36 DBG_RX_START = 0, 37 DBG_RX_DMAC_IN = DBG_RX_START, 38 DBG_RX_DMAC2HCC, 39 DBG_RX_END = DBG_RX_DMAC2HCC, 40 DBG_RX_POS_NUM 41 } dmac_pkt_dbg_rx_pos_enum; 42 43 typedef enum { 44 DBG_TX_START = 0, 45 DBG_TX_DMAC_IN = DBG_TX_START, 46 DBG_TX_DIR_TX, 47 DBG_TX_NO_QUE, 48 DBG_TX_ENQUE, 49 DBG_TX_DEQUE, 50 DBG_TX_COMP_IN, 51 DBG_TX_COMP_FREE, 52 DBG_TX_ERR_FREE, 53 DBG_TX_RETRY_DROP, 54 DBG_TX_CACHE_DROP, 55 DBG_TX_MGMT_RETRY, 56 DBG_TX_DMAC2HAL, 57 DBG_TX_END = DBG_TX_DMAC2HAL, 58 DBG_TX_POS_NUM 59 } dmac_pkt_dbg_tx_pos_enum; 60 61 typedef enum { 62 DBG_DMAC = 0, 63 DBG_HCC, 64 DBG_DEVICE_ALL, 65 DBG_MODULE_NUM 66 } dmac_pkt_dbg_module_enum; 67 68 typedef osal_void (*dmac_pkt_dbg_cb)(osal_u8 module_id, osal_u8 dir, osal_u8 pos_num, osal_char *pos, osal_void *skb); 69 osal_void pkt_dbg(osal_u8 module_id, osal_u8 dir, osal_u8 pos_num, osal_char *pos, osal_void *skb); 70 71 #ifdef __cplusplus 72 #if __cplusplus 73 } 74 #endif 75 #endif 76 77 #endif /* end of dmac_pkt_debug_rom.h */