WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hmac_wur_ap.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2020. All rights reserved.
3 * Description: hmac_wur_ap.h
4 * Date: 2020-07-07
5 */
6
7#ifndef __HMAC_WUR_AP_H__
8#define __HMAC_WUR_AP_H__
9
10#include "oal_ext_if.h"
11#include "hmac_vap.h"
12
13#ifdef __cplusplus
14#if __cplusplus
15extern "C" {
16#endif
17#endif
18
19#ifdef _PRE_WLAN_FEATURE_WUR_TX
20
21/* 2 宏定义 */
22#define HMAC_WUR_BITS_OFFSET 32
23#define WUR_LDR 0
24#define WUR_HDR 1
25#define WUR_SHORT 2
26#define WUR_TU 1024
27#define OOS_DATA_LEN 1500
28
29/* 3 枚举定义 */
30typedef enum {
31 WUR_TYPE_INVAILD = 0,
32 WUR_TYPE_BEACON_LDR = 1,
33 WUR_TYPE_BEACON_HDR = 2,
34 WUR_TYPE_FL_WAKE_LDR = 3,
35 WUR_TYPE_FL_WAKE_HDR = 4,
36 WUR_TYPE_SHORT_WAKE_LDR = 5,
37 WUR_TYPE_SHORT_WAKE_HDR = 6,
38} hmac_wur_frame_type_enum;
39
40typedef enum {
41 WUR_UNICAST_WAKEUP = 0,
42 WUR_MULTICAST_WAKEUP = 1,
43 WUR_BSS_PARAM_WAKEUP = 2,
44} hmac_wur_wakeup_type_enum;
45typedef osal_u8 hmac_wur_wakeup_type_enum_uint8;
46
47typedef enum {
48 WUR_DESC_TYPE_BEACON = 0,
49 WUR_DESC_TYPE_FL_WAKE = 1,
50 WUR_DESC_TYPE_SHORT_WAKE = 2,
51} tx_desc_wur_frame_type_enum;
52
53/* 新增枚举类型, 在更新WUR传事件时,用于区分来源 */
54typedef enum {
55 MAC_WUR_UPDATE_SOURCE_ASSOC = 0,
56 MAC_WUR_UPDATE_SOURCE_SETUP = 1,
57 MAC_WUR_UPDATE_SOURCE_TEARDOWN = 2,
58 MAC_WUR_UPDATE_SOURCE_MAX
59} mac_wur_update_source_enum;
60typedef osal_u8 mac_wur_update_source_enum_uint8;
61
62/* WUR action帧类型 */
63typedef enum {
64 MAC_WUR_ACTION_MODE_SETUP = 0,
65 MAC_WUR_ACTION_MODE_TEARDOWN = 1,
66 MAC_WUR_ACTION_WAKEUP_INDICATION = 2,
67} mac_wur_action_enum;
68typedef osal_u8 mac_wur_action_enum_uint8;
69
70/* WUR action type字段类型 */
71typedef enum {
72 MAC_WUR_ENTER_WUR_MODE_REQ = 0,
73 MAC_WUR_ENTER_WUR_MODE_RSP = 1,
74 MAC_WUR_ENTER_WUR_MODE_SUSPEND_REQ = 2,
75 MAC_WUR_ENTER_WUR_MODE_SUSPEND_RSP = 3,
76 MAC_WUR_ENTER_WUR_MODE_SUSPEND = 4,
77 MAC_WUR_ENTER_WUR_MODE = 5,
78} mac_wur_action_type_enum;
79typedef osal_u8 mac_wur_action_type_enum_uint8;
80
81/* WUR Mode response status字段类型 */
82typedef enum {
83 MAC_WUR_MODE_ACCEPT = 0,
84 MAC_WUR_MODE_DENIED_UNSPECIFIED = 1,
85 MAC_WUR_MODE_DENIED_PERIOD = 2,
86 MAC_WUR_MODE_DENIED_KEEPALIVE = 3,
87 MAC_WUR_MODE_RESERVED = 255,
88} mac_wur_response_status_enum;
89typedef osal_u8 mac_wur_response_status_enum_uint8;
90
91/* WUR更新事件参数 */
92typedef struct {
93 mac_wur_update_source_enum_uint8 update_source;
94 osal_u8 resv;
95 osal_u16 user_idx;
96 mac_wur_param_htd_stru wur_param_htd;
97 mac_user_wur_cap_ie_stru wur_cap_ie;
98} hmac_ctx_update_wur_stru;
99
100typedef struct {
101 osal_u8 mac_addr[WLAN_MAC_ADDR_LEN]; /* 用户的MAC ADDR */
102 osal_u8 resv[2]; /* 2 byte保留字段 */
103 mac_wur_mode_setup_frame_stru wur_mode_setup;
104} mac_cfg_wur_mode_setup_param_stru;
105
106typedef struct {
107 osal_u8 mac_addr[WLAN_MAC_ADDR_LEN]; /* 用户的MAC ADDR */
108 osal_u8 resv[2]; /* 2 byte保留字段 */
109} mac_cfg_wur_mode_teardown_param_stru;
110
111typedef struct {
112 osal_u8 twbtt_bcn_en : 1, /* TWBTT中断硬件发WUR BEACON开关 */
113 wur_period_en : 1, /* WUR周期中断开关 */
114 wur_frame_type : 4, /* WUR唤醒帧类型 0无效 */
115 wur_enable : 1, /* WUR使能开关 */
116 rsvd : 1;
117 osal_u8 resv[3]; /* 3 byte保留字段 */
118 mac_wur_basic_param_stru wur_basic_param; /* hmac初始化同步到dmac */
119} mac_cfg_wur_enable_option_param_stru;
120
121/* 10 函数声明 */
122osal_void hmac_wur_set_param_en(osal_u8 wur_twbtt_bcn_en, osal_u8 wur_period_en,
123 osal_u8 wur_frame_type);
124osal_u8 hmac_wur_get_user_status(const hmac_user_stru *hmac_user);
125osal_u8 hmac_wur_is_ps_enqueue(const hmac_user_stru *hmac_user);
126osal_void hmac_wur_init_user_info(hmac_user_stru *hmac_user);
127osal_void hmac_wur_user_del_handle(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
128
129osal_s32 hmac_wur_update(hmac_vap_stru *hmac_vap, hmac_ctx_update_wur_stru *crx_action_sync);
130osal_u32 dmac_mgmt_tx_wur_mode_setup(hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
131 const hmac_ctx_action_event_stru *ctx_action_event, oal_netbuf_stru *netbuf);
132osal_u32 dmac_mgmt_tx_wur_mode_teardown(hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
133 const hmac_ctx_action_event_stru *ctx_action_event, oal_netbuf_stru *netbuf);
134osal_u32 hmac_wur_mode_teardown_success(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
135osal_void hmac_wur_action_tx_complete_process(hmac_vap_stru *hmac_vap, oal_netbuf_stru *netbuf,
136 osal_u8 dscr_status);
137osal_u32 hmac_wur_is_all_support_hdr(const hmac_vap_stru *hmac_vap);
138osal_void hmac_wur_write_wake_up_frame(const hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
139 osal_u8 is_multi, osal_u8 wur_bss_update_cnt, osal_u8 wur_frame_type);
140osal_void hmac_wur_unicast_wake_process(hmac_vap_stru *hmac_vap);
141osal_void hmac_wur_multi_wake_process(hmac_vap_stru *hmac_vap);
142osal_s32 hmac_wur_sp_start_event(hmac_vap_stru *hmac_vap, frw_msg *msg);
143osal_s32 hmac_wur_sp_end_event(hmac_vap_stru *hmac_vap, frw_msg *msg);
144osal_void hmac_wur_ps_enqueue_process(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
145 mac_tx_ctl_stru *tx_ctrl);
146osal_u8 hmac_wur_is_multi_flush(const hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
147osal_void hmac_wur_bss_update_process(hmac_vap_stru *hmac_vap);
148osal_void hmac_wur_ht_oper_ie_save(hmac_vap_stru *hmac_vap, const mac_ht_opern_stru *ht_opern_tmp);
149osal_void hmac_wur_vht_oper_ie_save(hmac_vap_stru *hmac_vap, const mac_vht_opern_stru *vht_opern_tmp);
150osal_void hmac_wur_he_oper_ie_save(hmac_vap_stru *hmac_vap, const mac_frame_he_operation_param_stru *he_opern_param,
151 const mac_frame_he_bss_color_info_stru *he_bss_color, const mac_frame_he_mcs_nss_bit_map_stru *mcs_bit_map);
152osal_u32 hmac_wur_psm_rx_process(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
153 oal_netbuf_stru *net_buf);
154osal_u32 hmac_wur_mode_setup_update(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
155 osal_u8 action_type);
156osal_u32 hmac_wur_fill_start_time(const hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
157 const hmac_ctx_action_event_stru *ctx_action_event, const oal_netbuf_stru *netbuf);
158osal_u32 hmac_wur_setup_succ_update(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
159 mac_wur_mode_ie_stru *wur_mode_element, const mac_wur_param_ap_field_stru *wur_param_ap_field);
160osal_u32 hmac_wur_encap_wake_up_frame(const hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
161 osal_u8 is_multi, osal_u8 wur_bss_update_cnt, osal_u8 *wur_frame_type);
162osal_u32 hmac_wur_sp_start_process(hmac_vap_stru *hmac_vap, frw_msg *msg);
163osal_s32 hmac_wur_sp_end_process(hmac_vap_stru *hmac_vap, frw_msg *msg);
164osal_u32 hmac_wur_frame_tx_complete_process(osal_u8 dscr_status, mac_tx_ctl_stru *cb,
165 hal_to_dmac_device_stru *hal_device);
166osal_s32 hmac_config_wur_send_setup(hmac_vap_stru *hmac_vap, frw_msg *msg);
167osal_s32 hmac_config_wur_send_teardown(hmac_vap_stru *hmac_vap, frw_msg *msg);
168osal_s32 hmac_config_wur_enable_option(hmac_vap_stru *hmac_vap, frw_msg *msg);
169
170osal_u32 hmac_ap_wur_update_event(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
171 mac_wur_update_source_enum_uint8 wur_update_source);
172osal_u32 hmac_mgmt_tx_wur_mode_setup(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
173 mac_wur_param_htd_stru *wur_param_htd);
174osal_u32 hmac_mgmt_tx_wur_mode_teardown(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
175osal_u32 hmac_ap_rx_wur_mode_setup_frame(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
176 osal_u8 *payload);
177osal_u32 hmac_ap_rx_wur_mode_teardown_frame(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
178osal_u32 hmac_proc_wur_cap_ie(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
179 osal_u8 *wur_cap_ie);
180
181/* 回调函数声明 */
182typedef osal_u32 (*hmac_wur_psm_rx_process_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
183 oal_netbuf_stru *net_buf);
184typedef osal_u32 (*hmac_wur_mode_setup_update_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
185 osal_u8 action_type);
186typedef osal_u32 (*hmac_wur_fill_start_time_cb)(const hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
187 const hmac_ctx_action_event_stru *ctx_action_event, const oal_netbuf_stru *netbuf);
188typedef osal_u32 (*hmac_wur_setup_succ_update_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user,
189 mac_wur_mode_ie_stru *wur_mode_element, const mac_wur_param_ap_field_stru *wur_param_ap_field);
190typedef osal_u32 (*hmac_wur_mode_teardown_success_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
191typedef osal_u32 (*hmac_wur_encap_wake_up_frame_cb)(const hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user,
192 osal_u8 is_multi, osal_u8 wur_bss_update_cnt, osal_u8 *wur_frame_type);
193typedef osal_u8 (*hmac_wur_is_multi_flush_cb)(const hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
194typedef osal_s32 (*hmac_wur_sp_start_process_cb)(hmac_vap_stru *hmac_vap, frw_msg *msg);
195typedef osal_s32 (*hmac_wur_sp_end_process_cb)(hmac_vap_stru *hmac_vap, frw_msg *msg);
196typedef osal_u32 (*hmac_wur_frame_tx_complete_process_cb)(osal_u8 dscr_status, mac_tx_ctl_stru *cb,
197 hal_to_dmac_device_stru *hal_device);
198
199osal_void hmac_ap_up_rx_action_wur(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user, osal_u8 *data);
200#endif
201
202#ifdef __cplusplus
203#if __cplusplus
204}
205#endif
206#endif
207
208#endif /* end of hmac_wur_ap.h */
#define WLAN_MAC_ADDR_LEN
Definition mac_addr.c:28
int osal_s32
Definition osal_types.h:19
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 frw_msg_rom.h:74
Definition dmac_ext_if_hcm.h:431
Definition mac_user_ext.h:519
Definition mac_vap_ext.h:2019
Definition mac_frame_common_rom.h:948
Definition mac_frame_common_rom.h:917
Definition mac_frame_common_rom.h:935
Definition mac_frame.h:1325
Definition dmac_ext_if_device_rom.h:98
Definition mac_frame.h:1361
Definition oal_skbuff.h:82
Definition hal_ops_common_rom.h:529
Definition hal_uart_v151_regs_def.h:38