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 __WAL_IOCTL_H__ 20 #define __WAL_IOCTL_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "oal_ext_if.h" 26 #include "hmac_ext_if.h" 27 #include "wal_main.h" 28 #include "wal_event_msg.h" 29 30 #ifdef __cplusplus 31 #if __cplusplus 32 extern "C" { 33 #endif 34 #endif 35 36 /* **************************************************************************** 37 2 宏定义 38 **************************************************************************** */ 39 #if (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION) 40 /* IOCTL私有配置命令宏定义 */ 41 #define WAL_IOCTL_PRIV_SETPARAM (OAL_SIOCIWFIRSTPRIV + 0) 42 #define WAL_IOCTL_PRIV_GETPARAM (OAL_SIOCIWFIRSTPRIV + 1) 43 #define WAL_IOCTL_PRIV_SET_WMM_PARAM (OAL_SIOCIWFIRSTPRIV + 3) 44 #define WAL_IOCTL_PRIV_GET_WMM_PARAM (OAL_SIOCIWFIRSTPRIV + 5) 45 #define WAL_IOCTL_PRIV_SET_COUNTRY (OAL_SIOCIWFIRSTPRIV + 8) 46 #define WAL_IOCTL_PRIV_GET_COUNTRY (OAL_SIOCIWFIRSTPRIV + 9) 47 #define WAL_IOCTL_PRIV_GET_MODE (OAL_SIOCIWFIRSTPRIV + 17) /* 读取模式 */ 48 #define WAL_IOCTL_PRIV_SET_MODE (OAL_SIOCIWFIRSTPRIV + 18) /* 设置模式 包括协议,频段,带宽 */ 49 #define WAL_IOCTL_PRIV_AP_GET_STA_LIST (OAL_SIOCIWFIRSTPRIV + 21) 50 #define WAL_IOCTL_PRIV_AP_MAC_FLTR (OAL_SIOCIWFIRSTPRIV + 22) 51 /* netd将此配置命令作为GET方式下发,get方式命令用奇数,set用偶数 */ 52 #define WAL_IOCTL_PRIV_SET_AP_CFG (OAL_SIOCIWFIRSTPRIV + 23) 53 #define WAL_IOCTL_PRIV_AP_STA_DISASSOC (OAL_SIOCIWFIRSTPRIV + 24) 54 #endif 55 #define WAL_IOCTL_PRIV_SUBCMD_MAX_LEN 20 56 57 /* **************************************************************************** 58 3 枚举定义 59 **************************************************************************** */ 60 /* **************************************************************************** 61 4 全局变量声明 62 **************************************************************************** */ 63 #if (_PRE_MULTI_CORE_MODE_OFFLOAD_DMAC == _PRE_MULTI_CORE_MODE) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION) 64 extern oal_ethtool_ops_stru g_wal_ethtool_ops; 65 #endif 66 67 /* **************************************************************************** 68 5 消息头定义 69 **************************************************************************** */ 70 /* **************************************************************************** 71 6 消息定义 72 **************************************************************************** */ 73 /* **************************************************************************** 74 7 STRUCT定义 75 **************************************************************************** */ 76 /* 协议模式与字符串映射 */ 77 typedef struct { 78 hi_char *pc_name; /* 模式名字符串 */ 79 wlan_protocol_enum_uint8 mode; /* 协议模式 */ 80 wlan_channel_band_enum_uint8 band; /* 频段 */ 81 wlan_channel_bandwidth_enum_uint8 en_bandwidth; /* 带宽 */ 82 hi_u8 auc_resv[1]; 83 } wal_ioctl_mode_map_stru; 84 85 typedef struct wal_wifi_priv_cmd { 86 hi_s32 l_total_len; 87 hi_s32 l_used_len; 88 hi_u8 *puc_buf; 89 } wal_wifi_priv_cmd_stru; 90 91 /* CFG VAP h2d */ 92 typedef struct { 93 oal_net_device_stru *net_dev; 94 } mac_cfg_vap_h2d_stru; 95 96 /* **************************************************************************** 97 8 UNION定义 98 **************************************************************************** */ 99 /* **************************************************************************** 100 9 OTHERS定义 101 **************************************************************************** */ 102 /* **************************************************************************** 103 10 函数声明 104 **************************************************************************** */ 105 hi_u32 wal_alloc_cfg_event(oal_net_device_stru *netdev, frw_event_mem_stru **event_mem, hi_void *resp_addr, 106 wal_msg_stru **cfg_msg, hi_u16 us_len); 107 hi_u32 wal_send_cfg_event(oal_net_device_stru *netdev, wal_msg_type_enum_uint8 msg_type, hi_u16 us_len, 108 const hi_u8 *puc_param, hi_u8 need_rsp, wal_msg_stru **rsp_msg); 109 110 hi_u32 wal_start_vap(oal_net_device_stru *netdev); 111 hi_u32 wal_stop_vap(oal_net_device_stru *netdev); 112 hi_u32 wal_init_wlan_vap(oal_net_device_stru *netdev); 113 hi_u32 wal_deinit_wlan_vap(oal_net_device_stru *netdev); 114 hi_u32 wal_setup_vap(oal_net_device_stru *netdev); 115 hi_u32 wal_host_dev_init(const oal_net_device_stru *netdev); 116 #ifdef _PRE_WLAN_FEATURE_P2P 117 wlan_p2p_mode_enum_uint8 wal_wireless_iftype_to_mac_p2p_mode(nl80211_iftype_uint8 iftype); 118 #endif 119 hi_u32 wal_cfg_vap_h2d_event(oal_net_device_stru *netdev); 120 hi_u32 wal_recover_ini_main_gloabal(hi_void); 121 hi_u32 wal_host_dev_exit(const oal_net_device_stru *netdev); 122 123 hi_u32 wal_ioctl_set_freq(oal_net_device_stru *netdev, hi_char *pc_param); 124 hi_u32 wal_ioctl_set_mode(oal_net_device_stru *netdev, hi_char *pc_param); 125 hi_u32 wal_ioctl_set_essid(oal_net_device_stru *netdev, hi_char *pc_param); 126 hi_u32 wal_ioctl_set_txpower(oal_net_device_stru *netdev, hi_char *pc_param); 127 hi_u32 wal_get_cmd_one_arg(const hi_char *pc_cmd, hi_char *pc_arg, hi_u32 pc_arg_len, hi_u32 *pul_cmd_offset); 128 hi_u32 wal_set_mac_to_mib(oal_net_device_stru *netdev); 129 #if (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION) 130 hi_u32 wal_priv_cmd(oal_net_device_stru *netdev, oal_ifreq_stru *ifr, hi_s32 cmd); 131 #endif 132 #ifdef _PRE_WLAN_FEATURE_REKEY_OFFLOAD 133 hi_u32 wal_cfg80211_set_rekey_info(oal_net_device_stru *netdev, mac_rekey_offload_stru *rekey_offload); 134 #endif 135 hi_u32 wal_macaddr_check(const hi_u8 *mac_addr); 136 #ifdef _PRE_WLAN_FEATURE_P2P 137 hi_u32 wal_ioctl_set_p2p_noa(oal_net_device_stru *netdev, const mac_cfg_p2p_noa_param_stru *p2p_noa_param); 138 hi_u32 wal_ioctl_set_p2p_ops(oal_net_device_stru *netdev, const mac_cfg_p2p_ops_param_stru *p2p_ops_param); 139 hi_u32 wal_ioctl_set_wps_p2p_ie(oal_net_device_stru *netdev, const hi_u8 *puc_buf, hi_u32 len, 140 en_app_ie_type_uint8 type); 141 #endif 142 #if (_PRE_OS_VERSION == _PRE_OS_VERSION_LINUX) 143 oal_iw_handler_def_stru *wal_get_g_iw_handler_def(hi_void); 144 #endif 145 146 #ifdef __cplusplus 147 #if __cplusplus 148 } 149 #endif 150 #endif 151 152 #endif /* end of wal_ioctl.h */ 153