6#ifndef WLAN_THRUPUT_DEBUG_H
7#define WLAN_THRUPUT_DEBUG_H
42#define param_unref(P) ((P) = (P))
44#ifdef TIMESTAMP_RECORD_DEBUG
45#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
48#define STAT_TIMER_32M_TICK_REG (TIMER2_REG_BASE + 4)
49#define STAT_TIMER_32M_CTRL_REG (TIMER2_REG_BASE + 8)
50#define STAT_TIMER_CTRL_EN 0xc0
53#define STAT_TIME_REG_MAX (0xFFFFFFFF - 1)
54#define stat_time_revert(start, end) (((STAT_TIME_REG_MAX) - (start)) + (end))
55#define stat_get_runtime(start, end) \
56 ((((start) > (end)) ? (stat_time_revert((start), (end))) : ((end) - (start))) / 32)
58#define STAT_CNT_TIME 5000000
62#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
70#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
77#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
81 netbuf->times[index] = stat_get_timer_tick();
90#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION) && defined(TIME_STAMP_TX_DEBUG)
91 stat_record_timestamp(netbuf, index);
100#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION) && defined(TIME_STAMP_RX_DEBUG)
101 stat_record_timestamp(netbuf, index);
110#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
111 osal_u32 curr_time = stat_get_timer_tick();
113 if (netbuf->
resv == 0x5) {
114 wifi_printf(
"%u-%u-%u-%u %u-%u-%u-%u %u-%u-%u-%u %u-%u-%u-%u %u-%u-%u-TL:%u\r\n",
133 stat_get_runtime(curr_time, netbuf->times[
STAT_T18]),
134 stat_get_runtime(curr_time, netbuf->times[
STAT_T0]));
145#ifdef TIME_STAMP_RX_DEBUG
146 host_print_timestamp(netbuf);
154#ifdef TIME_STAMP_TX_DEBUG
155#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
158 osal_u64 curr_time = uapi_get_time_us();
160 host_print_timestamp(netbuf);
162#if (_PRE_OS_VERSION_LINUX != _PRE_OS_VERSION)
164 if (curr_time - host_tx_time > STAT_CNT_TIME) {
166 host_tx_time = curr_time;
#define uapi_reg_read_val32(addr)
Definition common_def.h:96
#define uapi_reg_write(addr, val)
Definition common_def.h:92
void osal_printk(const char *fmt,...)
Log printing function.
Definition osal_debug.c:28
#define wifi_printf(fmt, arg...)
Definition oal_util_hcm.h:44
unsigned long long osal_u64
Definition osal_types.h:14
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
Definition oal_skbuff.h:82
td_u8 resv
Definition oal_skbuff.h:112
#define param_unref(P)
Definition wlan_thruput_debug.h:42
@ DEV_STAT_T3
Definition wlan_thruput_debug.h:37
@ DEV_STAT_T5
Definition wlan_thruput_debug.h:39
@ DEV_STAT_T2
Definition wlan_thruput_debug.h:36
@ DEV_STAT_T6
Definition wlan_thruput_debug.h:40
@ DEV_STAT_T1
Definition wlan_thruput_debug.h:35
@ DEV_STAT_T0
Definition wlan_thruput_debug.h:34
@ DEV_STAT_T4
Definition wlan_thruput_debug.h:38
@ STAT_T5
Definition wlan_thruput_debug.h:17
@ STAT_T15
Definition wlan_thruput_debug.h:27
@ STAT_T10
Definition wlan_thruput_debug.h:22
@ STAT_T12
Definition wlan_thruput_debug.h:24
@ STAT_T9
Definition wlan_thruput_debug.h:21
@ STAT_T13
Definition wlan_thruput_debug.h:25
@ STAT_T2
Definition wlan_thruput_debug.h:14
@ STAT_T6
Definition wlan_thruput_debug.h:18
@ STAT_T11
Definition wlan_thruput_debug.h:23
@ STAT_T4
Definition wlan_thruput_debug.h:16
@ STAT_T0
Definition wlan_thruput_debug.h:12
@ STAT_T16
Definition wlan_thruput_debug.h:28
@ STAT_T18
Definition wlan_thruput_debug.h:30
@ STAT_T1
Definition wlan_thruput_debug.h:13
@ STAT_T3
Definition wlan_thruput_debug.h:15
@ STAT_T17
Definition wlan_thruput_debug.h:29
@ STAT_T8
Definition wlan_thruput_debug.h:20
@ STAT_T14
Definition wlan_thruput_debug.h:26
@ STAT_T7
Definition wlan_thruput_debug.h:19