• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 Huawei Device Co., Ltd.
3  *
4  * This software may be distributed under the terms of the BSD license.
5  * See README for more details.
6  */
7 
8 #ifndef DRIVER_NL80211_HISI_H
9 #define DRIVER_NL80211_HISI_H
10 
11 #include "includes.h"
12 #include <sys/ioctl.h>
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 #include <fcntl.h>
16 #include <net/if.h>
17 #include <netlink/genl/genl.h>
18 #include <netlink/genl/family.h>
19 #include <netlink/genl/ctrl.h>
20 #include <linux/rtnetlink.h>
21 #include <netpacket/packet.h>
22 #include <linux/filter.h>
23 #include "nl80211_copy.h"
24 
25 #include "common.h"
26 #include "eloop.h"
27 #include "utils/list.h"
28 #include "common/ieee802_11_defs.h"
29 #include "netlink.h"
30 #include "linux_ioctl.h"
31 #include "radiotap.h"
32 #include "radiotap_iter.h"
33 #include "rfkill.h"
34 #include "driver.h"
35 
36 #ifdef CONFIG_LIBNL20
37 /* libnl 2.0 compatibility code */
38 #define nl_handle nl_sock
39 #define nl80211_handle_alloc nl_socket_alloc_cb
40 #define nl80211_handle_destroy nl_socket_free
41 #endif /* CONFIG_LIBNL20 */
42 
43 #ifndef IFF_LOWER_UP
44 #define IFF_LOWER_UP   0x10000         /* driver signals L1 up */
45 #endif
46 #ifndef IFF_DORMANT
47 #define IFF_DORMANT    0x20000         /* driver signals dormant */
48 #endif
49 
50 #ifndef IF_OPER_DORMANT
51 #define IF_OPER_DORMANT 5
52 #endif
53 #ifndef IF_OPER_UP
54 #define IF_OPER_UP 6
55 #endif
56 
57 #define MAX_QOS_UP_RANGE  8
58 #define MAX_DSCP_EXCEPT   21  /* maximum of DSCP Exception fields for QoS Map set */
59 #define MAX_PRIV_CMD_SIZE		4096
60 #define WLAN_WPS_IE_MAX_SIZE    608
61 #define MAX_WPSP2PIE_CMD_SIZE   (WLAN_WPS_IE_MAX_SIZE + 8 + 32)  /* IE body + IE header + cmd length */
62 //#error duankaiyong 512
63 typedef unsigned char               uint8;
64 typedef char                        int8;
65 typedef short                       int16;
66 typedef unsigned short              uint16;
67 typedef unsigned int                uint32;
68 typedef int                         int32;
69 typedef unsigned long long          uint64;
70 
71 typedef struct wifi_priv_cmd {
72     int     total_len;
73     int     used_len;
74     char    buf[MAX_PRIV_CMD_SIZE];
75 } wifi_priv_cmd;
76 
77 typedef struct
78 {
79     uint32  ul_ie_len;
80     uint8   en_app_ie_type;
81     uint8   auc_rsv[3];
82     uint8   auc_ie[WLAN_WPS_IE_MAX_SIZE];
83 }oal_app_ie_stru;
84 
85 enum SET_MLME_TYPE
86 {
87     OAL_IEEE80211_MLME_AUTH         = 0,
88     OAL_IEEE80211_MLME_ASSOC_RSP    = 1,
89     OAL_IEEE80211_MLME_REASSOC_RSP  = 2,
90     OAL_IEEE80211_MLME_NUM
91 };
92 typedef u8 en_set_mlme_type_uint8;
93 
94 typedef struct
95 {
96     en_set_mlme_type_uint8     en_mlme_type;
97     u8                  uc_seq;
98     u16                 us_status;
99     u8                  uc_macaddr[6];
100     u16                 us_ie_len;
101     u8                  auc_ie[WLAN_WPS_IE_MAX_SIZE];
102 }set_mlme_stru;
103 
104 /* P2P OPS parameter*/
105 typedef struct
106 {
107     uint8       en_ops_ctrl;
108     uint8       uc_ct_window;
109     uint8       auc_rsv[2];
110 }oal_p2p_ops_param_stru;
111 
112 /* P2P NOA parameter */
113 typedef struct
114 {
115     uint32      ul_start_time;
116     uint32      ul_duration;
117     uint32      ul_interval;
118     uint8       uc_count;
119     uint8       auc_rsv[3];
120 }oal_p2p_noa_param_stru;
121 
122 /* QoS Map SET ELEMENT */
123 typedef struct
124 {
125     uint8  valid;
126     uint8  num_dscp_except;
127     uint8  up_low[MAX_QOS_UP_RANGE];
128     uint8  up_high[MAX_QOS_UP_RANGE];
129     uint8  dscp_exception_up[MAX_DSCP_EXCEPT];
130     uint8  dscp_exception[MAX_DSCP_EXCEPT];
131 }oal_qos_map_param_stru;
132 
133 
134 /* supplicant customized struct. */
135 typedef struct cust_data_stru
136 {
137     u32  read;
138     u32  disable_capab_2ght40;
139 }cust_data_stru;
140 
141 #endif  /* DRIVER_NL80211_HISI_H */
142