1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __HMAC_RX_DATA_H__ 20 #define __HMAC_RX_DATA_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "oal_ext_if.h" 26 #include "mac_frame.h" 27 #include "dmac_ext_if.h" 28 #include "hmac_user.h" 29 #include "oal_net.h" 30 #include "hmac_device.h" 31 #include "hmac_vap.h" 32 33 #ifdef __cplusplus 34 #if __cplusplus 35 extern "C" { 36 #endif 37 #endif 38 39 /* **************************************************************************** 40 2 宏定义 41 **************************************************************************** */ 42 #define HMAC_RX_DATA_ETHER_OFFSET_LENGTH 6 /* 代表发送lan的包,需要填写以太网头,需要向前偏移6 */ 43 44 /* **************************************************************************** 45 3 结构体定义 46 **************************************************************************** */ 47 /* 每一个MSDU包含的内容的结构体的定义 */ 48 typedef struct { 49 hi_u8 auc_sa[WLAN_MAC_ADDR_LEN]; /* MSDU发送的源地址 */ 50 hi_u8 auc_da[WLAN_MAC_ADDR_LEN]; /* MSDU接收的目的地址 */ 51 hi_u8 auc_ta[WLAN_MAC_ADDR_LEN]; /* MSDU接收的发送地址 */ 52 hi_u8 priority; 53 hi_u8 auc_resv; 54 55 oal_netbuf_stru *netbuf; /* MSDU对应的netbuf指针(可以使clone的netbuf) */ 56 } hmac_msdu_stru; 57 58 /* 处理MPDU的MSDU的处理状态的结构体的定义 */ 59 typedef struct { 60 oal_netbuf_stru *curr_netbuf; /* 当前处理的netbuf指针 */ 61 hi_u8 *puc_curr_netbuf_data; /* 当前处理的netbuf的data指针 */ 62 hi_u16 us_submsdu_offset; /* 当前处理的submsdu的偏移量, */ 63 hi_u8 msdu_nums_in_netbuf; /* 当前netbuf包含的总的msdu数目 */ 64 hi_u8 procd_msdu_in_netbuf; /* 当前netbuf中已处理的msdu数目 */ 65 } hmac_msdu_proc_state_stru; 66 67 /* HMAC模块接收流程处理MSDU状态 */ 68 typedef enum { 69 MAC_PROC_ERROR = 0, 70 MAC_PROC_LAST_MSDU, 71 MAC_PROC_MORE_MSDU, 72 MAC_PROC_LAST_MSDU_ODD, 73 74 MAC_PROC_BUTT 75 } hmac_msdu_proc_status_enum; 76 typedef hi_u8 hmac_msdu_proc_status_enum_uint8; 77 78 /* **************************************************************************** 79 4 函数声明 80 **************************************************************************** */ 81 hi_u32 hmac_rx_process_data_ap(frw_event_mem_stru *event_mem); 82 hi_void hmac_rx_process_data_ap_tcp_ack_opt(const hmac_vap_stru *hmac_vap, const oal_netbuf_head_stru *netbuf_header); 83 hi_u32 hmac_rx_process_data_sta(frw_event_mem_stru *event_mem); 84 hi_void hmac_rx_free_netbuf(oal_netbuf_stru *netbuf, hi_u16 us_nums); 85 hi_void hmac_rx_free_netbuf_list(oal_netbuf_head_stru *netbuf_hdr, hi_u16 num_buf); 86 87 hi_void hmac_rx_lan_frame(const oal_netbuf_head_stru *netbuf_header); 88 #ifdef _PRE_WLAN_FEATURE_PKT_MEM_OPT 89 hi_void hmac_pkt_mem_opt_init(hmac_device_stru *hmac_dev); 90 hi_void hmac_pkt_mem_opt_exit(hmac_device_stru *hmac_dev); 91 hi_void hmac_pkt_mem_opt_cfg(hi_u32 cfg_tpye, hi_u32 cfg_value); 92 #endif 93 94 #ifdef __cplusplus 95 #if __cplusplus 96 } 97 #endif 98 #endif 99 100 #endif /* __HMAC_RX_DATA_H__ */ 101