WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hmac_tcp_opt_struc.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2021-2023. All rights reserved.
3 * Description: Header file for hmac_tcp_opt_struc.c.
4 * Create: 2021-12-15
5 */
6
7#ifndef __HMAC_TCP_OPT_STRUC_H__
8#define __HMAC_TCP_OPT_STRUC_H__
9
10#ifdef _PRE_WLAN_TCP_OPT
11
12/*****************************************************************************
13 1 其他头文件包含
14*****************************************************************************/
15#include "oal_types.h"
16#include "oal_netbuf_ext.h"
17#include "oam_ext_if.h"
18
19#ifdef __cplusplus
20#if __cplusplus
21extern "C" {
22#endif
23#endif
24
25#undef THIS_FILE_ID
26#define THIS_FILE_ID OAM_FILE_ID_HMAC_TCP_OPT_STRUC_H
27
28/*****************************************************************************
29 2 宏定义
30*****************************************************************************/
31#define HMAC_TCP_STREAM 32
32#define TCPDATA_INFO_MAXNUM 4
33#define TCPDATA_PSH_INFO_MAXNUM (8 * TCPDATA_INFO_MAXNUM)
34
35/*****************************************************************************
36 3 枚举定义
37*****************************************************************************/
38enum {
39 TCP_ACK_FILTER_TYPE = 1,
40 TCP_ACK_DUP_TYPE = 2,
41 TCP_TYPE_ERROR
42};
43typedef osal_u8 oal_tcp_ack_type_enum_uint8;
44/*****************************************************************************
45 4 全局变量声明
46*****************************************************************************/
47
48
49/*****************************************************************************
50 5 消息头定义
51*****************************************************************************/
52
53
54/*****************************************************************************
55 6 消息定义
56*****************************************************************************/
57
58
59/*****************************************************************************
60 7 STRUCT定义
61*****************************************************************************/
62typedef struct _wlan_perform_tcp_impl_ {
63 osal_u64 ull_drop_count;
64 osal_u64 ull_send_count;
65 osal_u64 ull_dup_ack_count;
66} wlan_perform_tcp_impl;
67
68typedef struct _wlan_perform_tcp_impls_ {
69 osal_u32 ack_limit;
70 osal_u64 ull_ignored_count;
71 wlan_perform_tcp_impl tcp_info[HMAC_TCP_STREAM];
72} wlan_perform_tcp_impls;
73
74struct skb_tcp_cb {
75 osal_u16 us_index;
76 osal_u16 reserve;
77 osal_u32 tcp_type;
78 osal_u32 tcp_ack_no;
79};
80
81struct wlan_perform_tcp {
82 /* hcc rx/tx tcp ack param */
83 oal_netbuf_head_stru hcc_ack_queue[HMAC_TCP_STREAM];
84 osal_u32 hcc_ack_count[HMAC_TCP_STREAM]; /* ack num in each queue */
85 osal_u32 hcc_duplicate_ack_count[HMAC_TCP_STREAM];
86 osal_u32 hcc_tcp_ack_no[HMAC_TCP_STREAM];
87 osal_spinlock hmac_tcp_ack_lock;
88};
89struct wlan_tcp_flow {
90 osal_u32 src_ip;
91 osal_u32 dst_ip;
92 osal_u16 src_port;
93 osal_u16 dst_port;
94 osal_u8 protocol;
95};
96struct tcp_list_node {
97 struct osal_list_head list;
98 osal_u32 used; /* 0-free, 1-used */
99 struct wlan_tcp_flow wlan_tcp_info;
100 osal_u32 index;
101 osal_ulong last_ts; /* time of last frame */
102};
103struct wlan_perform_tcp_list {
104 struct tcp_list_node tcp_pool[HMAC_TCP_STREAM];
105 osal_u32 free_count;
106 osal_spinlock tcp_lock; /* lock for tcp pool */
107 osal_spinlock tcp_list_lock; /* lock for tcp list */
108 struct osal_list_head tcp_list;
109};
110
111typedef enum _hmac_tcp_opt_queue_ {
112 HMAC_TCP_ACK_QUEUE = 0,
113 HMAC_TCP_OPT_QUEUE_BUTT
114} hmac_tcp_opt_queue;
115
116typedef osal_u16 (*hmac_trans_cb_func)(void *hmac_device, hmac_tcp_opt_queue type, hcc_chan_type dir, void *data);
117
118/* tcp_ack优化 */
119typedef struct {
120 struct wlan_perform_tcp hmac_tcp_ack;
121 struct wlan_perform_tcp_list hmac_tcp_ack_list;
122 wlan_perform_tcp_impls filter_info;
123 hmac_trans_cb_func filter[HMAC_TCP_OPT_QUEUE_BUTT]; // 过滤处理钩子函数
124 osal_u64 all_ack_count[HMAC_TCP_OPT_QUEUE_BUTT]; // 丢弃的TCP ACK统计
125 osal_u64 drop_count[HMAC_TCP_OPT_QUEUE_BUTT]; // 丢弃的TCP ACK统计
126 oal_netbuf_head_stru data_queue[HMAC_TCP_OPT_QUEUE_BUTT];
127 osal_spinlock data_queue_lock[HMAC_TCP_OPT_QUEUE_BUTT];
128} hmac_tcp_ack_stru;
129
130typedef struct {
131 /* 定制化是否打开tcp ack过滤 */
132 osal_u8 tcp_ack_filter_en;
133 /* 当前状态 */
134 osal_u8 cur_filter_status;
135 osal_u16 rx_filter_throughput_high;
136 osal_u16 rx_filter_throughput_low;
137 osal_u8 tcp_ack_max_num_start_process;
138 osal_u8 resv;
139} mac_tcp_ack_filter_stru;
140extern mac_tcp_ack_filter_stru g_st_tcp_ack_filter;
141
142/*****************************************************************************
143 8 UNION定义
144*****************************************************************************/
145
146
147/*****************************************************************************
148 9 OTHERS定义
149*****************************************************************************/
150
151
152/*****************************************************************************
153 10 函数声明
154*****************************************************************************/
155/*****************************************************************************
156 11 内联函数定义
157*****************************************************************************/
158
159#ifdef __cplusplus
160#if __cplusplus
161}
162#endif
163#endif
164
165#endif /* end of _PRE_WLAN_TCP_OPT */
166
167#endif /* end of hmac_tcp_opt_struc.h */
enum _hcc_chan_type_ hcc_chan_type
static osal_u32 used
Definition hmac_11k.h:542
osal_u8 type
Definition oal_net.h:0
unsigned char osal_u8
Definition osal_types.h:11
unsigned long long osal_u64
Definition osal_types.h:14
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
unsigned long osal_ulong
Definition osal_types.h:15
Definition osal_list.h:39
Definition osal_spinlock.h:18
Definition oal_skbuff.h:73
Definition hal_uart_v151_regs_def.h:38