WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
oal_net_cfg80211.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2020. All rights reserved.
3 * Description: oal net interface
4 * Create: 2020-05-02
5 */
6
7#ifndef __OAL_NET_CFG80211_HCM_H__
8#define __OAL_NET_CFG80211_HCM_H__
9
10#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
11#include <net/iw_handler.h>
12#include <net/rtnetlink.h>
13#include <net/netlink.h>
14#include <net/sch_generic.h>
15#include <net/ip6_checksum.h>
16#include <net/ipv6.h>
17#include <net/arp.h>
18#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
19#include <net/sock.h>
20#endif
21
22#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34))
23#include <net/cfg80211.h>
24#else
25#include <net/wireless.h>
26#endif
27#include <../net/wireless/nl80211.h>
28
29#include <linux/version.h>
30#include <linux/netdevice.h>
31#include <linux/if.h>
32#include <linux/etherdevice.h>
33#include <linux/wireless.h>
34#include <linux/socket.h>
35#include <linux/if_vlan.h>
36#include <linux/if_ether.h>
37#include <linux/ip.h>
38#include <linux/rtnetlink.h>
39#include <linux/netfilter_bridge.h>
40#include <linux/if_arp.h>
41#include <linux/in.h>
42#include <linux/udp.h>
43#include <linux/icmpv6.h>
44#include <linux/ipv6.h>
45#include <linux/inet.h>
46#include <linux/nl80211.h>
47#include <linux/ieee80211.h>
48#endif
49#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
50#include "lwip/netif.h"
51#include "oal_skbuff.h"
52#endif
53
54#include "wlan_spec.h"
55
56#ifdef __cplusplus
57#if __cplusplus
58extern "C" {
59#endif
60#endif
61
63#define OAL_MAC_ADDR_LEN 6
64#define OAL_IF_NAME_SIZE 16
65#define OAL_IEEE80211_MAX_SSID_LEN 32 /* 最大SSID长度 */
66#define OAL_NL80211_MAX_NR_CIPHER_SUITES 5
67#define BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY 123
68#define MAX_STA_NUM_OF_ONE_GROUP 8 /* 一个组播组最大支持32个用户 */
69#define MAX_NUM_OF_GROUP 8 /* 最大支持256个组播组 */
70
76
77#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
78/*****************************************************************************
79 2 宏定义
80*****************************************************************************/
81#define IEEE80211_HT_MCS_MASK_LEN 10
82#define OAL_NL80211_MAX_NR_AKM_SUITES 2
83#define OAL_WLAN_SA_QUERY_TR_ID_LEN 2
84#ifdef _PRE_WLAN_FEATURE_015CHANNEL_EXP
85#define OAL_MAX_SCAN_CHANNELS 16
86#else
87#define OAL_MAX_SCAN_CHANNELS 14
88#endif
89#define WLAN_SA_QUERY_TR_ID_LEN 2
90#define NL80211_RRF_NO_OFDM (1<<0)
91#define NL80211_RRF_DFS (1<<4)
92#define NL80211_RRF_NO_OUTDOOR (1<<3)
93
94typedef td_u8 oal_nl80211_channel_type_uint8;
95typedef td_u8 nl80211_iftype_uint8;
96typedef td_u8 cfg80211_signal_type_uint8;
97typedef td_u8 oal_ieee80211_band_enum_uint8;
98/*****************************************************************************
99 3 枚举定义
100*****************************************************************************/
101enum nl80211_band {
102 NL80211_BAND_2GHZ,
103 NL80211_BAND_5GHZ,
104};
105
106enum ieee80211_band {
107 IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
108 IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
109
110 /* keep last */
111 IEEE80211_NUM_BANDS
112};
113
114#define OAL_IEEE80211_BAND_2GHZ IEEE80211_BAND_2GHZ
115#define OAL_IEEE80211_BAND_5GHZ IEEE80211_BAND_5GHZ
116#define OAL_IEEE80211_NUM_BANDS IEEE80211_NUM_BANDS
117
118enum nl80211_channel_type {
119 NL80211_CHAN_NO_HT,
120 NL80211_CHAN_HT20,
121 NL80211_CHAN_HT40MINUS,
122 NL80211_CHAN_HT40PLUS
123};
124typedef enum nl80211_channel_type oal_nl80211_channel_type;
125
126enum nl80211_key_type {
127 NL80211_KEYTYPE_GROUP,
128 NL80211_KEYTYPE_PAIRWISE,
129 NL80211_KEYTYPE_PEERKEY,
130 NUM_NL80211_KEYTYPES
131};
132typedef enum nl80211_key_type oal_nl80211_key_type;
133
134enum nl80211_iftype {
135 NL80211_IFTYPE_UNSPECIFIED,
136 NL80211_IFTYPE_ADHOC,
137 NL80211_IFTYPE_STATION,
139 NL80211_IFTYPE_AP_VLAN,
140 NL80211_IFTYPE_WDS,
141 NL80211_IFTYPE_MONITOR,
142 NL80211_IFTYPE_MESH_POINT,
143 NL80211_IFTYPE_P2P_CLIENT,
144 NL80211_IFTYPE_P2P_GO,
145 NL80211_IFTYPE_P2P_DEVICE,
146 /* keep last */
147 NUM_NL80211_IFTYPES,
148 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
149};
150
151enum cfg80211_signal_type {
152 CFG80211_SIGNAL_TYPE_NONE,
153 CFG80211_SIGNAL_TYPE_MBM,
154 CFG80211_SIGNAL_TYPE_UNSPEC,
155};
156
157enum station_info_flags {
158 STATION_INFO_INACTIVE_TIME = 1 << 0,
159 STATION_INFO_RX_BYTES = 1 << 1,
160 STATION_INFO_TX_BYTES = 1 << 2,
161 STATION_INFO_LLID = 1 << 3,
162 STATION_INFO_PLID = 1 << 4,
163 STATION_INFO_PLINK_STATE = 1 << 5,
164 STATION_INFO_SIGNAL = 1 << 6,
165 STATION_INFO_TX_BITRATE = 1 << 7,
166 STATION_INFO_RX_PACKETS = 1 << 8,
167 STATION_INFO_TX_PACKETS = 1 << 9,
168 STATION_INFO_TX_RETRIES = 1 << 10,
169 STATION_INFO_TX_FAILED = 1 << 11,
170 STATION_INFO_RX_DROP_MISC = 1 << 12,
171 STATION_INFO_SIGNAL_AVG = 1 << 13,
172 STATION_INFO_RX_BITRATE = 1 << 14,
173 STATION_INFO_BSS_PARAM = 1 << 15,
174 STATION_INFO_CONNECTED_TIME = 1 << 16,
175 STATION_INFO_ASSOC_REQ_IES = 1 << 17,
176 STATION_INFO_STA_FLAGS = 1 << 18,
177 STATION_INFO_BEACON_LOSS_COUNT = 1 << 19,
178 STATION_INFO_T_OFFSET = 1 << 20,
179 STATION_INFO_LOCAL_PM = 1 << 21,
180 STATION_INFO_PEER_PM = 1 << 22,
181 STATION_INFO_NONPEER_PM = 1 << 23,
182 STATION_INFO_RX_BYTES64 = 1 << 24,
183 STATION_INFO_TX_BYTES64 = 1 << 25,
184};
185
186/* 原hmac和dmac结构体SAE/EAP成员定义是反的。dmac未使用以hmac为准 */
187typedef enum nl80211_auth_type {
188 NL80211_AUTHTYPE_OPEN_SYSTEM,
189 NL80211_AUTHTYPE_SHARED_KEY,
190 NL80211_AUTHTYPE_FT,
191 NL80211_AUTHTYPE_SAE,
192 NL80211_AUTHTYPE_NETWORK_EAP,
193 /* keep last */
194 NL80211_AUTHTYPE_AUTOMATIC
195} oal_nl80211_auth_type_enum;
196typedef td_u8 oal_nl80211_auth_type_enum_uint8;
197
198enum nl80211_sae_pwe_mechanism {
199 NL80211_SAE_PWE_UNSPECIFIED,
200 NL80211_SAE_PWE_HUNT_AND_PECK,
201 NL80211_SAE_PWE_HASH_TO_ELEMENT,
202 NL80211_SAE_PWE_BOTH,
203};
204
205enum nl80211_hidden_ssid {
206 NL80211_HIDDEN_SSID_NOT_IN_USE,
207 NL80211_HIDDEN_SSID_ZERO_LEN,
208 NL80211_HIDDEN_SSID_ZERO_CONTENTS
209};
210
211/* enum nl80211_mfp - Management frame protection state
212 * @NL80211_MFP_NO: Management frame protection not used
213 * @NL80211_MFP_REQUIRED: Management frame protection required */
214typedef enum nl80211_mfp {
215 NL80211_MFP_NO,
216 NL80211_MFP_REQUIRED,
217} oal_nl80211_mfp_enum;
218typedef td_u8 oal_nl80211_mfp_enum_uint8;
219
220enum nl80211_acl_policy {
221 NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED,
222 NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
223};
224
225enum wiphy_flags {
226 WIPHY_FLAG_CUSTOM_REGULATORY = bit(0),
227 WIPHY_FLAG_STRICT_REGULATORY = bit(1),
228 WIPHY_FLAG_DISABLE_BEACON_HINTS = bit(2),
229 WIPHY_FLAG_NETNS_OK = bit(3),
230 WIPHY_FLAG_PS_ON_BY_DEFAULT = bit(4),
231 WIPHY_FLAG_4ADDR_AP = bit(5),
232 WIPHY_FLAG_4ADDR_STATION = bit(6),
233 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = bit(7),
234 WIPHY_FLAG_IBSS_RSN = bit(8),
235 WIPHY_FLAG_MESH_AUTH = bit(10),
236 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = bit(11),
237 /* use hole at 12 */
238 WIPHY_FLAG_SUPPORTS_FW_ROAM = bit(13),
239 WIPHY_FLAG_AP_UAPSD = bit(14),
240 WIPHY_FLAG_SUPPORTS_TDLS = bit(15),
241 WIPHY_FLAG_TDLS_EXTERNAL_SETUP = bit(16),
242 WIPHY_FLAG_HAVE_AP_SME = bit(17),
243 WIPHY_FLAG_REPORTS_OBSS = bit(18),
244 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = bit(19),
245 WIPHY_FLAG_OFFCHAN_TX = bit(20),
246 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = bit(21),
247};
248
249enum nl80211_mesh_power_mode {
250 NL80211_MESH_POWER_UNKNOWN,
251 NL80211_MESH_POWER_ACTIVE,
252 NL80211_MESH_POWER_LIGHT_SLEEP,
253 NL80211_MESH_POWER_DEEP_SLEEP,
254
255 __NL80211_MESH_POWER_AFTER_LAST,
256 NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1
257};
258
259enum rate_info_flags {
260 RATE_INFO_FLAGS_MCS = bit(0),
261 RATE_INFO_FLAGS_VHT_MCS = bit(1),
262 RATE_INFO_FLAGS_40_MHZ_WIDTH = bit(2),
263 RATE_INFO_FLAGS_80_MHZ_WIDTH = bit(3),
264 RATE_INFO_FLAGS_80P80_MHZ_WIDTH = bit(4),
265 RATE_INFO_FLAGS_160_MHZ_WIDTH = bit(5),
266 RATE_INFO_FLAGS_SHORT_GI = bit(6),
267 RATE_INFO_FLAGS_60G = bit(7),
268};
269
270/*****************************************************************************
271 4 全局变量声明
272*****************************************************************************/
273
274/*****************************************************************************
275 5 消息头定义
276*****************************************************************************/
277
278/*****************************************************************************
279 6 消息定义
280*****************************************************************************/
281
282/*****************************************************************************
283 7 STRUCT定义
284*****************************************************************************/
285typedef struct {
286 td_u32 handle;
287} oal_qdisc_stru;
288
289/* iw_handler_def结构体封装 */
290typedef struct {
291 td_u16 cmd; /* Wireless Extension command */
292 td_u16 flags; /* More to come ;-) */
293} oal_iw_request_info_stru;
294
295typedef struct {
296 td_void* pointer; /* Pointer to the data (in user space) */
297 td_u16 length; /* number of fields or size in bytes */
298 td_u16 flags; /* Optional params */
299} oal_iw_point_stru;
300
301typedef struct {
302 td_s32 value; /* The value of the parameter itself */
303 td_u8 fixed; /* Hardware should not use auto select */
304 td_u8 disabled; /* Disable the feature */
305 td_u16 flags; /* Various specifc flags (if any) */
306} oal_iw_param_stru;
307
308typedef struct {
309 td_s32 m; /* Mantissa */
310 td_s16 e; /* Exponent */
311 td_u8 i; /* List index (when in range struct) */
312 td_u8 flags; /* Flags (fixed/auto) */
313} oal_iw_freq_stru;
314
315typedef struct {
316 td_u8 qual; /* link quality (%retries, SNR, %missed beacons or better...) */
317 td_u8 level; /* signal level (dBm) */
318 td_u8 noise; /* noise level (dBm) */
319 td_u8 updated; /* Flags to know if updated */
320} oal_iw_quality_stru;
321
322typedef struct {
323 td_u16 sa_family; /* address family, AF_xxx */
324 td_u8 sa_data[14]; /* 14 bytes of protocol address */
325} oal_sockaddr_stru;
326
327typedef struct netif oal_lwip_netif;
328struct ieee80211_mcs_info {
330 td_u16 rx_highest;
331 td_u8 tx_params;
332 td_u8 reserved[3]; /* 保留3字节对齐 */
333};
334
335struct ieee80211_freq_range {
336 td_u32 start_freq_khz;
337 td_u32 end_freq_khz;
338 td_u32 max_bandwidth_khz;
339};
340
341struct ieee80211_power_rule {
342 td_u32 max_antenna_gain;
343 td_u32 max_eirp;
344};
345
346struct ieee80211_reg_rule {
347 struct ieee80211_freq_range freq_range;
348 struct ieee80211_power_rule power_rule;
349 td_u32 flags;
350};
351
352struct ieee80211_msrment_ie {
353 td_u8 token;
354 td_u8 mode;
355 td_u8 type;
356 td_u8 request[0];
357};
358
359struct ieee80211_ext_chansw_ie {
360 td_u8 mode;
361 td_u8 new_operating_class;
362 td_u8 new_ch_num;
363 td_u8 count;
364};
365
366struct callback_head {
367 struct callback_head *next;
368 td_void (*func)(struct callback_head *head);
369};
370
371#define RCU_HEAD callback_head
372
373struct ieee80211_regdomain {
374 struct RCU_HEAD RCU_HEAD;
375 td_u32 n_reg_rules;
376 td_char alpha2[2]; /* 国家码2字符 */
377 td_u8 dfs_region;
378 struct ieee80211_reg_rule reg_rules[];
379};
380
381typedef struct ieee80211_regdomain oal_ieee80211_regdomain_stru;
382
383typedef struct oal_cfg80211_ssid_tag {
385 td_u8 ssid_len;
386 td_u8 arry[3]; /* 3: SIZE(0..3) */
387} oal_cfg80211_ssid_stru;
388
389/* 原结构体hmac和dmac不一致 以hmac为准 */
390typedef struct ieee80211_channel {
391 oal_ieee80211_band_enum_uint8 band;
392 td_u16 center_freq;
393 td_u16 hw_value;
394 td_u32 flags;
395 td_s32 max_antenna_gain;
396 td_s32 max_power;
397 td_bool beacon_found;
398 td_u8 resv[3]; /* 3 字节对齐 */
399 td_u32 orig_flags;
400 td_s32 orig_mag;
401 td_s32 orig_mpwr;
402} oal_ieee80211_channel_stru;
403typedef struct ieee80211_channel oal_ieee80211_channel;
404
405typedef struct oal_cfg80211_crypto_settings_tag {
406 td_u32 wpa_versions;
407 td_u32 cipher_group;
408 td_s32 n_ciphers_pairwise;
410 td_s32 n_akm_suites;
412 enum nl80211_sae_pwe_mechanism sae_pwe;
413
414 td_u8 control_port;
415 td_u8 arry[3]; /* 3: SIZE(0..3) */
416} oal_cfg80211_crypto_settings_stru;
417
418typedef struct cfg80211_add_key_info_stru {
419 td_u8 key_index;
420 td_bool pairwise;
421}cfg80211_add_key_info_stru;
422
423typedef struct cfg80211_get_key_info_stru {
424 td_u8 key_index;
425 td_u8 arsvd[2]; /* 2: 保留字段 */
426 bool pairwise;
427 const td_u8 *mac_addr;
428}cfg80211_get_key_info_stru;
429
430/* net_device ioctl结构体定义 */
431/* hostapd/wpa_supplicant 下发的信息元素结构 */
432/* 该结构为事件内存池大小,保存从hostapd/wpa_supplicant下发的ie 信息 */
433/* 注意: 整个结构体长度为事件内存池大小,如果事件内存池有修改,则需要同步修改app 数据结构 */
434struct oal_app_ie {
437 osal_u8 ie_type_bitmap;
438 osal_u8 rsv[2]; /* 保留2字节对齐 */
439 /* ie 中保存信息元素,长度 = (事件内存池大小 - 保留长度) */
441};
442typedef struct oal_app_ie oal_app_ie_stru;
443
444typedef struct {
445 td_u32 fake;
446} oal_iw_statistics_stru;
447
448typedef union {
449 /* Config - generic */
451 oal_iw_point_stru essid; /* Extended network name */
452 oal_iw_param_stru nwid; /* network id (or domain - the cell) */
453 oal_iw_freq_stru freq; /* frequency or channel : * 0-1000 = channel * > 1000 = frequency in Hz */
454 oal_iw_param_stru sens; /* signal level threshold */
455 oal_iw_param_stru bitrate; /* default bit rate */
456 oal_iw_param_stru txpower; /* default transmit power */
457 oal_iw_param_stru rts; /* RTS threshold threshold */
458 oal_iw_param_stru frag; /* Fragmentation threshold */
459 td_u32 mode; /* Operation mode */
460 oal_iw_param_stru retry; /* Retry limits & lifetime */
461 oal_iw_point_stru encoding; /* Encoding stuff : tokens */
462 oal_iw_param_stru power; /* PM duration/timeout */
463 oal_iw_quality_stru qual; /* Quality part of statistics */
464 oal_sockaddr_stru ap_addr; /* Access point address */
465 oal_sockaddr_stru addr; /* Destination address (hw/mac) */
466 oal_iw_param_stru param; /* Other small parameters */
467 oal_iw_point_stru data; /* Other large parameters */
468} oal_iwreq_data_union;
469
470struct oal_net_device;
471typedef td_u32 (*oal_iw_handler)(struct oal_net_device* dev, oal_iw_request_info_stru* info,
472 oal_iwreq_data_union* wrqu, td_s8* extra);
473
474/* 私有IOCTL接口信息 */
475typedef struct {
476 td_u32 cmd; /* ioctl命令号 */
477 td_u16 set_args; /* 类型和参数字符个数 */
478 td_u16 get_args; /* 类型和参数字符个数 */
479 td_char name[OAL_IF_NAME_SIZE]; /* 私有命令名 */
480} oal_iw_priv_args_stru;
481
482typedef struct {
483 const oal_iw_handler* standard;
484 td_u16 num_standard;
485 td_u16 num_private;
486
487 /* FangBaoshun For wrl31 Compile */
488 const oal_iw_handler* private;
489 /* FangBaoshun For wrl31 Compile */
490 td_u8 auc_resv[2]; /* 2: bytes保留字段 */
491 td_u16 num_private_args;
492
493 const oal_iw_handler* private_win32;
494
495 const oal_iw_priv_args_stru* private_args;
496 oal_iw_statistics_stru* (*get_wireless_stats)(struct oal_net_device* dev);
497} oal_iw_handler_def_stru;
498
499typedef struct _oal_ext_eapol_stru {
500 td_bool register_code;
501 td_u8 eapol_cnt; /* 当前链表中eapol数量 */
502 td_u16 enqueue_time; /* 记录的eapol帧最早入队时间 单位s 用于超时老化 */
503 td_void* context;
504 td_void (*notify_callback)(td_void* name, td_void* context);
505 oal_netbuf_head_stru eapol_skb_head;
506} oal_ext_eapol_stru;
507
508typedef struct {
509 td_u32 rx_packets; /* total packets received */
510 td_u32 tx_packets; /* total packets transmitted */
511 td_u32 rx_bytes; /* total bytes received */
512 td_u32 tx_bytes; /* total bytes transmitted */
513 td_u32 rx_errors; /* bad packets received */
514 td_u32 tx_errors; /* packet transmit problems */
515 td_u32 rx_dropped; /* no space in linux buffers */
516 td_u32 tx_dropped; /* no space available in linux */
517 td_u32 multicast; /* multicast packets received */
518 td_u32 collisions;
519
520 /* detailed rx_errors: */
521 td_u32 rx_length_errors;
522 td_u32 rx_over_errors; /* receiver ring buff overflow */
523 td_u32 rx_crc_errors; /* recved pkt with crc error */
524 td_u32 rx_frame_errors; /* recv'd frame alignment error */
525 td_u32 rx_fifo_errors; /* recv'r fifo overrun */
526 td_u32 rx_missed_errors; /* receiver missed packet */
527
528 /* detailed tx_errors */
529 td_u32 tx_aborted_errors;
530 td_u32 tx_carrier_errors;
531 td_u32 tx_fifo_errors;
532 td_u32 tx_heartbeat_errors;
533 td_u32 tx_window_errors;
534
535 /* for cslip etc */
536 td_u32 rx_compressed;
537 td_u32 tx_compressed;
538} oal_net_device_stats_stru;
539
540/* 原hmac和dmac结构体不一致 以HMAC为准 */
541typedef struct oal_net_device {
543 td_void* ml_priv;
544 struct oal_net_device_ops* netdev_ops;
545 td_u32 last_rx;
546 td_u32 flags;
547 oal_iw_handler_def_stru* wireless_handlers;
548 td_u8 dev_addr[ETHER_ADDR_LEN];
550 td_u8 resv;
551 td_s32 tx_queue_len;
552 td_u16 hard_header_len;
553 td_u16 type;
554 td_u16 needed_headroom;
555 td_u16 needed_tailroom;
556 struct oal_net_device* master;
557 struct wireless_dev* ieee80211_ptr;
558 oal_qdisc_stru* qdisc;
559 td_u8* ifalias;
560 td_u8 addr_len;
561 td_u8 resv2[3]; /* 3: bytes保留字段 */
562 td_s32 watchdog_timeo;
563 oal_net_device_stats_stru stats;
564 td_u32 mtu;
565 td_void (*destructor)(struct oal_net_device*);
566 td_void* priv;
567 td_u32 num_tx_queues;
568 oal_ext_eapol_stru ext_eapol; /* EAPOL报文收发数据结构 */
569 oal_lwip_netif* lwip_netif; /* LWIP协议栈数据结构 */
570#ifdef _PRE_WLAN_FEATURE_VLWIP
571 oal_lwip_netif* vlwip_netif;
572#endif
573#ifdef _PRE_WLAN_LWIP_PAYLOAD_COPY_TRANS
574 oal_netbuf_stru* rx_pkt;
575#endif
576} oal_net_device_stru;
577
578typedef struct oal_net_notify {
579 td_u32 ip_addr;
580 td_u32 notify_type;
581} oal_net_notify_stru;
582
583// 适配HW_LITEOS_OPEN_VERSION_NUM >= kernel_version(1,4,2))
584typedef struct ifreq oal_ifreq_stru;
585
586typedef struct oal_net_device_ops {
587 td_s32 (*ndo_init)(oal_net_device_stru*);
588 td_s32 (*ndo_open)(struct oal_net_device*);
589 td_s32 (*ndo_stop)(struct oal_net_device*);
590 oal_net_dev_tx_enum (*ndo_start_xmit) (oal_netbuf_stru*, struct oal_net_device*);
591 td_void (*ndo_set_multicast_list)(struct oal_net_device*);
592 oal_net_device_stats_stru* (*ndo_get_stats)(oal_net_device_stru*);
593 td_s32 (*ndo_do_ioctl)(struct oal_net_device*, oal_ifreq_stru*, td_s32);
594 td_s32 (*ndo_change_mtu)(struct oal_net_device*, td_s32);
595 td_s32 (*ndo_set_mac_address)(struct oal_net_device*, oal_sockaddr_stru*);
596 td_s16 (*ndo_select_queue)(oal_net_device_stru* dev, oal_netbuf_stru*);
597 td_s32 (*ndo_netif_notify)(oal_net_device_stru*, oal_net_notify_stru*);
598} oal_net_device_ops_stru;
599
600/* 此结构体成员命名是为了保持跟linux一致 */
601typedef struct ieee80211_rate {
602 td_u32 flags;
603 td_u16 bitrate;
604 td_u16 hw_value;
605 td_u16 hw_value_short;
606 td_u8 rsv[2]; /* 2: bytes保留字段 */
607} oal_ieee80211_rate;
608
609typedef struct ieee80211_sta_ht_cap {
610 td_u16 cap; /* use IEEE80211_HT_CAP_ */
611 td_u8 ht_supported;
612 td_u8 ampdu_factor;
613 td_u8 ampdu_density;
614 td_u8 rsv[3]; /* 3: bytes保留字段 */
615 struct ieee80211_mcs_info mcs;
616} oal_ieee80211_sta_ht_cap;
617
618typedef struct ieee80211_supported_band {
619 oal_ieee80211_channel* channels;
620 oal_ieee80211_rate* bitrates;
621 oal_ieee80211_band_enum_uint8 band;
622 td_s32 n_channels;
623 td_s32 n_bitrates;
624 oal_ieee80211_sta_ht_cap ht_cap;
625} oal_ieee80211_supported_band;
626
627typedef struct oal_wiphy_tag {
628 oal_ieee80211_supported_band* bands[IEEE80211_NUM_BANDS];
629 td_u8 priv[4]; /* 4: SIZE(0..4) */
630} oal_wiphy_stru;
631
632typedef struct cfg80211_chan_def {
633 oal_ieee80211_channel* chan;
634 oal_nl80211_channel_type width;
635 td_s32 center_freq1;
636 td_s32 center_freq2;
637} oal_cfg80211_chan_def;
638
639typedef struct cfg80211_pmksa oal_cfg80211_pmksa_stru;
640
641typedef struct oal_key_params_tag {
642 td_u8* key;
643 td_u8* seq;
644 td_s32 key_len;
645 td_s32 seq_len;
646 td_u32 cipher;
647} oal_key_params_stru;
648
649typedef struct oal_cfg80211_scan_request_tag {
650 oal_cfg80211_ssid_stru* ssids;
651 td_u32 n_ssids;
652 td_u32 n_channels;
654
655 /* internal */
656 oal_net_device_stru* dev;
657 struct wireless_dev* wdev;
658
659 td_u8 aborted;
660 td_u8 prefix_ssid_scan_flag;
661#if defined(_PRE_WLAN_FEATURE_WS92_MERGE) && defined(_PRE_WLAN_FEATURE_ACS)
662 td_u8 acs_scan_flag;
663 td_u8 resv;
664#else
665 td_u8 resv[2]; /* 2: 锟斤拷锟斤拷锟街讹拷 */
666#endif
667
668 td_u8* ie;
669 /* keep last */
670 oal_ieee80211_channel_stru* channels[OAL_MAX_SCAN_CHANNELS];
671} oal_cfg80211_scan_request_stru;
672
673typedef struct cfg80211_sched_scan_request {
674 struct cfg80211_ssid* ssids;
675 td_s32 n_ssids;
676 td_u32 n_channels;
677 td_u32 interval;
678 const td_u8* ie;
679 size_t ie_len;
680 td_u32 flags;
681 struct cfg80211_match_set* match_sets;
682 td_s32 n_match_sets;
683 td_s32 min_rssi_thold;
684 td_s32 rssi_thold; /* just for backward compatible */
685
686 /* internal */
687 struct wiphy* wiphy;
688 struct oal_net_device_stru* dev;
689 td_u32 scan_start;
690 /* keep last */
691 struct ieee80211_channel* channels[0];
692} oal_cfg80211_sched_scan_request_stru;
693
694typedef struct oal_cfg80211_connect_params_tag {
695 oal_ieee80211_channel_stru* channel;
696
697 td_u8* bssid;
698 td_u8* ssid;
699 td_u8* ie;
700
701 td_u32 ssid_len;
703 oal_cfg80211_crypto_settings_stru crypto;
704 const td_u8* key;
705
706 oal_nl80211_auth_type_enum_uint8 auth_type;
707 td_u8 privacy;
708 td_u8 key_len;
709 td_u8 key_idx;
710 oal_nl80211_mfp_enum_uint8 mfp;
711 td_u8 auc_resv[3]; /* 3: 閿熸枻鎷烽敓鏂ゆ嫹閿熻鏂ゆ嫹 */
712} oal_cfg80211_connect_params_stru;
713
714typedef struct ieee80211_mgmt {
716 td_u16 duration;
717 td_u8 da[6]; /* 6: SIZE(0..6) */
718 td_u8 sa[6]; /* 6: SIZE(0..6) */
719 td_u8 bssid[6]; /* 6: SIZE(0..6) */
720 td_u16 seq_ctrl;
721 union {
722 struct {
723 td_u16 auth_alg;
724 td_u16 auth_transaction;
725 td_u16 status_code;
726 /* possibly followed by Challenge text */
727 td_u8 variable[0];
728 } auth;
729 struct {
730 td_u16 reason_code;
731 } deauth;
732 struct {
733 td_u16 capab_info;
734 td_u16 listen_interval;
735 /* followed by SSID and Supported rates */
736 td_u8 variable[0];
737 } assoc_req;
738 struct {
739 td_u16 capab_info;
740 td_u16 status_code;
741 td_u16 aid;
742 /* followed by Supported rates */
743 td_u8 variable[0];
744 } assoc_resp, reassoc_resp;
745 struct {
746 td_u16 capab_info;
747 td_u16 listen_interval;
748 td_u8 current_ap[6]; /* 6: SIZE(0..6) */
749 /* followed by SSID and Supported rates */
750 td_u8 variable[0];
751 } reassoc_req;
752 struct {
753 td_u16 reason_code;
754 } disassoc;
755 struct {
756 td_u64 timestamp;
757 td_u16 beacon_int;
758 td_u16 capab_info;
759 /* followed by some of SSID, Supported rates,
760 * FH Params, DS Params, CF Params, IBSS Params, TIM */
761 td_u8 variable[4]; /* 4: FH Params, DS Params, CF Params, IBSS Params */
762 } beacon;
763 struct {
764 td_u64 timestamp;
765 td_u16 beacon_int;
766 td_u16 capab_info;
767 /* followed by some of SSID, Supported rates,
768 * FH Params, DS Params, CF Params, IBSS Params */
769 td_u8 variable[4]; /* 4: FH Params, DS Params, CF Params, IBSS Params */
770 } probe_resp;
771 struct {
772 td_u8 category;
773 union {
774 struct {
775 td_u8 action_code;
776 td_u8 dialog_token;
777 td_u8 status_code;
778 td_u8 variable[0];
779 } wme_action;
780 struct {
781 td_u8 action_code;
782 td_u8 variable[0];
783 } chan_switch;
784 struct {
785 td_u8 action_code;
786 struct ieee80211_ext_chansw_ie data;
787 td_u8 variable[0];
788 } ext_chan_switch;
789 struct {
790 td_u8 action_code;
791 td_u8 dialog_token;
792 td_u8 element_id;
793 td_u8 length;
794 struct ieee80211_msrment_ie msr_elem;
795 } measurement;
796 struct {
797 td_u8 action_code;
798 td_u8 dialog_token;
799 td_u16 capab;
800 td_u16 timeout;
801 td_u16 start_seq_num;
802 } addba_req;
803 struct {
804 td_u8 action_code;
805 td_u8 dialog_token;
806 td_u16 status;
807 td_u16 capab;
808 td_u16 timeout;
809 } addba_resp;
810 struct {
811 td_u8 action_code;
812 td_u8 resv;
813 td_u16 params;
814 td_u16 reason_code;
815 } delba;
816 struct {
817 td_u8 action_code;
818 td_u8 variable[0];
819 } self_prot;
820 struct {
821 td_u8 action_code;
822 td_u8 variable[0];
823 } mesh_action;
824 struct {
825 td_u8 action;
826 td_u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
827 } sa_query;
828 struct {
829 td_u8 action;
830 td_u8 smps_control;
831 } ht_smps;
832 struct {
833 td_u8 action_code;
834 td_u8 chanwidth;
835 } ht_notify_cw;
836 struct {
837 td_u8 action_code;
838 td_u8 dialog_token;
839 td_u16 capability;
840 td_u8 variable[0];
841 } tdls_discover_resp;
842 struct {
843 td_u8 action_code;
844 td_u8 operating_mode;
845 } vht_opmode_notif;
846 } u;
847 } action;
848 } u;
849} oal_ieee80211_mgmt_stru;
850
851struct cfg80211_crypto_settings {
852 td_u32 wpa_versions;
853 td_u32 cipher_group;
854 td_s32 n_ciphers_pairwise;
856 td_s32 n_akm_suites;
858 td_u16 control_port_ethertype;
859 td_bool control_port;
860 td_bool control_port_no_encrypt;
861};
862
863struct ieee80211_vht_mcs_info {
864 td_u16 rx_mcs_map;
865 td_u16 rx_highest;
866 td_u16 tx_mcs_map;
867 td_u16 tx_highest;
868};
869
870typedef struct cfg80211_bss oal_cfg80211_bss_stru;
871
872typedef struct rate_info {
873 td_u8 flags;
874 td_u8 mcs;
875 td_u16 legacy;
876 td_u8 nss;
877 td_u8 resv;
878} oal_rate_info_stru;
879
880typedef struct vif_params {
881 td_s32 use_4addr;
882 td_u8* macaddr;
883} oal_vif_params_stru;
884
885typedef struct cfg80211_update_ft_ies_params {
886 td_u16 md;
887 const td_u8 *ie;
888 size_t ie_len;
889} oal_cfg80211_update_ft_ies_stru;
890
891typedef struct cfg80211_ft_event_params {
892 td_u8 *ies;
893 size_t ies_len;
894 td_u8 target_ap[OAL_MAC_ADDR_LEN];
895 td_u8 resv[2];
896 const td_u8 *ric_ies;
897 size_t ric_ies_len;
898} oal_cfg80211_ft_event_stru;
899
900/* To be implement! */
901typedef struct cfg80211_beacon_data {
902 const td_u8 *head;
903 const td_u8 *tail;
904 const td_u8 *beacon_ies;
905 const td_u8 *proberesp_ies;
906 const td_u8 *assocresp_ies;
907 const td_u8 *probe_resp;
908
909 size_t head_len, tail_len;
910 size_t beacon_ies_len;
911 size_t proberesp_ies_len;
912 size_t assocresp_ies_len;
913 size_t probe_resp_len;
914} oal_beacon_data_stru;
915
916struct oal_mac_address {
918};
919
920struct cfg80211_acl_data {
921 enum nl80211_acl_policy acl_policy;
922 td_s32 n_acl_entries;
923
924 /* Keep it last */
925 struct oal_mac_address mac_addrs[];
926};
927
928typedef struct cfg80211_ap_settings {
929 struct cfg80211_chan_def chandef;
930 struct cfg80211_beacon_data beacon;
931
932 td_s32 beacon_interval;
933 td_s32 dtim_period;
934 const td_u8* ssid;
935 size_t ssid_len;
936
937 enum nl80211_hidden_ssid hidden_ssid;
938 enum nl80211_auth_type auth_type;
939 enum nl80211_sae_pwe_mechanism sae_pwe;
940 struct cfg80211_crypto_settings crypto;
941
942 td_s32 inactivity_timeout;
943 td_bool privacy;
944 td_bool p2p_opp_ps;
945 td_u8 p2p_ctwindow;
946 td_bool radar_required;
947
948 const struct cfg80211_acl_data* acl;
949} oal_ap_settings_stru;
950
951typedef struct bss_parameters {
952 td_s32 use_cts_prot;
953 td_s32 use_short_preamble;
954 td_s32 use_short_slot_time;
955 const td_u8 *basic_rates;
956 td_u8 basic_rates_len;
957 td_s32 ap_isolate;
958 td_s32 ht_opmode;
959 td_s8 p2p_ctwindow;
960 td_s8 p2p_opp_ps;
961} oal_bss_parameters;
962
963struct beacon_parameters {
964 td_u8 *head, *tail;
965 td_s32 interval, dtim_period;
966 td_s32 head_len, tail_len;
967};
968typedef struct beacon_parameters oal_beacon_parameters;
969typedef struct ieee80211_mgmt oal_ieee80211_mgmt;
970
971/* dmac未使用 */
972#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
973#ifndef _PRE_WLAN_FEATURE_MFG_ONLY
974typedef ip4_addr_t oal_ip_addr_t;
975#if LWIP_API_MESH
976typedef linklayer_event_ap_conn_t oal_event_ap_conn_stru;
977#endif
978#endif
979#endif
980
981
982typedef struct {
983 td_s32 sk_wmem_queued;
984} oal_sock_stru;
985
986struct sta_bss_parameters {
987 td_u8 flags;
988 td_u8 dtim_period;
989 td_u16 beacon_interval;
990};
991
992struct nl80211_sta_flag_update {
993 td_u32 mask;
994 td_u32 set;
995};
996
997typedef struct oal_station_info_tag {
998 td_u32 filled;
999 const td_u8* assoc_req_ies;
1000 td_u32 assoc_req_ies_len;
1001} oal_station_info_stru;
1002
1003typedef struct module oal_module_stru;
1004
1005typedef struct ieee80211_iface_limit {
1006 td_u16 max;
1007 td_u16 types;
1008} oal_ieee80211_iface_limit;
1009
1010typedef struct ieee80211_iface_combination {
1011 const struct ieee80211_iface_limit* limits;
1012 td_u32 num_different_channels;
1013 td_u16 max_interfaces;
1014 td_u8 n_limits;
1015 td_u8 radar_detect_widths;
1016 td_bool beacon_int_infra_match;
1017 td_u8 resv[3]; /* 3: 娣囨繄鏆€鐎涙顔? */
1018} oal_ieee80211_iface_combination;
1019
1020typedef struct wireless_dev {
1021 struct oal_net_device* netdev;
1022 oal_wiphy_stru* wiphy;
1023 nl80211_iftype_uint8 iftype;
1024 td_u8 resv[3]; /* reserve 3byte */
1025 /* 新内核新增字段 */
1026 oal_cfg80211_chan_def preset_chandef;
1027} oal_wireless_dev;
1028
1029typedef oal_wireless_dev oal_wireless_dev_stru;
1030
1031/*****************************************************************************
1032 8 UNION定义
1033*****************************************************************************/
1034
1035/*****************************************************************************
1036 9 OTHERS定义
1037*****************************************************************************/
1038
1039/*****************************************************************************
1040 10 函数声明
1041*****************************************************************************/
1042typedef struct oal_cfg80211_ops_tag {
1043 td_s32 (*add_key)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev,
1044 cfg80211_add_key_info_stru *p_cfg80211_add_key_info,
1045 const td_u8* mac_addr, oal_key_params_stru* params);
1046 td_s32 (*get_key)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev,
1047 cfg80211_get_key_info_stru *p_cfg80211_get_key_info, td_void* cookie,
1048 td_void (*callback)(td_void* cookie, oal_key_params_stru* key));
1049 td_s32 (*del_key)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u8 key_index, td_bool pairwise,
1050 const td_u8* mac_addr);
1051 td_s32 (*set_default_key)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u8 key_index, td_bool unicast,
1052 td_bool multicast);
1053 td_s32 (*set_default_mgmt_key)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u8 key_index);
1054 td_s32 (*scan)(oal_wiphy_stru* wiphy, oal_cfg80211_scan_request_stru* request);
1055 td_s32 (*connect)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev,
1056 oal_cfg80211_connect_params_stru* sme);
1057 td_s32 (*disconnect)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u16 reason_code);
1058 td_s32 (*set_channel)(oal_wiphy_stru* wiphy, oal_ieee80211_channel* chan,
1059 oal_nl80211_channel_type channel_type);
1060 td_s32 (*set_wiphy_params)(oal_wiphy_stru* wiphy, td_u32 changed);
1061 td_s32 (*add_beacon)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, oal_beacon_parameters* info);
1062 td_s32 (*change_virtual_intf)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, nl80211_iftype_uint8 type,
1063 td_u32* pul_flags, oal_vif_params_stru* params);
1064 td_s32 (*add_station)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u8* mac_addr, td_void* sta_parms);
1065 td_s32 (*del_station)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, const td_u8* mac_addr);
1066 td_s32 (*change_station)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u8* mac_addr,
1067 td_void* sta_parms);
1068 td_s32 (*get_station)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev, td_u8* mac_addr,
1069 oal_station_info_stru* sta_info);
1070 td_s32 (*dump_station)(oal_wiphy_stru* wiphy, oal_net_device_stru* dev, td_s32 idx, td_u8* mac,
1071 oal_station_info_stru* sta_info);
1072 td_s32 (*change_beacon)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev,
1073 oal_beacon_data_stru* beacon_info);
1074 td_s32 (*start_ap)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev,
1075 oal_ap_settings_stru* ap_settings);
1076 td_s32 (*stop_ap)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev);
1077 td_s32 (*change_bss)(oal_wiphy_stru* wiphy, oal_net_device_stru* netdev,
1078 td_void* bss_params);
1079 td_s32 (*set_power_mgmt)(oal_wiphy_stru* wiphy, oal_net_device_stru* ndev, td_bool enabled,
1080 td_s32 timeout);
1081 td_s32 (*sched_scan_start)(oal_wiphy_stru* wiphy, oal_net_device_stru* dev,
1082 struct cfg80211_sched_scan_request* request);
1083 td_s32 (*sched_scan_stop)(oal_wiphy_stru* wiphy, oal_net_device_stru* dev);
1084 td_s32 (*remain_on_channel)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev, struct ieee80211_channel* chan,
1085 td_u32 duration, td_u64* cookie);
1086 td_s32 (*cancel_remain_on_channel)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev, td_u64 cookie);
1087 td_s32 (*mgmt_tx)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev, struct ieee80211_channel* chan,
1088 td_bool offchan, td_u32 wait, const td_u8* buf, size_t len, td_bool no_cck,
1089 td_bool dont_wait_for_ack, td_u64* cookie);
1090 td_void (*mgmt_frame_register)(struct wiphy* wiphy, struct wireless_dev* wdev, td_u16 frame_type, td_bool reg);
1091 struct wireless_dev* (*add_virtual_intf)(oal_wiphy_stru* wiphy, const td_char* name, nl80211_iftype_uint8 type,
1092 td_u32* flags, struct vif_params* params);
1093 td_s32 (*del_virtual_intf)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev);
1094 td_s32 (*mgmt_tx_cancel_wait)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev, td_u64 cookie);
1095 td_s32 (*start_p2p_device)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev);
1096 td_void (*stop_p2p_device)(oal_wiphy_stru* wiphy, struct wireless_dev* wdev);
1097} oal_cfg80211_ops;
1098
1099#endif
1100
1101#define MAX_BLACKLIST_NUM 128
1102
1103typedef struct {
1104 osal_u8 blkwhtlst_cnt; /* 黑白名单个数 */
1105 osal_u8 mode; /* 黑白名单模式 */
1106 osal_u8 auc_resv[2];
1109
1110#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
1111#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0))
1112#define OAL_IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
1113#define OAL_IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
1114#define OAL_IEEE80211_NUM_BANDS NUM_NL80211_BANDS
1115#else
1116#define OAL_IEEE80211_BAND_2GHZ IEEE80211_BAND_2GHZ
1117#define OAL_IEEE80211_BAND_5GHZ IEEE80211_BAND_5GHZ
1118#define OAL_IEEE80211_NUM_BANDS IEEE80211_NUM_BANDS
1119#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)) */
1120
1121typedef td_u8 oal_ieee80211_band_enum_uint8;
1122#endif
1123
1124#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
1125/* ================================================================ */
1126/* 以下结构体copy from hmac oal_net.h 适配dmac编译
1127 * 原dmac头文件linux也使用自定义的,未引用linux定义。
1128 */
1129
1130/* linux 结构体 */
1131typedef struct iw_statistics oal_iw_statistics_stru;
1132typedef struct net_device oal_net_device_stru;
1133typedef struct net_device_ops oal_net_device_ops_stru;
1134typedef struct ethtool_ops oal_ethtool_ops_stru;
1135typedef struct iw_priv_args oal_iw_priv_args_stru;
1136typedef struct iw_handler_def oal_iw_handler_def_stru;
1137typedef struct iw_point oal_iw_point_stru;
1138typedef struct iw_param oal_iw_param_stru;
1139typedef struct iw_freq oal_iw_freq_stru;
1140typedef struct iw_request_info oal_iw_request_info_stru;
1141typedef struct rtnl_link_ops oal_rtnl_link_ops_stru;
1142typedef struct sockaddr oal_sockaddr_stru;
1143typedef struct net_device_stats oal_net_device_stats_stru;
1144typedef struct ifreq oal_ifreq_stru;
1145typedef struct Qdisc oal_qdisc_stru;
1146typedef struct vlan_ethhdr oal_vlan_ethhdr_stru;
1147typedef struct wiphy oal_wiphy_stru;
1148typedef struct wireless_dev oal_wireless_dev_stru;
1149typedef struct cfg80211_ops oal_cfg80211_ops_stru;
1150typedef struct wiphy_vendor_command oal_wiphy_vendor_command_stru;
1151typedef struct nl80211_vendor_cmd_info oal_nl80211_vendor_cmd_info_stru;
1152
1153typedef struct kobj_uevent_env oal_kobj_uevent_env_stru;
1154typedef struct iw_quality oal_iw_quality_stru;
1155typedef struct cfg80211_gtk_rekey_data oal_cfg80211_gtk_rekey_data;
1156typedef union iwreq_data oal_iwreq_data_union;
1157
1158#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
1159typedef struct cfg80211_pmksa oal_cfg80211_pmksa_stru;
1160#endif
1161
1162#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
1163typedef struct survey_info oal_survey_info_stru;
1164#endif
1165
1166typedef struct key_params oal_key_params_stru;
1167
1168typedef struct cfg80211_scan_request oal_cfg80211_scan_request_stru;
1169typedef struct cfg80211_ssid oal_cfg80211_ssid_stru;
1170typedef struct cfg80211_sched_scan_request oal_cfg80211_sched_scan_request_stru;
1171/* linux-2.6.34内核才有以下两个结构体,加密相关 */
1172#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
1173typedef enum nl80211_mfp oal_nl80211_mfp_enum_uint8;
1174typedef struct cfg80211_connect_params oal_cfg80211_conn_stru;
1175typedef struct cfg80211_crypto_settings oal_cfg80211_crypto_settings_stru;
1176#else
1177/* linux-2.6.30内核没有这两个加密相关的结构体,命令下发上报也是内核透传,这里打桩 */
1178typedef struct cfg80211_crypto_settings {
1179 td_u32 wpa_versions;
1180 td_u32 cipher_group;
1181 td_s32 n_ciphers_pairwise;
1182 td_u32 ciphers_pairwise[OAL_NL80211_MAX_NR_CIPHER_SUITES];
1183 td_s32 n_akm_suites;
1185
1186 oal_bool_enum_uint8 control_port;
1187 td_u8 arry[3];
1188}oal_cfg80211_crypto_settings_stru;
1189
1190#endif
1191
1192typedef struct ieee80211_mgmt oal_ieee80211_mgmt_stru;
1193typedef struct ieee80211_channel oal_ieee80211_channel_stru;
1194typedef struct cfg80211_bss oal_cfg80211_bss_stru;
1195typedef struct rate_info oal_rate_info_stru;
1196typedef struct station_info oal_station_info_stru;
1197typedef struct station_parameters oal_station_parameters_stru;
1198typedef enum station_info_flags oal_station_info_flags;
1199
1200typedef struct nlattr oal_nlattr_stru;
1201typedef struct genl_family oal_genl_family_stru;
1202typedef struct genl_multicast_group oal_genl_multicast_group_stru;
1203typedef struct cfg80211_registered_device oal_cfg80211_registered_device_stru;
1204
1205typedef struct ieee80211_rate oal_ieee80211_rate;
1206typedef struct ieee80211_channel oal_ieee80211_channel;
1207typedef struct ieee80211_supported_band oal_ieee80211_supported_band;
1208typedef enum cfg80211_signal_type oal_cfg80211_signal_type;
1209typedef enum nl80211_channel_type oal_nl80211_channel_type;
1210typedef struct cfg80211_update_owe_info oal_cfg80211_update_owe_info;
1211
1212#ifdef CONTROLLER_CUSTOMIZATION
1213typedef struct cfg80211_update_p2p_ie oal_cfg80211_update_p2p_ie;
1214#endif
1215
1216#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
1218typedef enum wiphy_flags oal_wiphy_flags;
1219#else
1220/* linux-2.6.30内核打桩一份wiphy_flags枚举 */
1221typedef enum wiphy_flags {
1222 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1223 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1224 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1225 WIPHY_FLAG_NETNS_OK = BIT(3),
1226 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1227 WIPHY_FLAG_4ADDR_AP = BIT(5),
1228 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1229 WIPHY_FLAG_HAVE_AP_SME = BIT(17),
1230 WIPHY_FLAG_OFFCHAN_TX = BIT(20),
1231 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
1232}oal_wiphy_flags;
1233#endif
1234
1235typedef struct vif_params oal_vif_params_stru;
1236
1237#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
1238typedef enum nl80211_key_type oal_nl80211_key_type;
1239#else
1240enum nl80211_key_type {
1241 NL80211_KEYTYPE_GROUP,
1242 NL80211_KEYTYPE_PAIRWISE,
1243 NL80211_KEYTYPE_PEERKEY,
1244 NUM_NL80211_KEYTYPES
1245};
1246typedef enum nl80211_key_type oal_nl80211_key_type;
1247#endif
1248
1249typedef struct ieee80211_sta_ht_cap oal_ieee80211_sta_ht_cap;
1250typedef struct ieee80211_regdomain oal_ieee80211_regdomain_stru;
1251typedef struct cfg80211_update_ft_ies_params oal_cfg80211_update_ft_ies_stru;
1252typedef struct cfg80211_ft_event_params oal_cfg80211_ft_event_stru;
1253typedef struct cfg80211_chan_def oal_cfg80211_chan_def;
1254#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
1255/* To be implement! */
1256typedef struct cfg80211_beacon_data oal_beacon_data_stru;
1257typedef struct cfg80211_ap_settings oal_ap_settings_stru;
1258typedef struct bss_parameters oal_bss_parameters;
1259struct beacon_parameters {
1260 td_u8 *head, *tail;
1261 td_s32 interval, dtim_period;
1262 td_s32 head_len, tail_len;
1263};
1264typedef struct beacon_parameters oal_beacon_parameters;
1265#else
1266typedef struct beacon_parameters oal_beacon_parameters;
1267#endif
1268typedef struct ieee80211_channel_sw_ie oal_ieee80211_channel_sw_ie;
1269typedef struct ieee80211_msrment_ie oal_ieee80211_msrment_ie;
1270typedef struct ieee80211_mgmt oal_ieee80211_mgmt;
1271
1272/* ================================================================ */
1273/* 以下结构体copy from liteos 适配dmac编译 */
1274
1275/* net_device ioctl结构体定义 */
1276/* hostapd/wpa_supplicant 下发的信息元素结构 */
1277/* 该结构为事件内存池大小,保存从hostapd/wpa_supplicant下发的ie 信息 */
1278/* 注意: 整个结构体长度为事件内存池大小,如果事件内存池有修改,则需要同步修改app 数据结构 */
1279struct oal_app_ie {
1282 osal_u8 ie_type_bitmap;
1283 osal_u8 rsv[2]; /* 保留2字节对齐 */
1284 /* ie 中保存信息元素,长度 = (事件内存池大小 - 保留长度) */
1286};
1287typedef struct oal_app_ie oal_app_ie_stru;
1288
1289typedef td_u8 oal_nl80211_auth_type_enum_uint8;
1290
1291/* ================================================================ */
1292/* 以下dmac原始定义和linux冲突 待特性确认 */
1293#endif // (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
1294
1295typedef struct {
1296 osal_u8 sta_mac[WLAN_MAC_ADDR_LEN]; /* 要获取的sta的mac */
1297 oal_bool_enum_uint8 support_11h; /* 保存sta是否支持11h,为出参 */
1300
1301typedef struct {
1302 osal_u8 sta_mac[OAL_MAC_ADDR_LEN]; /* 要获取的sta的mac */
1303 oal_bool_enum_uint8 support_11r; /* 保存sta是否支持11r,为出参 */
1306
1307
1310 osal_u8 rx_rssi; /* 0 ~ 100 ,0xff为无效值 */
1311 osal_u8 tx_pwr; /* 0 ~ 100 */
1312 osal_u32 rx_rate; /* avr nego rate in kpbs */
1313 osal_u32 tx_rate; /* avr nego rate in kpbs */
1314 osal_u32 rx_minrate; /* min nego rx rate in last duration, clean to 0 when app read over */
1315 osal_u32 rx_maxrate; /* max nego rx rate in last duration, clean to 0 when app read over */
1316 osal_u32 tx_minrate; /* min nego tx rate in last duration, clean to 0 when app read over */
1317 osal_u32 tx_maxrate; /* max nego tx rate in last duration, clean to 0 when app read over */
1320 osal_u32 tx_frames_rty; /* tx frame retry cnt */
1321 osal_u32 tx_frames_all; /* tx total frame cnt */
1323 osal_u32 SNR; /* snr */
1324};
1325
1327 unsigned long buf_cnt; /* input: sta_info count provided */
1328 unsigned long sta_cnt; /* outpu: how many sta really */
1329 unsigned int cur_channel;
1330 struct hostap_sta_link_info *sta_info; /* output */
1331};
1334
1335/* sta包含增量信息结构体 */
1337 osal_u8 auth_st; /* 认证状态 */
1338 oal_bool_enum_uint8 band; /* 工作频段 */
1339 oal_bool_enum_uint8 wmm_switch; /* wmm是否使能 */
1340 osal_u8 ps_st; /* 节能状态 */
1341 osal_u8 sta_num; /* 空间流数 */
1342 osal_u8 work_mode; /* 协议模式 */
1343 osal_s8 c_noise; /* 节点的噪声值 */
1345 osal_u32 associated_time; /* 用户已连接的时长 */
1346};
1347
1349 unsigned long buf_cnt; /* input: sta_info count provided */
1350 unsigned long sta_cnt; /* outpu: how many sta really */
1351 unsigned int cur_channel;
1354};
1357
1358
1365
1371
1372/* net_device ioctl结构体定义 */
1374 osal_s32 l_cmd; /* 命令号 */
1375 union {
1376 struct {
1379 osal_u32 buf_size; /* 用户空间ie 缓冲大小 */
1380 osal_u8 *buf; /* 用户空间ie 缓冲地址 */
1381 } assoc_req_ie; /* AP 模式,用于获取STA 关联请求ie 信息 */
1382
1383 struct {
1386
1387 struct {
1390
1393
1394 struct {
1404
1405 oal_app_ie_stru app_ie; /* beacon ie,index 0; proberesp ie index 1; assocresp ie index 2 */
1406
1407 struct {
1408 osal_s32 l_freq; /* ap所在频段,与linux-2.6.34内核中定义不同 */
1409 osal_u32 ssid_len; /* SSID 长度 */
1411
1413 OAL_CONST osal_u8 *ssid; /* 期望关联的AP SSID */
1414 OAL_CONST osal_u8 *bssid; /* 期望关联的AP BSSID */
1415
1416 osal_u8 privacy; /* 是否加密标志 */
1417 oal_nl80211_auth_type_enum_uint8 auth_type; /* 认证类型,OPEN or SHARE-KEY */
1418
1419 osal_u8 wep_key_len; /* WEP KEY长度 */
1420 osal_u8 wep_key_index; /* WEP KEY索引 */
1421 OAL_CONST osal_u8 *wep_key; /* WEP KEY密钥 */
1422
1423 oal_cfg80211_crypto_settings_stru crypto; /* 密钥套件信息 */
1425 struct {
1427 osal_u16 reason_code; /* 去关联 reason code */
1429
1432 osal_s32 l_frag; /* 分片门限值 */
1433 osal_s32 l_rts; /* RTS 门限值 */
1434
1440
1441#endif /* end of file */
1442
#define reg(base, offset)
Definition chip_io.h:178
#define bit(x)
Definition common_def.h:71
#define max(x, y)
Definition common_def.h:33
enum wiphy_params_flags oal_wiphy_params_flags
Definition eth_ip_common_rom.h:180
wiphy_params_flags
Definition eth_ip_common_rom.h:173
#define ETHER_ADDR_LEN
Definition eth_ip_common_rom.h:21
#define WLAN_MAC_ADDR_LEN
Definition mac_addr.c:28
addr_idx
Definition mac_addr.c:51
mac_header_frame_control_stru frame_control
Definition mac_frame_rom.h:0
osal_u16 resv2
Definition oal_net.h:3
osal_u8 type
Definition oal_net.h:0
app_ie_type_uint8 app_ie_type
Definition oal_net.h:1
osal_u32 ie_len
Definition oal_net.h:0
osal_u8 app_ie_type_uint8
Definition oal_net.h:308
osal_u8 rsv[3]
Definition oal_net.h:2
osal_u16 reserved
Definition oal_net.h:4
struct oal_net_dev_ioctl_data_tag oal_net_dev_ioctl_data_stru
oal_net_dev_tx_enum
Definition oal_net_cfg80211.h:71
@ OAL_NETDEV_TX_OK
Definition oal_net_cfg80211.h:72
@ OAL_NETDEV_TX_LOCKED
Definition oal_net_cfg80211.h:74
@ OAL_NETDEV_TX_BUSY
Definition oal_net_cfg80211.h:73
#define OAL_IEEE80211_MAX_SSID_LEN
Definition oal_net_cfg80211.h:65
#define MAX_STA_NUM_OF_ONE_GROUP
Definition oal_net_cfg80211.h:68
osal_u8 app_ie_type_uint8
Definition oal_net_cfg80211.h:62
#define MAX_BLACKLIST_NUM
Definition oal_net_cfg80211.h:1101
#define OAL_IF_NAME_SIZE
Definition oal_net_cfg80211.h:64
#define OAL_MAC_ADDR_LEN
Definition oal_net_cfg80211.h:63
#define OAL_NL80211_MAX_NR_CIPHER_SUITES
Definition oal_net_rom.h:178
#define OAL_IEEE80211_MAX_SSID_LEN
Definition oal_net_rom.h:181
#define OAL_NL80211_MAX_NR_AKM_SUITES
Definition oal_net_rom.h:179
#define IEEE80211_HT_MCS_MASK_LEN
Definition oal_net_rom.h:108
#define OAL_MAC_ADDR_LEN
Definition oal_net_rom.h:28
#define OAL_CONST
Definition oal_types.h:45
osal_u8 oal_bool_enum_uint8
Definition oal_types_device_rom.h:45
int osal_s32
Definition osal_types.h:19
unsigned char osal_u8
Definition osal_types.h:11
signed char osal_s8
Definition osal_types.h:17
unsigned long long osal_u64
Definition osal_types.h:14
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
#define BIT(x)
Definition pinctrl_porting_ws63.c:14
#define NL80211_IFTYPE_AP
Definition soc_wifi_service_api.c:3951
Definition oal_net_cfg80211.h:1103
osal_u8 blkwhtlst_cnt
Definition oal_net_cfg80211.h:1104
osal_u8 mode
Definition oal_net_cfg80211.h:1105
Definition oal_net_cfg80211.h:1373
osal_s32 l_frag
Definition oal_net_cfg80211.h:1432
osal_s32 l_channel
Definition oal_net_cfg80211.h:1396
osal_u8 rsv[2]
Definition oal_net_cfg80211.h:1378
union oal_net_dev_ioctl_data_tag::@462 pri_data
osal_u8 * ie
Definition oal_net_cfg80211.h:1412
osal_u8 auc_country_code[4]
Definition oal_net_cfg80211.h:1388
osal_u8 wep_key_len
Definition oal_net_cfg80211.h:1419
struct oal_net_dev_ioctl_data_tag::@462::@468 kick_user_params
OAL_CONST osal_u8 * wep_key
Definition oal_net_cfg80211.h:1421
osal_u16 reason_code
Definition oal_net_cfg80211.h:1427
oal_hilink_get_sta_11h_ability fbt_get_sta_11h_ability
Definition oal_net_cfg80211.h:1431
osal_s32 l_center_freq1
Definition oal_net_cfg80211.h:1400
struct oal_net_dev_ioctl_data_tag::@462::@466 freq
osal_u32 vap_max_user
Definition oal_net_cfg80211.h:1392
oal_snoop_all_group_stru all_snoop_group
Definition oal_net_cfg80211.h:1435
osal_s32 l_center_freq2
Definition oal_net_cfg80211.h:1401
struct oal_net_dev_ioctl_data_tag::@462::@465 country_code
oal_net_all_sta_link_info_ext_stru all_sta_link_info_ext
Definition oal_net_cfg80211.h:1436
osal_u8 privacy
Definition oal_net_cfg80211.h:1416
osal_u32 buf_size
Definition oal_net_cfg80211.h:1379
osal_u8 * buf
Definition oal_net_cfg80211.h:1380
oal_nl80211_auth_type_enum_uint8 auth_type
Definition oal_net_cfg80211.h:1417
osal_s32 l_rts
Definition oal_net_cfg80211.h:1433
osal_u32 ie_len
Definition oal_net_cfg80211.h:1410
osal_u8 mac[6]
Definition oal_net_cfg80211.h:1377
OAL_CONST osal_u8 * bssid
Definition oal_net_cfg80211.h:1414
osal_s32 l_sec_channel_offset
Definition oal_net_cfg80211.h:1398
struct oal_net_dev_ioctl_data_tag::@462::@467 cfg80211_connect_params
osal_s32 l_ht_enabled
Definition oal_net_cfg80211.h:1397
struct oal_net_dev_ioctl_data_tag::@462::@464 auth_params
oal_cfg80211_crypto_settings_stru crypto
Definition oal_net_cfg80211.h:1423
osal_u8 ssid[32+4]
Definition oal_net_cfg80211.h:1391
osal_s32 l_cmd
Definition oal_net_cfg80211.h:1374
osal_s32 l_freq
Definition oal_net_cfg80211.h:1395
osal_u32 auth_alg
Definition oal_net_cfg80211.h:1384
osal_u32 ssid_len
Definition oal_net_cfg80211.h:1409
struct oal_net_dev_ioctl_data_tag::@462::@463 assoc_req_ie
oal_app_ie_stru app_ie
Definition oal_net_cfg80211.h:1405
osal_s32 l_bandwidth
Definition oal_net_cfg80211.h:1402
oal_blkwhtlst_stru blkwhtlst
Definition oal_net_cfg80211.h:1437
oal_net_all_sta_link_info_stru all_sta_link_info
Definition oal_net_cfg80211.h:1430
osal_u8 wep_key_index
Definition oal_net_cfg80211.h:1420
osal_s32 l_vht_enabled
Definition oal_net_cfg80211.h:1399
OAL_CONST osal_u8 * ssid
Definition oal_net_cfg80211.h:1413
Definition oal_net_cfg80211.h:1366
osal_u16 group_cnt
Definition oal_net_cfg80211.h:1367
oal_snoop_group_stru * buf
Definition oal_net_cfg80211.h:1369
Definition oal_net_cfg80211.h:1359
osal_u8 sta_num
Definition oal_net_cfg80211.h:1361
osal_u8 reserve
Definition oal_net_cfg80211.h:1362
Definition oal_skbuff.h:73
Definition oal_skbuff.h:82
unsigned short td_u16
Definition td_type.h:37
unsigned char td_u8
Definition td_type.h:36
td_u8 td_bool
Definition td_type.h:50
void td_void
Definition td_type.h:49
signed char td_s8
Definition td_type.h:42
unsigned int td_u32
Definition td_type.h:38
short td_s16
Definition td_type.h:43
int td_s32
Definition td_type.h:44
unsigned long long td_u64
Definition td_type.h:39
char td_char
Definition td_type.h:41
Definition hal_uart_v151_regs_def.h:38
#define WLAN_WPS_IE_MAX_SIZE
Definition wlan_spec_rom.h:178