WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
oal_net.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 */
7#ifndef __OAL_NET_HCM_H__
8#define __OAL_NET_HCM_H__
9#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
10#include <linux/version.h>
11#include <net/iw_handler.h>
12#include <linux/netdevice.h>
13#endif
14#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
15#include "oal_mm.h"
16#include "lwip/netif.h"
17#include "lwip/dhcp.h"
18#include "eth_ip_common_rom.h"
19#endif
20#include "oal_util.h"
21#include "oal_skbuff.h"
22#include "oal_netbuf_ext.h"
23#include "oal_net_cfg80211.h"
24
25#ifdef __cplusplus
26#if __cplusplus
27extern "C" {
28#endif
29#endif
30
31/*****************************************************************************
32 2 宏定义
33*****************************************************************************/
34/* xr util还未融合,OAL_DECLARE_PACKED暂时在此处重复定义 */
35#define OAL_DECLARE_PACKED __attribute__((__packed__))
36#define OAL_NETBUF_DEFAULT_DATA_OFFSET 48 /* 5115上实际测得data比head大48,用于netbuf data指针复位 */
37
38#define OAL_ASSOC_REQ_IE_OFFSET 28 /* 上报内核关联请求帧偏移量 */
39#define OAL_ASSOC_RSP_IE_OFFSET 30 /* 上报内核关联响应帧偏移量 */
40#define OAL_AUTH_IE_OFFSET 30
41#define OAL_FT_ACTION_IE_OFFSET 40
42#define OAL_ASSOC_RSP_FIXED_OFFSET 6 /* 关联响应帧帧长FIXED PARAMETERS偏移量 */
43#define OAL_PMKID_LEN 16
44#define OAL_WPA_KEY_LEN 32
45#define OAL_WPA_SEQ_LEN 16
46#define OAL_WLAN_SA_QUERY_TR_ID_LEN 2
47#define OAL_BITFIELD_LITTLE_ENDIAN 0
48#define OAL_BITFIELD_BIG_ENDIAN 1
49/*
50 * Byte order/swapping support.
51 */
52#define OAL_LITTLE_ENDIAN 1234
53#define OAL_BIG_ENDIAN 4321
54#define OAL_BYTE_ORDER OAL_BIG_ENDIAN
55#define OAL_BYTE_HALF_WIDTH 4
56
57/* ICMP协议报文 */
58#define MAC_ICMP_PROTOCAL 1
59#define MAC_ICMP_REQUEST 0x08
60#define MAC_ICMP_RESPONSE 0x00
61
62/*****************************************************************************
63 2.10 IP宏定义
64*****************************************************************************/
65#define IPV6_ADDR_MULTICAST 0x0002U
66#define IPV6_ADDR_UNICAST 0x0001U
67#define IPV6_ADDR_SCOPE_TYPE(scope) ((scope) << 16)
68#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
69#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
70#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
71#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08
72#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
73#define IPV6_ADDR_LOOPBACK 0x0010U
74#define IPV6_ADDR_LINKLOCAL 0x0020U
75#define IPV6_ADDR_SITELOCAL 0x0040U
76#define IPV6_ADDR_RESERVED 0x2000U /* reserved address space */
77
78#define WLAN_DSCP_PRI_SHIFT 2
79#define WLAN_IP_PRI_SHIFT 5
80#define WLAN_IPV6_PRIORITY_MASK 0x0FF00000
81#define WLAN_IPV6_PRIORITY_SHIFT 20
82
83/* ICMP codes for neighbour discovery messages */
84#define OAL_NDISC_ROUTER_SOLICITATION 133
85#define OAL_NDISC_ROUTER_ADVERTISEMENT 134
86#define OAL_NDISC_NEIGHBOUR_SOLICITATION 135
87#define OAL_NDISC_NEIGHBOUR_ADVERTISEMENT 136
88#define OAL_NDISC_REDIRECT 137
89
90#define OAL_ND_OPT_TARGET_LL_ADDR 2
91#define OAL_ND_OPT_SOURCE_LL_ADDR 1
92#define OAL_IPV6_ADDR_ANY 0x0000U
93#define OAL_IPV6_ADDR_MULTICAST 0x0002U
94#define OAL_IPV6_MAC_ADDR_LEN 16
95
96/*
97 * support for ARP/ND offload. add 2015.6.12
98 */
99#define OAL_IPV4_ADDR_SIZE 4
100#define OAL_IPV6_ADDR_SIZE 16
101#define OAL_IPV6_ADDR16_SIZE 8
102#define OAL_IPV6_ADDR32_SIZE 4
103#define OAL_IP_ADDR_MAX_SIZE OAL_IPV6_ADDR_SIZE
104
105#define OAL_IP4_ADDR IP4_ADDR
106
107/* ip头到协议类型字段的偏移 */
108#define IP_HDR_LEN 20
109
110#define OAL_IPPROTO_UDP 17 /* User Datagram Protocot */
111#define OAL_IPPROTO_ICMPV6 58 /* ICMPv6 */
112
113/*****************************************************************************
114 2.12 LLC SNAP宏定义
115*****************************************************************************/
116#define LLC_UI 0x3
117#define SNAP_LLC_FRAME_LEN 8
118#define SNAP_LLC_LSAP 0xaa
119#define SNAP_RFC1042_ORGCODE_0 0x00
120#define SNAP_RFC1042_ORGCODE_1 0x00
121#define SNAP_RFC1042_ORGCODE_2 0x00
122#define SNAP_BTEP_ORGCODE_0 0x00
123#define SNAP_BTEP_ORGCODE_1 0x00
124#define SNAP_BTEP_ORGCODE_2 0xf8
125
126/*****************************************************************************
127 2.13 ETHER宏定义
128*****************************************************************************/
129#define IP6_ETHER_ADDR_LEN 16 /* efuse中ipv6 MAC地址大小 */
130
131#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
132#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
133#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */
134#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */
135#define ETHER_HDR_LEN 14
136#define ETHER_MAX_LEN 1518
137#endif
138#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
139#define ETH_ALEN 6
140#define ETH_HLEN 14
141#define ETH_FRAME_LEN 1514
142#ifndef ETHER_HDR_LEN
143#define ETHER_HDR_LEN ETH_HLEN
144#endif
145#ifndef ETHER_MAX_LEN
146#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN)
147#endif
148#endif
149#define ETHER_MTU (ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
150
151#define ETH_SENDER_IP_ADDR_LEN 4 /* length of an Ethernet send ip address */
152#define ETH_TARGET_IP_ADDR_LEN 4 /* length of an Ethernet target ip address */
153
154/* ether type */
155#define ETHER_TYPE_START 0x0600
156#define ETHER_TYPE_RARP 0x8035
157#define ETHER_TYPE_PAE 0x888e /* EAPOL PAE/802.1x */
158#define ETHER_TYPE_IP 0x0800 /* IP protocol */
159#define ETHER_TYPE_AARP 0x80f3 /* Appletalk AARP protocol */
160#define ETHER_TYPE_IPX 0x8137 /* IPX over DIX protocol */
161#define ETHER_TYPE_ARP 0x0806 /* ARP protocol */
162#define ETHER_TYPE_IPV6 0x86dd /* IPv6 */
163#define ETHER_TYPE_VLAN 0x8100 /* VLAN TAG protocol */
164#define ETHER_TYPE_TDLS 0x890d /* TDLS */
165#define ETHER_TYPE_WAI 0x88b4 /* WAI/WAPI */
166#define ETHER_LLTD_TYPE 0x88D9 /* LLTD */
167#define ETHER_ONE_X_TYPE 0x888E /* 802.1x Authentication */
168#define ETHER_TUNNEL_TYPE 0x88bd /* 自定义tunnel协议 */
169#define ETHER_TYPE_PPP_DISC 0x8863 /* PPPoE discovery messages */
170#define ETHER_TYPE_PPP_SES 0x8864 /* PPPoE session messages */
171#define ETHER_TYPE_6LO 0xa0ed /* 6lowpan */
172
173#define BROADCAST_MACADDR ((const osal_u8 *)"\xFF\xFF\xFF\xFF\xFF\xFF") /* 广播MAC地址 */
174
175
176/*****************************************************************************
177 WLAN MAC宏定义
178*****************************************************************************/
179/* CCMP加密字节数 */
180#define WLAN_CCMP_ENCRYP_LEN 16
181/* CCMP256加密字节数 */
182#define WLAN_CCMP256_GCMP_ENCRYP_LEN 24
183
184/* Probe Rsp APP IE长度超过该值,发送帧netbuf采用大包 */
185#define OAL_MGMT_NETBUF_APP_PROBE_RSP_IE_LEN_LIMIT 450
186
187#define WLAN_DATA_VIP_TID WLAN_TIDNO_BCAST
188
189/* MAC地址占的字符长度 */
190#define WLAN_MAC_ADDR_BYTE_LEN 17
191
192#define OAL_MAX_FT_ALL_LEN 518 /* MD:5 FT:257 RSN:256 */
193
194#define AP_WPS_P2P_IE_CMD_BEACON 0x1
195#define AP_WPS_P2P_IE_CMD_PROBE_RSP 0x2
196#define AP_WPS_P2P_IE_CMD_ASSOC_RSP 0x4
197
198
199#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
200#define oal_smp_mb() smp_mb()
201#else
202#define oal_smp_mb()
203#endif
204#define OAL_CONTAINER_OF(_member_ptr, _stru_type, _stru_member_name) \
205 container_of(_member_ptr, _stru_type, _stru_member_name)
206#define ETHER_IS_MULTICAST(_a) (*(_a) & 0x01)
207
208/* is address bcast */
209#define ETHER_IS_BROADCAST(_a) \
210 ((_a)[0] == 0xff && \
211 (_a)[1] == 0xff && \
212 (_a)[2] == 0xff && \
213 (_a)[3] == 0xff && \
214 (_a)[4] == 0xff && \
215 (_a)[5] == 0xff)
216
217/* IPv4永久组地址判断: 224.0.0.0~224.0.0.255为永久组地址 */
218#define OAL_IPV4_PERMANET_GROUP_ADDR 0x000000E0
219#define OAL_IPV4_IS_PERMANENT_GROUP(_a) ((((_a) & 0x00FFFFFF) ^ OAL_IPV4_PERMANET_GROUP_ADDR) == 0)
220
221/*****************************************************************************
222 3 枚举定义
223*****************************************************************************/
225
237
238#if defined(_PRE_WLAN_FEATURE_QUE_CLASSIFY)
239static inline osal_u8 wlan_data_queue_to_hcc(osal_u16 qid)
240{
241 return ((qid == WLAN_UDP_DATA_QUEUE) ? DATA_UDP_DATA_QUEUE :
242 (qid == WLAN_TCP_DATA_QUEUE) ? DATA_TCP_DATA_QUEUE :
243 (qid == WLAN_TCP_ACK_QUEUE) ? DATA_TCP_ACK_QUEUE : DATA_LO_QUEUE);
244}
245
246static inline osal_u16 hcc_data_queue_to_wlan(osal_u8 qid)
247{
248 return ((qid == DATA_UDP_DATA_QUEUE) ? WLAN_UDP_DATA_QUEUE :
249 (qid == DATA_TCP_DATA_QUEUE) ? WLAN_TCP_DATA_QUEUE :
250 (qid == DATA_TCP_ACK_QUEUE) ? WLAN_TCP_ACK_QUEUE : WLAN_NORMAL_QUEUE);
251}
252#endif
253
254typedef enum {
255 OAL_IEEE80211_MLME_AUTH = 0, /* MLME下发认证帧相关内容 */
256 OAL_IEEE80211_MLME_ASSOC = 1, /* MLME下发关联帧相关内容 */
257 OAL_IEEE80211_MLME_REASSOC = 2, /* MLME下发重关联帧相关内容 */
261
262/* 以下不区分操作系统 */
263/* 内核下发的扫描类型 */
271
272/* 内核下发的扫描频段 */
281
283 BEACON_IE = (1 << 0),
284 PROBE_REQ_IE = (1 << 1),
285 PROBE_RSP_IE = (1 << 2),
286 ASSOC_REQ_IE = (1 << 3),
287 ASSOC_RSP_IE = (1 << 4),
288 REASSOC_REQ_IE = (1 << 5),
289 AUTH_REQ_IE = (1 << 6)
292
309
310/*****************************************************************************
311 7 STRUCT定义
312*****************************************************************************/
313/* 不分平台通用结构体 */
314typedef struct {
315 osal_u8 ssid[OAL_IEEE80211_MAX_SSID_LEN]; /* ssid array */
316 osal_u8 ssid_len; /* length of the array */
317 osal_u8 arry[3]; /* 3字节存储其他数据 */
319
320typedef union {
322 struct {
324 low : 4;
325 } bits;
327
328static inline osal_u8 a2x(const osal_char c)
329{
330 if (c >= '0' && c <= '9') {
331 return (osal_u8)(c - '0');
332 }
333 if (c >= 'a' && c <= 'f') {
334 return (osal_u8)0xa + (osal_u8)(c - 'a');
335 }
336 if (c >= 'A' && c <= 'F') {
337 return (osal_u8)0xa + (osal_u8)(c - 'A');
338 }
339 return 0;
340}
341
342 /* ipv6 组播mac地址 */
343#define ETHER_IS_IPV6_MULTICAST(_a) (((_a)[0]) == 0x33 && ((_a)[1]) == 0x33)
344 /* IPv6未指定地址: ::/128 ,该地址仅用于接口还没有被分配IPv6地址时与其它节点
345 通讯作为源地址,例如在重复地址检测DAD中会出现. */
346#define OAL_IPV6_IS_UNSPECIFIED_ADDR(_a) \
347 ((_a)[0] == 0x00 && (_a)[1] == 0x00 && (_a)[2] == 0x00 && \
348 (_a)[3] == 0x00 && (_a)[4] == 0x00 && (_a)[5] == 0x00 && \
349 (_a)[6] == 0x00 && (_a)[7] == 0x00 && (_a)[8] == 0x00 && \
350 (_a)[9] == 0x00 && (_a)[10] == 0x00 && (_a)[11] == 0x00 && \
351 (_a)[12] == 0x00 && (_a)[13] == 0x00 && (_a)[14] == 0x00 && \
352 (_a)[15] == 0x00)
353
354 /* IPv6链路本地地址: 最高10位值为1111111010, 例如:FE80:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX */
355#define OAL_IPV6_IS_LINK_LOCAL_ADDR(_a) (((_a)[0] == 0xFE) && ((_a)[1] >> 6 == 2))
356
357 /* IGMP record type */
358#define MAC_IGMP_QUERY_TYPE 0x11
359#define MAC_IGMPV1_REPORT_TYPE 0x12
360#define MAC_IGMPV2_REPORT_TYPE 0x16
361#define MAC_IGMPV2_LEAVE_TYPE 0x17
362#define MAC_IGMPV3_REPORT_TYPE 0x22
363
364 /* V3 group record types [grec_type] */
365#define IGMPV3_MODE_IS_INCLUDE 1
366#define IGMPV3_MODE_IS_EXCLUDE 2
367#define IGMPV3_CHANGE_TO_INCLUDE 3
368#define IGMPV3_CHANGE_TO_EXCLUDE 4
369#define IGMPV3_ALLOW_NEW_SOURCES 5
370#define IGMPV3_BLOCK_OLD_SOURCES 6
371
372 /* IGMP record type */
373#define MLD_QUERY_TYPE 130
374#define MLDV1_REPORT_TYPE 131
375#define MLDV1_DONE_TYPE 132
376#define MLDV2_REPORT_TYPE 143
377
378 /* MLD V2 group record types [grec_type] */
379#define MLDV2_MODE_IS_INCLUDE 1
380#define MLDV2_MODE_IS_EXCLUDE 2
381#define MLDV2_CHANGE_TO_INCLUDE 3
382#define MLDV2_CHANGE_TO_EXCLUDE 4
383#define MLDV2_ALLOW_NEW_SOURCES 5
384#define MLDV2_BLOCK_OLD_SOURCES 6
385
386#define SERVERNAME_LEN 64
387#define BOOTFILE_LEN 128
388
389 /* DHCP message type */
390#define DHCP_DISCOVER 1
391#define DHCP_OFFER 2
392#define DHCP_REQUEST 3
393#define DHCP_ACK 5
394#define DHCP_NAK 6
395
396#define DHO_PAD 0
397#define DHO_IPADDRESS 50
398#define DHO_MESSAGETYPE 53
399#define DHO_SERVERID 54
400#define DHO_END 255
401
402#define DNS_MAX_DOMAIN_LEN (100)
403
404#define DHCP_SERVER_PORT (67)
405#define DHCP_CLIENT_PORT (68)
406#define DNS_SERVER_PORT (53)
407
408#define OAL_NETDEVICE_OPS(_pst_dev) ((_pst_dev)->netdev_ops)
409#define OAL_NETDEVICE_MAC_ADDR(_pst_dev) ((_pst_dev)->dev_addr)
410#define OAL_NETDEVICE_IFALIAS(_pst_dev) ((_pst_dev)->ifalias)
411#define OAL_NETDEVICE_WDEV(_pst_dev) ((_pst_dev)->ieee80211_ptr)
412#define OAL_NETDEVICE_HEADROOM(_pst_dev) ((_pst_dev)->needed_headroom)
413#define OAL_NETDEVICE_TAILROOM(_pst_dev) ((_pst_dev)->needed_tailroom)
414#define OAL_NETDEVICE_FLAGS(_pst_dev) ((_pst_dev)->flags)
415#define OAL_NETDEVICE_WATCHDOG_TIMEO(_pst_dev) ((_pst_dev)->watchdog_timeo)
416#define OAL_WIRELESS_DEV_WIPHY(_pst_wireless_dev) ((_pst_wireless_dev)->wiphy)
417#define oal_netdevice_master(_pst_dev) ((_pst_dev)->master)
418
419#define OAL_IFF_RUNNING 0x40
420#define OAL_IFF_UP 0x01
421
422#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS != _PRE_OS_VERSION)
423#define oal_is_broadcast_ether_addr(a) (((a)[0] & (a)[1] & (a)[2] & (a)[3] & (a)[4] & (a)[5]) == 0xff)
424/* is address mcast */
425typedef struct {
426 osal_u16 ar_hrd; /* format of hardware address */
427 osal_u16 ar_pro; /* format of protocol address */
428
429 osal_u8 ar_hln; /* length of hardware address */
430 osal_u8 ar_pln; /* length of protocol address */
431 osal_u16 ar_op; /* ARP opcode (command) */
432
433 osal_u8 ar_sha[ETHER_ADDR_LEN]; /* sender hardware address */
434 osal_u8 ar_sip[ETH_SENDER_IP_ADDR_LEN]; /* sender IP address */
435 osal_u8 ar_tha[ETHER_ADDR_LEN]; /* target hardware address */
436 osal_u8 ar_tip[ETH_TARGET_IP_ADDR_LEN]; /* target IP address */
438
439/* WIN32和linux共用结构体 */
440typedef struct {
442 osal_u8 len;
443 osal_u8 addr[6]; /* hardware address6字节 */
445
446typedef struct {
447 osal_u8 op; /* packet opcode type */
448 osal_u8 htype; /* hardware addr type */
449 osal_u8 hlen; /* hardware addr length */
450 osal_u8 hops; /* gateway hops */
451 osal_u32 xid; /* transaction ID */
452 osal_u16 secs; /* seconds since boot began */
453 osal_u16 flags; /* flags */
454 osal_u32 ciaddr; /* client IP address */
455 osal_u32 yiaddr; /* 'your' IP address */
456 osal_u32 siaddr; /* server IP address */
457 osal_u32 giaddr; /* gateway IP address */
458 osal_u8 chaddr[16]; /* client hardware address16字节 */
459 osal_u8 sname[64]; /* server host name字符串长度64 */
460 osal_u8 file[128]; /* boot file name字符串长度128 */
461 osal_u8 options[4]; /* variable-length options field 4字节 */
463
464struct oal_ip_header {
465#if (_PRE_LITTLE_CPU_ENDIAN == _PRE_CPU_ENDIAN) /* LITTLE_ENDIAN */
466 osal_u8 ihl : 4,
467 version_ihl : 4;
468#else
470 ihl : 4;
471#endif
472 osal_u8 tos;
474 osal_u16 id;
476 osal_u8 ttl;
482typedef struct oal_ip_header oal_ip_header_stru;
483
484typedef struct {
485 osal_u16 sport;
486 osal_u16 dport;
487 osal_u32 seqnum;
488 osal_u32 acknum;
489 osal_u8 offset;
490 osal_u8 flags;
491 osal_u16 window;
493 osal_u16 urgent;
495
496typedef struct {
497 osal_u16 source;
498 osal_u16 dest;
499 osal_u16 len;
500 osal_u16 check;
502
503struct oal_ether_header {
509#endif
510
511/*
512wal 层到hmac侧传递使用该数据, WLAN_WPS_IE_MAX_SIZE扩容到608字节,超过事件队列大小,
513wal到hmac ie data采用指针传递
514*/
522
532
533/*
534 * Header in on cable format
535 */
543
544/* Group record format
545 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546 | Record Type | Aux Data Len | Number of Sources (N) |
547 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 | Multicast Address |
549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 | Source Address [1] |
551 +- -+
552 | Source Address [2] |
553 +- -+
554 . . .
555 . . .
556 . . .
557 +- -+
558 | Source Address [N] |
559 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
560 | |
561 . .
562 . Auxiliary Data .
563 . .
564 | |
565 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 */
574
575/* IGMPv3 report format
576 0 1 2 3
577 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
578 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 | Type = 0x22 | Reserved | Checksum |
580 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
581 | Reserved | Number of Group Records (M) |
582 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 | |
584 . .
585 . Group Record [1] .
586 . .
587 | |
588 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
589 | |
590 . .
591 . Group Record [2] .
592 . .
593 | |
594 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
595 | . |
596 . . .
597 | . |
598 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
599 | |
600 . .
601 . Group Record [M] .
602 . .
603 | |
604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
605 */
614
615
625
634
642
644 osal_u16 tpid; // tag ID
645 osal_u16 user_pri : 3, // 帧的优先级
646 cfi : 1,
647 vlan_id : 12; // 可配置的VLAN ID
650
651typedef struct {
652 osal_u16 id; /* transaction id */
653 osal_u16 flags; /* message future */
654 osal_u16 qdcount; /* question record count */
655 osal_u16 ancount; /* answer record count */
656 osal_u16 nscount; /* authority record count */
657 osal_u16 arcount; /* additional record count */
659
660typedef enum {
661 OAL_NS_Q_REQUEST = 0, /* request */
662 OAL_NS_Q_RESPONSE = 1, /* response */
664
665typedef enum {
666 OAL_NS_O_QUERY = 0, /* Standard query. */
667 OAL_NS_O_IQUERY = 1, /* Inverse query (deprecated/unsupported). */
669
670/*
671 * Currently defined response codes.
672 */
673typedef enum {
674 OAL_NS_R_NOERROR = 0, /* No error occurred. */
676
677typedef enum {
678 OAL_NS_T_INVALID = 0, /* Cookie. */
679 OAL_NS_T_A = 1, /* Host address. */
681
682/* 邻居AP列表的BSS描述信息结构体 */
684 osal_u8 ap_reachability : 2, /* AP的可到达性 */
685 security : 1, /* 该AP的加密规则与当前连接是否一致 */
686 key_scope : 1, /* 该AP的认证信息是否与当前上报一直 */
687 spectrum_mgmt : 1, /* 能力位: 支持频谱管理 */ /* 能力位字段与beacon定义一致 */
688 qos : 1, /* 能力位: 支持QOS */
689 apsd : 1, /* 能力位: 支持APSD */
690 radio_meas : 1; /* 能力位: 波长测量 */
691 osal_u8 delay_block_ack : 1, /* 能力位: 阻塞延迟应答 */
692 immediate_block_ack : 1, /* 能力位: 阻塞立即应答 */
693 mobility_domain : 1, /* 该AP的beacon帧中是否含有MDE,且与此次上报一致 */
694 high_throughput : 1, /* 该AP的beacon帧中是否含有高吞吐量元素,且与此次上报一致 */
695 resv1 : 4; /* 预留 */
700
701#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS != _PRE_OS_VERSION)
702/*****************************************************************************
703 函 数 名 : ether_is_multicast
704 功能描述 : 判断一个地址是否为组播地址
705*****************************************************************************/
706static INLINE__ osal_u8 ether_is_multicast(const osal_u8 *addr)
707{
708 return ((*addr) & 0x01);
709}
710
711/*****************************************************************************
712 函 数 名 : ether_is_broadcast
713 功能描述 : 判断一个地址是否为广播地址
714*****************************************************************************/
715static INLINE__ osal_u8 ether_is_broadcast(const osal_u8 *addr)
716{
717 return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) &&
718 (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
719}
720
721/*****************************************************************************
722 函 数 名 : ether_is_ipv4_multicast
723 功能描述 : 判断一个地址是否为IPv4组播地址
724*****************************************************************************/
725static INLINE__ osal_u8 ether_is_ipv4_multicast(const osal_u8 *addr)
726{
727 return ((addr[0] == 0x01) && (addr[1] == 0x00) && (addr[2] == 0x5e));
728}
729
730/*****************************************************************************
731 函 数 名 : oal_ipv4_is_permanent_group
732 功能描述 : 判断一个IPv4地址是否为永久组地址:224.0.0.0~224.0.0.255
733*****************************************************************************/
734static INLINE__ osal_u8 oal_ipv4_is_permanent_group(osal_u32 addr)
735{
736 return (((addr & 0x00FFFFFF) ^ OAL_IPV4_PERMANET_GROUP_ADDR) == 0);
737}
738
739/*****************************************************************************
740 函 数 名 : oal_ipv6_is_multicast
741 功能描述 : 判断一个地址是否为IPv6组播地址:FFXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
742*****************************************************************************/
743static INLINE__ osal_u8 oal_ipv6_is_multicast(const osal_u8 *addr)
744{
745 return ((osal_u8)(addr[0]) == 0xff);
746}
747
748/*****************************************************************************
749 函 数 名 : oal_ipv6_is_unspecified_addr
750 功能描述 : 判断一个地址是否为IPv6未指定地址
751 IPv6未指定地址: ::/128 ,该地址仅用于接口还没有被分配IPv6地址时
752 与其它节点通讯作为源地址,例如在重复地址检测DAD中会出现.
753*****************************************************************************/
754static INLINE__ osal_u8 oal_ipv6_is_unspecified_addr(const osal_u8 *addr)
755{
756 return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && (addr[3] == 0x00) &&
757 (addr[4] == 0x00) && (addr[5] == 0x00) && (addr[6] == 0x00) && (addr[7] == 0x00) &&
758 (addr[8] == 0x00) && (addr[9] == 0x00) && (addr[10] == 0x00) && (addr[11] == 0x00) &&
759 (addr[12] == 0x00) && (addr[13] == 0x00) && (addr[14] == 0x00) && (addr[15] == 0x00));
760}
761
762/*****************************************************************************
763 函 数 名 : oal_ipv6_is_link_local_addr
764 功能描述 : 判断一个地址是否为IPv6链路本地地址.最高10位值为1111111010.
765 例如:FE80:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
766*****************************************************************************/
767static INLINE__ osal_u8 oal_ipv6_is_link_local_addr(const osal_u8 *addr)
768{
769 return ((addr[0] == 0xFE) && ((addr[1] >> 6) == 2));
770}
771
772static INLINE__ osal_u8 *oal_netbuf_put_rsv(const oal_netbuf_stru *netbuf, osal_u32 len)
773{
774 /* device侧注空啥都不做 */
775 unref_param(netbuf);
776 unref_param(len);
777 return 0;
778}
779#endif
780
781/***************************************xr 分界线***************************************************/
782#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
783typedef iw_handler oal_iw_handler;
784#define oal_netif_running(_pst_net_dev) netif_running(_pst_net_dev)
785#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
786#define OAL_NETDEVICE_DESTRUCTOR(_pst_dev) ((_pst_dev)->priv_destructor)
787#else
788#define OAL_NETDEVICE_LAST_RX(_pst_dev) ((_pst_dev)->last_rx)
789#define OAL_NETDEVICE_DESTRUCTOR(_pst_dev) ((_pst_dev)->destructor)
790#endif
791#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
792#define oal_netdevice_qdisc(_pst_dev, val) ((_pst_dev)->qdisc = val)
793#else
794#define oal_netdevice_qdisc(_pst_dev, val)
795#endif
796
797#define OAL_SIOCIWFIRSTPRIV SIOCIWFIRSTPRIV
798
799/* iw_priv参数类型OAL封装 */
800#define OAL_IW_PRIV_TYPE_BYTE IW_PRIV_TYPE_BYTE /* Char as number */
801#define OAL_IW_PRIV_TYPE_CHAR IW_PRIV_TYPE_CHAR /* Char as character */
802#define OAL_IW_PRIV_TYPE_INT IW_PRIV_TYPE_INT /* 32 bits int */
803#define OAL_IW_PRIV_TYPE_ADDR IW_PRIV_TYPE_ADDR /* struct sockaddr */
804#define OAL_IW_PRIV_SIZE_FIXED IW_PRIV_SIZE_FIXED /* Variable or fixed number of args */
805#define OAL_IW_PRIV_SIZE_MASK IW_PRIV_SIZE_MASK /* Max number of those args */
806
807/* iwconfig mode oal封装 */
808#define OAL_IW_MODE_AUTO IW_MODE_AUTO /* Let the driver decides */
809#define OAL_IW_MODE_INFRA IW_MODE_INFRA /* Multi cell network, roaming, ... */
810
811/* Transmit Power flags available */
812#define OAL_IW_TXPOW_DBM IW_TXPOW_DBM /* Value is in dBm */
813
814/* 主机与网络字节序转换 */
815#define oal_host2net_short(_x) htons(_x)
816#define oal_net2host_short(_x) ntohs(_x)
817#define oal_host2net_long(_x) htonl(_x)
818#define oal_net2host_long(_x) ntohl(_x)
819
820#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
821#define OAL_VLAN_PRIO_SHIFT VLAN_PRIO_SHIFT
822#else
823#define OAL_VLAN_PRIO_SHIFT 13
824#endif
825
826/* ARP protocol opcodes. */
827#define OAL_ARPOP_REQUEST ARPOP_REQUEST /* ARP request */
828#define OAL_ARPOP_REPLY ARPOP_REPLY /* ARP reply */
829
830#define OAL_IPPROTO_TCP IPPROTO_TCP /* Transmission Control Protocol */
831
832#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
833#define oal_wdev_match(_netif, _req) ((_netif)->ieee80211_ptr == (_req)->wdev)
834#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34))
835#define oal_wdev_match(_netif, _req) ((_netif) == (_req)->dev)
836#else
837#define oal_wdev_match(_netif, _req) ((_netif)->ifindex == (_req)->ifidx)
838#endif
839
840typedef struct sock oal_sock_stru;
841typedef struct net oal_net_stru;
842typedef struct module oal_module_stru;
843typedef struct nlmsghdr oal_nlmsghdr_stru;
844
845typedef struct ethhdr oal_ethhdr;
846typedef struct nf_hook_ops oal_nf_hook_ops_stru;
847typedef struct net_bridge_port oal_net_bridge_port;
848
849typedef struct ipv6hdr oal_ipv6hdr_stru;
850typedef struct icmp6hdr oal_icmp6hdr_stru;
851typedef struct in6_addr oal_in6_addr;
852typedef struct nd_msg oal_nd_msg_stru;
853typedef struct nd_opt_hdr oal_nd_opt_hdr;
854typedef struct netlink_skb_parms oal_netlink_skb_parms;
855#ifdef _PRE_WLAN_FEATURE_WPA3
856typedef struct cfg80211_external_auth_params oal_external_auth_stru;
857#endif
858
859/* netlink���� */
860#define OAL_NLMSG_HDRLEN NLMSG_HDRLEN
861
862#define OAL_NLA_FOR_EACH_ATTR(pos, head, len, rem) nla_for_each_attr(pos, head, len, rem)
863
864typedef struct ieee80211_iface_limit oal_ieee80211_iface_limit;
865typedef struct ieee80211_iface_combination oal_ieee80211_iface_combination;
866
867#elif defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
868#define OAL_NETDEVICE_DESTRUCTOR(_pst_dev) ((_pst_dev)->destructor)
869#define oal_netdevice_qdisc(_pst_dev, val) ((_pst_dev)->qdisc = val)
870
871#define IEEE80211_MAX_SSID_LEN 32
872#define OAL_VLAN_PRIO_SHIFT 13
873#define OAL_SIOCIWFIRSTPRIV 0x8BE0
874
875/* iw_priv参数类型OAL封装 */
876#define OAL_IW_PRIV_TYPE_BYTE 0x1000 /* Char as number */
877#define OAL_IW_PRIV_TYPE_CHAR 0x2000 /* Char as character */
878#define OAL_IW_PRIV_TYPE_INT 0x4000 /* 32 bits int */
879#define OAL_IW_PRIV_TYPE_ADDR 0x6000 /* struct sockaddr */
880#define OAL_IW_PRIV_SIZE_FIXED 0x0800 /* Variable or fixed number of args */
881#define OAL_IW_PRIV_SIZE_MASK 0x07FF /* Max number of those args */
882
883/* iwconfig mode oal封装 */
884#define OAL_IW_MODE_AUTO 0 /* Let the driver decides */
885#define OAL_IW_MODE_ADHOC 1 /* Single cell network */
886#define OAL_IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
887#define OAL_IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
888#define OAL_IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
889#define OAL_IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
890#define OAL_IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
891#define OAL_IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
892
893 /* Transmit Power flags available */
894#define OAL_IW_TXPOW_TYPE 0x00FF /* Type of value */
895#define OAL_IW_TXPOW_DBM 0x0000 /* Value is in dBm */
896#define OAL_IW_TXPOW_MWATT 0x0001 /* Value is in mW */
897#define OAL_IW_TXPOW_RELATIVE 0x0002 /* Value is in arbitrary units */
898#define OAL_IW_TXPOW_RANGE 0x1000 /* Range of value between min/max */
899
900/* 主机与网络字节序转换 */
901
902#define oal_host2net_short(_x) oal_swap_byteorder_16(_x)
903#define oal_net2host_short(_x) oal_swap_byteorder_16(_x)
904#define oal_host2net_long(_x) oal_swap_byteorder_32(_x)
905#define oal_net2host_long(_x) oal_swap_byteorder_32(_x)
906
907 /* ARP protocol opcodes. */
908#define OAL_ARPOP_REQUEST 1 /* ARP request */
909#define OAL_ARPOP_REPLY 2 /* ARP reply */
910
911
912#define OAL_IPPROTO_TCP 6 /* Transmission Control Protocol */
913
914#define OAL_INIT_NET init_net
915#define OAL_THIS_MODULE THIS_MODULE
916#define OAL_MSG_DONTWAIT MSG_DONTWAIT
917
918/* 管制域相关结构体定义 */
919#define mhz_to_khz(freq) ((freq) * 1000)
920#define dbi_to_mbi(gain) ((gain) * 100)
921#define dbm_to_mbm(gain) ((gain) * 100)
922
923#define reg_rule(start, end, bw, gain, eirp, reg_flags) \
924 { \
925 .freq_range.start_freq_khz = mhz_to_khz(start), \
926 .freq_range.end_freq_khz = mhz_to_khz(end), \
927 .freq_range.max_bandwidth_khz = mhz_to_khz(bw), \
928 .power_rule.max_antenna_gain = dbi_to_mbi(gain), \
929 .power_rule.max_eirp = dbm_to_mbm(eirp), \
930 .flags = (reg_flags), \
931 }
932
933/* netlink相关 */
934#define OAL_NLMSG_ALIGNTO 4
935#define oal_nlmsg_align(_len) (((_len) + OAL_NLMSG_ALIGNTO - 1) & ~(OAL_NLMSG_ALIGNTO - 1))
936
937/* VLAN以太网头 win32封装 */
938typedef struct {
939 td_u8 h_dest[6]; /* 6字节目的地址 */
940 td_u8 h_source[6]; /* 6字节源地址 */
941 td_u16 h_vlan_proto;
942 td_u16 h_vlan_TCI;
943 td_u16 h_vlan_encapsulated_proto;
944} oal_vlan_ethhdr_stru;
945#endif
946
947static inline td_s32 oal_ieee80211_channel_to_frequency(td_s32 l_channel,
948 oal_ieee80211_band_enum_uint8 band)
949{
950 if (l_channel <= 0) {
951 return 0; /* not supported */
952 }
953
954 if (band == OAL_IEEE80211_BAND_2GHZ) {
955 /* 14:信道 2484/2407:频率 5:两个信道中心频率相差5MHZ */
956 return ((l_channel == 14) ? 2484 : (2407 + l_channel * 5));
957 } else if (band == OAL_IEEE80211_BAND_5GHZ) {
958 /* 182/196:信道 4000/5000:频率 5:两个信道中心频率相差5MHZ */
959 return ((l_channel >= 182 && l_channel <= 196) ? (4000 + l_channel * 5) : (5000 + l_channel * 5));
960 }
961
962 /* not supported */
963 return 0;
964}
965
966static inline td_s32 oal_ieee80211_frequency_to_channel(td_s32 l_center_freq)
967{
968 td_s32 l_channel;
969
970 /* see 802.11 17.3.8.3.2 and Annex J */
971 if (l_center_freq == 0) {
972 l_channel = 0;
973#ifdef _PRE_WLAN_FEATURE_015CHANNEL_EXP
974 } else if (l_center_freq == 2512) { // 频率为2512
975 l_channel = 15; // 频率为2512对应信道号为15
976 } else if (l_center_freq == 2384) { // 频率为2384
977 l_channel = 16; // 频率为2384对应信道号为16
978#endif
979 } else if (l_center_freq == 2484) { /* 频率为2484 */
980 l_channel = 14; /* 14信道对应2484 */
981 } else if (l_center_freq < 2484) { /* 频率小于2484 */
982 l_channel = (l_center_freq - 2407) / 5; /* 频率小于2484对应的信道号 = (频率 - 2407)/ 5 */
983 } else if (l_center_freq >= 4910 && l_center_freq <= 4980) { /* 频率在[4910, 4980] */
984 l_channel = (l_center_freq - 4000) / 5; /* 对应的信道号 =(频率 - 4000) / 5 */
985 } else if (l_center_freq <= 45000) { /* DMG band lower limit 45000 */
986 l_channel = (l_center_freq - 5000) / 5; /* 对应的信道号 =(频率 - 5000) / 5 */
987 } else if (l_center_freq >= 58320 && l_center_freq <= 64800) { /* 频率在[58320, 64800] */
988 l_channel = (l_center_freq - 56160) / 2160; /* 对应的信道号 =(频率 - 56160)/2160 */
989 } else {
990 l_channel = 0;
991 }
992 return l_channel;
993}
994
995#if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
996static inline oal_ieee80211_channel_stru* oal_ieee80211_get_channel(oal_wiphy_stru *wiphy,
997 td_s32 freq)
998{
999 return ieee80211_get_channel(wiphy, freq);
1000}
1001
1002static inline oal_wiphy_stru* oal_wiphy_new(oal_cfg80211_ops_stru *ops, td_s32 sizeof_priv)
1003{
1004 return wiphy_new(ops, sizeof_priv);
1005}
1006
1007static inline td_s32 oal_wiphy_register(oal_wiphy_stru *wiphy)
1008{
1009 return wiphy_register(wiphy);
1010}
1011
1012
1013static inline td_void oal_wiphy_unregister(oal_wiphy_stru *wiphy)
1014{
1015 return wiphy_unregister(wiphy);
1016}
1017
1018
1019static inline void oal_wiphy_free(oal_wiphy_stru *wiphy)
1020{
1021 wiphy_free(wiphy);
1022}
1023
1024static inline void *oal_wiphy_priv(oal_wiphy_stru *wiphy)
1025{
1026 return wiphy_priv(wiphy);
1027}
1028
1029
1030static inline void oal_wiphy_apply_custom_regulatory(oal_wiphy_stru *wiphy,
1031 const oal_ieee80211_regdomain_stru *regd)
1032{
1033 wiphy_apply_custom_regulatory(wiphy, regd);
1034}
1035
1036static inline td_u16 oal_eth_type_trans(oal_netbuf_stru *pst_netbuf, oal_net_device_stru *device)
1037{
1038 return eth_type_trans(pst_netbuf, device);
1039}
1040
1041static inline td_void oal_ether_setup(oal_net_device_stru *p_net_device)
1042{
1043 if (TD_NULL == p_net_device) {
1044 return;
1045 }
1046
1047 ether_setup(p_net_device);
1048
1049 return;
1050}
1051
1052static inline oal_net_device_stru* oal_dev_get_by_name(const td_s8 *pc_name)
1053{
1054 return dev_get_by_name(&init_net, pc_name);
1055}
1056
1057
1058#define oal_dev_put(_pst_dev) dev_put(_pst_dev)
1059
1060static inline td_void oal_net_close_dev(oal_net_device_stru *netdev)
1061{
1062 rtnl_lock();
1063 dev_close(netdev);
1064 rtnl_unlock();
1065}
1066
1067static inline oal_net_device_stru* oal_net_alloc_netdev(td_u32 sizeof_priv, td_s8 *name,
1068 td_void *p_set_up)
1069{
1070 if ((TD_NULL == name) || (TD_NULL == p_set_up)) {
1071 return TD_NULL;
1072 }
1073#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
1074 return alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, p_set_up);
1075#else
1076 return alloc_netdev(sizeof_priv, name, p_set_up);
1077#endif
1078}
1079
1080static inline oal_net_device_stru* oal_net_alloc_netdev_mqs(td_u32 sizeof_priv, td_s8 *name,
1081 td_void *p_set_up, td_u32 txqs, td_u32 rxqs)
1082{
1083 if ((TD_NULL == name) || (TD_NULL == p_set_up)) {
1084 return TD_NULL;
1085 }
1086#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
1087 return alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, p_set_up, txqs);
1088#else
1089 return alloc_netdev_mq(sizeof_priv, name, p_set_up, txqs);
1090#endif
1091}
1092
1093static inline td_void oal_net_tx_wake_all_queues(oal_net_device_stru *dev)
1094{
1095 if (TD_NULL == dev) {
1096 return;
1097 }
1098
1099 return netif_tx_wake_all_queues(dev);
1100}
1101
1102
1103static inline td_void oal_net_tx_stop_all_queues(oal_net_device_stru *dev)
1104{
1105 if (TD_NULL == dev) {
1106 return;
1107 }
1108
1109 return netif_tx_stop_all_queues(dev);
1110}
1111
1112static inline td_void oal_net_wake_subqueue(oal_net_device_stru *dev, td_u16 queue_idx)
1113{
1114 if (TD_NULL == dev) {
1115 return;
1116 }
1117
1118 return netif_wake_subqueue(dev, queue_idx);
1119}
1120
1121
1122static inline td_void oal_net_stop_subqueue(oal_net_device_stru *dev, td_u16 queue_idx)
1123{
1124 if (TD_NULL == dev) {
1125 return;
1126 }
1127
1128 return netif_stop_subqueue(dev, queue_idx);
1129}
1130
1131static inline td_void oal_net_free_netdev(oal_net_device_stru *netdev)
1132{
1133 if (TD_NULL == netdev) {
1134 return ;
1135 }
1136
1137 free_netdev(netdev);
1138}
1139
1140static inline td_s32 oal_net_register_netdev(oal_net_device_stru *p_net_device)
1141{
1142 if (TD_NULL == p_net_device) {
1143 return OAL_ERR_CODE_PTR_NULL;
1144 }
1145
1146 /* Just For HCC */
1147#ifdef _PRE_WLAN_FEATURE_MULTI_NETBUF_AMSDU
1148 /* ETHER HEAD 4bytes */
1149 OAL_NETDEVICE_HEADROOM(p_net_device) = 74; /* netdevice headroom指定大小74 */
1150#else
1151 OAL_NETDEVICE_HEADROOM(p_net_device) = 64; /* netdevice headroom指定大小64 */
1152#endif
1153 OAL_NETDEVICE_TAILROOM(p_net_device) = 32; /* netdevice tailroom指定大小32 */
1154
1155 return register_netdev(p_net_device);
1156}
1157
1158static inline td_void oal_net_unregister_netdev(oal_net_device_stru *p_net_device)
1159{
1160 if (TD_NULL == p_net_device) {
1161 return ;
1162 }
1163
1164 if (p_net_device->reg_state != NETREG_REGISTERED) {
1165 wifi_printf("net device not registed regstate:%d!!\n", p_net_device->reg_state);
1166 return;
1167 }
1168 unregister_netdev(p_net_device);
1169}
1170
1171static inline td_s32 oal_net_device_open(oal_net_device_stru *dev)
1172{
1173 dev->flags |= OAL_IFF_RUNNING;
1174
1175 return OAL_SUCC;
1176}
1177
1178static inline td_s32 oal_net_device_close(oal_net_device_stru *dev)
1179{
1180 dev->flags &= ~OAL_IFF_RUNNING;
1181
1182 return OAL_SUCC;
1183}
1184
1185static inline td_s32 oal_net_device_set_macaddr(oal_net_device_stru *dev, td_void *addr)
1186{
1187 oal_sockaddr_stru *mac;
1188
1189 mac = (oal_sockaddr_stru *)addr;
1190
1191 (td_void)memcpy_s(dev->dev_addr, ETHER_ADDR_LEN, mac->sa_data, ETHER_ADDR_LEN);
1192 return OAL_SUCC;
1193}
1194
1195static inline td_s32 oal_net_device_init(oal_net_device_stru *dev)
1196{
1197 return OAL_SUCC;
1198}
1199
1200static inline oal_net_device_stats_stru *oal_net_device_get_stats(oal_net_device_stru *dev)
1201{
1202 oal_net_device_stats_stru *stats;
1203
1204 stats = &dev->stats;
1205
1206 stats->tx_errors = 0;
1207 stats->tx_dropped = 0;
1208 stats->tx_packets = 0;
1209 stats->rx_packets = 0;
1210 stats->rx_errors = 0;
1211 stats->rx_dropped = 0;
1212 stats->rx_crc_errors = 0;
1213
1214 return stats;
1215}
1216
1217static inline td_s32 oal_net_device_ioctl(oal_net_device_stru *dev, oal_ifreq_stru *ifr, td_s32 ul_cmd)
1218{
1219 return -OAL_EINVAL;
1220}
1221
1222static inline td_s32 oal_net_device_change_mtu(oal_net_device_stru *dev, td_s32 mtu)
1223{
1224 dev->mtu = mtu;
1225 return OAL_SUCC;
1226}
1227
1228#ifdef _PRE_SKB_TRACE
1229#define oal_netif_rx_ni(pst_netbuf) \
1230({ \
1231 mem_trace_delete_node((osal_ulong)(pst_netbuf)); \
1232 netif_rx_ni(pst_netbuf); \
1233})
1234#else
1235static inline td_s32 oal_netif_rx_ni(oal_netbuf_stru *pst_netbuf)
1236{
1237 return netif_rx_ni(pst_netbuf);
1238}
1239#endif
1240
1241static inline td_s32 oal_nla_put_u32(oal_netbuf_stru *skb, td_s32 l_attrtype, td_u32 value)
1242{
1243 return nla_put_u32(skb, l_attrtype, value);
1244}
1245
1246static inline td_s32 oal_nla_put_u16(oal_netbuf_stru *skb, td_s32 l_attrtype, td_u32 value)
1247{
1248 return nla_put_u16(skb, l_attrtype, value);
1249}
1250
1251static inline td_s32 oal_nla_put_flag(oal_netbuf_stru *skb, td_s32 l_attrtype)
1252{
1253 return nla_put_flag(skb, l_attrtype);
1254}
1255
1256static inline td_s32 oal_nla_put(oal_netbuf_stru *skb, td_s32 l_attrtype, td_s32 l_attrlen, const td_void *p_data)
1257{
1258 return nla_put(skb, l_attrtype, l_attrlen, p_data);
1259}
1260
1261/*
1262 * nla_put_nohdr - Add a netlink attribute without header
1263 * @skb: socket buffer to add attribute to
1264 * @attrlen: length of attribute payload
1265 * @data: head of attribute payload
1266 *
1267 * Returns -EMSGSIZE if the tailroom of the skb is insufficient to store
1268 * the attribute payload.
1269 */
1270static inline td_s32 oal_nla_put_nohdr(oal_netbuf_stru *skb, td_s32 l_attrlen, const td_void *p_data)
1271{
1272 return nla_put_nohdr(skb, l_attrlen, p_data);
1273}
1274
1275static inline oal_netbuf_stru *oal_nlmsg_new(td_s32 payload, oal_gfp_enum_uint8 flags)
1276{
1277 return nlmsg_new(payload, flags);
1278}
1279
1280static inline td_void oal_nlmsg_free(oal_netbuf_stru *skb)
1281{
1282 return nlmsg_free(skb);
1283}
1284
1285static inline td_s32 oal_genlmsg_multicast(oal_genl_family_stru *family, oal_netbuf_stru *skb, td_u32 pid,
1287{
1288#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0))
1289 return genlmsg_multicast(skb, pid, group, flags);
1290#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0))
1291 return genlmsg_multicast(family, skb, pid, group, flags);
1292#else
1293 /* Linux genlmsg_multicast */
1294 return OAL_SUCC;
1295#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) */
1296}
1297
1298static inline td_void *oal_genlmsg_put(oal_netbuf_stru *skb, td_u32 pid, td_u32 seq,
1299 oal_genl_family_stru *family, td_s32 flags, td_u8 cmd)
1300{
1301 return genlmsg_put(skb, pid, seq, family, flags, cmd);
1302}
1303
1304static inline oal_nlattr_stru *oal_nla_nest_start(oal_netbuf_stru *skb, td_s32 l_attrtype)
1305{
1306 return nla_nest_start(skb, l_attrtype);
1307}
1308
1309static inline td_void oal_genlmsg_cancel(oal_netbuf_stru *skb, td_void *hdr)
1310{
1311 return genlmsg_cancel(skb, hdr);
1312}
1313
1314static inline td_s32 oal_nla_nest_end(oal_netbuf_stru *skb, oal_nlattr_stru *start)
1315{
1316 return nla_nest_end(skb, start);
1317}
1318
1319static inline td_s32 oal_genlmsg_end(oal_netbuf_stru *skb, td_void *hdr)
1320{
1321#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
1322 return genlmsg_end(skb, hdr);
1323#else
1324 genlmsg_end(skb, hdr);
1325 return OAL_SUCC;
1326#endif
1327}
1328
1329static inline td_void *oal_nla_data(const oal_nlattr_stru *nla)
1330{
1331 return nla_data(nla);
1332}
1333
1334static inline td_u32 oal_nla_get_u8(const oal_nlattr_stru *nla)
1335{
1336 return nla_get_u8(nla);
1337}
1338
1339static inline td_u32 oal_nla_get_u16(const oal_nlattr_stru *nla)
1340{
1341 return nla_get_u16(nla);
1342}
1343
1344static inline td_u32 oal_nla_get_u32(const oal_nlattr_stru *nla)
1345{
1346 return nla_get_u32(nla);
1347}
1348
1349
1350static inline td_u32 oal_nla_total_size(const oal_nlattr_stru *nla)
1351{
1352 td_s32 payload = nla_len(nla);
1353 return nla_total_size(payload);
1354}
1355
1356static inline td_s32 oal_nla_len(const oal_nlattr_stru *nla)
1357{
1358 return nla_len(nla);
1359}
1360
1361
1362static inline td_s32 oal_nla_type(const oal_nlattr_stru *nla)
1363{
1364 return nla_type(nla);
1365}
1366
1367static inline oal_cfg80211_registered_device_stru *oal_wiphy_to_dev(oal_wiphy_stru *wiphy)
1368{
1369#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0))
1370 return wiphy_to_dev(wiphy);
1371#else
1372 return wiphy_to_rdev(wiphy);
1373#endif
1374}
1375
1376static inline td_u16 oal_csum_ipv6_magic(oal_in6_addr *ipv6_s, oal_in6_addr *ipv6_d,
1377 td_u32 len, td_u16 proto, td_u32 sum)
1378{
1379 return csum_ipv6_magic(ipv6_s, ipv6_d, len, proto, sum);
1380}
1381
1382static inline td_u32 oal_csum_partial(const td_void *p_buff, td_s32 l_len, td_u32 sum)
1383{
1384 return csum_partial(p_buff, l_len, sum);
1385}
1386
1387static inline td_s32 oal_ipv6_addr_type(oal_in6_addr *ipv6)
1388{
1389#ifdef _PRE_WLAN_FEATURE_SUPPORT_IPV6
1390 return ipv6_addr_type(ipv6);
1391#else
1392 return (td_s32)IPV6_ADDR_RESERVED;
1393#endif
1394}
1395
1396static inline td_s32 oal_pskb_may_pull(oal_netbuf_stru *nb, td_u32 len)
1397{
1398 return pskb_may_pull(nb, len);
1399}
1400
1401static inline oal_netbuf_stru *oal_arp_create(td_s32 l_type, td_s32 l_ptype, td_u32 dest_ip,
1402 oal_net_device_stru *dev, td_u32 src_ip, td_u8 *dest_hw, td_u8 *src_hw, td_u8 *target_hw)
1403{
1404 return arp_create(l_type, l_ptype, dest_ip, dev, src_ip, dest_hw, src_hw, target_hw);
1405}
1406extern oal_bool_enum_uint8 oal_netbuf_is_dhcp_port_etc(const oal_udp_header_stru *udp_hdr);
1407extern oal_bool_enum_uint8 oal_netbuf_is_dhcp6_etc(oal_ipv6hdr_stru *ipv6hdr);
1408extern oal_bool_enum_uint8 oal_netbuf_is_tcp_ack6_etc(oal_ipv6hdr_stru *ipv6hdr);
1409extern osal_u16 oal_netbuf_select_queue_etc(oal_netbuf_stru *buf);
1410extern oal_bool_enum_uint8 oal_netbuf_is_tcp_ack_etc(oal_ip_header_stru *ip_hdr);
1411extern oal_bool_enum_uint8 oal_netbuf_is_icmp_etc(oal_ip_header_stru *ip_hdr);
1412
1413#elif defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
1414
1415typedef struct ieee80211_channel_sw_ie {
1416 osal_u8 mode;
1417 osal_u8 new_ch_num;
1418 osal_u8 count;
1419 osal_u8 rsv[1];
1420} oal_ieee80211_channel_sw_ie;
1421
1422td_u32 hwal_netif_rx(oal_net_device_stru* netdev, oal_netbuf_stru* netbuf);
1423
1424#define chan2g(_channel, _freq, _flags) \
1425{ \
1426 .band = OAL_IEEE80211_BAND_2GHZ, \
1427 .center_freq = (_freq), \
1428 .hw_value = (_channel), \
1429 .flags = (_flags), \
1430 .max_antenna_gain = 0, \
1431 .max_power = 30, \
1432}
1433
1434#define ratetab_ent(_rate, _rateid, _flags) \
1435{ \
1436 .bitrate = (_rate), \
1437 .hw_value = (_rateid), \
1438 .flags = (_flags), \
1439}
1440
1441static inline osal_void oal_net_tx_stop_all_queues(const oal_net_device_stru *dev)
1442{
1443 if (dev == OAL_PTR_NULL) {
1444 return;
1445 }
1446
1447 return;
1448}
1449
1450static inline osal_void oal_net_tx_wake_all_queues(const oal_net_device_stru *dev)
1451{
1452 if (dev == OAL_PTR_NULL) {
1453 return;
1454 }
1455
1456 return ;
1457}
1458
1459static inline osal_void oal_net_stop_subqueue(const oal_net_device_stru *dev, osal_u16 queue_idx)
1460{
1461 unref_param(queue_idx);
1462 if (dev == OAL_PTR_NULL) {
1463 return;
1464 }
1465
1466 return ;
1467}
1468
1469
1470static inline osal_s32 oal_netif_rx(oal_netbuf_stru *pst_netbuf)
1471{
1472 return (osal_s32)hwal_netif_rx(pst_netbuf->dev, pst_netbuf);
1473}
1474
1475
1476static inline osal_u8 oal_netbuf_get_bitfield(osal_void)
1477{
1478 bitfield_un un_bitfield;
1479
1480 un_bitfield.byte = 0x12;
1481 if (un_bitfield.bits.low == 0x2) {
1483 } else {
1485 }
1486}
1487
1488
1489#ifdef _PRE_SKB_TRACE
1490#define oal_netbuf_copy(pst_netbuf, priority) \
1491({ \
1492 oal_netbuf_stru *__no_pst_copy_netbuf; \
1493 __no_pst_copy_netbuf = skb_copy(pst_netbuf, priority); \
1494 if (__no_pst_copy_netbuf) \
1495 { \
1496 mem_trace_add_node((osal_ulong)__no_pst_copy_netbuf); \
1497 } \
1498 __no_pst_copy_netbuf; \
1499})
1500#else
1501#define oal_netbuf_copy(pst_netbuf, priority) _oal_netbuf_copy(pst_netbuf, priority)
1502#endif
1503
1504static inline osal_void oal_net_wake_subqueue(const oal_net_device_stru *dev, osal_u16 queue_idx)
1505{
1506 unref_param(queue_idx);
1507 if (dev == OAL_PTR_NULL) {
1508 return;
1509 }
1510
1511 return ;
1512}
1513
1514static inline osal_u16 oal_eth_type_trans(oal_netbuf_stru *pst_netbuf, oal_net_device_stru *device)
1515{
1516 unref_param(device);
1517 oal_netbuf_pull(pst_netbuf, sizeof(oal_ether_header_stru));
1518 return 0;
1519}
1520
1521static inline osal_void oal_net_close_dev(oal_net_device_stru *netdev)
1522{
1523 OAL_NETDEVICE_FLAGS(netdev) &= ~OAL_IFF_RUNNING;
1524}
1525
1526static inline osal_s32 oal_net_device_open(oal_net_device_stru *dev)
1527{
1528 dev->flags |= OAL_IFF_RUNNING;
1529
1530 return OAL_SUCC;
1531}
1532
1533static inline osal_s32 oal_net_device_close(oal_net_device_stru *dev)
1534{
1535 dev->flags &= ~OAL_IFF_RUNNING;
1536
1537 return OAL_SUCC;
1538}
1539
1540static inline osal_s32 oal_net_device_set_macaddr(oal_net_device_stru *dev, osal_void *addr)
1541{
1542 oal_sockaddr_stru *mac;
1543
1544 mac = (oal_sockaddr_stru *)addr;
1545
1546 (osal_void)memcpy_s(dev->dev_addr, 6, mac->sa_data, 6); /* 6:mac长度 */
1547 return OAL_SUCC;
1548}
1549
1550static inline osal_s32 oal_net_device_init(oal_net_device_stru *dev)
1551{
1552 unref_param(dev);
1553 return OAL_SUCC;
1554}
1555
1556static inline oal_net_device_stats_stru *oal_net_device_get_stats(oal_net_device_stru *dev)
1557{
1558 oal_net_device_stats_stru *stats;
1559
1560 stats = &dev->stats;
1561
1562 stats->tx_errors = 0;
1563 stats->tx_dropped = 0;
1564 stats->tx_packets = 0;
1565 stats->rx_packets = 0;
1566 stats->rx_errors = 0;
1567 stats->rx_dropped = 0;
1568 stats->rx_crc_errors = 0;
1569
1570 return stats;
1571}
1572
1573static inline osal_s32 oal_net_device_ioctl(oal_net_device_stru *dev, oal_ifreq_stru *ifr, osal_s32 ul_cmd)
1574{
1575 unref_param(dev);
1576 unref_param(ifr);
1577 unref_param(ul_cmd);
1578 return -OAL_EINVAL;
1579}
1580
1581static inline osal_s32 oal_net_device_change_mtu(oal_net_device_stru *dev, osal_s32 mtu)
1582{
1583 dev->mtu = (osal_u32)mtu;
1584 return OAL_SUCC;
1585}
1586
1587#ifdef _PRE_SKB_TRACE
1588#define oal_netif_rx_ni(pst_netbuf) \
1589({ \
1590 mem_trace_delete_node((osal_ulong)(pst_netbuf)); \
1591 netif_rx_ni(pst_netbuf); \
1592})
1593#else
1594static inline osal_s32 oal_netif_rx_ni(oal_netbuf_stru *pst_netbuf)
1595{
1596#if defined(_PRE_OS_VERSION_LITEOS) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION)
1597 return (osal_s32)hwal_netif_rx(pst_netbuf->dev, pst_netbuf);
1598#elif defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
1599 return netif_rx_ni(pst_netbuf);
1600#endif
1601}
1602#endif
1603
1604oal_bool_enum_uint8 oal_netbuf_is_dhcp_port_etc(const oal_udp_header_stru *udp_hdr);
1605oal_bool_enum_uint8 oal_netbuf_is_dhcp6_etc(oal_ipv6hdr_stru *ipv6hdr);
1606oal_net_device_stru* oal_net_alloc_netdev(const td_char *name, td_u8 max_name_len);
1607td_void oal_net_free_netdev(oal_net_device_stru *netdev);
1608td_u32 oal_net_register_netdev(oal_net_device_stru* netdev);
1609td_void oal_net_unregister_netdev(oal_net_device_stru* netdev);
1610
1611oal_bool_enum_uint8 oal_netbuf_is_tcp_ack6_etc(oal_ipv6hdr_stru *ipv6hdr);
1612osal_u16 oal_netbuf_select_queue_etc(oal_netbuf_stru *buf);
1613oal_bool_enum_uint8 oal_netbuf_is_tcp_ack_etc(oal_ip_header_stru *ip_hdr);
1614oal_bool_enum_uint8 oal_netbuf_is_icmp_etc(oal_ip_header_stru *ip_hdr);
1615
1616/* ws61 */
1617oal_net_device_stru* oal_get_past_net_device_by_index(td_u32 netdev_index);
1618td_void oal_set_past_net_device_by_index(td_u32 netdev_index, oal_net_device_stru *netdev);
1619oal_net_device_stru* oal_get_netdev_by_name(const td_char* pc_name);
1620oal_net_device_stru* oal_get_netdev_by_type(nl80211_iftype_uint8 type);
1621td_u32 oal_net_check_and_get_devname(nl80211_iftype_uint8 type, char* dev_name, td_u32* len);
1622td_void oal_net_tx_wake_all_queues(const oal_net_device_stru *dev);
1623
1624
1625#endif
1626
1627
1628#ifdef __cplusplus
1629#if __cplusplus
1630}
1631#endif
1632#endif
1633
1634#endif /* end of file */
@ OAL_SUCC
Definition common_error_code_rom.h:18
@ OAL_ERR_CODE_PTR_NULL
Definition common_error_code_rom.h:34
#define unref_param(P)
Definition dmac_misc_type.h:33
#define ETHER_ADDR_LEN
Definition eth_ip_common_rom.h:21
@ DATA_LO_QUEUE
Definition hcc_cfg_comm.h:71
gfp_t oal_gfp_enum_uint8
Definition oal_netbuf.h:21
td_u32 gfp_t
Definition oal_skbuff.h:67
#define ETH_TARGET_IP_ADDR_LEN
Definition oal_net.h:152
gfp_t oal_gfp_enum_uint8
Definition oal_net.h:224
osal_u8 app_ie_bitmap
Definition oal_net.h:291
APP_IE_BITMAP
Definition oal_net.h:282
@ REASSOC_REQ_IE
Definition oal_net.h:288
@ AUTH_REQ_IE
Definition oal_net.h:289
@ ASSOC_REQ_IE
Definition oal_net.h:286
@ ASSOC_RSP_IE
Definition oal_net.h:287
@ PROBE_REQ_IE
Definition oal_net.h:284
@ PROBE_RSP_IE
Definition oal_net.h:285
@ BEACON_IE
Definition oal_net.h:283
_wlan_net_queue_type_
Definition oal_net.h:226
@ WLAN_NET_QUEUE_BUTT
Definition oal_net.h:235
@ WLAN_NORMAL_QUEUE
Definition oal_net.h:228
@ WLAN_TCP_ACK_QUEUE
Definition oal_net.h:231
@ WLAN_HI_QUEUE
Definition oal_net.h:227
@ WLAN_TCP_DATA_QUEUE
Definition oal_net.h:230
@ WLAN_UDP_DATA_QUEUE
Definition oal_net.h:233
osal_u32 group
Definition oal_net.h:3
oal_ns_type
Definition oal_net.h:677
@ OAL_NS_T_A
Definition oal_net.h:679
@ OAL_NS_T_INVALID
Definition oal_net.h:678
mlme_type_enum
Definition oal_net.h:254
@ OAL_IEEE80211_MLME_AUTH
Definition oal_net.h:255
@ OAL_IEEE80211_MLME_NUM
Definition oal_net.h:258
@ OAL_IEEE80211_MLME_REASSOC
Definition oal_net.h:257
@ OAL_IEEE80211_MLME_ASSOC
Definition oal_net.h:256
#define OAL_NETDEVICE_HEADROOM(_pst_dev)
Definition oal_net.h:412
#define OAL_NETDEVICE_FLAGS(_pst_dev)
Definition oal_net.h:414
#define OAL_MAX_FT_ALL_LEN
Definition oal_net.h:192
#define OAL_NETDEVICE_TAILROOM(_pst_dev)
Definition oal_net.h:413
#define OAL_BITFIELD_LITTLE_ENDIAN
Definition oal_net.h:47
#define OAL_DECLARE_PACKED
Definition oal_net.h:35
#define OAL_BITFIELD_BIG_ENDIAN
Definition oal_net.h:48
enum _wlan_net_queue_type_ wlan_net_queue_type
osal_u8 type
Definition oal_net.h:0
oal_scan_enum
Definition oal_net.h:264
@ OAL_ACTIVE_SCAN
Definition oal_net.h:266
@ OAL_SCAN_BUTT
Definition oal_net.h:268
@ OAL_PASSIVE_SCAN
Definition oal_net.h:265
osal_u8 oal_scan_band_enum_uint8
Definition oal_net.h:280
oal_ns_rcode
Definition oal_net.h:673
@ OAL_NS_R_NOERROR
Definition oal_net.h:674
osal_u8 app_ie_type_uint8
Definition oal_net.h:308
oal_scan_band_enum
Definition oal_net.h:273
@ OAL_SCAN_ALL_BAND
Definition oal_net.h:276
@ OAL_SCAN_BAND_BUTT
Definition oal_net.h:278
@ OAL_SCAN_5G_BAND
Definition oal_net.h:275
@ OAL_SCAN_2G_BAND
Definition oal_net.h:274
#define OAL_IPV4_PERMANET_GROUP_ADDR
Definition oal_net.h:218
APP_IE_TYPE
Definition oal_net.h:293
@ OAL_APP_IE_NUM
Definition oal_net.h:306
@ OAL_APP_EXTEND_IE3
Definition oal_net.h:303
@ OAL_APP_BEACON_IE
Definition oal_net.h:294
@ OAL_APP_EXTEND_IE1
Definition oal_net.h:301
@ OAL_APP_REASSOC_REQ_IE
Definition oal_net.h:300
@ OAL_APP_VENDOR_IE
Definition oal_net.h:305
@ OAL_APP_PROBE_RSP_IE
Definition oal_net.h:296
@ OAL_APP_PROBE_REQ_IE
Definition oal_net.h:295
@ OAL_APP_FT_IE
Definition oal_net.h:299
@ OAL_APP_ASSOC_RSP_IE
Definition oal_net.h:298
@ OAL_APP_EXTEND_IE4
Definition oal_net.h:304
@ OAL_APP_ASSOC_REQ_IE
Definition oal_net.h:297
@ OAL_APP_EXTEND_IE2
Definition oal_net.h:302
oal_ns_qrcode
Definition oal_net.h:660
@ OAL_NS_Q_RESPONSE
Definition oal_net.h:662
@ OAL_NS_Q_REQUEST
Definition oal_net.h:661
#define ETH_SENDER_IP_ADDR_LEN
Definition oal_net.h:151
#define OAL_IPV6_ADDR_SIZE
Definition oal_net.h:100
#define IPV6_ADDR_RESERVED
Definition oal_net.h:76
oal_ns_opcode
Definition oal_net.h:665
@ OAL_NS_O_IQUERY
Definition oal_net.h:667
@ OAL_NS_O_QUERY
Definition oal_net.h:666
osal_u8 rsv[3]
Definition oal_net.h:2
#define OAL_IFF_RUNNING
Definition oal_net.h:419
osal_u8 oal_scan_enum_uint8
Definition oal_net.h:270
osal_u8 mlme_type_enum_uint8
Definition oal_net.h:260
#define OAL_IEEE80211_MAX_SSID_LEN
Definition oal_net_rom.h:181
#define OAL_EINVAL
Definition oal_types_device_rom.h:38
osal_u8 oal_bool_enum_uint8
Definition oal_types_device_rom.h:45
#define OAL_PTR_NULL
Definition oal_types_device_rom.h:30
#define wifi_printf(fmt, arg...)
Definition oal_util_hcm.h:44
#define INLINE__
Definition osal_list.h:25
int osal_s32
Definition osal_types.h:19
unsigned char osal_u8
Definition osal_types.h:11
char osal_char
Definition osal_types.h:16
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
errno_t memcpy_s(void *dest, size_t destMax, const void *src, size_t count)
Definition oal_net.h:536
osal_u8 code
Definition oal_net.h:538
osal_u32 group
Definition oal_net.h:540
osal_u16 csum
Definition oal_net.h:539
osal_u8 type
Definition oal_net.h:537
Definition oal_net.h:567
osal_u8 grec_type
Definition oal_net.h:568
osal_u16 grec_nsrcs
Definition oal_net.h:570
osal_u32 grec_group_ip
Definition oal_net.h:571
osal_u8 grec_auxwords
Definition oal_net.h:569
Definition oal_net.h:606
osal_u8 resv1
Definition oal_net.h:608
osal_u16 ngrec
Definition oal_net.h:611
osal_u8 type
Definition oal_net.h:607
osal_u16 csum
Definition oal_net.h:609
osal_u16 resv2
Definition oal_net.h:610
Definition oal_net.h:616
osal_u8 group_ip[16]
Definition oal_net.h:622
osal_u16 reserved
Definition oal_net.h:621
osal_u8 type
Definition oal_net.h:617
osal_u8 code
Definition oal_net.h:618
osal_u16 check_sum
Definition oal_net.h:619
osal_u16 max_response_delay
Definition oal_net.h:620
Definition oal_net.h:635
osal_u8 grec_type
Definition oal_net.h:636
osal_u8 grec_auxwords
Definition oal_net.h:637
osal_u16 grec_srcaddr_num
Definition oal_net.h:638
osal_u8 group_ip[16]
Definition oal_net.h:639
Definition oal_net.h:626
osal_u16 group_address_num
Definition oal_net.h:631
osal_u16 reserved
Definition oal_net.h:630
osal_u16 check_sum
Definition oal_net.h:629
osal_u8 code
Definition oal_net.h:628
osal_u8 type
Definition oal_net.h:627
Definition oal_net.h:643
osal_u16 user_pri
Definition oal_net.h:645
osal_u16 vlan_id
Definition oal_net.h:647
osal_u16 cfi
Definition oal_net.h:646
osal_u16 tpid
Definition oal_net.h:644
Definition oal_net.h:683
osal_u8 qos
Definition oal_net.h:688
osal_u8 resv2
Definition oal_net.h:696
osal_u8 key_scope
Definition oal_net.h:686
osal_u8 high_throughput
Definition oal_net.h:694
osal_u8 resv3
Definition oal_net.h:697
osal_u8 delay_block_ack
Definition oal_net.h:691
osal_u8 mobility_domain
Definition oal_net.h:693
osal_u8 security
Definition oal_net.h:685
osal_u8 immediate_block_ack
Definition oal_net.h:692
osal_u8 spectrum_mgmt
Definition oal_net.h:687
osal_u8 resv1
Definition oal_net.h:695
osal_u8 radio_meas
Definition oal_net.h:690
osal_u8 apsd
Definition oal_net.h:689
osal_u8 ap_reachability
Definition oal_net.h:684
Definition eth_ip_common_rom.h:79
Definition oal_net.h:651
osal_u16 ancount
Definition oal_net.h:655
osal_u16 nscount
Definition oal_net.h:656
osal_u16 flags
Definition oal_net.h:653
osal_u16 arcount
Definition oal_net.h:657
osal_u16 id
Definition oal_net.h:652
osal_u16 qdcount
Definition oal_net.h:654
Definition eth_ip_common_rom.h:59
Definition eth_ip_common_rom.h:73
Definition eth_ip_common_rom.h:26
osal_u8 ether_dhost[6]
Definition eth_ip_common_rom.h:27
osal_u8 ether_shost[6]
Definition eth_ip_common_rom.h:28
osal_u16 ether_type
Definition eth_ip_common_rom.h:29
Definition eth_ip_common_rom.h:152
Definition eth_ip_common_rom.h:116
Definition eth_ip_common_rom.h:36
osal_u32 saddr
Definition eth_ip_common_rom.h:52
osal_u16 frag_off
Definition eth_ip_common_rom.h:48
osal_u32 daddr
Definition eth_ip_common_rom.h:53
osal_u16 check
Definition eth_ip_common_rom.h:51
osal_u8 ttl
Definition eth_ip_common_rom.h:49
osal_u8 protocol
Definition eth_ip_common_rom.h:50
osal_u8 ihl
Definition eth_ip_common_rom.h:43
osal_u16 tot_len
Definition eth_ip_common_rom.h:46
osal_u16 id
Definition eth_ip_common_rom.h:47
osal_u8 tos
Definition eth_ip_common_rom.h:45
osal_u8 version_ihl
Definition eth_ip_common_rom.h:42
Definition eth_ip_common_rom.h:127
Definition oal_net.h:523
osal_u16 optie_len
Definition oal_net.h:528
mlme_type_enum_uint8 mlme_type
Definition oal_net.h:524
osal_u8 macaddr[6]
Definition oal_net.h:527
osal_u8 optie[518]
Definition oal_net.h:529
osal_u16 reason
Definition oal_net.h:526
osal_u8 seq
Definition oal_net.h:525
Definition eth_ip_common_rom.h:165
Definition oal_net.h:314
osal_u8 ssid_len
Definition oal_net.h:316
Definition eth_ip_common_rom.h:97
Definition eth_ip_common_rom.h:109
Definition oal_net.h:515
osal_u8 * data_ie
Definition oal_net.h:519
osal_u8 rsv[3]
Definition oal_net.h:518
app_ie_type_uint8 app_ie_type
Definition oal_net.h:517
osal_u32 ie_len
Definition oal_net.h:516
Definition oal_skbuff.h:82
td_void * dev
Definition oal_skbuff.h:89
unsigned short td_u16
Definition td_type.h:37
unsigned char td_u8
Definition td_type.h:36
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
#define TD_NULL
Definition td_type.h:30
int td_s32
Definition td_type.h:44
char td_char
Definition td_type.h:41
Definition oal_net.h:320
td_u8 high
Definition oal_net.h:323
td_u8 low
Definition oal_net.h:324
struct bitfield_un::@471 bits
td_u8 byte
Definition oal_net.h:321