• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: Header file
15  */
16 
17 #ifndef MSG_WOW_ROM_H
18 #define MSG_WOW_ROM_H
19 
20 #include "msg_arp_offload_rom.h"
21 #include "msg_rekey_offload_rom.h"
22 #include "msg_dhcp_offload_rom.h"
23 
24 #ifndef OAL_IP_ADDR_MAX_SIZE
25 #define OAL_IP_ADDR_MAX_SIZE    16
26 #endif
27 
28 /* 修改参数 */
29 #define WOW_NETPATTERN_MAX_NUM 4
30 #define WOW_NETPATTERN_MAX_LEN 64
31 
32 typedef enum {
33     MAC_IP_ADDR_DEL = 0,                /* 删除IP地址 */
34     MAC_IP_ADDR_ADD,                    /* 增加IP地址 */
35     MAC_IP_OPER_BUTT
36 } mac_ip_oper;
37 typedef osal_u8 mac_ip_oper_enum_uint8;
38 
39 typedef enum {
40     MAC_CONFIG_IPV4 = 0,                /* 配置IPv4地址 */
41     MAC_CONFIG_IPV6,                    /* 配置IPv6地址 */
42     MAC_CONFIG_BUTT
43 } mac_ip_type;
44 typedef osal_u8 mac_ip_type_enum_uint8;
45 
46 typedef struct {
47     mac_ip_type_enum_uint8 type;
48     mac_ip_oper_enum_uint8 oper;
49     osal_u8 resv[2]; /* 填充2字节 */
50     union {
51         osal_u32 ipv4; /* 注意:网络字节序、大端。 */
52         osal_u8 ipv6[OAL_IP_ADDR_MAX_SIZE];
53     } ip;
54 } mac_ip_addr_config_stru;
55 
56 typedef struct {
57     osal_u8 pattern_data[WOW_NETPATTERN_MAX_LEN];
58     osal_u32 pattern_len;
59 } wow_pattern_stru;
60 
61 typedef struct {
62     wow_pattern_stru pattern[WOW_NETPATTERN_MAX_NUM];
63     osal_u16 pattern_map;
64     osal_u16 pattern_num;
65 } wow_pattern_cfg_stru;
66 typedef struct {
67     osal_u8 wow_en;
68     osal_u8 res[3];
69     osal_u32 wow_event;
70     wow_pattern_cfg_stru wow_pattern;
71 } mac_wow_cfg_stu;
72 
73 typedef enum {
74     MAC_WOW_SLEEP_NOTIFY_MSG,
75     MAC_WOW_SYNC_DATA_MSG,
76     MAC_WOW_MSG_BUTT,
77 } mac_wow_msg_enum;
78 typedef osal_u8 mac_wow_msg_enum_uint8;
79 
80 typedef struct {
81     mac_wow_msg_enum_uint8 msg_type; /* 传输的消息类型 */
82     osal_u8 notify_param;            /* 睡眠通知参数 */
83     osal_u8 auc_resv[2];             /* 2 BYTE保留字段 */
84 } mac_h2d_syn_info_hdr_stru;
85 
86 typedef struct {
87     mac_arp_offload_param_sync arp_param;
88     mac_dhcp_offload_param_sync dhcp_param;
89     mac_rekey_offload_param_sync rekey_param;
90     mac_wow_cfg_stu wow_cfg;
91 } wow_param_sync_stru;
92 
93 typedef struct {
94     osal_u16 file_remain_len;
95     osal_u16 block_data_len;
96     osal_u8 msg_type;
97     osal_u8 block_id;
98     osal_u8 rsv[2];
99 } mac_wow_load_info_stru;
100 
101 /* WOW_OFFLOAD模块收发包统计的数据结构 */
102 typedef struct {
103     osal_u8 wow_rcv_magic : 1,
104             wow_rcv_disasoc : 1,
105             wow_rcv_deauth : 1,
106             wow_rcv_net_pattern_tcp : 1,
107             wow_rcv_net_pattern_udp : 1,
108             rsv1 : 3;
109     osal_u8 rsv2[3];
110     osal_u32 arp_offload_rcv_arp_req;
111     osal_u32 arp_offload_rcv_ns;
112     osal_u32 rekey_offload_rcv_eapol;
113     osal_u32 arp_offload_send_arp_rsp;
114     osal_u32 arp_offload_send_ns;
115     osal_u32 arp_offload_send_free_arp;
116     osal_u32 dhcp_offload_send_dhcp_renew;
117     osal_u32 rekey_offload_send_eapol;
118 } mac_wow_offload_info_stru;
119 
120 typedef struct {
121     mac_wow_offload_info_stru mac_wow_offload_info;
122     osal_u8 wakeup_reason;
123 } wow_result_to_host_stru;
124 
125 #endif
126