• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: vap / user common info for host and device
15  */
16 
17 #ifndef __ALG_COMMON_ROM_H__
18 #define __ALG_COMMON_ROM_H__
19 
20 #include "alg_autorate_common_rom.h"
21 #include "alg_common_macros_rom.h"
22 #include "hal_commom_ops_type_rom.h"
23 #include "hal_ops_common_rom.h"
24 #include "oal_types_device_rom.h"
25 #include "osal_types.h"
26 #include "wlan_types_base_rom.h"
27 
28 #ifdef __cplusplus
29 #if __cplusplus
30 extern "C" {
31 #endif
32 #endif
33 /*****************************************************************************
34   3 结构体
35 *****************************************************************************/
36 /* GLA功能 各算法ID,唯一识别某个算法,ID=2的整数值 */
37 typedef enum {
38     ALG_GLA_ID_AUTORATE    = 0x00000001,
39     ALG_GLA_ID_RTS         = 0x00000002,
40     ALG_GLA_ID_AGGR        = 0x00000004,
41     ALG_GLA_ID_DBAC        = 0x00000008,
42     ALG_GLA_ID_TPC         = 0x00000010,
43     ALG_GLA_ID_TRAFFIC_CTL = 0x00000020,
44     ALG_GLA_ID_SCHEDULE    = 0x00000040,
45     ALG_GLA_ID_INTF_DET   = 0x00000080,
46     ALG_GLA_ID_WEAK_IMMUNE = 0x00000100,
47     ALG_GLA_ID_CCA         = 0x00000200,
48     ALG_GLA_ID_EDCA        = 0x00000400,
49     ALG_GLA_ID_TEMP_PRTECT = 0x00000800,
50     ALG_GLA_ID_TXBF        = 0x00001000,
51 
52     ALG_GLA_ID_BUTT
53 } alg_gla_id_enum;
54 typedef osal_u32 alg_gla_id_enum_uint32;
55 
56 /* TXMODE LOG 算法参数枚举,参数值 */
57 typedef struct {
58     mac_alg_cfg_enum_uint16 alg_cfg;      /* 配置命令枚举 */
59     osal_u8 ac_no;                       /* AC类型 */
60     osal_u8 mac_addr[WLAN_MAC_ADDR_LEN]; /* MAC地址 */
61     osal_u8 auc_resv1[1];
62     osal_u16 value; /* 配置参数值 */
63 } mac_ioctl_alg_txbf_log_param_stru;
64 
65 /* 算法配置命令接口 */
66 typedef struct {
67     osal_u8 argc;
68     osal_u8 argv_offset[DMAC_ALG_CONFIG_MAX_ARG];
69 } mac_ioctl_alg_config_stru;
70 
71 /* TPC LOG 算法参数枚举,参数值 */
72 typedef struct {
73     mac_alg_cfg_enum_uint16 alg_cfg;      /* 配置命令枚举 */
74     osal_u8 mac_addr[WLAN_MAC_ADDR_LEN]; /* MAC地址 */
75     osal_u8 ac_no;                       /* AC类型 */
76     osal_u8 rev[1];
77     osal_u16 value;                      /* 配置参数值 */
78     osal_char *frame_name;               /* 获取特定帧功率使用该变量 */
79 } mac_ioctl_alg_tpc_log_param_stru;
80 
81 /* cca opt LOG 算法参数枚举,参数值 */
82 typedef struct {
83     mac_alg_cfg_enum_uint16 alg_cfg; /* 配置命令枚举 */
84     osal_u16 value;                 /* 统计总时间 */
85 } mac_ioctl_alg_intfdet_log_param_stru;
86 
87 /* 传到device侧的消息内容 */
88 typedef struct {
89     oal_bool_enum_uint8 coch_intf_state; /* 同频干扰的检测状态 */
90     oal_bool_enum_uint8 coch_intf_state_last; /* 指示之前同频干扰的检测状态 */
91     hal_alg_intf_det_mode_enum_uint8 adjch_intf_type; /* 指示邻频干扰模式 */
92     hal_alg_intf_det_mode_enum_uint8 adjch_intf_type_last; /* 指示之前的邻频干扰模式 */
93     alg_intf_det_type_enum_uint8 intf_det_type;    /* 通知device时指示当前干扰检测类型 */
94     osal_u8 resv[3];                    /* 对齐 */
95     osal_u16 duty_cyc_ratio_20;         /* pri20干扰繁忙度(千分之x) */
96     osal_u16 duty_cyc_ratio_sec20;      /* sec20干扰繁忙度(千分之x) */
97 } alg_intf_det_notify_info_stru;
98 
99 typedef osal_u32 (*p_alg_anti_intf_switch_func)(hal_to_dmac_device_stru *hal_device, oal_bool_enum_uint8 alg_enable);
100 typedef osal_u32 (*p_alg_anti_intf_tx_time_notify_func)(hal_to_dmac_device_stru *hal_device);
101 typedef osal_u32 (*p_alg_bfee_report_pow_adjust_notify)(hal_to_dmac_device_stru *hal_device);
102 typedef enum {
103     ALG_TPC_QUERY_CONFIG_PARA = 0,
104     ALG_TPC_QUERY_STATUS = 1,
105     ALG_TPC_QUERY_ALL_POWER = 2,
106     ALG_TPC_QUERY_TPC_CODE_TABLE = 3,
107     ALG_TPC_QUERY_ACK_MODE_OPEN = 4,
108     ALG_TPC_QUERY_ACK_MODE_CLOSE = 5,
109     ALG_TPC_QUERY_STUB_INTF = 6,
110     ALG_TPC_QUERY_STUB_INTF_CLEAR = 7,
111     ALG_TPC_QUERY_STUB_OVER_TEMP = 8,
112     ALG_TPC_QUERY_STUB_OVER_TEMP_CLEAR = 9,
113     ALG_TPC_QUERY_STUB_CHANGE_CHANNEL = 10,
114     ALG_TPC_QUERY_STUB_ACK_RSSI_NEAR = 11,
115     ALG_TPC_QUERY_STUB_ACK_RSSI_FAR = 12,
116     ALG_TPC_QUERY_STUB_ACK_RSSI_CLEAR = 13,
117     ALG_TPC_QUERY_TYPE_BUTT
118 } alg_tpc_query_type_enum;
119 typedef enum {
120     ALG_TPC_DBG_OFF  = 0,    /* 关闭调试日志 */
121     ALG_TPC_DBG_DIST = 1,    /* 只在距离变化时打印 */
122     ALG_TPC_DBG_PROBE = 2,   /* 打印探测相关信息 */
123     ALG_TPC_DBG_PKT  = 3,    /* 打印每一包信息 */
124     ALG_TPC_DBG_BUTT
125 } alg_tpc_dbg_enum;
126 typedef osal_u8 alg_tpc_dbg_enum_uint8;
127 typedef enum {
128     CFG_DBAC_LED_VAP_IDX = 0,
129     CFG_DBAC_FLW_VAP_IDX,
130 
131     CFG_DBAC_VAP_IDX_BUTT
132 } alg_dbac_vap_idx_enum;
133 typedef osal_u8 alg_dbac_vap_idx_enum_uint8;
134 /* TPC需要从host同步参数的结构体 */
135 typedef struct {
136     /* para start */
137     osal_s8 tpc_normal2near_thres;
138     osal_s8 tpc_near2normal_thres;
139     osal_s8 tpc_normal2far_thres;
140     osal_s8 tpc_far2normal_thres;
141     osal_s8 near_distance_rssi;
142     osal_s8 far_distance_rssi;
143     osal_u8 tpc_normal2near_rate_gap_cnt;
144     osal_u8 tpc_normal2near_rate_gap;
145     osal_u8 tpc_normal2far_rate_gap;
146     osal_u8 tpc_ack_mode : 1;
147     osal_u8 fix_power_level : 3;
148     osal_u8 data_rf_limit_enable : 1;
149     osal_u8 resv_bit : 3;
150     osal_u8 resv[2];
151     /* para end */
152 } alg_param_sync_tpc_stru;
153 typedef struct {
154     osal_u16 config_dscr_restore_thres; /* 强制配置的预留长度,如果不为0,优先使用配置值 */
155     osal_u16 dscr_default_thres;        /* 默认预留长度,算法未打开时使用默认值 */
156     osal_u16 pkt_low_thres;
157     osal_u16 pkt_high_thres;
158     osal_u16 pkt_busy_thres;
159     osal_u16 dscr_min_thres;
160     osal_u16 dscr_low_thres;
161     osal_u16 dscr_high_thres;
162     osal_u16 dscr_busy_thres;
163     osal_u16 resv[1];
164 } alg_traffic_rx_ctl_stru;
165 
166 typedef struct {
167     osal_u8 flowctl_flag; /* true: dont send, false: send */
168     osal_u8 resv[1];
169     osal_u16 tx_continue_on_cycle; /* if flowctl keep on, inc 1 */
170     osal_u16 tx_on_cnt; /* flowctl count */
171     osal_u16 tx_off_cnt; /* flowctl count */
172     osal_u16 tx_stop_thres;
173     osal_u16 tx_start_thres;
174 } alg_traffic_tx_ctl_stru;
175 
176 typedef struct {
177     osal_u8 vap_id;
178     osal_u8 hal_vap_id;
179     osal_u8 vap_state;
180     osal_u8 hal_vap_state;
181     osal_u8 vap_ppdu_count[HAL_TX_QUEUE_NUM];
182     osal_u8 vap_mpdu_count[HAL_TX_QUEUE_NUM];
183     osal_u8 vap_fake_ppdu_count[HAL_TX_QUEUE_NUM];
184     osal_u8 vap_fake_mpdu_count[HAL_TX_QUEUE_NUM];
185 } alg_traffic_vap_stats;
186 
187 typedef struct {
188     /* tx_stats */
189     osal_u32 netbuf_alloc_fail;
190     osal_u32 netbuf_alloc_succ;
191     osal_u32 netbuf_release;
192     osal_u32 tx_max_flowcnt_cycle;
193 } alg_traffic_stats_stru;
194 
195 typedef struct {
196     /* rx_stats */
197     osal_u8  normal_used;
198     osal_u8  normal_free;
199     osal_u8  small_free;
200     osal_u8  high_free;
201     osal_u8  rx_normal_thres;
202     osal_u8  rx_normal_element_cnt;
203     osal_u8  rx_small_thres;
204     osal_u8  rx_small_element_cnt;
205     osal_u32 rx_normal_q_empty;
206     osal_u32 rx_small_q_empty;
207     osal_u32 rx_high_q_empty;
208     osal_u16 rx_normal_smooth_dscr;
209     osal_u16 rx_normal_smooth_pkt;
210     osal_u16 rx_small_smooth_dscr;
211     osal_u16 rx_small_smooth_pkt;
212     /* vap stats */
213     alg_traffic_vap_stats vap_stats[2];
214     /* hw stats */
215     osal_u8 hw_mpdu_count[HAL_TX_QUEUE_NUM];
216     osal_u8 hw_ppdu_count[HAL_TX_QUEUE_NUM];
217 } alg_traffic_status_stru;
218 
219 typedef struct {
220     wlan_tpc_mode_enum_uint8 tpc_mode;         /* TPC当前工作模式 */
221     osal_u8 is_over_temp      : 1;             /* 是否超温 */
222     osal_u8 is_tpc_registered : 1;             /* 算法注册标志 */
223     osal_u8 resvbit1          : 2;
224     wlan_tpc_mode_enum_uint8 tpc_cfg_mode : 4; /* 存储TPC配置的工作模式 */
225     alg_tpc_dbg_enum_uint8 debug_flag;         /* 调试开关等级 */
226     osal_u8 fix_pwr_code;          /* 固定发送功率码 */
227     osal_u8 adj_intf_mode : 4;    /* CCA上报的邻频干扰模式 */
228     osal_u8 co_intf_mode : 1;     /* 同频干扰模式通知 */
229     osal_u8 test_nearackrssi : 1;      /* 上板ST使用 */
230     osal_u8 test_farackrssi : 1;       /* 上板ST使用 */
231     osal_u8 need_distance_change : 1;  /* 需要触发一次距离变化 */
232     osal_u8 control_frm_power_level;
233     osal_u8 intrf_mode_flag;
234     osal_u8 rev;
235 #ifdef _PRE_WLAN_TPC_DO_PROBE
236     osal_u8 min_probe_intvl_pktnum;
237     osal_u8 max_probe_intvl_pktnum;
238     /* 指向已分配地址空间的TPC可调速率门限值 */
239     alg_tpc_target_rate_index_stru alg_tpc_target_rate_index_dev;
240 #endif
241 } alg_tpc_common_info_stru;
242 typedef struct {
243     osal_s16 tpc_rssi[ALG_TPC_RSSI_BUTT];
244     osal_u8 resv;
245     osal_u8 wlan_bw;             /* 带宽 */
246 } alg_tpc_user_rssi_stru;
247 /* 用户距离信息结构体 */
248 typedef struct {
249     wlan_user_distance_enum_uint8 distance_id;
250     oal_bool_enum_uint8 distance_id_valid;
251     wlan_user_distance_enum_uint8 rssi_distance;   /* 根据当前rssi判断用户的距离 */
252     wlan_user_distance_enum_uint8 last_distance_id;
253     osal_u8 low_rate_wait_count;                  /* 低速率保持次数 */
254     osal_u8 resv[3];
255 } alg_tpc_user_distance_stru;
256 typedef struct {
257     osal_s16 assoc_id;
258     osal_u8 per;
259     osal_u8 best_rate_index;
260     alg_tpc_user_rssi_stru rssi;
261     alg_tpc_user_distance_stru distance;
262 } alg_tpc_user_query_status_stru;
263 typedef struct {
264     osal_u8 traffic_ctl_enable;          /* 拥塞控制开关 */
265     osal_u8 log_debug_enable;            /* oam日志记录开关 */
266     osal_u8 tx_traffic_ctl_enable;       /* TX方向拥塞控制开关 */
267     osal_u8 rx_traffic_ctl_enable;       /* RX方向拥塞控制开关 */
268     osal_u16 traffic_ctl_cycle_ms;       /* 拥塞控制定时器周期 */
269 
270     osal_u8 window_size;                 /* 发送,回滞区间 */
271     osal_u8 netbuf_reserve_size;         /* 发送,预留长度 */
272     osal_u8 busy_ctl;                    /* 发送, 控制是否需要根据业务忙碌减少拥塞控制次数 */
273     osal_u8 shift_size;                  /* 接收,控制平滑系数 */
274     osal_u16 tx_max_flowctl_cycle;       /* 控制发送方向最长持续流控次数,等于0xFFFF时表示不限制次数 */
275     alg_traffic_rx_ctl_stru rx_ctl[HAL_RX_DSCR_QUEUE_ID_BUTT];     /* 接收拥塞控制阈值和参数 */
276 } alg_param_sync_traffic_ctl_stru;
277 typedef struct {
278     osal_u16 vap_tbtt_channel_mismatch;
279     osal_u16 vap_tx_cb_check_mismatch_cnt;
280     osal_u16 vap_tx_pause_cnt;
281     osal_u16 vap_tx_vap_id_mismatch_cnt;
282     osal_u16 vap_tx_noa_start_bias_cnt;
283     osal_u16 vap_tx_noa_end_bias_cnt;
284     osal_u16 vap_one_packet_send_fail_cnt;
285     osal_u16 vap_preempt_cnt;
286     osal_u16 vap_tbtt_isr_cnt;
287     osal_u16 vap_channel_switch_cnt;
288 } alg_dbac_vap_stats_info;
289 
290 typedef struct {
291     osal_u16 sync_sta_tsf_to_ap_cnt;
292     osal_u16 sync_go_tsf_to_sta_cnt;
293     osal_u16 tx_netbuf_alloc_fail_cnt;
294     osal_u16 led_tbtt_channel_err_cnt;
295     osal_u16 noa_slot_num_err_cnt;
296     osal_u16 timer_isr_cnt;
297     osal_u16 noa_start_isr_cnt;
298     osal_u16 noa_end_isr_cnt;
299     osal_u32 noa_start_tsf;
300 } alg_dbac_dev_stats_info;
301 typedef struct {
302     osal_u8 dbac_type : 4;
303     osal_u8 dbac_state : 4;
304     osal_u8 dbac_pause : 4;
305     osal_u8 dual_sta_mode : 4;
306     osal_u8 vap_idx[CFG_DBAC_VAP_IDX_BUTT];
307     alg_dbac_dev_stats_info dev_stats;
308     alg_dbac_vap_stats_info vap_stats[CFG_DBAC_VAP_IDX_BUTT];
309     osal_u8 resv_netbuf_cnt[CFG_DBAC_VAP_IDX_BUTT];
310     osal_u8 resv;
311 } alg_dbac_stats_info;
312 
313 /* rts rate 结构体 */
314 typedef struct {
315     osal_u8 non_erp_rate  : 4;
316     osal_u8 erp_rate      : 4;
317 } alg_rts_rate_elem_stru;
318 typedef struct {
319     alg_rts_rate_elem_stru rate_elem[HAL_TX_RATE_MAX_NUM];
320 } alg_rts_rate_tbl_stru;
321 typedef struct {
322     osal_u32 tolerant_rts_all_fail_cnt       : 4;    /* 可容忍的RTS All fail次数 */
323     osal_u32 per_multiple                    : 11;   /* per扩大的倍数,默认扩大1024倍 */
324     osal_u32 loss_ratio_max_num              : 9;    /* 首包错包率最大门限,大于该门限清零 */
325     osal_u32 loss_ratio_rts_retry_num        : 4;    /* 首包错误率统计重传次数门限,小于该重传次数时,保持1024 */
326     osal_u32 loss_ratio_stat_retry_num       : 4;    /* 首包错误率统计重传次数门限,小于该重传次数时,统计值减半 */
327 
328     osal_s16 per_stat_far_rssi_thr;                  /* 更新PER时判定当前是否为强信号的门限 */
329     osal_s16 per_stat_normal_rssi_thr;               /* 更新PER时判定当前是否为强信号的门限 */
330 
331     osal_u32 first_pkt_stat_shift            : 4;    /* 首包错误率的默认统计除2位移值(只针对最优速率) */
332     osal_u32 first_pkt_stat_intvl            : 8;    /* 默认首包错误率的统计间隔包数目 */
333     osal_u32 legacy_1st_loss_ratio_th        : 10;   /* LEGACY帧的默认首包错误率(单位:千分数) */
334     osal_u32 ht_vht_1st_loss_ratio_th        : 10;   /* HT/VHT帧的默认首包错误率(单位:千分数) */
335 
336     osal_s16 open_rts_rssi_high_thr;                 /* RSSI小于该门限时,打开RTS */
337     osal_s16 open_rts_rssi_low_thr;                  /* RSSI大于该门限时,打开RTS */
338 
339     osal_u32 txop_duration_rts_threshold_max : 10;   /* dot11TxopRTSThreshold的最大值 */
340     osal_u32 txop_duration_rts_threshold_on  : 1;    /* dot11TxopRTSThreshold是否开启 */
341     osal_u32 rts_threshold                   : 12;   /* dot11RTSThreshold的最大值 */
342     osal_u32 kbps_to_bpus                    : 10;   /* kbps转换到bpus */
343 
344     osal_u32 rts_duration_multiple           : 10;   /* 与rts空口相加,与ppdu空口比较,判断ppdu空口是否需要rts保护 */
345     osal_u32 rts_duration_open               : 1;    /* 是否开启用ppdu空口开销决策是否开关rts */
346     osal_u32 rts_rssi_open                   : 1;    /* 是否启用弱信号场景打开RTS的功能 */
347     osal_u32 rts_rate_descend                : 1;    /* RTS速率是否主动降档 */
348 
349     osal_u32 reserved                        : 18;   /* 4字节对齐 */
350 
351     alg_rts_rate_tbl_stru rts_11b_tbl[ALG_RTS_11B_RATE_NUM];      /* 数据帧11b rts速率表 */
352     alg_rts_rate_tbl_stru rts_11g_tbl[ALG_RTS_11G_RATE_NUM];      /* 数据帧11g rts速率表 */
353     alg_rts_rate_tbl_stru rts_11n_tbl[ALG_RTS_11N_RATE_NUM];      /* 数据帧11n rts速率表 */
354     alg_rts_rate_tbl_stru rts_11ax_tbl[ALG_RTS_11AX_RATE_NUM];    /* 数据帧11ax rts速率表 */
355 } alg_param_sync_rts_stru;
356 
357 /* rts 配置命令同步结构体 */
358 typedef struct {
359     osal_u32                rts_enable           : 1;    /* rts算法使能开关 */
360     osal_u32                rts_fixed_mode       : 1;    /* 配置命令决定是否固定rts模式 */
361     osal_u32                enable_rts_log       : 1;    /* 使能日志的标志位 */
362     osal_u32                rts_mode             : 3;    /* RTS模式 */
363 
364     osal_u32                res                  : 26;   /* 4字节对齐 */
365 } alg_config_param_sync_rts_stru;
366 
367 typedef struct {
368     hal_fcs_protect_cnt_enum_uint8 protect_cnt;     /* 保护帧发送次数 */
369     osal_u8 vip_frame_protect_threshold;            /* vip帧的保护切信道次数 */
370     osal_u16 sw_protect_timeout;                    /* 软件超时等待值 */
371     osal_u16 hw_protect_timeout;                    /* FCS芯片超时值 */
372     osal_u16 dbac_tbtt_offset;                      /* TBTT 提前上报量 */
373     osal_u16 timer_adjust;                          /* Timer的提前量 */
374     osal_u16 noa_start_adjust;                      /* NOA start time的提前量 */
375     osal_u16 desired_tbtt_adjust;                   /* 设置理想tbtt的调整量 */
376     osal_u8 customize_sta_gc_slot_ratio;            /* 定制化文件配置的gc共存vap占用空口的比例 */
377     osal_u8 customize_sta_go_slot_ratio;            /* 定制化文件配置的go共存vap占用空口的比例 */
378     osal_u16 sync_tsf_threshold;                    /* 同步tsf的阈值 */
379     osal_u8 resv_netbuf_threshod;                   /* 预留netbuf门限 */
380     osal_u8 protect_gc_slot_period;                 /* gc保护周期 */
381 } alg_param_sync_dbac_stru;
382 
383 typedef struct {
384     osal_u32 max_lock_times;
385     osal_u32 lock_timestamp_th;
386 } alg_param_sync_common_stru;
387 typedef struct {
388     osal_u32 aging_time_ms;                /* 聚合per统计老化时间 */
389     osal_u8 dbac_aggr_time_idx;            /* DBAC约束的最大聚合时间对应的g_aaggr_time_list数组下标 */
390     osal_u8 max_probe_wait_cnt;            /* 等待探测结果的最大发送完成中断次数(避免中断丢失导致状态异常) */
391     osal_u8 aggr_non_probe_pck_num;        /* 最优速率发送变化后,不进行探测的包数目 */
392     osal_u8 aggr_probe_intvl_num;          /* 聚合时间探测对应的间隔包数目 */
393 
394     osal_u8 intf_aggr_stat_shift;          /* 干扰场景下聚合时间探测的统计delta PER的包数目除2位移值 */
395     osal_u8 no_intf_aggr_stat_shift;       /* 无干扰时聚合时间探测的统计delta PER的包数目 */
396     osal_u8 init_avg_stat_num;             /* 聚合初始per统计的包数目 */
397     osal_u8 aggr_tb_switch : 1;            /* TB场景是否采用最优聚合度 */
398     osal_u8 resv :           7;            /* 对齐 */
399 
400     osal_u8 intf_up_aggr_stat_num;         /* 干扰场景向上聚合时间探测的统计delta PER的包数目 */
401     osal_u8 intf_down_aggr_stat_num;       /* 干扰场景向下聚合时间探测的统计delta PER的包数目 */
402     osal_u8 intf_up_update_stat_cnt_thd;   /* 干扰场景聚合时间向上探测的开始更新state num数目 */
403     osal_u8 intf_down_update_stat_cnt_thd; /* 干扰场景聚合时间向下探测的开始更新state num数目 */
404 } alg_param_sync_aggr_stru;
405 typedef struct {
406     osal_u8 tx_tb_in_th;
407     osal_u8 tx_tb_out_th : 7;
408     osal_u8 suspend_tx_flag : 1;
409     osal_u8 tx_tb_in_ms_th;
410     osal_u8 tx_tb_out_ms_th;
411 } alg_param_sync_tx_tb_stru;
412 /* autorate模块需要从HOST同步的参数 */
413 typedef struct {
414     alg_autorate_dev_stru autorate_dev;
415 } alg_param_sync_autorate_stru;
416 typedef struct {
417     osal_u8 tx_time_method;
418     osal_u8 rev;
419     osal_u16 report_period;
420 } alg_param_sync_sch_stru;
421 /* 注意4字节对齐 */
422 typedef struct {
423     osal_u32 head_magic_num;
424     alg_param_sync_tpc_stru tpc_para;
425     alg_param_sync_traffic_ctl_stru traffic_ctl_para;
426     alg_param_sync_rts_stru rts_para;
427     alg_param_sync_dbac_stru dbac_para;
428     alg_param_sync_common_stru common_para;
429     alg_param_sync_aggr_stru aggr_para;
430     alg_param_sync_autorate_stru autorate_para;
431     alg_param_sync_tx_tb_stru tx_tb_para;
432     alg_param_sync_sch_stru sch_para;
433     osal_u32 gla_enable_bitmap[ALG_GLA_SWITCH_TYPE_BUTT];
434     osal_u32 tail_magic_num;
435 } alg_param_sync_stru;
436 
437 typedef struct {
438     /* 统计计数 */
439     osal_u32 tx_cnt;        /* 统计周期内总发包个数计数 */
440     osal_u32 collision_cnt; /* 统计周期内碰撞个数计数 */
441     osal_u32 pkt_short_goodput_sum;
442 } alg_edca_det_ac_info_stru;
443 #ifdef _PRE_WLAN_FEATURE_ANTI_INTERF
444 typedef struct {
445     osal_u16 short_per;
446     osal_u8 user_lut_idx;          /* 用户id */
447     osal_u8 res;                  /* 对齐 */
448     osal_u32 goodput;      /* 对应带宽下该速率的理论goodput */
449 } alg_anti_intf_ar_info_stru;
450 
451 typedef struct {
452     osal_u8 user_num;               /* 有效用户数 */
453     osal_u8 resv[3];                /* 对齐 */
454     alg_anti_intf_ar_info_stru user_ar_info[ALG_MAX_USER_NUM_BUTT];
455 } alg_anti_intf_info_stru;
456 
457 typedef struct {
458     osal_u16 user_bitmap;           /* device侧收到包的用户 */
459     osal_s8 rssi_min;           /* device侧最小rssi */
460     osal_s8 res;                    /* 对齐 */
461 } alg_anti_intf_tx_comp_info_stru;
462 #endif
463 #ifdef _PRE_WLAN_FEATURE_SCHEDULE
464 /* device调度同步host侧调度 */
465 typedef struct {
466     osal_u8 user_num;
467     osal_u8 reserve[3];     /* 预留3字节对齐 */
468 
469     osal_u32 bcast_time;
470     osal_u32 bcast_bytes;
471 } dmac_to_hmac_sch_user_info_header_stru;
472 typedef struct {
473     osal_u8 user_id;
474     osal_u8 resv;
475     osal_u16 dequeue_mpdu_num;
476     osal_u32 total_tx_time;
477     osal_u32 tx_mpdu_bytes;
478 
479     osal_u32 resv1;
480 } dmac_to_hmac_user_rate_stru;
481 typedef struct {
482     dmac_to_hmac_sch_user_info_header_stru header;
483     dmac_to_hmac_user_rate_stru user_info[ALG_MAX_USER_NUM_BUTT];
484 } dmac_to_hmac_sch_user_info_stru;
485 #endif
486 #ifdef __cplusplus
487 #if __cplusplus
488 }
489 #endif
490 #endif
491 
492 #endif /* end of alg_common_rom.h */
493