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