xref: /netbsd-src/external/bsd/wpa/dist/src/drivers/android_drv.h (revision 3c260e60464a854d43a997892d1e6c468d47919a)
1e604d861Schristos /*
2e604d861Schristos  * Android driver interface
3e604d861Schristos  *
4*3c260e60Schristos  * This software may be distributed under the terms of the BSD license.
5*3c260e60Schristos  * See README for more details.
6e604d861Schristos  */
7e604d861Schristos 
8e604d861Schristos #ifndef ANDROID_DRV_H
9e604d861Schristos #define ANDROID_DRV_H
10e604d861Schristos 
11e604d861Schristos #define WPA_EVENT_DRIVER_STATE "CTRL-EVENT-DRIVER-STATE "
12e604d861Schristos 
13e604d861Schristos #define MAX_SSID_LEN 32
14e604d861Schristos 
15e604d861Schristos #define MAX_DRV_CMD_SIZE		248
16e604d861Schristos #define DRV_NUMBER_SEQUENTIAL_ERRORS	4
17e604d861Schristos 
18e604d861Schristos #define WEXT_PNOSETUP_HEADER		"PNOSETUP "
19e604d861Schristos #define WEXT_PNOSETUP_HEADER_SIZE	9
20e604d861Schristos #define WEXT_PNO_TLV_PREFIX		'S'
21e604d861Schristos #define WEXT_PNO_TLV_VERSION		'1'
22e604d861Schristos #define WEXT_PNO_TLV_SUBVERSION		'2'
23e604d861Schristos #define WEXT_PNO_TLV_RESERVED		'0'
24e604d861Schristos #define WEXT_PNO_VERSION_SIZE		4
25e604d861Schristos #define WEXT_PNO_AMOUNT			16
26e604d861Schristos #define WEXT_PNO_SSID_SECTION		'S'
27e604d861Schristos /* SSID header size is SSID section type above + SSID length */
28e604d861Schristos #define WEXT_PNO_SSID_HEADER_SIZE	2
29e604d861Schristos #define WEXT_PNO_SCAN_INTERVAL_SECTION	'T'
30e604d861Schristos #define WEXT_PNO_SCAN_INTERVAL_LENGTH	2
31e604d861Schristos #define WEXT_PNO_SCAN_INTERVAL		30
32e604d861Schristos /* Scan interval size is scan interval section type + scan interval length
33e604d861Schristos  * above */
34e604d861Schristos #define WEXT_PNO_SCAN_INTERVAL_SIZE	(1 + WEXT_PNO_SCAN_INTERVAL_LENGTH)
35e604d861Schristos #define WEXT_PNO_REPEAT_SECTION		'R'
36e604d861Schristos #define WEXT_PNO_REPEAT_LENGTH		1
37e604d861Schristos #define WEXT_PNO_REPEAT			4
38e604d861Schristos /* Repeat section size is Repeat section type + Repeat value length above */
39e604d861Schristos #define WEXT_PNO_REPEAT_SIZE		(1 + WEXT_PNO_REPEAT_LENGTH)
40e604d861Schristos #define WEXT_PNO_MAX_REPEAT_SECTION	'M'
41e604d861Schristos #define WEXT_PNO_MAX_REPEAT_LENGTH	1
42e604d861Schristos #define WEXT_PNO_MAX_REPEAT		3
43e604d861Schristos /* Max Repeat section size is Max Repeat section type + Max Repeat value length
44e604d861Schristos  * above */
45e604d861Schristos #define WEXT_PNO_MAX_REPEAT_SIZE	(1 + WEXT_PNO_MAX_REPEAT_LENGTH)
46e604d861Schristos /* This corresponds to the size of all sections expect SSIDs */
47e604d861Schristos #define WEXT_PNO_NONSSID_SECTIONS_SIZE \
48e604d861Schristos (WEXT_PNO_SCAN_INTERVAL_SIZE + WEXT_PNO_REPEAT_SIZE + WEXT_PNO_MAX_REPEAT_SIZE)
49e604d861Schristos /* PNO Max command size is total of header, version, ssid and other sections +
50e604d861Schristos  * Null termination */
51e604d861Schristos #define WEXT_PNO_MAX_COMMAND_SIZE \
52e604d861Schristos 	(WEXT_PNOSETUP_HEADER_SIZE + WEXT_PNO_VERSION_SIZE \
53e604d861Schristos 	 + WEXT_PNO_AMOUNT * (WEXT_PNO_SSID_HEADER_SIZE + MAX_SSID_LEN) \
54e604d861Schristos 	 + WEXT_PNO_NONSSID_SECTIONS_SIZE + 1)
55e604d861Schristos 
56e604d861Schristos #endif /* ANDROID_DRV_H */
57