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