WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
alg_tpc_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_ROM_H
7#define ALG_TPC_ROM_H
8
9#ifdef _PRE_WLAN_FEATURE_TPC
10
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#define ALG_TPC_INVALID_FIX_PWR (0xff) /* 无效的固定功率值 */
29#define ALG_TPC_FIX_CODE_LOW_LEVEL 5
30#define ALG_TPC_FIX_CODE_COMPANSATION 3
31
32#define ALG_TPC_40M_RSSI_ADJUST 3
33#define ALG_TPC_80M_RSSI_ADJUST 6
34
35/******************************************************************************
36 3 枚举定义
37******************************************************************************/
38/* 数据类型 */
39typedef enum {
40 ALG_TPC_CFG_INT8 = 0,
41 ALG_TPC_CFG_UINT8 = 1,
42 ALG_TPC_CFG_UINT16 = 2,
43 ALG_TPC_CFG_UINT32 = 3,
44 ALG_TPC_CFG_UINT64 = 4,
45 ALG_TPC_CFG_TYPE_BUTT
46} alg_tpc_cfg_param_type_enum;
47typedef osal_u8 alg_tpc_cfg_param_type_enum_uint8;
48
49/******************************************************************************
50 4 STRUCT定义
51******************************************************************************/
52typedef struct {
53 alg_param_sync_tpc_stru *param_sync;
54 alg_tpc_common_info_stru common_info;
55} alg_tpc_stru;
56
57/* 用户功率信息结构体 */
58typedef struct {
59 dmac_user_stru *user;
60 alg_tpc_user_rssi_stru user_rssi_info; /* 用户RSSI信息结构体 */
61 alg_tpc_user_distance_stru user_distance_info; /* 用户距离信息结构体 */
62#ifdef _PRE_WLAN_TPC_DO_PROBE
63 osal_u8 cur_query_pktno; /* 当前查询的报文编号 */
64 osal_u8 cur_complete_pktno; /* 当前完成的报文编号 */
65 osal_u8 resv[2];
66 alg_tpc_probe_info_stru bebk_tpc_probe_info; /* 该用户BE/BK业务的探测信息 */
67 alg_tpc_probe_info_stru vi_tpc_probe_info; /* 该用户VI业务的探测信息 */
68 alg_tpc_probe_info_stru vo_tpc_probe_info; /* 该用户VO业务的探测信息 */
69 alg_tpc_probe_info_stru *tpc_probe_info; /* 用户业务探测信息指针 */
70
71 osal_u8 aggr_smooth_scale; /* 聚合的平滑系数 */
72 osal_u8 normal_smooth_scale; /* 非聚合的平滑系数 */
73#endif
74} alg_tpc_user_pow_info_stru;
75
76
77/* 设置配置参数的回调函数指针 */
78typedef osal_void (*p_alg_tpc_config_param_handle_func)(const dmac_ioctl_alg_param_stru *alg_param);
79
80/* 算法参数配置表结构 */
81typedef struct {
82 mac_alg_cfg_enum_uint16 alg_cfg_param;
83 alg_tpc_cfg_param_type_enum_uint8 param_type;
84 osal_u8 rev[3];
85 osal_u16 param_offset;
86
87 p_alg_tpc_config_param_handle_func cfg_param_handle;
88} alg_tpc_cfg_param_table_stru;
89
90typedef osal_u32 (*alg_tpc_set_tx_tpc_cb)(hal_tx_txop_alg_stru *txop_param, const osal_u8 *pow_level,
91 mac_tx_ctl_stru *cb);
92typedef osal_u32 (*alg_tpc_set_tpc_mode_cb)(const hal_to_dmac_device_stru *hal_device,
94typedef osal_u32 (*alg_tpc_change_channel_num_process_cb)(dmac_vap_stru *dmac_vap,
96typedef osal_u32 (*alg_tpc_tx_complete_process_cb)(dmac_user_stru *dmac_user, oal_dmac_netbuf_stru *buf,
97 hal_tx_dscr_ctrl_one_param *tx_dscr_param);
98typedef osal_u32 (*alg_tpc_tx_query_cb)(hal_to_dmac_device_stru *hal_device,
99 alg_tpc_user_pow_info_stru *user_tpc_pow_info,
100 hal_user_pow_info_stru *hal_user_pow_info, mac_tx_ctl_stru *cb);
101typedef osal_u32 (*alg_tpc_user_distance_judge_cb)(const alg_tpc_user_rssi_stru *user_rssi_info,
102 alg_tpc_user_distance_stru *user_distance_info, const dmac_user_stru *dmac_user, osal_s8 tpc_rssi_20_m);
103typedef osal_u32 (*alg_tpc_distance_state_has_changed_cb)(dmac_user_stru *dmac_user,
104 alg_tpc_user_distance_stru *user_distance_info, wlan_user_distance_enum_uint8 old_distance);
105typedef osal_u32 (*alg_tpc_set_vap_spec_frame_tx_power_cb)(dmac_vap_stru *dmac_vap);
106typedef osal_u32 (*alg_tpc_init_user_cb)(dmac_vap_stru *dmac_vap, dmac_user_stru *dmac_user);
107typedef osal_u32 (*alg_tpc_tx_process_cb)(dmac_user_stru *dmac_user, mac_tx_ctl_stru *cb,
108 hal_tx_txop_alg_stru *txop_param);
109typedef osal_u32 (*alg_tpc_rx_process_cb)(dmac_vap_stru *dmac_vap, dmac_user_stru *dmac_user, oal_dmac_netbuf_stru *buf,
110 hal_rx_statistic_stru *rx_stats);
111typedef osal_u32 (*alg_tpc_rx_mgmt_process_cb)(const dmac_vap_stru *vap, dmac_user_stru *user,
113typedef osal_u32 (*alg_tpc_update_power_cb)(dmac_vap_stru *vap);
114
115/******************************************************************************
116 5 函数声明
117******************************************************************************/
118osal_u32 alg_tpc_init(osal_void);
119osal_u32 alg_tpc_exit(osal_void);
120osal_u32 alg_tpc_init_user(dmac_vap_stru *vap, dmac_user_stru *user);
121osal_u32 alg_tpc_exit_user(dmac_vap_stru *vap, dmac_user_stru *user);
122osal_u32 alg_tpc_tx_process(dmac_user_stru *dmac_user, mac_tx_ctl_stru *cb, hal_tx_txop_alg_stru *txop_param);
123osal_u32 alg_tpc_rx_process(dmac_vap_stru *dmac_vap, dmac_user_stru *dmac_user, oal_dmac_netbuf_stru *buf,
124 hal_rx_statistic_stru *rx_stats);
125osal_u32 alg_tpc_rx_mgmt_process(const dmac_vap_stru *vap, dmac_user_stru *user, oal_dmac_netbuf_stru *buf);
126osal_u32 alg_tpc_tx_complete_process(dmac_user_stru *user, oal_dmac_netbuf_stru *buf,
127 hal_tx_dscr_ctrl_one_param *tx_dscr_param);
128osal_u32 alg_tpc_param_sync(const alg_param_sync_stru *sync);
129osal_u32 alg_tpc_config_param(const dmac_vap_stru *dmac_vap, frw_msg *msg);
130alg_tpc_stru *alg_tpc_get_tpc(osal_void);
131osal_void alg_tpc_set_tpc_mode(const hal_to_dmac_device_stru *hal_device, wlan_tpc_mode_enum_uint8 new_mode);
132osal_void alg_tpc_set_anti_intrf_flag(osal_u8 enable, osal_u16 cfg_flag);
133osal_void alg_tpc_near_distance_rssi_handle(dmac_user_stru *user, alg_tpc_user_distance_stru *dist_info,
134 osal_u8 best_rate_index);
135#ifdef _PRE_WLAN_FEATURE_INTF_DET
136osal_u32 alg_tpc_intf_change_process(hal_to_dmac_device_stru *hal_device,
137 alg_intf_det_notify_info_stru *intf_det_notify);
138#endif
139#ifdef _PRE_WLAN_FEATURE_TEMP_PROTECT
140osal_u32 alg_tpc_over_temp_process(hal_to_dmac_device_stru *hal_device, osal_u8 flag);
141#endif
142
143#ifdef __cplusplus
144#if __cplusplus
145}
146#endif
147#endif
148
149#endif
150#endif /* end of alg_tpc_rom.h */
151
osal_u8 mac_alg_channel_bw_chg_type_uint8
Definition alg_common_macros_rom.h:164
osal_u16 mac_alg_cfg_enum_uint16
Definition alg_common_macros_rom.h:429
osal_u8 type
Definition oal_net.h:0
unsigned char osal_u8
Definition osal_types.h:11
signed char osal_s8
Definition osal_types.h:17
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 alg_common_rom.h:77
Definition alg_common_rom.h:411
Definition alg_common_rom.h:124
Definition alg_common_rom.h:208
Definition alg_common_rom.h:237
Definition alg_common_rom.h:231
Definition dmac_ext_if_rom.h:106
Definition frw_msg_rom.h:74
Definition hal_common_ops_device_rom.h:886
Definition hal_common_ops_rom.h:56
Definition hal_ops_common_rom.h:240
Definition hal_ops_common_rom.h:255
Definition dmac_ext_if_device_rom.h:98
Definition oal_net_pkt_rom.h:83
Definition hal_ops_common_rom.h:529
osal_u8 wlan_tpc_mode_enum_uint8
Definition wlan_types_base_rom.h:283
osal_u8 wlan_user_distance_enum_uint8
Definition wlan_types_base_rom.h:419