• 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: wal common msg api.
15  * Author:
16  * Create: 2021-08-16
17  */
18 
19 #ifndef __WAL_COMMON_H__
20 #define __WAL_COMMON_H__
21 
22 #include "oal_ext_if.h"
23 #include "wlan_types_common.h"
24 #include "wlan_spec.h"
25 #include "mac_vap_ext.h"
26 #include "hmac_ext_if.h"
27 #include "wal_ext_if.h"
28 #include "wal_utils.h"
29 
30 #undef THIS_FILE_ID
31 #define THIS_FILE_ID OAM_FILE_ID_WAL_COMMON_H
32 #undef THIS_MOD_ID
33 #define THIS_MOD_ID DIAG_MOD_ID_WIFI_HOST
34 
35 #ifdef __cplusplus
36 #if __cplusplus
37 extern "C" {
38 #endif
39 #endif
40 
41 /* channel index and frequence */
42 #define WAL_MIN_CHANNEL_2G      1
43 #define WAL_MAX_CHANNEL_2G      14
44 
45 #define WAL_MIN_CHANNEL_5G      36
46 #define WAL_MAX_CHANNEL_5G      165
47 
48 #define WAL_MIN_CHANNEL_4_9G    184
49 #define WAL_MAX_CHANNEL_4_9G    196
50 
51 #define WAL_ATCMDSRB_GET_RX_PCKT (5 * 1000)
52 
53 #define WAL_MSG_TIME_OUT_MS 4000
54 #define WAL_AL_TX_DELAY_OFF 70
55 
56 /* 协议模式与字符串映射 */
57 typedef struct {
58     osal_char                           *pc_name;        /* 模式名字符串 */
59     wlan_protocol_enum_uint8            mode;        /* 协议模式 */
60     wlan_channel_band_enum_uint8        band;        /* 频段 */
61     wlan_channel_bandwidth_enum_uint8   en_bandwidth;   /* 带宽 */
62     osal_u8                           auc_resv[1];
63 } wal_ioctl_mode_map_stru;
64 
65 osal_s32 wal_sync_post2hmac_no_rsp(osal_u8 vap_id, osal_u16 msg_id, osal_u8 *data, osal_u32 data_len);
66 osal_s32 wal_sync_send2device_no_rsp(osal_u8 vap_id, osal_u16 msg_id, osal_u8 *data, osal_u32 data_len);
67 osal_s32 wal_async_send2device_no_rsp(osal_u8 vap_id, osal_u16 msg_id, osal_u8 *data, osal_u32 data_len);
68 osal_s32 wal_async_post2hmac_no_rsp(osal_u8 vap_id, osal_u16 msg_id,
69     osal_u8 *data, osal_u32 data_len, frw_post_pri_enum_uint8 pri);
70 
71 #ifdef _PRE_WLAN_FEATURE_P2P
72 wlan_p2p_mode_enum_uint8 wal_wireless_iftype_to_mac_p2p_mode_etc(enum nl80211_iftype iftype);
73 #endif
74 osal_s32 wal_set_ssid(oal_net_device_stru *net_dev, const osal_u8 *ssid_ie, osal_u8 ssid_len);
75 osal_s32 wal_set_mode(oal_net_device_stru *net_dev, const wal_ioctl_mode_map_stru *mode_map,
76     const osal_s8 *mode_str);
77 osal_s32 wal_set_channel_info(osal_u8 vap_id, osal_u8 channel,
78     wlan_channel_band_enum_uint8 band, wlan_channel_bandwidth_enum_uint8 bandwidth);
79 osal_s32 wal_down_vap(oal_net_device_stru *net_dev, osal_u8 vap_id);
80 osal_s32 wal_add_vap(oal_net_device_stru *net_dev, osal_u8 vap_id, osal_u8 vap_mode, osal_u8 p2p_mode);
81 
82 osal_s32 wal_set_ap_max_user(oal_net_device_stru *net_dev, osal_u32 ap_max_user);
83 osal_s32 wal_get_rx_pckg(hmac_vap_stru *hmac_vap, osal_u32 data_op, osal_u32 print_info);
84 osal_void wal_set_ac_2g_enable(hmac_cfg_add_vap_param_stru *vap_info);
85 osal_u32 wal_set_service_control_etc(const service_control_msg *msg);
86 osal_u32 wal_get_service_control(osal_void);
87 osal_u32 wal_ccpriv_always_tx_get_param(osal_s8 **param, mac_rf_payload_enum_uint8 *payload_flag,
88     osal_u32 *len, mac_cfg_tx_comp_stru *set_bcast_param);
89 
90 oal_bool_enum_uint8 wal_is_dhcp_port_etc(const mac_ip_header_stru *ip_hdr);
91 mac_data_type_enum_uint8 wal_get_arp_type_by_arphdr(const oal_eth_arphdr_stru *rx_arp_hdr);
92 osal_u8 wal_get_data_type_from_8023_etc(const osal_u8 *frame_hdr, mac_netbuff_payload_type hdr_type);
93 #ifdef _PRE_WIFI_DEBUG
94 osal_void wal_print_tx_data_type(mac_ether_header_stru *ether_header);
95 #endif
96 osal_void wal_add_vap_set_cust(hmac_cfg_add_vap_param_stru *add_vap_param);
97 
98 osal_u32 uapi_ccpriv_blacklist_add(oal_net_device_stru *net_dev, osal_s8 *param);
99 osal_u32 uapi_ccpriv_blacklist_del(oal_net_device_stru *net_dev, osal_s8 *param);
100 osal_u32 uapi_ccpriv_blacklist_show(oal_net_device_stru *net_dev, osal_s8 *param);
101 
102 osal_void wal_print_nvram_list(osal_void);
103 #ifdef _PRE_WLAN_FEATURE_ALWAYS_TX
104 osal_u32 uapi_get_al_tx_rate(osal_u32 protocol, osal_u32 mcs);
105 osal_u32 uapi_get_back_off_time(osal_u32 rate, osal_u32 len, osal_u32 ratio);
106 #endif
107 
108 #ifdef __cplusplus
109 #if __cplusplus
110 }
111 #endif
112 #endif
113 
114 #endif
115