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 for wal_ccpriv.c. 15 */ 16 17 #ifndef __WAL_CCPRIV_H__ 18 #define __WAL_CCPRIV_H__ 19 20 /***************************************************************************** 21 1 其他头文件包含 22 *****************************************************************************/ 23 #include "oal_ext_if.h" 24 #include "hmac_ext_if.h" 25 #include "wal_main.h" 26 #include "mac_device_ext.h" 27 #include "wal_ccpriv_common.h" 28 29 #ifdef __cplusplus 30 #if __cplusplus 31 extern "C" { 32 #endif 33 #endif 34 35 /***************************************************************************** 36 2 宏定义 37 *****************************************************************************/ 38 #define WAL_CCPRIV_CMD_MAX_LEN 1024 39 40 #define WAL_CCPRIV_11B_MCS_MIN 0 41 #define WAL_CCPRIV_11B_MCS_MAX 3 42 #define WAL_CCPRIV_11G_MCS_MIN 8 43 #define WAL_CCPRIV_11G_MCS_MAX 15 44 #define WAL_CCPRIV_11N_MCS_MIN 0 45 #define WAL_CCPRIV_11N_MCS_MAX 7 46 #define WAL_CCPRIV_11AX_MCS_MIN 0 47 #define WAL_CCPRIV_11AX_MCS_MAX 11 48 49 #define WAL_CCPRIV_NSS_MIN 1 50 #define WAL_CCPRIV_NSS_MAX 4 51 #define WAL_CCPRIV_CH_NUM 4 52 #define WAL_CCPRIV_SNPRINTF_DST 10 53 54 #define WAL_CCPRIV_BOOL_NIM 0 55 #define WAL_CCPRIV_BOOL_MAX 1 56 #define WAL_CCPRIV_FREQ_SKEW_ARG_NUM 8 57 58 #define WAL_CCPRIV_MS_TO_S 1000 /* ms和s之间倍数差 */ 59 #define WAL_CCPRIV_KEEPALIVE_INTERVAL_MIN 5000 /* 受默认老化计数器出发时间所限制 */ 60 #define WAL_CCPRIV_KEEPALIVE_INTERVAL_MAX 0xffff /* timer间隔时间限制所致(oal_uin16) */ 61 #define WAL_AL_TX_RATIO_LOW 1 62 #define WAL_AL_TX_RATIO_HIGH 10 63 #define WAL_SET_MONITER_ON 1 64 #define WAL_MONITER_SWITCH_MODE 2 65 #define WAL_EXTERNAL_RECORD_ENABLE_ON 1 66 67 /***************************************************************************** 68 3 枚举定义 69 *****************************************************************************/ 70 /***************************************************************************** 71 4 全局变量声明 72 *****************************************************************************/ 73 /***************************************************************************** 74 5 消息头定义 75 *****************************************************************************/ 76 /***************************************************************************** 77 6 消息定义 78 *****************************************************************************/ 79 /***************************************************************************** 80 7 STRUCT定义 81 *****************************************************************************/ 82 83 /* ccpriv 参数解析结构体定义 */ 84 typedef struct { 85 td_char cmd_param1[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第一个参数字符串 */ 86 td_char cmd_param2[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第二个参数字符串 */ 87 }wal_ccpriv_two_param_stru; 88 89 typedef struct { 90 td_char cmd_param1[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第一个参数字符串 */ 91 td_char cmd_param2[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第二个参数字符串 */ 92 td_char cmd_param3[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第三个参数字符串 */ 93 }wal_ccpriv_three_param_stru; 94 95 typedef struct { 96 td_char cmd_param1[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第一个参数字符串 */ 97 td_char cmd_param2[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第二个参数字符串 */ 98 td_char cmd_param3[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第三个参数字符串 */ 99 td_char cmd_param4[WAL_CCPRIV_CMD_NAME_MAX_LEN]; /* 命令第三个参数字符串 */ 100 }wal_ccpriv_four_param_stru; 101 102 typedef struct { 103 osal_u32 back_off_time; 104 } al_tx_back_off_time_stru; 105 /***************************************************************************** 106 8 UNION定义 107 *****************************************************************************/ 108 /***************************************************************************** 109 9 OTHERS定义 110 *****************************************************************************/ 111 /***************************************************************************** 112 10 函数声明 113 *****************************************************************************/ 114 osal_u8 wal_tx_data_type_debug_on(osal_void); 115 td_u32 wal_ccpriv_set_mcs(oal_net_device_stru *netdev, td_char *pc_param); 116 td_u32 wal_ccpriv_del_vap(oal_net_device_stru *netdev, td_char *pc_param); 117 td_u32 uapi_ccpriv_set_sleep(oal_net_device_stru *net_dev, osal_s8 *pc_param); 118 td_u32 uapi_ccpriv_vap_info(oal_net_device_stru *netdev, td_s8 *pc_param); 119 td_u32 wal_ccpriv_remove_proc(td_void); 120 td_u32 wal_ccpriv_get_bw(oal_net_device_stru *netdev, hal_channel_assemble_enum_uint8 *pen_bw_index); 121 td_u32 wal_ccpriv_set_bw(oal_net_device_stru *netdev, td_char *pc_param); 122 td_u32 uapi_ccpriv_getcountry(oal_net_device_stru *netdev, td_char *pc_param); 123 td_u32 wal_ccpriv_sta_set_psm_offset(oal_net_device_stru *netdev, td_char *param); 124 td_u32 wal_ccpriv_sta_set_offload_param(oal_net_device_stru *netdev, td_char *param); 125 td_u32 wal_ccpriv_sta_set_hw_ps_mode(oal_net_device_stru *netdev, td_char *param); 126 td_u32 wal_ccpriv_set_pm_switch(oal_net_device_stru *netdev, td_char *pc_param); 127 td_u32 uapi_ccpriv_setcountry(oal_net_device_stru *netdev, td_char *param); 128 td_u32 uapi_ccpriv_ampdu_tx_on(oal_net_device_stru *netdev, td_s8 *pc_param); 129 td_u32 wal_ccpriv_amsdu_tx_on(oal_net_device_stru *netdev, td_char *pc_param); 130 td_u32 wal_ccpriv_tx_proc(oal_net_device_stru *netdev, td_char *pc_param); 131 td_u32 wal_ccpriv_rx_proc(oal_net_device_stru *netdev, td_char *pc_param); 132 td_u32 uapi_ccpriv_rx_fcs_info(oal_net_device_stru *netdev, td_char *pc_param); 133 osal_u32 uapi_ccpriv_user_info(oal_net_device_stru *netdev, td_s8 *pc_param); 134 td_u32 wal_ccpriv_bsrp_dbg(oal_net_device_stru *netdev, td_char *param); 135 td_bool is_under_ps(td_void); 136 td_void set_under_ps(td_bool under_ps); 137 td_u32 uapi_ccpriv_send_pkt(oal_net_device_stru *net_dev, osal_s8 *param); 138 osal_void wal_ccpriv_str_to_hex(osal_s8 *param, td_s16 len, osal_u8 *value); 139 td_u32 wal_send_custom_pkt(oal_net_device_stru *net_dev, osal_u8 *data, osal_u32 len); 140 #ifdef _PRE_WLAN_DFT_STAT 141 osal_void wal_record_wifi_external_log(const osal_u32 addr); 142 #endif 143 oal_bool_enum_uint8 check_unsigned_range(osal_s8 *value, osal_u32 min, osal_u32 max); 144 145 #ifdef _PRE_WLAN_CFGID_DEBUG 146 osal_u32 wal_ccpriv_parse_cmd_debug(const td_char *cmd_name, td_u8 *ccpriv_cmd_id, wal_ccpriv_cmd_func *func); 147 #endif 148 149 #ifdef _PRE_WLAN_RF_CALI_DEBUG 150 // 单音测试参数 151 #define SINGLE_TONE_TEST_8BITS 8 152 #define SINGLE_TONE_TEST_16BITS 16 153 #define SINGLE_TONE_TEST_24BITS 24 154 #define SINGLE_TONE_TEST_ACCUM_TYPE 4 155 #define SINGLE_TONE_TEST_FLAG_BUTT 4 156 #define SINGLE_TONE_TEST_TYPE_BUTT 6 157 #define SINGLE_TONE_TEST_CHAN_BUTT 3 158 #define SINGLE_TONE_TEST_TIMES_BUTT 7 159 #define SINGLE_TONE_TEST_PARAM3_BUTT 15 160 #define SINGLE_TONE_TEST_PARAM4_BUTT 0xc8 161 #endif 162 163 #ifdef __cplusplus 164 #if __cplusplus 165 } 166 #endif 167 #endif 168 169 #endif /* end of wal_ccpriv.h */ 170 171