Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
| 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 | |
| 28 | #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 |
| 42 | #define QCSAP_MAX_GET_STA_INFO 512 |
| 43 | |
| 44 | typedef struct sSSID { |
| 45 | uint8_t length; |
| 46 | uint8_t ssId[32]; |
| 47 | } tSSID; |
| 48 | |
| 49 | typedef struct sSSIDInfo { |
| 50 | tSSID ssid; |
| 51 | uint8_t ssidHidden; |
| 52 | } tSSIDInfo; |
| 53 | |
| 54 | typedef enum { |
| 55 | eQC_DOT11_MODE_ALL = 0, |
| 56 | eQC_DOT11_MODE_ABG = 0x0001, /* 11a/b/g only, no HT, no proprietary */ |
| 57 | eQC_DOT11_MODE_11A = 0x0002, |
| 58 | eQC_DOT11_MODE_11B = 0x0004, |
| 59 | eQC_DOT11_MODE_11G = 0x0008, |
| 60 | eQC_DOT11_MODE_11N = 0x0010, |
| 61 | eQC_DOT11_MODE_11G_ONLY = 0x0020, |
| 62 | eQC_DOT11_MODE_11N_ONLY = 0x0040, |
| 63 | eQC_DOT11_MODE_11B_ONLY = 0x0080, |
| 64 | eQC_DOT11_MODE_11A_ONLY = 0x0100, |
| 65 | /* This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL except when it starts IBSS in 11B of 2.4GHz */ |
| 66 | /* It is for CSR internal use */ |
| 67 | eQC_DOT11_MODE_AUTO = 0x0200, |
| 68 | |
| 69 | } tQcPhyMode; |
| 70 | |
| 71 | #define QCSAP_ADDR_LEN 6 |
| 72 | |
| 73 | typedef uint8_t qcmacaddr[QCSAP_ADDR_LEN]; |
| 74 | |
| 75 | struct qc_mac_acl_entry { |
| 76 | qcmacaddr addr; |
| 77 | int vlan_id; |
| 78 | }; |
| 79 | |
| 80 | typedef enum { |
| 81 | eQC_AUTH_TYPE_OPEN_SYSTEM, |
| 82 | eQC_AUTH_TYPE_SHARED_KEY, |
| 83 | eQC_AUTH_TYPE_AUTO_SWITCH |
| 84 | } eQcAuthType; |
| 85 | |
| 86 | typedef enum { |
| 87 | eQC_WPS_BEACON_IE, |
| 88 | eQC_WPS_PROBE_RSP_IE, |
| 89 | eQC_WPS_ASSOC_RSP_IE |
| 90 | } eQCWPSType; |
| 91 | |
| 92 | /* |
| 93 | * Retrieve the WPA/RSN information element for an associated station. |
| 94 | */ |
| 95 | struct sQcSapreq_wpaie { |
| 96 | uint8_t wpa_ie[QCSAP_MAX_OPT_IE]; |
| 97 | uint8_t wpa_macaddr[QCSAP_ADDR_LEN]; |
| 98 | }; |
| 99 | |
| 100 | /* |
| 101 | * Retrieve the WSC information element for an associated station. |
| 102 | */ |
| 103 | struct sQcSapreq_wscie { |
| 104 | uint8_t wsc_macaddr[QCSAP_ADDR_LEN]; |
| 105 | uint8_t wsc_ie[QCSAP_MAX_WSC_IE]; |
| 106 | }; |
| 107 | |
| 108 | /* |
| 109 | * Retrieve the WPS PBC Probe Request IEs. |
| 110 | */ |
| 111 | typedef struct sQcSapreq_WPSPBCProbeReqIES { |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 112 | struct qdf_mac_addr macaddr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 113 | uint16_t probeReqIELen; |
| 114 | uint8_t probeReqIE[512]; |
| 115 | } sQcSapreq_WPSPBCProbeReqIES_t; |
| 116 | |
| 117 | /* |
| 118 | * Channel List Info |
| 119 | */ |
| 120 | |
| 121 | typedef struct { |
| 122 | uint8_t num_channels; |
| 123 | uint8_t channels[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 124 | } tChannelListInfo, *tpChannelListInfo; |
| 125 | |
| 126 | #ifdef __linux__ |
| 127 | /* |
| 128 | * Wireless Extensions API, private ioctl interfaces. |
| 129 | * |
| 130 | * NB: Even-numbered ioctl numbers have set semantics and are privileged! |
| 131 | * (regardless of the incorrect comment in wireless.h!) |
| 132 | */ |
| 133 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 134 | #define QCSAP_IOCTL_SETPARAM (SIOCIWFIRSTPRIV + 0) |
| 135 | #define QCSAP_IOCTL_GETPARAM (SIOCIWFIRSTPRIV + 1) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 136 | /* (SIOCIWFIRSTPRIV+2) is unused */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 137 | #define QCSAP_IOCTL_SET_NONE_GET_THREE (SIOCIWFIRSTPRIV + 3) |
| 138 | #define WE_GET_TSF 1 |
| 139 | #define QCSAP_IOCTL_GET_STAWPAIE (SIOCIWFIRSTPRIV + 4) |
| 140 | #define QCSAP_IOCTL_SETWPAIE (SIOCIWFIRSTPRIV + 5) |
| 141 | #define QCSAP_IOCTL_STOPBSS (SIOCIWFIRSTPRIV + 6) |
| 142 | #define QCSAP_IOCTL_VERSION (SIOCIWFIRSTPRIV + 7) |
| 143 | #define QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES (SIOCIWFIRSTPRIV + 8) |
| 144 | #define QCSAP_IOCTL_GET_CHANNEL (SIOCIWFIRSTPRIV + 9) |
| 145 | #define QCSAP_IOCTL_ASSOC_STA_MACADDR (SIOCIWFIRSTPRIV + 10) |
| 146 | #define QCSAP_IOCTL_DISASSOC_STA (SIOCIWFIRSTPRIV + 11) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 147 | /* (SIOCIWFIRSTPRIV+12) is unused */ |
| 148 | /* Private ioctls and their sub-ioctls */ |
| 149 | #define QCSAP_PRIV_GET_CHAR_SET_NONE (SIOCIWFIRSTPRIV + 13) |
| 150 | #define QCSAP_GET_STATS 1 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 151 | #define QCSAP_LIST_FW_PROFILE 2 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 152 | #define QCSAP_IOCTL_CLR_STATS (SIOCIWFIRSTPRIV + 14) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 153 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 154 | #define QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 15) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 155 | #define WE_SET_WLAN_DBG 1 |
| 156 | #define WE_SET_DP_TRACE 2 |
| 157 | #define WE_SET_SAP_CHANNELS 3 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 158 | #define QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 16) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 159 | #define WE_UNIT_TEST_CMD 7 |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 160 | #define QCSAP_IOCTL_SET_CHANNEL_RANGE (SIOCIWFIRSTPRIV + 17) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 161 | |
| 162 | #define WE_P2P_NOA_CMD 2 |
| 163 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 164 | #define QCSAP_IOCTL_MODIFY_ACL (SIOCIWFIRSTPRIV + 18) |
| 165 | #define QCSAP_IOCTL_GET_CHANNEL_LIST (SIOCIWFIRSTPRIV + 19) |
| 166 | #define QCSAP_IOCTL_SET_TX_POWER (SIOCIWFIRSTPRIV + 20) |
| 167 | #define QCSAP_IOCTL_GET_STA_INFO (SIOCIWFIRSTPRIV + 21) |
| 168 | #define QCSAP_IOCTL_SET_MAX_TX_POWER (SIOCIWFIRSTPRIV + 22) |
| 169 | #define QCSAP_IOCTL_GET_INI_CFG (SIOCIWFIRSTPRIV + 25) |
| 170 | #define QCSAP_IOCTL_SET_INI_CFG (SIOCIWFIRSTPRIV + 26) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 171 | #define QCSAP_IOCTL_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) |
| 172 | #ifdef DEBUG |
| 173 | #define QCSAP_IOCTL_SET_FW_CRASH_INJECT 1 |
| 174 | #endif |
| 175 | #define QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL 2 |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 176 | #define QCSAP_ENABLE_FW_PROFILE 3 |
| 177 | #define QCSAP_SET_FW_PROFILE_HIST_INTVL 4 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 178 | |
| 179 | #define MAX_VAR_ARGS 7 |
| 180 | #define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31) |
| 181 | |
| 182 | #define QCSAP_IOCTL_MAX_STR_LEN 1024 |
| 183 | |
| 184 | #define RC_2_RATE_IDX(_rc) ((_rc) & 0x7) |
| 185 | #define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) |
| 186 | |
| 187 | #define RC_2_RATE_IDX_11AC(_rc) ((_rc) & 0xf) |
| 188 | #define HT_RC_2_STREAMS_11AC(_rc) ((((_rc) & 0x30) >> 4) + 1) |
| 189 | |
| 190 | enum { |
| 191 | QCSAP_PARAM_MAX_ASSOC = 1, |
| 192 | QCSAP_PARAM_GET_WLAN_DBG, |
| 193 | QCSAP_PARAM_CLR_ACL = 4, |
| 194 | QCSAP_PARAM_ACL_MODE, |
| 195 | QCSAP_PARAM_HIDE_SSID, |
| 196 | QCSAP_PARAM_AUTO_CHANNEL, |
| 197 | QCSAP_PARAM_SET_MC_RATE, |
| 198 | QCSAP_PARAM_SET_TXRX_FW_STATS, |
| 199 | QCSAP_PARAM_SET_MCC_CHANNEL_LATENCY, |
| 200 | QCSAP_PARAM_SET_MCC_CHANNEL_QUOTA, |
| 201 | QCSAP_DBGLOG_LOG_LEVEL, |
| 202 | QCSAP_DBGLOG_VAP_ENABLE, |
| 203 | QCSAP_DBGLOG_VAP_DISABLE, |
| 204 | QCSAP_DBGLOG_MODULE_ENABLE, |
| 205 | QCSAP_DBGLOG_MODULE_DISABLE, |
| 206 | QCSAP_DBGLOG_MOD_LOG_LEVEL, |
| 207 | QCSAP_DBGLOG_TYPE, |
| 208 | QCSAP_DBGLOG_REPORT_ENABLE, |
| 209 | QCASAP_TXRX_FWSTATS_RESET, |
| 210 | QCSAP_PARAM_RTSCTS, |
| 211 | QCASAP_SET_11N_RATE, |
| 212 | QCASAP_SET_VHT_RATE, |
| 213 | QCASAP_SHORT_GI, |
| 214 | QCSAP_SET_AMPDU, |
| 215 | QCSAP_SET_AMSDU, |
| 216 | QCSAP_GTX_HT_MCS, |
| 217 | QCSAP_GTX_VHT_MCS, |
| 218 | QCSAP_GTX_USRCFG, |
| 219 | QCSAP_GTX_THRE, |
| 220 | QCSAP_GTX_MARGIN, |
| 221 | QCSAP_GTX_STEP, |
| 222 | QCSAP_GTX_MINTPC, |
| 223 | QCSAP_GTX_BWMASK, |
| 224 | #ifdef QCA_PKT_PROTO_TRACE |
| 225 | QCASAP_SET_DEBUG_LOG, |
| 226 | #endif |
| 227 | QCASAP_SET_TM_LEVEL, |
| 228 | QCASAP_SET_DFS_IGNORE_CAC, |
| 229 | QCASAP_GET_DFS_NOL, |
| 230 | QCASAP_SET_DFS_NOL, |
| 231 | QCSAP_PARAM_SET_CHANNEL_CHANGE, |
| 232 | QCASAP_SET_DFS_TARGET_CHNL, |
| 233 | QCASAP_SET_RADAR_CMD, |
| 234 | QCSAP_GET_ACL, |
| 235 | QCASAP_TX_CHAINMASK_CMD, |
| 236 | QCASAP_RX_CHAINMASK_CMD, |
| 237 | QCASAP_NSS_CMD, |
| 238 | QCSAP_IPA_UC_STAT, |
| 239 | QCASAP_SET_PHYMODE, |
| 240 | QCASAP_GET_TEMP_CMD, |
| 241 | QCASAP_DUMP_STATS, |
| 242 | QCASAP_CLEAR_STATS, |
| 243 | QCASAP_SET_RADAR_DBG, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 244 | QCSAP_GET_FW_PROFILE_DATA, |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 245 | QCSAP_START_FW_PROFILING, |
| 246 | QCSAP_CAP_TSF, |
| 247 | QCSAP_GET_TSF, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 248 | }; |
| 249 | |
| 250 | int iw_softap_get_channel_list(struct net_device *dev, |
| 251 | struct iw_request_info *info, |
| 252 | union iwreq_data *wrqu, char *extra); |
| 253 | |
| 254 | #endif /* __linux__ */ |
| 255 | |
| 256 | #endif /*_QC_SAP_IOCTL_H_*/ |