| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 1 | /* |
| Duy Truong | d48aa31 | 2013-02-10 02:16:54 -0800 | [diff] [blame] | 2 | * Copyright (c) 2010, The Linux Foundation. All rights reserved. |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 3 | |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are |
| 6 | * met: |
| 7 | * * Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * * Redistributions in binary form must reproduce the above |
| 10 | * copyright notice, this list of conditions and the following |
| 11 | * disclaimer in the documentation and/or other materials provided |
| 12 | * with the distribution. |
| Duy Truong | d48aa31 | 2013-02-10 02:16:54 -0800 | [diff] [blame] | 13 | * * Neither the name of The Linux Foundation nor the names of its |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 14 | * contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | |
| 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | */ |
| 29 | |
| 30 | |
| 31 | #ifndef _QSAP_API_H_ |
| 32 | #define _QSAP_API_H_ |
| 33 | |
| 34 | #if __cplusplus |
| 35 | extern "C" { |
| 36 | #endif |
| 37 | |
| 38 | typedef unsigned char u8; |
| 39 | typedef char s8; |
| 40 | typedef unsigned short int u16; |
| 41 | typedef signed short int s16; |
| 42 | typedef unsigned long int u32; |
| 43 | typedef signed long int s32; |
| 44 | |
| 45 | /** Success and error messages */ |
| 46 | #define SUCCESS "success" |
| 47 | #define ERR_INVALID_ARG "failure invalid arguments" |
| 48 | #define ERR_INVALID_PARAM "failure invalid parameter" |
| 49 | #define ERR_UNKNOWN "failure unknown error" |
| 50 | #define ERR_INVALIDCMD "failure invalid command" |
| 51 | #define ERR_INVALIDREQ "failure invalid request" |
| 52 | #define ERR_FEATURE_NOT_ENABLED "failure feature not enabled" |
| 53 | #define ERR_NOT_SUPPORTED "failure not supported" |
| 54 | #define ERR_NOT_READY "failure not ready" |
| 55 | #define ERR_RES_UNAVAILABLE "failure resource unavailable" |
| 56 | #define ERR_SOFTAP_NOT_STARTED "failure softap not started" |
| 57 | |
| 58 | /** Error numbers used with the SDK */ |
| 59 | enum error_val { |
| 60 | eERR_UNKNOWN = -1, |
| 61 | eSUCCESS = 0, |
| 62 | eERR_STOP_BSS, |
| 63 | eERR_BSS_NOT_STARTED, |
| 64 | eERR_COMMIT, |
| 65 | eERR_START_SAP, |
| 66 | eERR_STOP_SAP, |
| 67 | eERR_RELOAD_SAP, |
| 68 | eERR_FILE_OPEN, |
| 69 | eERR_CONF_FILE, |
| 70 | eERR_INVALID_MAC_ADDR, |
| 71 | eERR_SEND_TO_HOSTAPD, |
| 72 | eERR_CONFIG_PARAM_MISSING, |
| 73 | eERR_CHAN_READ, |
| 74 | eERR_FEATURE_NOT_ENABLED, |
| 75 | eERR_UNLOAD_FAILED_SDIO, |
| 76 | eERR_UNLOAD_FAILED_SOFTAP, |
| 77 | eERR_LOAD_FAILED_SDIOIF, |
| Deepthi Gowri | 684d2f9 | 2012-05-23 23:28:16 +0530 | [diff] [blame] | 78 | eERR_LOAD_FAILED_SOFTAP, |
| Deepthi Gowri | 6ce5756 | 2012-06-27 01:18:15 +0530 | [diff] [blame] | 79 | eERR_SET_CHAN_RANGE, |
| 80 | eERR_GET_AUTO_CHAN |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 81 | }; |
| 82 | |
| Deepthi Gowri | ae5a4f7 | 2012-01-31 19:39:06 +0530 | [diff] [blame] | 83 | #ifndef WIFI_DRIVER_CONF_FILE |
| 84 | #define WIFI_DRIVER_CONF_FILE NULL |
| 85 | #endif |
| 86 | |
| 87 | #ifndef WIFI_DRIVER_DEF_CONF_FILE |
| 88 | #define WIFI_DRIVER_DEF_CONF_FILE NULL |
| 89 | #endif |
| 90 | |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 91 | /** Configuration file name */ |
| Santosh Sajjan | 47e3a84 | 2011-12-10 21:11:12 +0530 | [diff] [blame] | 92 | #define CONFIG_FILE "/data/misc/wifi/hostapd.conf" |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 93 | |
| 94 | /** Default configuration file path */ |
| Deepthi Gowri | 80a36e2 | 2012-10-16 18:33:51 +0530 | [diff] [blame] | 95 | #define DEFAULT_CONFIG_FILE_PATH "/system/etc/hostapd/hostapd_default.conf" |
| 96 | |
| 97 | /** Default Accept list file name */ |
| 98 | #define DEFAULT_ACCEPT_LIST_FILE_PATH "/system/etc/hostapd/hostapd.accept" |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 99 | |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 100 | /** Accept list file name */ |
| Neelansh Mittal | 587b8b3 | 2014-11-18 19:31:25 +0530 | [diff] [blame^] | 101 | #define ACCEPT_LIST_FILE "/data/misc/wifi/hostapd.accept" |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 102 | |
| Deepthi Gowri | 80a36e2 | 2012-10-16 18:33:51 +0530 | [diff] [blame] | 103 | /** Default Deny list file name */ |
| 104 | #define DEFAULT_DENY_LIST_FILE_PATH "/system/etc/hostapd/hostapd.deny" |
| 105 | |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 106 | /** Deny list file name */ |
| Neelansh Mittal | 587b8b3 | 2014-11-18 19:31:25 +0530 | [diff] [blame^] | 107 | #define DENY_LIST_FILE "/data/misc/wifi/hostapd.deny" |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 108 | |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 109 | /** Default Ini file */ |
| 110 | #define DEFAULT_INI_FILE "/persist/qcom/softap/qcom_cfg_default.ini" |
| 111 | |
| 112 | /** SDK control interface path */ |
| Neelansh Mittal | 587b8b3 | 2014-11-18 19:31:25 +0530 | [diff] [blame^] | 113 | #define SDK_CTRL_IF "/data/misc/wifi/softap_sdk_ctrl" |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 114 | |
| 115 | /** Maximum length of the line in the configuration file */ |
| 116 | #define MAX_CONF_LINE_LEN (156) |
| 117 | |
| 118 | /** MAC address length in acsii string format*/ |
| 119 | #define MAC_ADDR_LEN (17) |
| 120 | |
| 121 | /** MAC address length, as integer */ |
| 122 | #define MAC_ADDR_LEN_INT (6) |
| 123 | /** Maximum number of MAC address in the allow / deny MAC list */ |
| 124 | #define MAX_ALLOWED_MAC (15) |
| 125 | |
| 126 | /** Maximum length of the file path */ |
| 127 | #define MAX_FILE_PATH_LEN (128) |
| 128 | |
| 129 | /** WPS key length - 8 digit key, usually*/ |
| 130 | #define WPS_KEY_LEN (8) |
| 131 | |
| 132 | /** Maximum length of the SSID */ |
| 133 | #define SSD_MAX_LEN (32) |
| Santosh Sajjan | c463f73 | 2011-12-22 18:24:56 +0530 | [diff] [blame] | 134 | #define CTRY_MAX_LEN (3) |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 135 | |
| 136 | /** Beacon interval 50 to 65535 */ |
| 137 | #define BCN_INTERVAL_MIN (1) |
| 138 | #define BCN_INTERVAL_MAX (65535) |
| 139 | |
| 140 | /** Passphrase max length 63 bytes, Minumum lenght is 8. |
| 141 | * NOTE: If Passphrase length is 64, then phassphrase is treated as PSK. |
| 142 | */ |
| 143 | #define PASSPHRASE_MIN (8) |
| 144 | #define PASSPHRASE_MAX (63) |
| 145 | |
| 146 | /** DTIM period 1 to 255 -- Qualcomm 10 */ |
| 147 | #define DTIM_PERIOD_MIN (1) |
| 148 | #define DTIM_PERIOD_MAX (255) |
| 149 | |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 150 | /** WEP key lengths in ASCII and hex */ |
| 151 | #define WEP_64_KEY_ASCII (5) |
| 152 | #define WEP_64_KEY_HEX (10) |
| 153 | |
| 154 | #define WEP_128_KEY_ASCII (13) |
| 155 | #define WEP_128_KEY_HEX (26) |
| 156 | |
| 157 | #define WEP_152_KEY_ASCII (16) |
| 158 | #define WEP_152_KEY_HEX (32) |
| 159 | |
| 160 | #define WPS_PIN_LEN (8) |
| 161 | |
| 162 | #define CHANNEL_MIN (0) |
| 163 | #define CHANNEL_MAX (14) |
| 164 | #define AUTO_CHANNEL (0) |
| 165 | #define BG_MAX_CHANNEL (11) |
| 166 | |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 167 | /** Fragmentation threshold 256 to 2346 */ |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 168 | #define FRAG_THRESHOLD_MIN (256) |
| 169 | #define FRAG_THRESHOLD_MAX (2346) |
| 170 | |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 171 | /** RTS threshold 1 to 2347 */ |
| 172 | #define RTS_THRESHOLD_MIN (1) |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 173 | #define RTS_THRESHOLD_MAX (2347) |
| 174 | |
| 175 | #define MIN_UUID_LEN (1) |
| 176 | #define MAX_UUID_LEN (36) |
| 177 | |
| 178 | #define MIN_DEVICENAME_LEN (1) |
| 179 | #define MAX_DEVICENAME_LEN (32) |
| 180 | |
| 181 | #define MIN_MANUFACTURER_LEN (1) |
| 182 | #define MAX_MANUFACTURER_LEN (64) |
| 183 | |
| 184 | #define MIN_MODELNAME_LEN (1) |
| 185 | #define MAX_MODELNAME_LEN (32) |
| 186 | |
| 187 | #define MIN_MODELNUM_LEN (1) |
| 188 | #define MAX_MODELNUM_LEN (32) |
| 189 | |
| 190 | #define MIN_SERIALNUM_LEN (1) |
| 191 | #define MAX_SERIALNUM_LEN (32) |
| 192 | |
| 193 | #define MIN_DEV_TYPE_LEN (1) |
| 194 | #define MAX_DEV_TYPE_LEN (20) |
| 195 | |
| 196 | #define MIN_OS_VERSION_LEN (1) |
| 197 | #define MAX_OS_VERSION_LEN (12) |
| 198 | |
| 199 | #define MIN_FRIENDLY_NAME_LEN (1) |
| 200 | #define MAX_FRIENDLY_NAME_LEN (64) |
| 201 | |
| 202 | #define MAX_URL_LEN (128) |
| 203 | |
| 204 | #define MIN_MODEL_DESC_LEN (1) |
| 205 | #define MAX_MODEL_DESC_LEN (128) |
| 206 | |
| 207 | #define MIN_UPC_LEN (1) |
| 208 | #define MAX_UPC_LEN (128) |
| 209 | |
| 210 | #define GTK_MIN (600) |
| 211 | |
| 212 | #define MAX_INT_STR (8) |
| 213 | |
| 214 | /** Tx Power range 2dBm to 18 dBm */ |
| 215 | #define MIN_TX_POWER (2) |
| 216 | #define MAX_TX_POWER (30) |
| 217 | |
| 218 | /** Data rate index */ |
| 219 | #define MIN_DATA_RATE_IDX (0) |
| 220 | #define MAX_DATA_RATE_IDX (28) |
| 221 | #define AUTO_DATA_RATE (0) |
| 222 | #define B_MODE_MAX_DATA_RATE_IDX (4) |
| 223 | #define G_ONLY_MODE_MAX_DATA_RATE_IDX (12) |
| 224 | |
| 225 | /** parameters for read config */ |
| 226 | #define GET_COMMENTED_VALUE 1 |
| 227 | #define GET_ENABLED_ONLY 0 |
| 228 | |
| 229 | #define MAX_RESP_LEN 255 |
| 230 | |
| 231 | /** AP shutoff time */ |
| 232 | #define AP_SHUTOFF_MIN (0) |
| 233 | #define AP_SHUTOFF_MAX (120) |
| 234 | |
| 235 | /** AP shutoff time */ |
| 236 | #define AP_ENERGY_DETECT_TH_MIN (0) |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 237 | #define AP_ENERGY_DETECT_TH_MAX (9) |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 238 | |
| 239 | /** command request index - in the array Cmd_req[] */ |
| 240 | enum eCmd_req { |
| 241 | eCMD_GET = 0, |
| 242 | eCMD_SET = 1, |
| 243 | |
| 244 | eCMD_REQ_LAST |
| 245 | }; |
| 246 | |
| 247 | /** |
| 248 | * Command numbers, these numbers form the index into the array of |
| 249 | * command names stored in the 'cmd_list'. |
| 250 | * |
| 251 | * Warning: An addtion of an entry in 'esap_cmd', should be followed |
| 252 | * by an addition of a command name string in the 'cmd_list' array |
| 253 | */ |
| 254 | typedef enum esap_cmd { |
| 255 | eCMD_INVALID = -1, |
| 256 | eCMD_SSID = 0, |
| 257 | eCMD_BSSID = 1, |
| 258 | eCMD_CHAN = 2, |
| 259 | eCMD_BCN_INTERVAL = 3, |
| 260 | eCMD_DTIM_PERIOD = 4, |
| 261 | eCMD_HW_MODE = 5, |
| 262 | eCMD_AUTH_ALGS = 6, |
| 263 | eCMD_SEC_MODE = 7, |
| 264 | eCMD_WEP_KEY0 = 8, |
| 265 | eCMD_WEP_KEY1 = 9, |
| 266 | eCMD_WEP_KEY2 = 10, |
| 267 | eCMD_WEP_KEY3 = 11, |
| 268 | eCMD_DEFAULT_KEY = 12, |
| 269 | eCMD_PASSPHRASE = 13, |
| 270 | eCMD_WPA_PAIRWISE = 14, |
| 271 | eCMD_RSN_PAIRWISE = 15, |
| 272 | eCMD_MAC_ADDR = 16, |
| 273 | eCMD_RESET_AP = 17, |
| 274 | eCMD_MAC_ACL = 18, |
| 275 | eCMD_ADD_TO_ALLOW = 19, |
| 276 | eCMD_ADD_TO_DENY = 20, |
| 277 | eCMD_REMOVE_FROM_ALLOW = 21, |
| 278 | eCMD_REMOVE_FROM_DENY = 22, |
| 279 | eCMD_ALLOW_LIST = 23, |
| 280 | eCMD_DENY_LIST = 24, |
| 281 | eCMD_COMMIT = 25, |
| 282 | eCMD_ENABLE_SOFTAP = 26, |
| 283 | eCMD_DISASSOC_STA = 27, |
| 284 | eCMD_RESET_TO_DEFAULT = 28, |
| 285 | eCMD_PROTECTION_FLAG = 29, |
| 286 | eCMD_DATA_RATES = 30, |
| 287 | eCMD_ASSOC_STA_MACS = 31, |
| 288 | eCMD_TX_POWER = 32, |
| 289 | eCMD_SDK_VERSION = 33, |
| 290 | eCMD_WMM_STATE = 34, |
| 291 | |
| 292 | /** WARNING: The order of WPS commands should not be altered. |
| 293 | New commands SHOULD be added above or below this */ |
| 294 | eCMD_WPS_STATE = 35, |
| 295 | eCMD_WPS_CONFIG_METHOD = 36, |
| 296 | eCMD_UUID = 37, |
| 297 | eCMD_DEVICE_NAME = 38, |
| 298 | eCMD_MANUFACTURER = 39, |
| 299 | eCMD_MODEL_NAME = 40, |
| 300 | eCMD_MODEL_NUMBER = 41, |
| 301 | eCMD_SERIAL_NUMBER = 42, |
| 302 | eCMD_DEVICE_TYPE = 43, |
| 303 | eCMD_OS_VERSION = 44, |
| 304 | eCMD_FRIENDLY_NAME = 45, |
| 305 | eCMD_MANUFACTURER_URL = 46, |
| 306 | eCMD_MODEL_DESC = 47, |
| 307 | eCMD_MODEL_URL = 48, |
| 308 | eCMD_UPC = 49, |
| 309 | /******************************************************/ |
| 310 | |
| 311 | eCMD_FRAG_THRESHOLD = 50, |
| 312 | eCMD_RTS_THRESHOLD = 51, |
| 313 | eCMD_GTK_TIMEOUT = 52, |
| 314 | eCMD_COUNTRY_CODE = 53, |
| 315 | eCMD_INTRA_BSS_FORWARD = 54, |
| 316 | eCMD_REGULATORY_DOMAIN = 55, |
| 317 | eCMD_AP_STATISTICS = 56, |
| 318 | eCMD_AP_AUTOSHUTOFF = 57, |
| 319 | eCMD_AP_ENERGY_DETECT_TH = 58, |
| Santosh Sajjan | c463f73 | 2011-12-22 18:24:56 +0530 | [diff] [blame] | 320 | eCMD_BASIC_RATES = 59, |
| 321 | eCMD_REQUIRE_HT = 60, |
| 322 | eCMD_IEEE80211N = 61, |
| Deepthi Gowri | 684d2f9 | 2012-05-23 23:28:16 +0530 | [diff] [blame] | 323 | eCMD_SET_CHANNEL_RANGE = 62, |
| Deepthi Gowri | 6ce5756 | 2012-06-27 01:18:15 +0530 | [diff] [blame] | 324 | eCMD_GET_AUTO_CHANNEL = 63, |
| Chet Lanctot | 4c15b56 | 2013-07-25 11:02:06 -0700 | [diff] [blame] | 325 | eCMD_IEEE80211W = 64, |
| Chet Lanctot | 7a2827f | 2013-09-09 17:48:58 -0700 | [diff] [blame] | 326 | eCMD_WPA_KEY_MGMT = 65, |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 327 | |
| 328 | eCMD_LAST /** New command numbers should be added above this */ |
| 329 | } esap_cmd_t; |
| 330 | |
| 331 | /** non-commands */ |
| 332 | typedef enum esap_str { |
| 333 | STR_WPA = 0, |
| 334 | STR_ACCEPT_MAC_FILE = 1, |
| 335 | STR_DENY_MAC_FILE = 2, |
| 336 | STR_MAC_IN_INI = 3, |
| 337 | STR_PROT_FLAG_IN_INI = 4, |
| 338 | STR_DATA_RATE_IN_INI = 5, |
| 339 | STR_TX_POWER_IN_INI = 6, |
| 340 | STR_FRAG_THRESHOLD_IN_INI = 7, |
| 341 | STR_RTS_THRESHOLD_IN_INI = 8, |
| 342 | STR_COUNTRY_CODE_IN_INI = 9, |
| 343 | STR_INTRA_BSS_FORWARD_IN_INI = 10, |
| 344 | STR_WMM_IN_INI = 11, |
| 345 | STR_802DOT11D_IN_INI = 12, |
| 346 | STR_HT_80211N = 13, |
| 347 | STR_CTRL_INTERFACE = 14, |
| 348 | STR_INTERFACE = 15, |
| 349 | STR_EAP_SERVER = 16, |
| 350 | STR_AP_AUTOSHUTOFF = 17, |
| 351 | STR_AP_ENERGY_DETECT_TH = 18, |
| 352 | eSTR_LAST |
| 353 | } esap_str_t; |
| 354 | |
| 355 | /** Supported security mode */ |
| 356 | typedef enum sec_mode { |
| 357 | SEC_MODE_NONE = 0, |
| 358 | SEC_MODE_WEP = 1, |
| 359 | SEC_MODE_WPA_PSK = 2, |
| 360 | SEC_MODE_WPA2_PSK = 3, |
| 361 | SEC_MODE_WPA_WPA2_PSK = 4, |
| 362 | |
| 363 | SEC_MODE_INVALID |
| 364 | } sec_mode_t; |
| 365 | |
| 366 | /** security mode in the configuration file */ |
| 367 | enum wpa_in_conf_file { |
| 368 | WPA_IN_CONF_FILE = 1, |
| 369 | WPA2_IN_CONF_FILE = 2, |
| 370 | WPA_WPA2_IN_CONF_FILE = 3 |
| 371 | }; |
| 372 | |
| 373 | enum { |
| 374 | DISABLE = 0, |
| 375 | ENABLE = 1 |
| 376 | }; |
| 377 | |
| 378 | enum { |
| 379 | FALSE = 0, |
| 380 | TRUE = 1 |
| 381 | }; |
| 382 | |
| 383 | /** IEEE 802.11 operating mode */ |
| 384 | enum oper_mode { |
| 385 | HW_MODE_B = 0, |
| 386 | HW_MODE_G = 1, |
| 387 | HW_MODE_N = 2, |
| 388 | HW_MODE_G_ONLY = 3, |
| 389 | HW_MODE_N_ONLY = 4, |
| Santosh Sajjan | c463f73 | 2011-12-22 18:24:56 +0530 | [diff] [blame] | 390 | HW_MODE_A = 5, |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 391 | |
| 392 | HW_MODE_UNKNOWN |
| 393 | }; |
| 394 | |
| 395 | /** Authentication algorithm */ |
| 396 | enum auth_alg { |
| 397 | AHTH_ALG_OPEN = 1, |
| 398 | AUTH_ALG_SHARED = 2, |
| 399 | AUTH_ALG_OPEN_SHARED = 3, |
| 400 | |
| 401 | AUTH_ALG_INVALID |
| 402 | }; |
| 403 | |
| 404 | /** Allow or Deny MAC address list selection */ |
| 405 | enum macaddr_acl { |
| 406 | ACL_DENY_LIST = 0, |
| Sameer Thalappil | caf8792 | 2012-01-30 16:56:29 -0800 | [diff] [blame] | 407 | ACL_ALLOW_LIST = 1, |
| 408 | ACL_ALLOW_AND_DENY_LIST = 2 |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 409 | }; |
| 410 | |
| 411 | enum ap_reset { |
| 412 | SAP_RESET_BSS = 0, |
| 413 | SAP_RESET_DRIVER_BSS = 1, |
| 414 | SAP_STOP_BSS = 2, |
| 415 | SAP_STOP_DRIVER_BSS = 3, |
| Sameer Thalappil | caf8792 | 2012-01-30 16:56:29 -0800 | [diff] [blame] | 416 | #ifdef QCOM_WLAN_CONCURRENCY |
| 417 | SAP_INITAP = 4, |
| 418 | SAP_EXITAP = 5, |
| 419 | #endif |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 420 | SAP_RESET_INVALID |
| 421 | }; |
| 422 | |
| 423 | enum wmm_state { |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 424 | WMM_AUTO_IN_INI = 0, |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 425 | WMM_ENABLED_IN_INI = 1, |
| 426 | WMM_DISABLED_IN_INI = 2 |
| 427 | }; |
| 428 | |
| 429 | enum wps_state { |
| 430 | WPS_STATE_DISABLE = 0, |
| 431 | WPS_STATE_ENABLE = 2 |
| 432 | }; |
| 433 | |
| 434 | |
| 435 | enum wps_config { |
| 436 | WPS_CONFIG_PBC = 0, |
| 437 | WPS_CONFIG_PIN = 1, |
| 438 | }; |
| 439 | |
| 440 | /** Choose the configuration file */ |
| 441 | enum eChoose_conf_file { |
| Santosh Sajjan | 47e3a84 | 2011-12-10 21:11:12 +0530 | [diff] [blame] | 442 | HOSTAPD_CONF_QCOM_FILE = 0, |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 443 | INI_CONF_FILE = 1 |
| 444 | }; |
| 445 | |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 446 | struct Command |
| 447 | { |
| 448 | s8 * name; |
| 449 | s8 * default_value; |
| 450 | }; |
| 451 | |
| Deepthi Gowri | 684d2f9 | 2012-05-23 23:28:16 +0530 | [diff] [blame] | 452 | /** STA Channel information*/ |
| 453 | typedef struct sta_channel_info { |
| 454 | int subioctl; |
| 455 | int stastartchan; |
| 456 | int staendchan; |
| 457 | int staband; |
| 458 | } sta_channel_info; |
| 459 | |
| 460 | /**SAP Channel information*/ |
| 461 | typedef struct sap_channel_info { |
| 462 | int startchan; |
| 463 | int endchan; |
| 464 | int band; |
| 465 | } sap_channel_info; |
| 466 | |
| Deepthi Gowri | 6ce5756 | 2012-06-27 01:18:15 +0530 | [diff] [blame] | 467 | /**SAP auto Channel information*/ |
| 468 | typedef struct sap_auto_channel_info { |
| 469 | int subioctl; |
| 470 | } sap_auto_channel_info; |
| 471 | |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 472 | /** Validate enable / disable softap */ |
| 473 | #define IS_VALID_SOFTAP_ENABLE(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE) |
| 474 | |
| 475 | /** Validate the channel */ |
| 476 | #define IS_VALID_CHANNEL(x) ((value >= CHANNEL_MIN) && (value <= CHANNEL_MAX) ? TRUE : FALSE) |
| 477 | |
| 478 | /** Validate the security mode */ |
| 479 | #define IS_VALID_SEC_MODE(x) (((x >= SEC_MODE_NONE) && (x < SEC_MODE_INVALID)) ? TRUE : FALSE) |
| 480 | |
| 481 | /** Validate the selection of access or deny MAC address list */ |
| Sameer Thalappil | caf8792 | 2012-01-30 16:56:29 -0800 | [diff] [blame] | 482 | #define IS_VALID_MAC_ACL(x) (((x==ACL_DENY_LIST) || (x==ACL_ALLOW_LIST) || (x==ACL_ALLOW_AND_DENY_LIST)) ? TRUE : FALSE) |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 483 | |
| 484 | /** Validate the broadcast SSID status */ |
| 485 | #define IS_VALID_BSSID(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE) |
| 486 | |
| 487 | /** Validate the length of the passphrase */ |
| 488 | #define IS_VALID_PASSPHRASE_LEN(x) (((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) ? TRUE: FALSE) |
| 489 | |
| 490 | /** Validate the beacon interval */ |
| 491 | #define IS_VALID_BEACON(x) (((x >= BCN_INTERVAL_MIN) && (x <= BCN_INTERVAL_MAX)) ? TRUE: FALSE) |
| 492 | |
| 493 | /** Validate the DTIM period */ |
| 494 | #define IS_VALID_DTIM_PERIOD(x) (((x >= DTIM_PERIOD_MIN) && (x <= DTIM_PERIOD_MAX)) ? TRUE: FALSE) |
| 495 | |
| 496 | /** Validate the WEP index */ |
| 497 | #define IS_VALID_WEP_KEY_IDX(x) ((x >= 0) && (x < 4) ? TRUE : FALSE) |
| 498 | |
| 499 | /** Validate the pairwise encryption */ |
| 500 | #define IS_VALID_PAIRWISE(x) (((!strcmp(x, "TKIP")) || (!strcmp(x, "CCMP")) || \ |
| 501 | (!strcmp(x, "TKIP CCMP")) || (!strcmp(x, "CCMP TKIP"))) ? TRUE : FALSE) |
| 502 | |
| 503 | /** Validate the WMM status */ |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 504 | #define IS_VALID_WMM_STATE(x) (((x >= WMM_AUTO_IN_INI) && (x <= WMM_DISABLED_IN_INI)) ? TRUE: FALSE) |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 505 | |
| 506 | /** Validate the WPS status */ |
| 507 | #define IS_VALID_WPS_STATE(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE) |
| 508 | |
| 509 | /** Validate the fragmentation threshold */ |
| 510 | #define IS_VALID_FRAG_THRESHOLD(x) (((x >= FRAG_THRESHOLD_MIN) && (x <= FRAG_THRESHOLD_MAX)) ? TRUE: FALSE) |
| 511 | |
| 512 | /** Validate the RTS threshold value */ |
| 513 | #define IS_VALID_RTS_THRESHOLD(x) (((x >= RTS_THRESHOLD_MIN) && (x <= RTS_THRESHOLD_MAX)) ? TRUE: FALSE) |
| 514 | |
| 515 | /** Validate the GTK */ |
| 516 | #define IS_VALID_GTK(x) ((x >= GTK_MIN) ? TRUE: FALSE) |
| 517 | |
| 518 | /** Validate the intra-bss forwarding status */ |
| 519 | #define IS_VALID_INTRA_BSS_STATUS(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE) |
| 520 | |
| 521 | /** Validate the protection flag */ |
| 522 | #define IS_VALID_PROTECTION(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE) |
| 523 | |
| 524 | /** Validate the UUID length */ |
| 525 | #define IS_VALID_UUID_LEN(x) (((x >= MIN_UUID_LEN) && (x <= MAX_UUID_LEN)) ? TRUE : FALSE) |
| 526 | |
| 527 | /** Validate the device name length */ |
| 528 | #define IS_VALID_DEVICENAME_LEN(x) (((x >= MIN_DEVICENAME_LEN) && (x <= MAX_DEVICENAME_LEN)) ? TRUE : FALSE) |
| 529 | |
| 530 | /** Validate the Manufacturer length */ |
| 531 | #define IS_VALID_MANUFACTURER_LEN(x) (((x >= MIN_MANUFACTURER_LEN) && (x <= MAX_MANUFACTURER_LEN)) ? TRUE : FALSE) |
| 532 | |
| 533 | /** Validate the Model name length */ |
| 534 | #define IS_VALID_MODELNAME_LEN(x) (((x >= MIN_MODELNAME_LEN) && (x <= MAX_MODELNAME_LEN)) ? TRUE : FALSE) |
| 535 | |
| 536 | /** Validate the Model number length */ |
| 537 | #define IS_VALID_MODELNUM_LEN(x) (((x >= MIN_MODELNUM_LEN) && (x <= MAX_MODELNUM_LEN)) ? TRUE : FALSE) |
| 538 | |
| 539 | /** Validate the Model serial number length */ |
| 540 | #define IS_VALID_SERIALNUM_LEN(x) (((x >= MIN_SERIALNUM_LEN) && (x <= MAX_SERIALNUM_LEN)) ? TRUE : FALSE) |
| 541 | |
| 542 | /** Validate the Primary device type length */ |
| 543 | #define IS_VALID_DEV_TYPE_LEN(x) (((x >= MIN_DEV_TYPE_LEN) && (x <= MAX_DEV_TYPE_LEN)) ? TRUE : FALSE) |
| 544 | |
| 545 | /** Validate the OS version length */ |
| 546 | #define IS_VALID_OS_VERSION_LEN(x) (((x >= MIN_OS_VERSION_LEN) && (x <= MAX_OS_VERSION_LEN)) ? TRUE : FALSE) |
| 547 | |
| 548 | /** Validate the friendly name length */ |
| 549 | #define IS_VALID_FRIENDLY_NAME_LEN(x) (((x >= MIN_FRIENDLY_NAME_LEN) && (x <= MAX_FRIENDLY_NAME_LEN)) ? TRUE : FALSE) |
| 550 | |
| 551 | /** Validate the URL length */ |
| 552 | #define IS_VALID_URL_LEN(x) (((x > 0) && (x <= MAX_URL_LEN)) ? TRUE : FALSE) |
| 553 | |
| 554 | /** Validate the model description length */ |
| 555 | #define IS_VALID_MODEL_DESC_LEN(x) (((x > MIN_MODEL_DESC_LEN) && (x <= MAX_MODEL_DESC_LEN)) ? TRUE : FALSE) |
| 556 | |
| 557 | /** Validate the Universal Product Code (UPC) length */ |
| 558 | #define IS_VALID_UPC_LEN(x) (((x > MIN_UPC_LEN) && (x <= MAX_UPC_LEN)) ? TRUE : FALSE) |
| 559 | |
| 560 | /** Validate the Tx power index */ |
| 561 | #define IS_VALID_TX_POWER(x) (((x >= MIN_TX_POWER ) && (x <= MAX_TX_POWER)) ? TRUE : FALSE) |
| 562 | |
| 563 | /** Validate the Data rate */ |
| 564 | #define IS_VALID_DATA_RATE_IDX(x) (((x >= MIN_DATA_RATE_IDX) && (x <= MAX_DATA_RATE_IDX)) ? TRUE : FALSE ) |
| 565 | |
| 566 | /** Validate WPS config */ |
| 567 | #define IS_VALID_WPS_CONFIG(x) (((x == WPS_CONFIG_PBC) || (x == WPS_CONFIG_PIN)) ? TRUE : FALSE) |
| 568 | |
| 569 | /** Validate the 802dot11d state */ |
| 570 | #define IS_VALID_802DOT11D_STATE(x) (((x == ENABLE) || (x == DISABLE)) ? TRUE: FALSE) |
| 571 | |
| 572 | /** Validate the AP shutoff time */ |
| 573 | #define IS_VALID_APSHUTOFFTIME(x) (((x >= AP_SHUTOFF_MIN) && (x <= AP_SHUTOFF_MAX)) ? TRUE : FALSE) |
| 574 | |
| 575 | /** Validate the AP shutoff time */ |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 576 | #define IS_VALID_ENERGY_DETECT_TH(x) ((((x >= AP_ENERGY_DETECT_TH_MIN) && (x <= AP_ENERGY_DETECT_TH_MAX)) ||( x == 128)) ? TRUE : FALSE) |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 577 | |
| 578 | /** Function declartion */ |
| 579 | void qsap_hostd_exec_cmd(s8 *pcmd, s8 *presp, u32 *plen); |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 580 | s8 *qsap_get_config_value(s8 *pfile, struct Command *pcmd, s8 *pbuf, u32 *plen); |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 581 | int qsapsetSoftap(int argc, char *argv[]); |
| 582 | void qsap_del_ctrl_iface(void); |
| Raj Kushwaha | ae27f82 | 2010-11-14 17:47:11 -0800 | [diff] [blame] | 583 | s16 wifi_qsap_reset_to_default(s8 *pcfgfile, s8 *pdefault); |
| 584 | void check_for_configuration_files(void); |
| Yunsen Wang | 458db7c | 2011-11-15 21:23:32 -0800 | [diff] [blame] | 585 | void qsap_set_ini_filename(void); |
| Deepthi Gowri | 684d2f9 | 2012-05-23 23:28:16 +0530 | [diff] [blame] | 586 | int qsap_set_channel_range(s8 * cmd); |
| Deepthi Gowri | 6ce5756 | 2012-06-27 01:18:15 +0530 | [diff] [blame] | 587 | int qsap_get_sap_auto_channel_slection(s32 *pautochan); |
| Mingcheng Zhu | 69b91cc | 2013-11-23 00:37:03 -0800 | [diff] [blame] | 588 | int qsap_get_mode(s32 *pmode); |
| Raj Kushwaha | 4102721 | 2010-10-13 00:11:12 -0700 | [diff] [blame] | 589 | |
| 590 | #if __cplusplus |
| 591 | }; // extern "C" |
| 592 | #endif |
| 593 | |
| 594 | #endif |
| 595 | |