WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
mac_frame_common.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.
3 * Description: Source file defined by the corresponding frame structure and operation interface (cannot be called by
4 * the HAL module).
5 * Create: 2022-11-26
6 */
7
8#ifndef __MAC_FRAME_COMMON_H__
9#define __MAC_FRAME_COMMON_H__
10
11/*****************************************************************************
12 1 其他头文件包含
13*****************************************************************************/
15#ifdef __cplusplus
16#if __cplusplus
17extern "C" {
18#endif
19#endif
20
21/* 此文件中定义的结构体与协议相关,需要1字节对齐 */
22/*****************************************************************************
23 2 宏定义
24*****************************************************************************/
25/* 初始值为5,由于11ac Operating Mode Notification特性标志为bit62长度修改为8,ftm特性需要长度为9, twt特性需要长度为10 */
26#define MAC_DHCP_DECLINE 4
27
28#define MAC_DHCP_NAK 6
29#define MAC_DHCP_RELEASE 7
30#define MAC_DHCP_INFORM 8
31
32/*****************************************************************************
33 3 枚举定义
34*****************************************************************************/
35/*****************************************************************************
36 枚举名 : wlan_ieee80211_frame_type_enum_uint8
37 协议表格:
38 枚举说明: 802.11 MAC帧头类型
39*****************************************************************************/
40typedef enum {
41 MAC_IEEE80211_BASE_FRAME = 0, /* 基础802.11帧类型 */
42 MAC_IEEE80211_QOS_FRAME, /* QoS帧类型 */
43 MAC_IEEE80211_QOS_HTC_FRAME, /* QoS + HTC帧类型 */
44 MAC_IEEE80211_ADDR4_FRAME, /* 四地址帧类型 */
45 MAC_IEEE80211_QOS_ADDR4_FRAME, /* QoS四地址帧类型 */
46 MAC_IEEE80211_QOS_HTC_ADDR4_FRAME, /* QoS + HTC四地址帧类型 */
47
51
52/*****************************************************************************
53 7 STRUCT定义
54*****************************************************************************/
55/* 私有管理帧通用的设置参数信息的结构体 */
56typedef struct {
58 osal_u8 arg1; /* 对应的tid序号 */
59 osal_u8 arg2; /* 接收端可接收的最大的mpdu的个数(针对AMPDU_START命令) */
60 osal_u8 arg3; /* 确认策略 */
61 osal_u16 user_idx; /* 对应的用户 */
62 osal_u8 auc_resv[2]; /* 预留2字节对齐 */
64
65osal_u8 *mac_find_ie_sec_etc(osal_u8 eid, osal_u8 *ie_addr, osal_s32 len, osal_u32 *remain_len);
66
67/*****************************************************************************
68 函 数 名 : mac_hdr_set_fragment_number
69 功能描述 : 设置MAC头分片序号字段
70
71*****************************************************************************/
72static inline osal_void mac_hdr_set_fragment_number(osal_u8 *header, osal_u8 frag_num)
73{
74 header[WLAN_HDR_FRAG_OFFSET] &= 0xF0;
75 header[WLAN_HDR_FRAG_OFFSET] |= (frag_num & 0x0F);
76}
77
78/*****************************************************************************
79 函 数 名 : mac_set_seq_num
80 功能描述 : 设置帧的序列号
81
82*****************************************************************************/
83static inline osal_void mac_set_seq_num(osal_u8 *header, osal_u16 seq_num)
84{
85 header[23] = (osal_u8)seq_num >> 4; /* seq字段高bit偏移23, bit偏移4 */
86 header[22] &= 0x0F; /* seq字段高bit偏移22, bit掩码0x0F */
87 header[22] |= (osal_u8)(seq_num << 4); /* seq字段高bit偏移22, bit偏移4 */
88}
89
90#ifdef __cplusplus
91#if __cplusplus
92}
93#endif
94#endif
95
96#endif /* end of mac_frame_common.h */
osal_u8 mac_ieee80211_frame_type_enum_uint8
Definition mac_frame_common.h:50
osal_u8 * mac_find_ie_sec_etc(osal_u8 eid, osal_u8 *ie_addr, osal_s32 len, osal_u32 *remain_len)
mac_ieee80211_frame_type_enum
Definition mac_frame_common.h:40
@ MAC_IEEE80211_QOS_HTC_ADDR4_FRAME
Definition mac_frame_common.h:46
@ MAC_IEEE80211_BASE_FRAME
Definition mac_frame_common.h:41
@ MAC_IEEE80211_QOS_ADDR4_FRAME
Definition mac_frame_common.h:45
@ MAC_IEEE80211_ADDR4_FRAME
Definition mac_frame_common.h:44
@ MAC_IEEE80211_FRAME_BUTT
Definition mac_frame_common.h:48
@ MAC_IEEE80211_QOS_HTC_FRAME
Definition mac_frame_common.h:43
@ MAC_IEEE80211_QOS_FRAME
Definition mac_frame_common.h:42
osal_u16 seq_num
Definition mac_frame_rom.h:7
osal_u16 frag_num
Definition mac_frame_rom.h:6
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 mac_frame_common.h:56
osal_u8 arg2
Definition mac_frame_common.h:59
osal_u8 arg3
Definition mac_frame_common.h:60
osal_u8 arg1
Definition mac_frame_common.h:58
osal_u8 type
Definition mac_frame_common.h:57
osal_u16 user_idx
Definition mac_frame_common.h:61
#define WLAN_HDR_FRAG_OFFSET
Definition wlan_types.h:120