blob: 3f6c2b634e640aff8ca8c81729f129600512654f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22#ifndef _QC_SAP_IOCTL_H_
23#define _QC_SAP_IOCTL_H_
24
25/*
26 * QCSAP ioctls.
27 */
28
29/*
30 * Max size of optional information elements. We artificially
31 * constrain this; it's limited only by the max frame size (and
32 * the max parameter size of the wireless extensions).
33 */
34#define QCSAP_MAX_OPT_IE 256
35#define QCSAP_MAX_WSC_IE 256
36
37typedef struct sSSID
38{
39 u_int8_t length;
40 u_int8_t ssId[32];
41} tSSID;
42
43typedef struct sSSIDInfo
44{
45 tSSID ssid;
46 u_int8_t ssidHidden;
47}tSSIDInfo;
48
49typedef enum {
50 eQC_DOT11_MODE_ALL = 0,
51 eQC_DOT11_MODE_ABG = 0x0001, //11a/b/g only, no HT, no proprietary
52 eQC_DOT11_MODE_11A = 0x0002,
53 eQC_DOT11_MODE_11B = 0x0004,
54 eQC_DOT11_MODE_11G = 0x0008,
55 eQC_DOT11_MODE_11N = 0x0010,
56 eQC_DOT11_MODE_11G_ONLY = 0x0020,
57 eQC_DOT11_MODE_11N_ONLY = 0x0040,
58 eQC_DOT11_MODE_11B_ONLY = 0x0080,
59 eQC_DOT11_MODE_11A_ONLY = 0x0100,
60 //This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL except when it starts IBSS in 11B of 2.4GHz
61 //It is for CSR internal use
62 eQC_DOT11_MODE_AUTO = 0x0200,
63
64} tQcPhyMode;
65
66#define QCSAP_ADDR_LEN 6
67
68typedef u_int8_t qcmacaddr[QCSAP_ADDR_LEN];
69
70struct qc_mac_acl_entry {
71 qcmacaddr addr;
72 int vlan_id;
73};
74
75typedef enum {
76 eQC_AUTH_TYPE_OPEN_SYSTEM,
77 eQC_AUTH_TYPE_SHARED_KEY,
78 eQC_AUTH_TYPE_AUTO_SWITCH
79} eQcAuthType;
80
81typedef enum {
82 eQC_WPS_BEACON_IE,
83 eQC_WPS_PROBE_RSP_IE,
84 eQC_WPS_ASSOC_RSP_IE
85} eQCWPSType;
86
87typedef struct s_CommitConfig {
88
89 tSSIDInfo SSIDinfo;
90
91 u_int32_t beacon_int; /* Beacon Interval */
92
93 tQcPhyMode hw_mode; /* Wireless Mode */
94
95 u_int32_t channel; /* Operation channel */
96
97 u_int32_t max_num_sta; /* maximum number of STAs in station table */
98
99 u_int32_t dtim_period; /* dtim interval */
100 u_int32_t max_listen_interval;
101
102 enum {
103 QC_ACCEPT_UNLESS_DENIED = 0,
104 QC_DENY_UNLESS_ACCEPTED = 1,
105 } qc_macaddr_acl;
106
107 struct qc_mac_acl_entry *accept_mac; /* MAC filtering */
108 u_int32_t num_accept_mac;
109 struct qc_mac_acl_entry *deny_mac; /* MAC filtering */
110 u_int32_t num_deny_mac;
111
112 u_int32_t ap_table_max_size;
113 u_int32_t ap_table_expiration_time;
114
115 int qcsap80211d;
116
117 u_int32_t countryCode[3]; //it ignored if [0] is 0.
118
119 u_int32_t ht_op_mode_fixed;
120
121 /*HT capability information to enable/diabale protection
122 * bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8
123 * (overlap) from11a from11b from11g Ht20 NonGf LsigTxop Rifs OBSS
124 * bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
125 * from11a from11b from11g ht20 nonGf lsigTxop rifs obss*/
126 u_int16_t ht_capab;
127
128 u_int32_t qcsap80211n;
129
130 eQcAuthType authType;
131
132 u_int8_t privacy;
133
134 u_int8_t set_ieee8021x;
135
136 u_int8_t RSNWPAReqIE[QCSAP_MAX_OPT_IE]; //If not null, it has the IE byte stream for RSN/WPA
137 u_int16_t RSNWPAReqIELength; //The byte count in the pRSNReqIE/ WPAIE
138
139 u_int8_t wps_state; //wps_state - disbaled/not configured, configured
140} s_CommitConfig_t;
141
142
143/*
144 * MLME state manipulation request. QCSAP_MLME_ASSOC
145 * is used for station mode only. The other types are used for station or ap mode.
146 */
147struct sQcSapreq_mlme {
148 u_int8_t im_op; /* operation to perform */
149#define QCSAP_MLME_ASSOC 1 /* associate station */
150#define QCSAP_MLME_DISASSOC 2 /* disassociate station */
151#define QCSAP_MLME_DEAUTH 3 /* deauthenticate station */
152#define QCSAP_MLME_AUTHORIZE 4 /* authorize station */
153#define QCSAP_MLME_UNAUTHORIZE 5 /* unauthorize station */
154#define QCSAP_MLME_MICFAILURE 6 /* TKIP MICFAILURE */
155 u_int16_t im_reason; /* 802.11 reason code */
156 u_int8_t im_macaddr[QCSAP_ADDR_LEN];
157};
158
159
160/*
161 * Retrieve the WPA/RSN information element for an associated station.
162 */
163struct sQcSapreq_wpaie {
164 u_int8_t wpa_ie[QCSAP_MAX_OPT_IE];
165 u_int8_t wpa_macaddr[QCSAP_ADDR_LEN];
166};
167
168/*
169 * Retrieve the WSC information element for an associated station.
170 */
171struct sQcSapreq_wscie {
172 u_int8_t wsc_macaddr[QCSAP_ADDR_LEN];
173 u_int8_t wsc_ie[QCSAP_MAX_WSC_IE];
174};
175
176
177/*
178 * Retrieve the WPS PBC Probe Request IEs.
179 */
180typedef struct sQcSapreq_WPSPBCProbeReqIES {
181 u_int8_t macaddr[QCSAP_ADDR_LEN];
182 u_int16_t probeReqIELen;
183 u_int8_t probeReqIE[512];
184} sQcSapreq_WPSPBCProbeReqIES_t ;
185
186/*
187 * Channel List Info
188 */
189
190typedef struct
191{
192 v_U8_t num_channels;
193 v_U8_t channels[WNI_CFG_VALID_CHANNEL_LIST_LEN];
194}tChannelListInfo, *tpChannelListInfo;
195
196
197#ifdef __linux__
198/*
199 * Wireless Extensions API, private ioctl interfaces.
200 *
201 * NB: Even-numbered ioctl numbers have set semantics and are privileged!
202 * (regardless of the incorrect comment in wireless.h!)
203 */
204
205#define QCSAP_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
206#define QCSAP_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
207#define QCSAP_IOCTL_COMMIT (SIOCIWFIRSTPRIV+2)
208#define QCSAP_IOCTL_SETMLME (SIOCIWFIRSTPRIV+3)
209
210#define QCSAP_IOCTL_GET_STAWPAIE (SIOCIWFIRSTPRIV+4)
211#define QCSAP_IOCTL_SETWPAIE (SIOCIWFIRSTPRIV+5)
212#define QCSAP_IOCTL_STOPBSS (SIOCIWFIRSTPRIV+6)
213#define QCSAP_IOCTL_VERSION (SIOCIWFIRSTPRIV+7)
214#define QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES (SIOCIWFIRSTPRIV+8)
215#define QCSAP_IOCTL_GET_CHANNEL (SIOCIWFIRSTPRIV+9)
216#define QCSAP_IOCTL_ASSOC_STA_MACADDR (SIOCIWFIRSTPRIV+10)
217#define QCSAP_IOCTL_DISASSOC_STA (SIOCIWFIRSTPRIV+11)
218#define QCSAP_IOCTL_AP_STATS (SIOCIWFIRSTPRIV+12)
219#define QCSAP_IOCTL_GET_STATS (SIOCIWFIRSTPRIV+13)
220#define QCSAP_IOCTL_CLR_STATS (SIOCIWFIRSTPRIV+14)
221
222#define QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV+15)
223#define WE_SET_WLAN_DBG 1
224#define QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV+16)
225#define WE_LOG_DUMP_CMD 1
226#define QCSAP_IOCTL_SET_CHANNEL_RANGE (SIOCIWFIRSTPRIV+17)
227
228#ifdef WLAN_FEATURE_P2P
229#define WE_P2P_NOA_CMD 2
230#endif
231
232#define QCSAP_IOCTL_MODIFY_ACL (SIOCIWFIRSTPRIV+18)
233#define QCSAP_IOCTL_GET_CHANNEL_LIST (SIOCIWFIRSTPRIV+19)
Jeff Johnsone7245742012-09-05 17:12:55 -0700234#define QCSAP_IOCTL_SET_TX_POWER (SIOCIWFIRSTPRIV+20)
Jeff Johnson295189b2012-06-20 16:38:30 -0700235
236#define MAX_VAR_ARGS 7
237#define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31)
238
239enum {
240 QCSAP_PARAM_MAX_ASSOC = 1,
Jeff Johnson43971f52012-07-17 12:26:56 -0700241 QCSAP_PARAM_GET_WLAN_DBG = 4,
Jeff Johnson295189b2012-06-20 16:38:30 -0700242 QCSAP_PARAM_MODULE_DOWN_IND = 5,
243 QCSAP_PARAM_CLR_ACL = 6,
244 QCSAP_PARAM_ACL_MODE = 7,
245 QCSAP_PARAM_HIDE_SSID = 8,
Jeff Johnson43971f52012-07-17 12:26:56 -0700246 QCSAP_PARAM_AUTO_CHANNEL = 9,
Jeff Johnson295189b2012-06-20 16:38:30 -0700247};
248
249int iw_softap_get_channel_list(struct net_device *dev,
250 struct iw_request_info *info,
251 union iwreq_data *wrqu, char *extra);
252
253#endif /* __linux__ */
254
255#endif /*_QC_SAP_IOCTL_H_*/