WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
alg_tpc_probe_rom.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2022. All rights reserved.
3 * Description: algorithm transfer power control
4 */
5
6#ifndef ALG_TPC_PROBE_ROM_H
7#define ALG_TPC_PROBE_ROM_H
8
9#ifdef _PRE_WLAN_FEATURE_TPC
10#ifdef _PRE_WLAN_TPC_DO_PROBE
11/******************************************************************************
12 1 其他头文件包含
13******************************************************************************/
15#include "wlan_spec_rom.h"
16#include "dmac_ext_if_rom.h"
17#include "alg_autorate_if_rom.h"
18
19#ifdef __cplusplus
20#if __cplusplus
21extern "C" {
22#endif
23#endif
24
25/******************************************************************************
26 2 宏定义
27******************************************************************************/
28/* 探测参数 */
29#define ALG_TPC_MIN_PROBE_INTVL_PKTNUM 8 /* 默认最小探测间隔包数目 */
30#define ALG_TPC_MAX_PROBE_INTVL_PKTNUM 128 /* 默认最大探测间隔包数目 */
31#define ALG_TPC_PROBE_INTVL_KEEP_TIMES 4 /* 默认探测间隔保持的次数 */
32#define ALG_TPC_AGGR_PER_SMOOTH_SCALE 3 /* 聚合PER平滑因子 */
33#define ALG_TPC_NORMAL_PER_SMOOTH_SCALE 5 /* 非聚合PER平滑因子 */
34#define ALG_TPC_PER_SMOOTH_SCALE_MIN 2 /* 最小PER平滑因子 */
35#define ALG_TPC_CUR_PER_REDUCE_TH 5 /* 本次PER会调整平滑PER门限 */
36
37/* PER门限 */
38#define ALG_TPC_INVALID_PER 0xffff /* 无效PER */
39#define ALG_TPC_BEST_RATE_PER_LIMIT_TO_DOWN (40)
40#define ALG_TPC_BEST_RATE_PER_LIMIT_TO_UP (80) // (100)
41#define ALG_TPC_PROBE_RATE_PER_LIMIT_STOP_DOWN (ALG_TPC_BEST_RATE_PER_LIMIT_TO_UP)
42#define ALG_TPC_PROBE_RATE_PER_LIMIT_STOP_UP (ALG_TPC_BEST_RATE_PER_LIMIT_TO_DOWN)
43#define ALG_TPC_PER_MARGIN (30) /* TPC PER相对增加量阈值 */
44#define ALG_TPC_MAX_PROBE_WAIT_COUNT 4 /* 等待探测结果的最大发送完成中断次数(避免中断丢失导致状态异常) */
45
46/******************************************************************************
47 3 枚举定义
48******************************************************************************/
49/* 算法状态 */
50typedef enum {
51 ALG_TPC_STATE_NORMAL = 0, /* TPC工作在最优功率的状态 */
52 ALG_TPC_STATE_PROBE_UP = 1, /* TPC向上探测的状态 */
53 ALG_TPC_STATE_PROBE_DOWN = 2, /* TPC向下探测的状态 */
54 ALG_TPC_STATE_BUTT
55} alg_tpc_state_enum;
56typedef osal_u8 alg_tpc_state_enum_uint8;
57
58/* TPC帧类型 */
59typedef enum {
60 ALG_TPC_FRAME_BEST = 0, /* TPC以最优功率发帧 */
61 ALG_TPC_FRAME_PROBE = 1, /* TPC以探测功率发帧 */
62 ALG_TPC_FRAME_FIX = 2, /* TPC以固定功率发帧(只针对data0用固定功率, data1~3仍用最大功率) */
63 ALG_TPC_FRAME_MAX = 3, /* TPC以最大功率发帧,用于autorate的探测帧 */
64 ALG_TPC_FRAME_BUTT
65} alg_tpc_frame_type_enum;
66typedef osal_u8 alg_tpc_frame_type_enum_uint8;
67
68/******************************************************************************
69 4 STRUCT定义
70******************************************************************************/
71/* 支持TPC功率调整的速率集合,区分元素protocol,bw */
72typedef struct {
73 osal_u8 alg_tpc_11b_bw_target_index;
74 osal_u8 alg_tpc_11g_11a_bw_target_index;
75 osal_u8 alg_tpc_11n_20mhz_target_index;
76 osal_u8 alg_tpc_11n_40mhz_target_index;
77
78 osal_u8 alg_tpc_11ac_20mhz_target_index;
79 osal_u8 alg_tpc_11ac_40mhz_target_index;
80 osal_u8 alg_tpc_11ac_80mhz_target_index;
81 osal_u8 alg_tpc_11ac_160mhz_target_index;
82} alg_tpc_target_rate_index_stru;
83
84/* VAP信息结构体 */
85typedef struct {
86#ifdef _PRE_WLAN_TPC_DO_PROBE
87 alg_tpc_state_enum_uint8 probe_state : 3; /* 当前用户当前业务类型的探测状态 */
88 oal_bool_enum_uint8 probe_query : 1; /* 探测功率已被查询使用过 */
89 oal_bool_enum_uint8 probe_update : 1; /* 探测功率的结果已更新 */
90 oal_bool_enum_uint8 allow_autorate_down_rate : 1; /* 是否允许autorate降速 */
91 oal_bool_enum_uint8 perform_ok_old : 1;
92 oal_bool_enum_uint8 resv : 1;
93 osal_u8 target_rate_index; /* 该业务的目标速率索引最小值(一般为速率集的最高速率) */
94#else
95 alg_tpc_state_enum_uint8 probe_state : 3; /* 当前用户当前业务类型的探测状态 */
96 oal_bool_enum_uint8 resv : 5;
97#endif
98 osal_u8 best_rate_index; /* 该业务当前Autorate选出的最优速率索引,AC最大速率索引表数目72 */
99 osal_u8 best_pow_idx; /* 最优功率索引 */
100#ifdef _PRE_WLAN_TPC_DO_PROBE
101 osal_u8 old_best_pow_idx;
102 osal_u8 cur_probe_pow_idx; /* 当前探测功率索引 */
103 osal_u8 perf_ok_min_pow_idx; /* 性能达到要求的最小功率索引 */
104 osal_u8 probe_intvl_pktcnt; /* 探测间隔计数 */
105
106 osal_u8 probe_intvl_pktnum; /* 探测间隔包数目 */
107 osal_u8 probe_intvl_keep_cnt; /* 探测间隔保持计数 */
108 osal_u8 probe_wait_count; /* 探测发送完成中断的等待计数 */
109 osal_u8 min_per_pow_idx; /* 最小PER对应的功率索引 */
110
111 osal_u16 probe_min_per; /* 探测过程中的最小PER(千分数) */
112 osal_u8 probe_pktno; /* 探测报文编号 */
113 osal_u8 resv1; /* 数组大小 */
114
115 osal_u16 smooth_per[HAL_POW_ADJUST_LEVEL_NUM]; /* 各个功率等级的统计信息 */
116#else
117 osal_u8 resv1; /* 数组大小 */
118#endif
119} alg_tpc_probe_info_stru;
120
121/******************************************************************************
122 5 函数声明
123******************************************************************************/
124typedef osal_u32 (*alg_tpc_probe_state_process_cb)(const alg_tpc_user_pow_info_stru *user_pow_info,
125 alg_tpc_probe_info_stru *probe, const hal_tx_dscr_ctrl_one_param *tx_dscr_param);
126osal_void alg_tpc_non_probe_state_process(const alg_tpc_user_pow_info_stru *user_pow_info,
127 hal_user_pow_info_stru *hal_user_pow_info, alg_tpc_probe_info_stru *probe_info,
128 hal_tx_dscr_ctrl_one_param *tx_dscr_param);
129osal_void alg_tpc_init_all_probe_info(const alg_tpc_user_pow_info_stru *user_pow_info);
130osal_void alg_tpc_probe_init(osal_void);
131osal_void alg_tpc_probe_exit(osal_void);
132osal_void alg_tpc_get_probe_pow_frame_type(alg_tpc_user_pow_info_stru *user_pow_info, mac_tx_ctl_stru *cb,
133 alg_tpc_frame_type_enum_uint8 *frame_type);
134osal_void alg_tpc_best_rate_change_process(alg_tpc_user_pow_info_stru *user_pow_info, osal_u8 best_rate_index);
135osal_void alg_tpc_tx_complete_probe_process(const alg_tpc_user_pow_info_stru *user_pow_info,
136 dmac_user_stru *dmac_user, alg_tpc_probe_info_stru *probe_info,
137 hal_tx_dscr_ctrl_one_param *tx_dscr_param)
138osal_void alg_tpc_init_all_user_probe_info(const hal_to_dmac_device_stru *hal_device);
139osal_u32 alg_tpc_get_traffic_rate_info(alg_tpc_user_pow_info_stru *user_pow_info,
140 wlan_wme_ac_type_enum_uint8 traffic_type);
141osal_void alg_tpc_update_power_per(const alg_tpc_user_pow_info_stru *user_pow_info,
142 alg_tpc_probe_info_stru *probe_info, const hal_tx_dscr_ctrl_one_param *tx_dscr_param, osal_u8 pow_idx);
143osal_void alg_tpc_best_rate_change_process(alg_tpc_user_pow_info_stru *user_pow_info, osal_u8 best_rate_index);
144osal_void alg_tpc_get_pow_frame_type(alg_tpc_user_pow_info_stru *user_pow_info, mac_tx_ctl_stru *cb,
145 alg_tpc_frame_type_enum_uint8 *frame_type);
146
147#ifdef __cplusplus
148#if __cplusplus
149}
150#endif
151#endif
152
153#endif
154#endif
155#endif /* end of alg_tpc_probe_rom.h */
156
#define HAL_POW_ADJUST_LEVEL_NUM
Definition hal_commom_ops_type_rom.h:342
osal_u8 resv1
Definition oal_net.h:1
osal_u8 oal_bool_enum_uint8
Definition oal_types_device_rom.h:45
unsigned char osal_u8
Definition osal_types.h:11
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
Definition hal_common_ops_rom.h:56
Definition hal_ops_common_rom.h:255
Definition dmac_ext_if_device_rom.h:98
Definition hal_ops_common_rom.h:529
osal_u8 wlan_wme_ac_type_enum_uint8
Definition wlan_types_base_rom.h:59