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