xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/nxp/mlinux/moal_eth_ioctl.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 
2 /** @file moal_eth_ioctl.h
3  *
4  * @brief This file contains definition for private IOCTL call.
5  *
6  *
7  * Copyright 2008-2022 NXP
8  *
9  * This software file (the File) is distributed by NXP
10  * under the terms of the GNU General Public License Version 2, June 1991
11  * (the License).  You may use, redistribute and/or modify the File in
12  * accordance with the terms and conditions of the License, a copy of which
13  * is available by writing to the Free Software Foundation, Inc.,
14  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
15  * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
16  *
17  * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
19  * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
20  * this warranty disclaimer.
21  *
22  */
23 
24 /********************************************************
25 Change log:
26     01/05/2012: initial version
27 ********************************************************/
28 #if defined(STA_CFG80211) || defined(UAP_CFG80211)
29 #include "moal_cfg80211.h"
30 #endif
31 
32 #ifndef _WOAL_ETH_PRIV_H_
33 #define _WOAL_ETH_PRIV_H_
34 
35 /** Command disabled */
36 #define CMD_DISABLED 0
37 /** Command enabled */
38 #define CMD_ENABLED 1
39 /** Command get */
40 #define CMD_GET 2
41 
42 /** 2K bytes */
43 #define WOAL_2K_BYTES 2000
44 
45 /** NXP private command identifier string */
46 #define CMD_NXP "MRVL_CMD"
47 
48 /** Private command: Version */
49 #define PRIV_CMD_VERSION "version"
50 /** Private command: Band cfg */
51 #define PRIV_CMD_BANDCFG "bandcfg"
52 /** Private command: Host cmd */
53 #define PRIV_CMD_HOSTCMD "hostcmd"
54 /** Private command: Custom IE config*/
55 #define PRIV_CMD_CUSTOMIE "customie"
56 /** Private command: HT Tx Cfg */
57 #define PRIV_CMD_HTTXCFG "httxcfg"
58 /** Private command: HT Cap Info */
59 #define PRIV_CMD_HTCAPINFO "htcapinfo"
60 /** Private command: Add BA para */
61 #define PRIV_CMD_ADDBAPARA "addbapara"
62 /** Private command: Aggragation priority table */
63 #define PRIV_CMD_AGGRPRIOTBL "aggrpriotbl"
64 /** Private command: Add BA reject cfg */
65 #define PRIV_CMD_ADDBAREJECT "addbareject"
66 /** Private command: Delete BA */
67 #define PRIV_CMD_DELBA "delba"
68 /** Private command: Reject Addba Req */
69 #define PRIV_CMD_REJECTADDBAREQ "rejectaddbareq"
70 /** Private command: 11AC Cfg */
71 #define PRIV_CMD_VHTCFG "vhtcfg"
72 /** Private command: 11AC Oper Mode Cfg */
73 #define PRIV_CMD_OPERMODECFG "opermodecfg"
74 #define PRIV_CMD_DATARATE "getdatarate"
75 #define PRIV_CMD_TXRATECFG "txratecfg"
76 #define PRIV_CMD_GETLOG "getlog"
77 #define PRIV_CMD_ESUPPMODE "esuppmode"
78 #define PRIV_CMD_PASSPHRASE "passphrase"
79 #define PRIV_CMD_DEAUTH "deauth"
80 #ifdef UAP_SUPPORT
81 #define PRIV_CMD_AP_DEAUTH "apdeauth"
82 #define PRIV_CMD_GET_STA_LIST "getstalist"
83 #define PRIV_CMD_BSS_CONFIG "bssconfig"
84 #endif
85 #ifdef WIFI_DIRECT_SUPPORT
86 #if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
87 #define PRIV_CMD_BSSROLE "bssrole"
88 #endif
89 #endif
90 #ifdef STA_SUPPORT
91 #define PRIV_CMD_GETSCANTABLE "getscantable"
92 #define PRIV_CMD_GETCHANSTATS "getchanstats"
93 typedef struct _chan_stats {
94 	/** Number of records in the chan_stats */
95 	t_u32 num_in_chan_stats;
96 	/** channel statistics */
97 	ChanStatistics_t stats[];
98 } chan_stats;
99 #define PRIV_CMD_SETUSERSCAN "setuserscan"
100 #define PRIV_CMD_EXTCAPCFG "extcapcfg"
101 #define PRIV_CMD_CANCELSCAN "cancelscan"
102 #endif
103 #define PRIV_CMD_DEEPSLEEP "deepsleep"
104 #define PRIV_CMD_IPADDR "ipaddr"
105 #define PRIV_CMD_WPSSESSION "wpssession"
106 #define PRIV_CMD_OTPUSERDATA "otpuserdata"
107 #define PRIV_CMD_COUNTRYCODE "countrycode"
108 #define PRIV_CMD_TCPACKENH "tcpackenh"
109 #ifdef REASSOCIATION
110 #define PRIV_CMD_ASSOCESSID "assocessid"
111 #define PRIV_CMD_ASSOCBSSID "assocessid_bssid"
112 #endif
113 #define PRIV_CMD_AUTOASSOC "assocctrl"
114 #define PRIV_CMD_WAKEUPREASON "wakeupreason"
115 #ifdef STA_SUPPORT
116 #define PRIV_CMD_LISTENINTERVAL "listeninterval"
117 #endif
118 #ifdef DEBUG_LEVEL1
119 #define PRIV_CMD_DRVDBG "drvdbg"
120 #endif
121 #define PRIV_CMD_HSCFG "hscfg"
122 #define PRIV_CMD_HSSETPARA "hssetpara"
123 #define PRIV_CMD_MGMT_FILTER "mgmtfilter"
124 #define PRIV_CMD_SCANCFG "scancfg"
125 #define PRIV_CMD_GETNLNUM "getnlnum"
126 #define PRIV_CMD_AGGRCTRL "aggrctrl"
127 #ifdef USB
128 #define PRIV_CMD_USBAGGRCTRL "usbaggrctrl"
129 #endif
130 #define PRIV_CMD_SET_BSS_MODE "setbssmode"
131 #ifdef STA_SUPPORT
132 #define PRIV_CMD_SET_AP "setap"
133 #define PRIV_CMD_SET_POWER "setpower"
134 #define PRIV_CMD_SET_ESSID "setessid"
135 #define PRIV_CMD_SET_AUTH "setauth"
136 #define PRIV_CMD_GET_AP "getap"
137 #define PRIV_CMD_GET_POWER "getpower"
138 #define PRIV_CMD_PSMODE "psmode"
139 #endif
140 #define PRIV_CMD_WARMRESET "warmreset"
141 #define PRIV_CMD_TXPOWERCFG "txpowercfg"
142 #define PRIV_CMD_PSCFG "pscfg"
143 #define PRIV_CMD_BCNTIMEOUTCFG "bcntimeoutcfg"
144 #define PRIV_CMD_SLEEPPD "sleeppd"
145 #define PRIV_CMD_TXCONTROL "txcontrol"
146 #define PRIV_CMD_REGRDWR "regrdwr"
147 #define PRIV_CMD_RDEEPROM "rdeeprom"
148 #define PRIV_CMD_MEMRDWR "memrdwr"
149 #ifdef SDIO
150 #define PRIV_CMD_SDCMD52RW "sdcmd52rw"
151 #endif
152 #define PRIV_CMD_ARPFILTER "arpfilter"
153 #define PRIV_CMD_HOTSPOTCFG "hotspotcfg"
154 #define PRIV_CMD_MGMT_FRAME_CTRL "mgmtframectrl"
155 #define PRIV_CMD_QCONFIG "qconfig"
156 #define PRIV_CMD_ADDTS "addts"
157 #define PRIV_CMD_DELTS "delts"
158 #define PRIV_CMD_QSTATUS "qstatus"
159 #define PRIV_CMD_TS_STATUS "ts_status"
160 #define PRIV_CMD_QOS_CFG "qoscfg"
161 #define PRIV_CMD_MAC_CTRL "macctrl"
162 #define PRIV_CMD_GETWAP "getwap"
163 #define PRIV_CMD_REGION_CODE "regioncode"
164 #define PRIV_CMD_CFPINFO "cfpinfo"
165 #define PRIV_CMD_FWMACADDR "fwmacaddr"
166 #define PRIV_CMD_OFFCHANNEL "offchannel"
167 #define PRIV_CMD_DSCP_MAP "dscpmap"
168 /** Private command: Verext */
169 #define PRIV_CMD_VEREXT "verext"
170 #ifdef CONFIG_USB_SUSPEND
171 #define PRIV_CMD_USB_SUSPEND "usbsuspend"
172 #define PRIV_CMD_USB_RESUME "usbresume"
173 #endif /* CONFIG_USB_SUSPEND */
174 #if defined(STA_SUPPORT) && defined(STA_WEXT)
175 #define PRIV_CMD_RADIO_CTRL "radioctrl"
176 #endif
177 #define PRIV_CMD_WMM_CFG "wmmcfg"
178 #define PRIV_CMD_MIN_BA_THRESH_CFG "min_ba_threshold"
179 #if defined(STA_SUPPORT)
180 #define PRIV_CMD_11D_CFG "11dcfg"
181 #define PRIV_CMD_11D_CLR_TBL "11dclrtbl"
182 #endif
183 #ifndef OPCHAN
184 #define PRIV_CMD_WWS_CFG "wwscfg"
185 #endif
186 #if defined(REASSOCIATION)
187 #define PRIV_CMD_REASSOCTRL "reassoctrl"
188 #endif
189 #define PRIV_CMD_TXBUF_CFG "txbufcfg"
190 #ifdef STA_SUPPORT
191 #define PRIV_CMD_AUTH_TYPE "authtype"
192 #endif
193 #define PRIV_CMD_POWER_CONS "powercons"
194 #define PRIV_CMD_HT_STREAM_CFG "htstreamcfg"
195 #define PRIV_CMD_MIMO_SWITCH "mimoswitch"
196 #define PRIV_CMD_THERMAL "thermal"
197 #define PRIV_CMD_BCN_INTERVAL "bcninterval"
198 #ifdef STA_SUPPORT
199 #define PRIV_CMD_GET_SIGNAL "getsignal"
200 #define PRIV_CMD_SIGNALEXT_CFG "signalextcfg"
201 #define PRIV_CMD_GET_SIGNAL_EXT_V2 "getsignalextv2"
202 #define PRIV_CMD_GET_SIGNAL_EXT "getsignalext"
203 #endif
204 #if defined(STA_SUPPORT)
205 #define PRIV_CMD_PMFCFG "pmfcfg"
206 #endif
207 #define PRIV_CMD_INACTIVITYTO "inactivityto"
208 #define PRIV_CMD_AMSDU_AGGR_CTRL "amsduaggrctrl"
209 #define PRIV_CMD_TX_BF_CAP "httxbfcap"
210 #ifdef SDIO
211 #define PRIV_CMD_SDIO_CLOCK "sdioclock"
212 #endif
213 #ifdef SDIO
214 #define PRIV_CMD_MPA_CTRL "mpactrl"
215 #endif
216 #define PRIV_CMD_SLEEP_PARAMS "sleepparams"
217 #define PRIV_CMD_NET_MON "netmon"
218 #if defined(STA_CFG80211) && defined(UAP_CFG80211)
219 #define PRIV_CMD_MONITOR_MODE "monitormode"
220 #endif
221 #define PRIV_CMD_DFS_TESTING "dfstesting"
222 #define PRIV_CMD_CLEAR_NOP "clear_nop"
223 #define PRIV_CMD_NOP_LIST "nop_list"
224 #define PRIV_CMD_FAKE_RADAR "fake_radar"
225 #define PRIV_CMD_DFS53_CFG "dfs53cfg"
226 #define PRIV_CMD_DFS_MODE "dfs_mode"
227 #define PRIV_CMD_DFS_CAC "dfs_cac"
228 #define PRIV_CMD_AUTODFS "autodfs"
229 #define PRIV_CMD_CFP_CODE "cfpcode"
230 #define PRIV_CMD_CWMODE "cwmode"
231 #define PRIV_CMD_ANT_CFG "antcfg"
232 #define PRIV_CMD_SYSCLOCK "sysclock"
233 #define PRIV_CMD_GET_KEY "getkey"
234 #define PRIV_CMD_ASSOCIATE "associate"
235 #define PRIV_CMD_TX_BF_CFG "httxbfcfg"
236 #define PRIV_CMD_PORT_CTRL "port_ctrl"
237 #define PRIV_CMD_PB_BYPASS "pb_bypass"
238 #ifdef SDIO
239 #define PRIV_CMD_SD_CMD53_RW "sdcmd53rw"
240 #endif
241 #ifdef RX_PACKET_COALESCE
242 #define PRIV_CMD_RX_COAL_CFG "rxpktcoal_cfg"
243 #endif
244 #ifdef WIFI_DIRECT_SUPPORT
245 #if defined(UAP_CFG80211)
246 #define PRIV_CMD_CFG_NOA "cfg_noa"
247 #define PRIV_CMD_CFG_OPP_PS "cfg_opp_ps"
248 #endif
249 #endif
250 #define PRIV_CMD_CFG_CLOCK_SYNC "clocksync"
251 #define PRIV_CMD_CFG_GET_TSF_INFO "gettsfinfo"
252 #define PRIV_CMD_TARGET_CHANNEL "targetchan"
253 #define PRIV_CMD_BACKUP_CHANNEL "backupchan"
254 
255 #define PRIV_CMD_DFS_REPEATER_CFG "dfs_repeater"
256 #ifdef WIFI_DIRECT_SUPPORT
257 #if defined(STA_CFG80211) || defined(UAP_CFG80211)
258 #define PRIV_CMD_MIRACAST_CFG "miracastcfg"
259 #endif
260 #endif
261 #define PRIV_CMD_COEX_RX_WINSIZE "coex_rx_winsize"
262 #define PRIV_CMD_TX_AGGR_CTRL "txaggrctrl"
263 #define PRIV_CMD_AUTO_TDLS "autotdls"
264 
265 #ifdef PCIE
266 #define PRIV_CMD_PCIE_REG_RW "pcieregrw"
267 #define PRIV_CMD_PCIE_BAR0_REG_RW "pciebar0regrw"
268 #endif
269 
270 #define PRIV_CMD_GET_SENSOR_TEMP "get_sensor_temp"
271 
272 #define PRIV_CMD_GET_CHNRGPWR "get_chnrgpwr"
273 #define PRIV_CMD_GET_TXPWR_LIMIT "get_txpwrlimit"
274 #define PRIV_CMD_GET_CFG_CHAN_LIST "getcfgchanlist"
275 #if defined(UAP_SUPPORT)
276 #define PRIV_CMD_EXTEND_CHAN_SWITCH "channel_switch"
277 #endif
278 
279 #define PRIV_CMD_TDLS_IDLE_TIME "tdls_idle_time"
280 
281 #define PRIV_CMD_DYN_BW "dyn_bw"
282 
283 #if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
284 #define PRIV_CMD_DFS_OFFLOAD "dfs_offload"
285 #endif
286 
287 #define PRIV_CMD_AUTO_ARP "auto_arp"
288 
289 #define PRIV_CMD_PER_PKT_CFG "per_pkt_cfg"
290 
291 #define PRIV_CMD_DEAUTH_CTRL "ctrldeauth"
292 
293 #define PRIV_CMD_TX_RX_HISTOGRAM "txrxhistogram"
294 
295 /**Private command ID to set/get independent reset*/
296 #define PRIV_CMD_IND_RST_CFG "indrstcfg"
297 
298 #define PRIV_CMD_MCAST_AGGR_GROUP "mcast_aggr_group"
299 #define PRIV_CMD_MC_AGGR_CFG "mc_aggr_cfg"
300 #define PRIV_CMD_STATS "stats"
301 #define PRIV_CMD_CH_LOAD "getchload"
302 #define PRIV_CMD_CH_LOAD_RESULTS "getloadresults"
303 
304 #define PRIV_CMD_ARB_CFG "arb"
305 
306 /**Private command to configure static rx abort config */
307 #define PRIV_CMD_RX_ABORT_CFG "rx_abort_cfg"
308 /**Private command to configure dynamic rx abort config */
309 #define PRIV_CMD_RX_ABORT_CFG_EXT "rx_abort_cfg_ext"
310 #define TX_AMPDU_RTS_CTS 0
311 #define TX_AMPDU_CTS_2_SELF 1
312 #define TX_AMPDU_DISABLE_PROTECTION 2
313 #define TX_AMPDU_DYNAMIC_RTS_CTS 3
314 /**Private command to set tx ampdu protection mode */
315 #define PRIV_CMD_TX_AMPDU_PROT_MODE "tx_ampdu_prot_mode"
316 /**Private command to configure tx rate adapt config */
317 #define PRIV_CMD_RATE_ADAPT_CFG "rate_adapt_cfg"
318 #define CCK_DESENSE_MODE_DISABLED 0
319 #define CCK_DESENSE_MODE_DYNAMIC 1
320 #define CCK_DESENSE_MODE_DYN_ENH 2
321 /**Private command to configure cck desense config */
322 #define PRIV_CMD_CCK_DESENSE_CFG "cck_desense_cfg"
323 #define PRIV_CMD_DOT11MC_UNASSOC_FTM_CFG "dot11mc_unassoc_ftm_cfg"
324 #define PRIV_CMD_HAL_PHY_CFG "hal_phy_cfg"
325 #define PRIV_CMD_IPS_CFG "ips_cfg"
326 
327 /** Private command ID for Android default commands */
328 #define WOAL_ANDROID_DEF_CMD (SIOCDEVPRIVATE + 1)
329 
330 /** Private command ID to send TLD configuration */
331 #define WOAL_TDLS_CONFIG (SIOCDEVPRIVATE + 5)
332 
333 /** Private command ID to pass mgmt frame */
334 #define WOAL_MGMT_FRAME_TX WOAL_MGMT_FRAME_TX_IOCTL
335 
336 /** Private command ID to pass custom IE list */
337 #define WOAL_CUSTOM_IE_CFG (SIOCDEVPRIVATE + 13)
338 
339 /** Private command ID for Android ICS priv CMDs */
340 #define WOAL_ANDROID_PRIV_CMD (SIOCDEVPRIVATE + 14)
341 
342 /** Private command ID to get BSS type */
343 #define WOAL_GET_BSS_TYPE (SIOCDEVPRIVATE + 15)
344 
345 /** Private command ID for robustcoex */
346 #define PRIV_CMD_ROBUSTCOEX "robustcoex"
347 
348 #define PRIV_CMD_DMCS "dmcs"
349 
350 #if defined(PCIE)
351 #define PRIV_CMD_SSU "ssu"
352 /** ssu_params_ctrl */
353 typedef struct _ssu_params_cfg {
354 	/* ssu mode */
355 	t_u8 ssu_mode;
356 	/* 0-3; # of FFT samples to skip*/
357 	t_u32 nskip;
358 	/* 0-3: # of FFT samples selected to dump */
359 	t_u32 nsel;
360 	/* 0-3: Down sample ADC input for buffering*/
361 	t_u32 adcdownsample;
362 	/* 0-1: Mask out ADC Data from spectral packet */
363 	t_u32 mask_adc_pkt;
364 	/* 0-1: Enable 16-Bit FFT output data precision in spectral packet */
365 	t_u32 out_16bits;
366 	/* 0-1: Enable power spectrum in dB for spectral packe */
367 	t_u32 spec_pwr_enable;
368 	/* 0-1: Enable spectral packet rate reduction in DB output format */
369 	t_u32 rate_deduction;
370 	/* 0-7: Number of spectral packets over which spectral data is to be
371 	 * averaged. */
372 	t_u32 n_pkt_avg;
373 } __attribute__((packed)) ssu_params_cfg;
374 #endif
375 
376 #define PRIV_CMD_CSI "csi"
377 
378 #define PRIV_CMD_BOOTSLEEP "bootsleep"
379 
380 /** Private command ID to config txwatchdog enable/disable */
381 #define PRIV_CMD_TXWATCHDOG "txwatchdog"
382 
383 /** Private command to get secure boot uuid */
384 #define PRIV_CMD_GET_SB_UUID "getuuid"
385 
386 /** Private command: 11AX Cfg */
387 #define PRIV_CMD_11AXCFG "11axcfg"
388 /** Private command: 11AX Cmd */
389 #define PRIV_CMD_11AXCMDCFG "11axcmd"
390 /** Private command: Range ext Cmd */
391 #define PRIV_CMD_RANGE_EXT "range_ext"
392 /** Private command: TWT Setup Cfg */
393 #define PRIV_CMD_TWT_SETUP "twt_setup"
394 /** Private command: TWT Teardown Cfg */
395 #define PRIV_CMD_TWT_TEARDOWN "twt_teardown"
396 
397 #define PRIV_CMD_LPM "lpm"
398 
399 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
400 int woal_do_ioctl(struct net_device *dev, struct ifreq *req, void __user *data,
401 		  int cmd);
402 #else
403 int woal_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
404 #endif
405 /*
406  * For android private commands, fixed value of ioctl is used.
407  * Internally commands are differentiated using strings.
408  *
409  * application needs to specify "total_len" of data for copy_from_user
410  * kernel updates "used_len" during copy_to_user
411  */
412 /** Private command structure from app */
413 #ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
414 typedef struct _android_wifi_priv_cmd {
415 	/** Buffer pointer */
416 	t_u64 buf;
417 	/** buffer updated by driver */
418 	int used_len;
419 	/** buffer sent by application */
420 	int total_len;
421 } __attribute__((packed)) android_wifi_priv_cmd;
422 #else
423 typedef struct _android_wifi_priv_cmd {
424 	/** Buffer pointer */
425 	char *buf;
426 	/** buffer updated by driver */
427 	int used_len;
428 	/** buffer sent by application */
429 	int total_len;
430 } android_wifi_priv_cmd;
431 #endif
432 
433 #ifndef IFNAMSIZ
434 #define IFNAMSIZ 16
435 #endif
436 
437 /* Maximum size of the ESSID and NICKN strings */
438 #define MW_ESSID_MAX_SIZE 32
439 
440 /* Modes of operation */
441 #define MW_MODE_AUTO 0 /* Let the driver decides */
442 #define MW_MODE_ADHOC 1 /* Single cell network */
443 #define MW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
444 #define MW_MODE_MASTER 3 /* Synchronisation master or Access Point */
445 #define MW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
446 #define MW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
447 #define MW_MODE_MONITOR 6 /* Passive monitor (listen only) */
448 #define MW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
449 
450 #define MW_POWER_TYPE 0xF000 /* Type of parameter */
451 #define MW_POWER_PERIOD 0x1000 /* Value is a period/duration of  */
452 #define MW_POWER_TIMEOUT 0x2000 /* Value is a timeout (to go asleep) */
453 
454 #define MW_AUTH_INDEX 0x0FFF
455 #define MW_AUTH_FLAGS 0xF000
456 #define MW_AUTH_WPA_VERSION 0
457 #define MW_AUTH_CIPHER_PAIRWISE 1
458 #define MW_AUTH_CIPHER_GROUP 2
459 #define MW_AUTH_KEY_MGMT 3
460 #define MW_AUTH_TKIP_COUNTERMEASURES 4
461 #define MW_AUTH_DROP_UNENCRYPTED 5
462 #define MW_AUTH_80211_AUTH_ALG 6
463 #define MW_AUTH_WPA_ENABLED 7
464 #define MW_AUTH_RX_UNENCRYPTED_EAPOL 8
465 #define MW_AUTH_ROAMING_CONTROL 9
466 #define MW_AUTH_PRIVACY_INVOKED 10
467 #define MW_AUTH_CIPHER_GROUP_MGMT 11
468 #define MW_AUTH_MFP 12
469 
470 #define MW_AUTH_CIPHER_NONE 0x00000001
471 #define MW_AUTH_CIPHER_WEP40 0x00000002
472 #define MW_AUTH_CIPHER_TKIP 0x00000004
473 #define MW_AUTH_CIPHER_CCMP 0x00000008
474 #define MW_AUTH_CIPHER_WEP104 0x00000010
475 #define MW_AUTH_CIPHER_AES_CMAC 0x00000020
476 
477 #define MW_AUTH_ALG_OPEN_SYSTEM 0x00000001
478 #define MW_AUTH_ALG_SHARED_KEY 0x00000002
479 #define MW_AUTH_ALG_LEAP 0x00000004
480 
481 /* Generic format for most parameters that fit in an int */
482 struct mw_param {
483 	t_s32 value; /* The value of the parameter itself */
484 	t_u8 fixed; /* Hardware should not use auto select */
485 	t_u8 disabled; /* Disable the feature */
486 	t_u16 flags; /* Various specifc flags (if any) */
487 };
488 
489 /*
490  *  For all data larger than 16 octets, we need to use a
491  *  pointer to memory allocated in user space.
492  */
493 struct mw_point {
494 	t_u8 *pointer; /* Pointer to the data  (in user space) */
495 	t_u16 length; /* number of fields or size in bytes */
496 	t_u16 flags; /* Optional params */
497 };
498 
499 /*
500  * This structure defines the payload of an ioctl, and is used
501  * below.
502  */
503 union mwreq_data {
504 	/* Config - generic */
505 	char name[IFNAMSIZ];
506 
507 	struct mw_point essid; /* Extended network name */
508 	t_u32 mode; /* Operation mode */
509 	struct mw_param power; /* PM duration/timeout */
510 	struct sockaddr ap_addr; /* Access point address */
511 	struct mw_param param; /* Other small parameters */
512 	struct mw_point data; /* Other large parameters */
513 };
514 
515 /* The structure to exchange data for ioctl */
516 struct mwreq {
517 	union {
518 		char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
519 	} ifr_ifrn;
520 
521 	/* Data part */
522 	union mwreq_data u;
523 };
524 
525 typedef struct woal_priv_ht_cap_info {
526 	t_u32 ht_cap_info_bg;
527 	t_u32 ht_cap_info_a;
528 } woal_ht_cap_info;
529 
530 typedef struct woal_priv_addba {
531 	t_u32 time_out;
532 	t_u32 tx_win_size;
533 	t_u32 rx_win_size;
534 	t_u32 tx_amsdu;
535 	t_u32 rx_amsdu;
536 } woal_addba;
537 
538 /** Action field value : get */
539 #define ACTION_GET 0
540 /** Action field value : set */
541 #define ACTION_SET 1
542 /** Action field value:  add */
543 #define ACTION_ADD 2
544 /** Action field value:  remove */
545 #define ACTION_REMOVE 3
546 
547 #define MC_AGGR_CTRL MBIT(0)
548 /* mcast_aggr_group */
549 typedef struct _mcast_aggr_group {
550 	/** action */
551 	t_u32 action;
552 	/** mcast addr */
553 	t_u8 mcast_addr[ETH_ALEN];
554 	/** Number of multicast addresses in the list */
555 	t_u32 num_mcast_addr;
556 	/** Multicast address list */
557 	mlan_802_11_mac_addr mac_list[MLAN_MAX_MULTICAST_LIST_SIZE];
558 } mcast_aggr_group, *pmcast_aggr_group;
559 
560 typedef struct _txrate_setting {
561 	t_u16 preamble : 2; /*BIT1-BIT0:
562 			     *  For legacy 11b: preamble type
563 			     *    00    = long
564 			     *    01    = short
565 			     *    10/11  = reserved
566 			     *  For legacy 11g: reserved
567 			     *  For 11n: Green field PPDU indicator
568 			     *    00 = HT-mix
569 			     *    01 = HT-GF
570 			     *    10/11 = reserved.
571 			     *  For 11ac: reserved.
572 			     *  For 11ax:
573 			     *    00 = HE-SU
574 			     *    01 = HE-EXT-SU
575 			     *    10 = HE-MU
576 			     *    11 = HE trigger based
577 			     */
578 	t_u16 bandwidth : 3; /* BIT2- BIT4
579 			      * For 11n and 11ac traffic: Bandwidth
580 			      *    0 = 20Mhz
581 			      *    1 = 40Mhz
582 			      *    2 = 80 Mhz
583 			      *    3 = 160 Mhz
584 			      *    4-7 = reserved
585 			      *  For legacy rate : BW>0 implies non-HT
586 			      * duplicates. For HE SU PPDU: 0 = 20Mhz 1 = 40Mhz
587 			      *    2 = 80 Mhz
588 			      *    3 = 160 Mhz
589 			      *    4-7 = reserved
590 			      *  For HE ER SU PPDU:
591 			      *    0 = 242-tone RU
592 			      *    1 = upper frequency 106 tone RU within the
593 			      * primary 20 Mhz. For HE MU PPDU: 0 = 20Mhz. 1 =
594 			      * 40Mhz. 2 = 80Mhz non-preamble puncturing mode 3
595 			      * = 160Mhz and 80+80 Mhz non-preamble. 4 = for
596 			      * preemble puncturing in 80 Mhz , where in the
597 			      * preamble only the secondary 20Mhz is punctured.
598 			      *    5 = for preemble puncturing in 80 Mhz ,
599 			      *        where in the preamble only one of the two
600 			      * 20Mhz subchannels in the secondary 40Mhz is
601 			      * punctured. 6 = for preemble puncturing in 160
602 			      * Mhz or 80 Mhz + 80 Mhz, where in the primary 80
603 			      * Mhz of the preamble only the secondary 20 Mhz is
604 			      * punctured. 7 = for preemble puncturing in 160
605 			      * Mhz or 80 Mhz + 80 Mhz, where in the primary 80
606 			      * Mhz of the preamble the primary 40 Mhz is
607 			      * present.
608 			      */
609 	t_u16 shortGI : 2; /*BIT5- BIT6
610 			    *  For legacy: not used
611 			    *  For 11n: 00 = normal, 01 =shortGI, 10/11 =
612 			    * reserved For 11ac: SGI map to VHT-SIG-A2[0]
613 			    *           VHT-SIG-A2[1] is set to 1 if short guard
614 			    * interval is used and NSYM mod 10 = 9, otherwise
615 			    * set to 0. For 11ax: 00 = 1xHELTF+GI0.8usec 01 =
616 			    * 2xHELTF+GI0.8usec 10 = 2xHELTF+GI1.6usec 11 =
617 			    * 4xHELTF+GI0.8 usec if both DCM and STBC are 1
618 			    *                4xHELTF+GI3.2 usec otherwise
619 			    */
620 	t_u16 stbc : 1; // BIT7, 0: no STBC; 1: STBC
621 	t_u16 dcm : 1; // BIT8, 0: no DCM; 1: DCM used.
622 	t_u16 adv_coding : 1; // BIT9, 0: BCC; 1: LDPC.
623 	t_u16 doppler : 2; /* BIT11-BIT10,
624 			      00: Doppler0
625 			      01: Doppler 1 with Mma =10
626 			      10: Doppler 1 with Mma =20
627 			   */
628 	t_u16 max_pktext : 2; /*BIT12-BIT13:
629 			       * Max packet extension
630 			       *  0 - 0 usec
631 			       *  1 - 8 usec
632 			       *  2 - 16 usec.
633 			       */
634 	t_u16 reserverd : 2; // BIT14-BIT15
635 } __ATTRIB_PACK__ txrate_setting;
636 
637 /** data structure for cmd txratecfg */
638 typedef struct woal_priv_tx_rate_cfg {
639 	/* LG rate: 0, HT rate: 1, VHT rate: 2 */
640 	t_u32 rate_format;
641 	/** Rate/MCS index (0xFF: auto) */
642 	t_u32 rate_index;
643 	/** Data rate */
644 	t_u32 rate;
645 	/** NSS */
646 	t_u32 nss;
647 	/** Rate Setting */
648 	t_u16 rate_setting;
649 } woal_tx_rate_cfg;
650 
651 typedef struct woal_priv_esuppmode_cfg {
652 	/* RSN mode */
653 	t_u16 rsn_mode;
654 	/* Pairwise cipher */
655 	t_u8 pairwise_cipher;
656 	/* Group cipher */
657 	t_u8 group_cipher;
658 } woal_esuppmode_cfg;
659 
660 mlan_status woal_set_ap_wps_p2p_ie(moal_private *priv, t_u8 *ie, size_t len);
661 
662 int woal_android_priv_cmd(struct net_device *dev, struct ifreq *req);
663 
664 #define PRIV_CMD_CLOUD_KEEP_ALIVE "cloud_keep_alive"
665 /** cloud keep alive parameters */
666 typedef struct _cloud_keep_alive {
667 	/** id */
668 	t_u8 mkeep_alive_id;
669 	/** enable/disable of this id */
670 	t_u8 enable;
671 	/** enable/disable reset*/
672 	t_u8 reset;
673 	/** Reserved */
674 	t_u8 reserved;
675 	/** Destination MAC address */
676 	t_u8 dst_mac[ETH_ALEN];
677 	/** Source MAC address */
678 	t_u8 src_mac[ETH_ALEN];
679 	/** packet send period */
680 	t_u32 sendInterval;
681 	/** packet retry interval */
682 	t_u32 retryInterval;
683 	/** packet retry count */
684 	t_u8 retryCount;
685 	/** packet length */
686 	t_u8 pkt_len;
687 	/** packet content */
688 	t_u8 pkt[255];
689 } __ATTRIB_PACK__ cloud_keep_alive;
690 
691 #define TLV_TYPE_PER_PKT_CFG 0x0001
692 #define TX_PKT_CTRL MBIT(0)
693 #define RX_PKT_INFO MBIT(1)
694 
695 #define FLAG_TX_HISTOGRAM 0x01
696 #define FLAG_RX_HISTOGRAM 0x02
697 #define DISABLE_TX_RX_HISTOGRAM 0x00
698 #define ENABLE_TX_RX_HISTOGRAM 0x01
699 #define GET_TX_RX_HISTOGRAM 0x02
700 #define PRIV_CMD_TX_RX_HISTOGRAM "txrxhistogram"
701 /** TX and RX histogram statistic parameters*/
702 typedef struct _tx_rx_histogram {
703 	/** Enable or disable get tx/rx histogram statistic */
704 	t_u8 enable;
705 	/** Choose to get TX, RX or both histogram statistic */
706 	t_u8 action;
707 } __ATTRIB_PACK__ tx_rx_histogram;
708 
709 /* Enum for different CW mode type */
710 typedef enum _cw_modes_e {
711 	CWMODE_DISABLE,
712 	CWMODE_TXCONTPKT,
713 	CWMODE_TXCONTWAVE,
714 } cw_modes_e;
715 
716 /** wlan_ieee80211_chan */
717 typedef struct {
718 	/** center freq */
719 	t_u16 center_freq;
720 	/** chan num */
721 	t_u16 hw_value;
722 	/** chan flags */
723 	t_u32 flags;
724 	/** max power */
725 	int max_power;
726 	/** dfs_state */
727 	t_u8 dfs_state;
728 } __ATTRIB_PACK__ wlan_ieee80211_chan;
729 
730 /** wlan_ieee80211_chan_list*/
731 typedef struct {
732 	/** num of chan */
733 	t_u8 num_chan;
734 	/** chan_list */
735 	wlan_ieee80211_chan chan_list[];
736 } __ATTRIB_PACK__ wlan_ieee80211_chan_list;
737 
738 #define PRIV_CMD_TP_STATE "tp_state"
739 #endif /* _WOAL_ETH_PRIV_H_ */
740