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 NET_ADAPTER_H 20 #define NET_ADAPTER_H 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "hmac_ext_if.h" 26 #include "oam_ext_if.h" 27 #include "wal_main.h" 28 29 #ifdef __cplusplus 30 #if __cplusplus 31 extern "C" { 32 #endif 33 #endif 34 35 /* **************************************************************************** 36 2 宏定义 37 **************************************************************************** */ 38 /* * Ask if a driver is ready to send */ 39 #define WAL_SIOCDEVPRIVATE 0x89F0 /* SIOCDEVPRIVATE */ 40 #define WAL_ADDR_MAX 16 41 42 /* **************************************************************************** 43 3 枚举定义 44 **************************************************************************** */ 45 typedef enum { 46 WAL_PHY_MODE_11N = 0, 47 WAL_PHY_MODE_11G = 1, 48 WAL_PHY_MODE_11B = 2, 49 WAL_PHY_MODE_BUTT 50 } wal_phy_mode; 51 52 typedef enum { 53 WAL_ADDR_IDX_STA0 = 0, 54 WAL_ADDR_IDX_AP0 = 1, 55 WAL_ADDR_IDX_STA1 = 2, 56 WAL_ADDR_IDX_STA2 = 3, 57 WAL_ADDR_IDX_BUTT 58 } wal_addr_idx; 59 60 /* **************************************************************************** 61 7 STRUCT定义 62 **************************************************************************** */ 63 typedef struct { 64 hi_u8 ac_addr[WLAN_MAC_ADDR_LEN]; 65 hi_u16 us_status; 66 } wal_dev_addr_stru; 67 68 /* **************************************************************************** 69 10 函数声明 70 **************************************************************************** */ 71 hi_s32 wal_netdev_open(oal_net_device_stru *netdev); 72 hi_s32 wal_netdev_stop(oal_net_device_stru *netdev); 73 74 #ifdef _PRE_WLAN_FEATURE_MESH_LWIP_RIPPLE 75 hi_s32 hwal_lwip_remove_user(oal_lwip_netif *netif, oal_linklayer_addr *mac_addr); 76 hi_s32 hwal_lwip_set_beacon_priority(oal_lwip_netif *netif, hi_u8 prio); 77 hi_s32 hwal_lwip_set_mnid(oal_lwip_netif *netif, oal_uniqid_t us_mnid); 78 #endif 79 hi_u32 wal_mesh_inform_tx_data_info(frw_event_mem_stru *event_mem); 80 hi_u32 wal_mesh_report_mesh_user_info(frw_event_mem_stru *event_mem); 81 hi_u32 wal_report_sta_assoc_info(frw_event_mem_stru *event_mem); 82 hi_void wal_ip_conver_multi_mac(hi_u8 *puc_group_mac, const hi_u8 *puc_group_ip, hi_u8 ip_len); 83 hi_void wal_init_dev_addr(hi_void); 84 hi_u32 wal_set_dev_addr(const hi_char *pc_addr, hi_u8 mac_len); 85 hi_u32 wal_set_dev_addr_from_efuse(const hi_char *pc_addr, hi_u8 mac_len); 86 hi_u8 wal_dev_is_running(hi_void); 87 hi_u32 wal_get_dev_addr(hi_u8 *pc_addr, hi_u8 addr_len, nl80211_iftype_uint8 type); 88 hi_s32 wal_init_drv_wlan_netdev(nl80211_iftype_uint8 type, wal_phy_mode mode, oal_net_device_stru *netdev); 89 hi_s32 wal_deinit_drv_wlan_netdev(oal_net_device_stru *netdev); 90 oal_net_device_ops_stru *wal_get_net_dev_ops(hi_void); 91 hi_u32 wal_get_efuse_mac_addr(hi_void); 92 hi_s32 InitNetdev(struct NetDevice *netDevice, nl80211_iftype_uint8 type); 93 hi_s32 DeinitNetdev(nl80211_iftype_uint8 type); 94 hi_s32 SetIfName(WifiIfAdd *ifAdd); 95 #ifdef __cplusplus 96 #if __cplusplus 97 } 98 #endif 99 #endif 100 101 #endif 102