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