1 /* 2 * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com> 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef _HAL_H_ 18 #define _HAL_H_ 19 20 /*--------------------------------------------------------------------------- 21 API VERSIONING INFORMATION 22 23 The RIVA API is versioned as MAJOR.MINOR.VERSION.REVISION 24 The MAJOR is incremented for major product/architecture changes 25 (and then MINOR/VERSION/REVISION are zeroed) 26 The MINOR is incremented for minor product/architecture changes 27 (and then VERSION/REVISION are zeroed) 28 The VERSION is incremented if a significant API change occurs 29 (and then REVISION is zeroed) 30 The REVISION is incremented if an insignificant API change occurs 31 or if a new API is added 32 All values are in the range 0..255 (ie they are 8-bit values) 33 ---------------------------------------------------------------------------*/ 34 #define WCN36XX_HAL_VER_MAJOR 1 35 #define WCN36XX_HAL_VER_MINOR 4 36 #define WCN36XX_HAL_VER_VERSION 1 37 #define WCN36XX_HAL_VER_REVISION 2 38 39 /* This is to force compiler to use the maximum of an int ( 4 bytes ) */ 40 #define WCN36XX_HAL_MAX_ENUM_SIZE 0x7FFFFFFF 41 #define WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF 42 43 /* Max no. of transmit categories */ 44 #define STACFG_MAX_TC 8 45 46 /* The maximum value of access category */ 47 #define WCN36XX_HAL_MAX_AC 4 48 49 #define WCN36XX_HAL_IPV4_ADDR_LEN 4 50 51 #define WCN36XX_HAL_STA_INVALID_IDX 0xFF 52 #define WCN36XX_HAL_BSS_INVALID_IDX 0xFF 53 54 /* Default Beacon template size */ 55 #define BEACON_TEMPLATE_SIZE 0x180 56 57 /* Minimum PVM size that the FW expects. See comment in smd.c for details. */ 58 #define TIM_MIN_PVM_SIZE 6 59 60 /* Param Change Bitmap sent to HAL */ 61 #define PARAM_BCN_INTERVAL_CHANGED (1 << 0) 62 #define PARAM_SHORT_PREAMBLE_CHANGED (1 << 1) 63 #define PARAM_SHORT_SLOT_TIME_CHANGED (1 << 2) 64 #define PARAM_llACOEXIST_CHANGED (1 << 3) 65 #define PARAM_llBCOEXIST_CHANGED (1 << 4) 66 #define PARAM_llGCOEXIST_CHANGED (1 << 5) 67 #define PARAM_HT20MHZCOEXIST_CHANGED (1<<6) 68 #define PARAM_NON_GF_DEVICES_PRESENT_CHANGED (1<<7) 69 #define PARAM_RIFS_MODE_CHANGED (1<<8) 70 #define PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED (1<<9) 71 #define PARAM_OBSS_MODE_CHANGED (1<<10) 72 #define PARAM_BEACON_UPDATE_MASK \ 73 (PARAM_BCN_INTERVAL_CHANGED | \ 74 PARAM_SHORT_PREAMBLE_CHANGED | \ 75 PARAM_SHORT_SLOT_TIME_CHANGED | \ 76 PARAM_llACOEXIST_CHANGED | \ 77 PARAM_llBCOEXIST_CHANGED | \ 78 PARAM_llGCOEXIST_CHANGED | \ 79 PARAM_HT20MHZCOEXIST_CHANGED | \ 80 PARAM_NON_GF_DEVICES_PRESENT_CHANGED | \ 81 PARAM_RIFS_MODE_CHANGED | \ 82 PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED | \ 83 PARAM_OBSS_MODE_CHANGED) 84 85 /* dump command response Buffer size */ 86 #define DUMPCMD_RSP_BUFFER 100 87 88 /* version string max length (including NULL) */ 89 #define WCN36XX_HAL_VERSION_LENGTH 64 90 91 /* message types for messages exchanged between WDI and HAL */ 92 enum wcn36xx_hal_host_msg_type { 93 /* Init/De-Init */ 94 WCN36XX_HAL_START_REQ = 0, 95 WCN36XX_HAL_START_RSP = 1, 96 WCN36XX_HAL_STOP_REQ = 2, 97 WCN36XX_HAL_STOP_RSP = 3, 98 99 /* Scan */ 100 WCN36XX_HAL_INIT_SCAN_REQ = 4, 101 WCN36XX_HAL_INIT_SCAN_RSP = 5, 102 WCN36XX_HAL_START_SCAN_REQ = 6, 103 WCN36XX_HAL_START_SCAN_RSP = 7, 104 WCN36XX_HAL_END_SCAN_REQ = 8, 105 WCN36XX_HAL_END_SCAN_RSP = 9, 106 WCN36XX_HAL_FINISH_SCAN_REQ = 10, 107 WCN36XX_HAL_FINISH_SCAN_RSP = 11, 108 109 /* HW STA configuration/deconfiguration */ 110 WCN36XX_HAL_CONFIG_STA_REQ = 12, 111 WCN36XX_HAL_CONFIG_STA_RSP = 13, 112 WCN36XX_HAL_DELETE_STA_REQ = 14, 113 WCN36XX_HAL_DELETE_STA_RSP = 15, 114 WCN36XX_HAL_CONFIG_BSS_REQ = 16, 115 WCN36XX_HAL_CONFIG_BSS_RSP = 17, 116 WCN36XX_HAL_DELETE_BSS_REQ = 18, 117 WCN36XX_HAL_DELETE_BSS_RSP = 19, 118 119 /* Infra STA asscoiation */ 120 WCN36XX_HAL_JOIN_REQ = 20, 121 WCN36XX_HAL_JOIN_RSP = 21, 122 WCN36XX_HAL_POST_ASSOC_REQ = 22, 123 WCN36XX_HAL_POST_ASSOC_RSP = 23, 124 125 /* Security */ 126 WCN36XX_HAL_SET_BSSKEY_REQ = 24, 127 WCN36XX_HAL_SET_BSSKEY_RSP = 25, 128 WCN36XX_HAL_SET_STAKEY_REQ = 26, 129 WCN36XX_HAL_SET_STAKEY_RSP = 27, 130 WCN36XX_HAL_RMV_BSSKEY_REQ = 28, 131 WCN36XX_HAL_RMV_BSSKEY_RSP = 29, 132 WCN36XX_HAL_RMV_STAKEY_REQ = 30, 133 WCN36XX_HAL_RMV_STAKEY_RSP = 31, 134 135 /* Qos Related */ 136 WCN36XX_HAL_ADD_TS_REQ = 32, 137 WCN36XX_HAL_ADD_TS_RSP = 33, 138 WCN36XX_HAL_DEL_TS_REQ = 34, 139 WCN36XX_HAL_DEL_TS_RSP = 35, 140 WCN36XX_HAL_UPD_EDCA_PARAMS_REQ = 36, 141 WCN36XX_HAL_UPD_EDCA_PARAMS_RSP = 37, 142 WCN36XX_HAL_ADD_BA_REQ = 38, 143 WCN36XX_HAL_ADD_BA_RSP = 39, 144 WCN36XX_HAL_DEL_BA_REQ = 40, 145 WCN36XX_HAL_DEL_BA_RSP = 41, 146 147 WCN36XX_HAL_CH_SWITCH_REQ = 42, 148 WCN36XX_HAL_CH_SWITCH_RSP = 43, 149 WCN36XX_HAL_SET_LINK_ST_REQ = 44, 150 WCN36XX_HAL_SET_LINK_ST_RSP = 45, 151 WCN36XX_HAL_GET_STATS_REQ = 46, 152 WCN36XX_HAL_GET_STATS_RSP = 47, 153 WCN36XX_HAL_UPDATE_CFG_REQ = 48, 154 WCN36XX_HAL_UPDATE_CFG_RSP = 49, 155 156 WCN36XX_HAL_MISSED_BEACON_IND = 50, 157 WCN36XX_HAL_UNKNOWN_ADDR2_FRAME_RX_IND = 51, 158 WCN36XX_HAL_MIC_FAILURE_IND = 52, 159 WCN36XX_HAL_FATAL_ERROR_IND = 53, 160 WCN36XX_HAL_SET_KEYDONE_MSG = 54, 161 162 /* NV Interface */ 163 WCN36XX_HAL_DOWNLOAD_NV_REQ = 55, 164 WCN36XX_HAL_DOWNLOAD_NV_RSP = 56, 165 166 WCN36XX_HAL_ADD_BA_SESSION_REQ = 57, 167 WCN36XX_HAL_ADD_BA_SESSION_RSP = 58, 168 WCN36XX_HAL_TRIGGER_BA_REQ = 59, 169 WCN36XX_HAL_TRIGGER_BA_RSP = 60, 170 WCN36XX_HAL_UPDATE_BEACON_REQ = 61, 171 WCN36XX_HAL_UPDATE_BEACON_RSP = 62, 172 WCN36XX_HAL_SEND_BEACON_REQ = 63, 173 WCN36XX_HAL_SEND_BEACON_RSP = 64, 174 175 WCN36XX_HAL_SET_BCASTKEY_REQ = 65, 176 WCN36XX_HAL_SET_BCASTKEY_RSP = 66, 177 WCN36XX_HAL_DELETE_STA_CONTEXT_IND = 67, 178 WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ = 68, 179 WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP = 69, 180 181 /* PTT interface support */ 182 WCN36XX_HAL_PROCESS_PTT_REQ = 70, 183 WCN36XX_HAL_PROCESS_PTT_RSP = 71, 184 185 /* BTAMP related events */ 186 WCN36XX_HAL_SIGNAL_BTAMP_EVENT_REQ = 72, 187 WCN36XX_HAL_SIGNAL_BTAMP_EVENT_RSP = 73, 188 WCN36XX_HAL_TL_HAL_FLUSH_AC_REQ = 74, 189 WCN36XX_HAL_TL_HAL_FLUSH_AC_RSP = 75, 190 191 WCN36XX_HAL_ENTER_IMPS_REQ = 76, 192 WCN36XX_HAL_EXIT_IMPS_REQ = 77, 193 WCN36XX_HAL_ENTER_BMPS_REQ = 78, 194 WCN36XX_HAL_EXIT_BMPS_REQ = 79, 195 WCN36XX_HAL_ENTER_UAPSD_REQ = 80, 196 WCN36XX_HAL_EXIT_UAPSD_REQ = 81, 197 WCN36XX_HAL_UPDATE_UAPSD_PARAM_REQ = 82, 198 WCN36XX_HAL_CONFIGURE_RXP_FILTER_REQ = 83, 199 WCN36XX_HAL_ADD_BCN_FILTER_REQ = 84, 200 WCN36XX_HAL_REM_BCN_FILTER_REQ = 85, 201 WCN36XX_HAL_ADD_WOWL_BCAST_PTRN = 86, 202 WCN36XX_HAL_DEL_WOWL_BCAST_PTRN = 87, 203 WCN36XX_HAL_ENTER_WOWL_REQ = 88, 204 WCN36XX_HAL_EXIT_WOWL_REQ = 89, 205 WCN36XX_HAL_HOST_OFFLOAD_REQ = 90, 206 WCN36XX_HAL_SET_RSSI_THRESH_REQ = 91, 207 WCN36XX_HAL_GET_RSSI_REQ = 92, 208 WCN36XX_HAL_SET_UAPSD_AC_PARAMS_REQ = 93, 209 WCN36XX_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ = 94, 210 211 WCN36XX_HAL_ENTER_IMPS_RSP = 95, 212 WCN36XX_HAL_EXIT_IMPS_RSP = 96, 213 WCN36XX_HAL_ENTER_BMPS_RSP = 97, 214 WCN36XX_HAL_EXIT_BMPS_RSP = 98, 215 WCN36XX_HAL_ENTER_UAPSD_RSP = 99, 216 WCN36XX_HAL_EXIT_UAPSD_RSP = 100, 217 WCN36XX_HAL_SET_UAPSD_AC_PARAMS_RSP = 101, 218 WCN36XX_HAL_UPDATE_UAPSD_PARAM_RSP = 102, 219 WCN36XX_HAL_CONFIGURE_RXP_FILTER_RSP = 103, 220 WCN36XX_HAL_ADD_BCN_FILTER_RSP = 104, 221 WCN36XX_HAL_REM_BCN_FILTER_RSP = 105, 222 WCN36XX_HAL_SET_RSSI_THRESH_RSP = 106, 223 WCN36XX_HAL_HOST_OFFLOAD_RSP = 107, 224 WCN36XX_HAL_ADD_WOWL_BCAST_PTRN_RSP = 108, 225 WCN36XX_HAL_DEL_WOWL_BCAST_PTRN_RSP = 109, 226 WCN36XX_HAL_ENTER_WOWL_RSP = 110, 227 WCN36XX_HAL_EXIT_WOWL_RSP = 111, 228 WCN36XX_HAL_RSSI_NOTIFICATION_IND = 112, 229 WCN36XX_HAL_GET_RSSI_RSP = 113, 230 WCN36XX_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP = 114, 231 232 /* 11k related events */ 233 WCN36XX_HAL_SET_MAX_TX_POWER_REQ = 115, 234 WCN36XX_HAL_SET_MAX_TX_POWER_RSP = 116, 235 236 /* 11R related msgs */ 237 WCN36XX_HAL_AGGR_ADD_TS_REQ = 117, 238 WCN36XX_HAL_AGGR_ADD_TS_RSP = 118, 239 240 /* P2P WLAN_FEATURE_P2P */ 241 WCN36XX_HAL_SET_P2P_GONOA_REQ = 119, 242 WCN36XX_HAL_SET_P2P_GONOA_RSP = 120, 243 244 /* WLAN Dump commands */ 245 WCN36XX_HAL_DUMP_COMMAND_REQ = 121, 246 WCN36XX_HAL_DUMP_COMMAND_RSP = 122, 247 248 /* OEM_DATA FEATURE SUPPORT */ 249 WCN36XX_HAL_START_OEM_DATA_REQ = 123, 250 WCN36XX_HAL_START_OEM_DATA_RSP = 124, 251 252 /* ADD SELF STA REQ and RSP */ 253 WCN36XX_HAL_ADD_STA_SELF_REQ = 125, 254 WCN36XX_HAL_ADD_STA_SELF_RSP = 126, 255 256 /* DEL SELF STA SUPPORT */ 257 WCN36XX_HAL_DEL_STA_SELF_REQ = 127, 258 WCN36XX_HAL_DEL_STA_SELF_RSP = 128, 259 260 /* Coex Indication */ 261 WCN36XX_HAL_COEX_IND = 129, 262 263 /* Tx Complete Indication */ 264 WCN36XX_HAL_OTA_TX_COMPL_IND = 130, 265 266 /* Host Suspend/resume messages */ 267 WCN36XX_HAL_HOST_SUSPEND_IND = 131, 268 WCN36XX_HAL_HOST_RESUME_REQ = 132, 269 WCN36XX_HAL_HOST_RESUME_RSP = 133, 270 271 WCN36XX_HAL_SET_TX_POWER_REQ = 134, 272 WCN36XX_HAL_SET_TX_POWER_RSP = 135, 273 WCN36XX_HAL_GET_TX_POWER_REQ = 136, 274 WCN36XX_HAL_GET_TX_POWER_RSP = 137, 275 276 WCN36XX_HAL_P2P_NOA_ATTR_IND = 138, 277 278 WCN36XX_HAL_ENABLE_RADAR_DETECT_REQ = 139, 279 WCN36XX_HAL_ENABLE_RADAR_DETECT_RSP = 140, 280 WCN36XX_HAL_GET_TPC_REPORT_REQ = 141, 281 WCN36XX_HAL_GET_TPC_REPORT_RSP = 142, 282 WCN36XX_HAL_RADAR_DETECT_IND = 143, 283 WCN36XX_HAL_RADAR_DETECT_INTR_IND = 144, 284 WCN36XX_HAL_KEEP_ALIVE_REQ = 145, 285 WCN36XX_HAL_KEEP_ALIVE_RSP = 146, 286 287 /* PNO messages */ 288 WCN36XX_HAL_SET_PREF_NETWORK_REQ = 147, 289 WCN36XX_HAL_SET_PREF_NETWORK_RSP = 148, 290 WCN36XX_HAL_SET_RSSI_FILTER_REQ = 149, 291 WCN36XX_HAL_SET_RSSI_FILTER_RSP = 150, 292 WCN36XX_HAL_UPDATE_SCAN_PARAM_REQ = 151, 293 WCN36XX_HAL_UPDATE_SCAN_PARAM_RSP = 152, 294 WCN36XX_HAL_PREF_NETW_FOUND_IND = 153, 295 296 WCN36XX_HAL_SET_TX_PER_TRACKING_REQ = 154, 297 WCN36XX_HAL_SET_TX_PER_TRACKING_RSP = 155, 298 WCN36XX_HAL_TX_PER_HIT_IND = 156, 299 300 WCN36XX_HAL_8023_MULTICAST_LIST_REQ = 157, 301 WCN36XX_HAL_8023_MULTICAST_LIST_RSP = 158, 302 303 WCN36XX_HAL_SET_PACKET_FILTER_REQ = 159, 304 WCN36XX_HAL_SET_PACKET_FILTER_RSP = 160, 305 WCN36XX_HAL_PACKET_FILTER_MATCH_COUNT_REQ = 161, 306 WCN36XX_HAL_PACKET_FILTER_MATCH_COUNT_RSP = 162, 307 WCN36XX_HAL_CLEAR_PACKET_FILTER_REQ = 163, 308 WCN36XX_HAL_CLEAR_PACKET_FILTER_RSP = 164, 309 310 /* 311 * This is temp fix. Should be removed once Host and Riva code is 312 * in sync. 313 */ 314 WCN36XX_HAL_INIT_SCAN_CON_REQ = 165, 315 316 WCN36XX_HAL_SET_POWER_PARAMS_REQ = 166, 317 WCN36XX_HAL_SET_POWER_PARAMS_RSP = 167, 318 319 WCN36XX_HAL_TSM_STATS_REQ = 168, 320 WCN36XX_HAL_TSM_STATS_RSP = 169, 321 322 /* wake reason indication (WOW) */ 323 WCN36XX_HAL_WAKE_REASON_IND = 170, 324 325 /* GTK offload support */ 326 WCN36XX_HAL_GTK_OFFLOAD_REQ = 171, 327 WCN36XX_HAL_GTK_OFFLOAD_RSP = 172, 328 WCN36XX_HAL_GTK_OFFLOAD_GETINFO_REQ = 173, 329 WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP = 174, 330 331 WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ = 175, 332 WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_RSP = 176, 333 WCN36XX_HAL_EXCLUDE_UNENCRYPTED_IND = 177, 334 335 WCN36XX_HAL_SET_THERMAL_MITIGATION_REQ = 178, 336 WCN36XX_HAL_SET_THERMAL_MITIGATION_RSP = 179, 337 338 WCN36XX_HAL_UPDATE_VHT_OP_MODE_REQ = 182, 339 WCN36XX_HAL_UPDATE_VHT_OP_MODE_RSP = 183, 340 341 WCN36XX_HAL_P2P_NOA_START_IND = 184, 342 343 WCN36XX_HAL_GET_ROAM_RSSI_REQ = 185, 344 WCN36XX_HAL_GET_ROAM_RSSI_RSP = 186, 345 346 WCN36XX_HAL_CLASS_B_STATS_IND = 187, 347 WCN36XX_HAL_DEL_BA_IND = 188, 348 WCN36XX_HAL_DHCP_START_IND = 189, 349 WCN36XX_HAL_DHCP_STOP_IND = 190, 350 351 /* Scan Offload(hw) APIs */ 352 WCN36XX_HAL_START_SCAN_OFFLOAD_REQ = 204, 353 WCN36XX_HAL_START_SCAN_OFFLOAD_RSP = 205, 354 WCN36XX_HAL_STOP_SCAN_OFFLOAD_REQ = 206, 355 WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP = 207, 356 WCN36XX_HAL_SCAN_OFFLOAD_IND = 210, 357 358 WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233, 359 360 WCN36XX_HAL_PRINT_REG_INFO_IND = 259, 361 362 WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE 363 }; 364 365 /* Enumeration for Version */ 366 enum wcn36xx_hal_host_msg_version { 367 WCN36XX_HAL_MSG_VERSION0 = 0, 368 WCN36XX_HAL_MSG_VERSION1 = 1, 369 /* define as 2 bytes data */ 370 WCN36XX_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, 371 WCN36XX_HAL_MSG_VERSION_MAX_FIELD = WCN36XX_HAL_MSG_WCNSS_CTRL_VERSION 372 }; 373 374 enum driver_type { 375 DRIVER_TYPE_PRODUCTION = 0, 376 DRIVER_TYPE_MFG = 1, 377 DRIVER_TYPE_DVT = 2, 378 DRIVER_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 379 }; 380 381 enum wcn36xx_hal_stop_type { 382 HAL_STOP_TYPE_SYS_RESET, 383 HAL_STOP_TYPE_SYS_DEEP_SLEEP, 384 HAL_STOP_TYPE_RF_KILL, 385 HAL_STOP_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 386 }; 387 388 enum wcn36xx_hal_sys_mode { 389 HAL_SYS_MODE_NORMAL, 390 HAL_SYS_MODE_LEARN, 391 HAL_SYS_MODE_SCAN, 392 HAL_SYS_MODE_PROMISC, 393 HAL_SYS_MODE_SUSPEND_LINK, 394 HAL_SYS_MODE_ROAM_SCAN, 395 HAL_SYS_MODE_ROAM_SUSPEND_LINK, 396 HAL_SYS_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 397 }; 398 399 enum phy_chan_bond_state { 400 /* 20MHz IF bandwidth centered on IF carrier */ 401 PHY_SINGLE_CHANNEL_CENTERED = 0, 402 403 /* 40MHz IF bandwidth with lower 20MHz supporting the primary channel */ 404 PHY_DOUBLE_CHANNEL_LOW_PRIMARY = 1, 405 406 /* 40MHz IF bandwidth centered on IF carrier */ 407 PHY_DOUBLE_CHANNEL_CENTERED = 2, 408 409 /* 40MHz IF bandwidth with higher 20MHz supporting the primary ch */ 410 PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3, 411 412 /* 20/40MHZ offset LOW 40/80MHZ offset CENTERED */ 413 PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED = 4, 414 415 /* 20/40MHZ offset CENTERED 40/80MHZ offset CENTERED */ 416 PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED = 5, 417 418 /* 20/40MHZ offset HIGH 40/80MHZ offset CENTERED */ 419 PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED = 6, 420 421 /* 20/40MHZ offset LOW 40/80MHZ offset LOW */ 422 PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW = 7, 423 424 /* 20/40MHZ offset HIGH 40/80MHZ offset LOW */ 425 PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW = 8, 426 427 /* 20/40MHZ offset LOW 40/80MHZ offset HIGH */ 428 PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH = 9, 429 430 /* 20/40MHZ offset-HIGH 40/80MHZ offset HIGH */ 431 PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH = 10, 432 433 PHY_CHANNEL_BONDING_STATE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 434 }; 435 436 /* Spatial Multiplexing(SM) Power Save mode */ 437 enum wcn36xx_hal_ht_mimo_state { 438 /* Static SM Power Save mode */ 439 WCN36XX_HAL_HT_MIMO_PS_STATIC = 0, 440 441 /* Dynamic SM Power Save mode */ 442 WCN36XX_HAL_HT_MIMO_PS_DYNAMIC = 1, 443 444 /* reserved */ 445 WCN36XX_HAL_HT_MIMO_PS_NA = 2, 446 447 /* SM Power Save disabled */ 448 WCN36XX_HAL_HT_MIMO_PS_NO_LIMIT = 3, 449 450 WCN36XX_HAL_HT_MIMO_PS_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 451 }; 452 453 /* each station added has a rate mode which specifies the sta attributes */ 454 enum sta_rate_mode { 455 STA_TAURUS = 0, 456 STA_TITAN, 457 STA_POLARIS, 458 STA_11b, 459 STA_11bg, 460 STA_11a, 461 STA_11n, 462 STA_11ac, 463 STA_INVALID_RATE_MODE = WCN36XX_HAL_MAX_ENUM_SIZE 464 }; 465 466 /* 1,2,5.5,11 */ 467 #define WCN36XX_HAL_NUM_DSSS_RATES 4 468 469 /* 6,9,12,18,24,36,48,54 */ 470 #define WCN36XX_HAL_NUM_OFDM_RATES 8 471 472 /* 72,96,108 */ 473 #define WCN36XX_HAL_NUM_POLARIS_RATES 3 474 475 #define WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET 16 476 477 enum wcn36xx_hal_bss_type { 478 WCN36XX_HAL_INFRASTRUCTURE_MODE, 479 480 /* Added for softAP support */ 481 WCN36XX_HAL_INFRA_AP_MODE, 482 483 WCN36XX_HAL_IBSS_MODE, 484 485 /* Added for BT-AMP support */ 486 WCN36XX_HAL_BTAMP_STA_MODE, 487 488 /* Added for BT-AMP support */ 489 WCN36XX_HAL_BTAMP_AP_MODE, 490 491 WCN36XX_HAL_AUTO_MODE, 492 493 WCN36XX_HAL_DONOT_USE_BSS_TYPE = WCN36XX_HAL_MAX_ENUM_SIZE 494 }; 495 496 enum wcn36xx_hal_nw_type { 497 WCN36XX_HAL_11A_NW_TYPE, 498 WCN36XX_HAL_11B_NW_TYPE, 499 WCN36XX_HAL_11G_NW_TYPE, 500 WCN36XX_HAL_11N_NW_TYPE, 501 WCN36XX_HAL_DONOT_USE_NW_TYPE = WCN36XX_HAL_MAX_ENUM_SIZE 502 }; 503 504 #define WCN36XX_HAL_MAC_RATESET_EID_MAX 12 505 506 enum wcn36xx_hal_ht_operating_mode { 507 /* No Protection */ 508 WCN36XX_HAL_HT_OP_MODE_PURE, 509 510 /* Overlap Legacy device present, protection is optional */ 511 WCN36XX_HAL_HT_OP_MODE_OVERLAP_LEGACY, 512 513 /* No legacy device, but 20 MHz HT present */ 514 WCN36XX_HAL_HT_OP_MODE_NO_LEGACY_20MHZ_HT, 515 516 /* Protection is required */ 517 WCN36XX_HAL_HT_OP_MODE_MIXED, 518 519 WCN36XX_HAL_HT_OP_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 520 }; 521 522 /* Encryption type enum used with peer */ 523 enum ani_ed_type { 524 WCN36XX_HAL_ED_NONE, 525 WCN36XX_HAL_ED_WEP40, 526 WCN36XX_HAL_ED_WEP104, 527 WCN36XX_HAL_ED_TKIP, 528 WCN36XX_HAL_ED_CCMP, 529 WCN36XX_HAL_ED_WPI, 530 WCN36XX_HAL_ED_AES_128_CMAC, 531 WCN36XX_HAL_ED_NOT_IMPLEMENTED = WCN36XX_HAL_MAX_ENUM_SIZE 532 }; 533 534 #define WLAN_MAX_KEY_RSC_LEN 16 535 #define WLAN_WAPI_KEY_RSC_LEN 16 536 537 /* MAX key length when ULA is used */ 538 #define WCN36XX_HAL_MAC_MAX_KEY_LENGTH 32 539 #define WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS 4 540 541 /* 542 * Enum to specify whether key is used for TX only, RX only or both. 543 */ 544 enum ani_key_direction { 545 WCN36XX_HAL_TX_ONLY, 546 WCN36XX_HAL_RX_ONLY, 547 WCN36XX_HAL_TX_RX, 548 WCN36XX_HAL_TX_DEFAULT, 549 WCN36XX_HAL_DONOT_USE_KEY_DIRECTION = WCN36XX_HAL_MAX_ENUM_SIZE 550 }; 551 552 enum ani_wep_type { 553 WCN36XX_HAL_WEP_STATIC, 554 WCN36XX_HAL_WEP_DYNAMIC, 555 WCN36XX_HAL_WEP_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 556 }; 557 558 enum wcn36xx_hal_link_state { 559 560 WCN36XX_HAL_LINK_IDLE_STATE = 0, 561 WCN36XX_HAL_LINK_PREASSOC_STATE = 1, 562 WCN36XX_HAL_LINK_POSTASSOC_STATE = 2, 563 WCN36XX_HAL_LINK_AP_STATE = 3, 564 WCN36XX_HAL_LINK_IBSS_STATE = 4, 565 566 /* BT-AMP Case */ 567 WCN36XX_HAL_LINK_BTAMP_PREASSOC_STATE = 5, 568 WCN36XX_HAL_LINK_BTAMP_POSTASSOC_STATE = 6, 569 WCN36XX_HAL_LINK_BTAMP_AP_STATE = 7, 570 WCN36XX_HAL_LINK_BTAMP_STA_STATE = 8, 571 572 /* Reserved for HAL Internal Use */ 573 WCN36XX_HAL_LINK_LEARN_STATE = 9, 574 WCN36XX_HAL_LINK_SCAN_STATE = 10, 575 WCN36XX_HAL_LINK_FINISH_SCAN_STATE = 11, 576 WCN36XX_HAL_LINK_INIT_CAL_STATE = 12, 577 WCN36XX_HAL_LINK_FINISH_CAL_STATE = 13, 578 WCN36XX_HAL_LINK_LISTEN_STATE = 14, 579 580 WCN36XX_HAL_LINK_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 581 }; 582 583 enum wcn36xx_hal_stats_mask { 584 HAL_SUMMARY_STATS_INFO = 0x00000001, 585 HAL_GLOBAL_CLASS_A_STATS_INFO = 0x00000002, 586 HAL_GLOBAL_CLASS_B_STATS_INFO = 0x00000004, 587 HAL_GLOBAL_CLASS_C_STATS_INFO = 0x00000008, 588 HAL_GLOBAL_CLASS_D_STATS_INFO = 0x00000010, 589 HAL_PER_STA_STATS_INFO = 0x00000020 590 }; 591 592 /* BT-AMP events type */ 593 enum bt_amp_event_type { 594 BTAMP_EVENT_CONNECTION_START, 595 BTAMP_EVENT_CONNECTION_STOP, 596 BTAMP_EVENT_CONNECTION_TERMINATED, 597 598 /* This and beyond are invalid values */ 599 BTAMP_EVENT_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE, 600 }; 601 602 /* PE Statistics */ 603 enum pe_stats_mask { 604 PE_SUMMARY_STATS_INFO = 0x00000001, 605 PE_GLOBAL_CLASS_A_STATS_INFO = 0x00000002, 606 PE_GLOBAL_CLASS_B_STATS_INFO = 0x00000004, 607 PE_GLOBAL_CLASS_C_STATS_INFO = 0x00000008, 608 PE_GLOBAL_CLASS_D_STATS_INFO = 0x00000010, 609 PE_PER_STA_STATS_INFO = 0x00000020, 610 611 /* This and beyond are invalid values */ 612 PE_STATS_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 613 }; 614 615 /* 616 * Configuration Parameter IDs 617 */ 618 #define WCN36XX_HAL_CFG_STA_ID 0 619 #define WCN36XX_HAL_CFG_CURRENT_TX_ANTENNA 1 620 #define WCN36XX_HAL_CFG_CURRENT_RX_ANTENNA 2 621 #define WCN36XX_HAL_CFG_LOW_GAIN_OVERRIDE 3 622 #define WCN36XX_HAL_CFG_POWER_STATE_PER_CHAIN 4 623 #define WCN36XX_HAL_CFG_CAL_PERIOD 5 624 #define WCN36XX_HAL_CFG_CAL_CONTROL 6 625 #define WCN36XX_HAL_CFG_PROXIMITY 7 626 #define WCN36XX_HAL_CFG_NETWORK_DENSITY 8 627 #define WCN36XX_HAL_CFG_MAX_MEDIUM_TIME 9 628 #define WCN36XX_HAL_CFG_MAX_MPDUS_IN_AMPDU 10 629 #define WCN36XX_HAL_CFG_RTS_THRESHOLD 11 630 #define WCN36XX_HAL_CFG_SHORT_RETRY_LIMIT 12 631 #define WCN36XX_HAL_CFG_LONG_RETRY_LIMIT 13 632 #define WCN36XX_HAL_CFG_FRAGMENTATION_THRESHOLD 14 633 #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_ZERO 15 634 #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_ONE 16 635 #define WCN36XX_HAL_CFG_DYNAMIC_THRESHOLD_TWO 17 636 #define WCN36XX_HAL_CFG_FIXED_RATE 18 637 #define WCN36XX_HAL_CFG_RETRYRATE_POLICY 19 638 #define WCN36XX_HAL_CFG_RETRYRATE_SECONDARY 20 639 #define WCN36XX_HAL_CFG_RETRYRATE_TERTIARY 21 640 #define WCN36XX_HAL_CFG_FORCE_POLICY_PROTECTION 22 641 #define WCN36XX_HAL_CFG_FIXED_RATE_MULTICAST_24GHZ 23 642 #define WCN36XX_HAL_CFG_FIXED_RATE_MULTICAST_5GHZ 24 643 #define WCN36XX_HAL_CFG_DEFAULT_RATE_INDEX_24GHZ 25 644 #define WCN36XX_HAL_CFG_DEFAULT_RATE_INDEX_5GHZ 26 645 #define WCN36XX_HAL_CFG_MAX_BA_SESSIONS 27 646 #define WCN36XX_HAL_CFG_PS_DATA_INACTIVITY_TIMEOUT 28 647 #define WCN36XX_HAL_CFG_PS_ENABLE_BCN_FILTER 29 648 #define WCN36XX_HAL_CFG_PS_ENABLE_RSSI_MONITOR 30 649 #define WCN36XX_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE 31 650 #define WCN36XX_HAL_CFG_STATS_PERIOD 32 651 #define WCN36XX_HAL_CFG_CFP_MAX_DURATION 33 652 #define WCN36XX_HAL_CFG_FRAME_TRANS_ENABLED 34 653 #define WCN36XX_HAL_CFG_DTIM_PERIOD 35 654 #define WCN36XX_HAL_CFG_EDCA_WMM_ACBK 36 655 #define WCN36XX_HAL_CFG_EDCA_WMM_ACBE 37 656 #define WCN36XX_HAL_CFG_EDCA_WMM_ACVO 38 657 #define WCN36XX_HAL_CFG_EDCA_WMM_ACVI 39 658 #define WCN36XX_HAL_CFG_BA_THRESHOLD_HIGH 40 659 #define WCN36XX_HAL_CFG_MAX_BA_BUFFERS 41 660 #define WCN36XX_HAL_CFG_RPE_POLLING_THRESHOLD 42 661 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC0_REG 43 662 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC1_REG 44 663 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC2_REG 45 664 #define WCN36XX_HAL_CFG_RPE_AGING_THRESHOLD_FOR_AC3_REG 46 665 #define WCN36XX_HAL_CFG_NO_OF_ONCHIP_REORDER_SESSIONS 47 666 #define WCN36XX_HAL_CFG_PS_LISTEN_INTERVAL 48 667 #define WCN36XX_HAL_CFG_PS_HEART_BEAT_THRESHOLD 49 668 #define WCN36XX_HAL_CFG_PS_NTH_BEACON_FILTER 50 669 #define WCN36XX_HAL_CFG_PS_MAX_PS_POLL 51 670 #define WCN36XX_HAL_CFG_PS_MIN_RSSI_THRESHOLD 52 671 #define WCN36XX_HAL_CFG_PS_RSSI_FILTER_PERIOD 53 672 #define WCN36XX_HAL_CFG_PS_BROADCAST_FRAME_FILTER_ENABLE 54 673 #define WCN36XX_HAL_CFG_PS_IGNORE_DTIM 55 674 #define WCN36XX_HAL_CFG_PS_ENABLE_BCN_EARLY_TERM 56 675 #define WCN36XX_HAL_CFG_DYNAMIC_PS_POLL_VALUE 57 676 #define WCN36XX_HAL_CFG_PS_NULLDATA_AP_RESP_TIMEOUT 58 677 #define WCN36XX_HAL_CFG_TELE_BCN_WAKEUP_EN 59 678 #define WCN36XX_HAL_CFG_TELE_BCN_TRANS_LI 60 679 #define WCN36XX_HAL_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS 61 680 #define WCN36XX_HAL_CFG_TELE_BCN_MAX_LI 62 681 #define WCN36XX_HAL_CFG_TELE_BCN_MAX_LI_IDLE_BCNS 63 682 #define WCN36XX_HAL_CFG_TX_PWR_CTRL_ENABLE 64 683 #define WCN36XX_HAL_CFG_VALID_RADAR_CHANNEL_LIST 65 684 #define WCN36XX_HAL_CFG_TX_POWER_24_20 66 685 #define WCN36XX_HAL_CFG_TX_POWER_24_40 67 686 #define WCN36XX_HAL_CFG_TX_POWER_50_20 68 687 #define WCN36XX_HAL_CFG_TX_POWER_50_40 69 688 #define WCN36XX_HAL_CFG_MCAST_BCAST_FILTER_SETTING 70 689 #define WCN36XX_HAL_CFG_BCN_EARLY_TERM_WAKEUP_INTERVAL 71 690 #define WCN36XX_HAL_CFG_MAX_TX_POWER_2_4 72 691 #define WCN36XX_HAL_CFG_MAX_TX_POWER_5 73 692 #define WCN36XX_HAL_CFG_INFRA_STA_KEEP_ALIVE_PERIOD 74 693 #define WCN36XX_HAL_CFG_ENABLE_CLOSE_LOOP 75 694 #define WCN36XX_HAL_CFG_BTC_EXECUTION_MODE 76 695 #define WCN36XX_HAL_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK 77 696 #define WCN36XX_HAL_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS 78 697 #define WCN36XX_HAL_CFG_PS_TX_INACTIVITY_TIMEOUT 79 698 #define WCN36XX_HAL_CFG_WCNSS_API_VERSION 80 699 #define WCN36XX_HAL_CFG_AP_KEEPALIVE_TIMEOUT 81 700 #define WCN36XX_HAL_CFG_GO_KEEPALIVE_TIMEOUT 82 701 #define WCN36XX_HAL_CFG_ENABLE_MC_ADDR_LIST 83 702 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_INQ_BT 84 703 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_PAGE_BT 85 704 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_CONN_BT 86 705 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_LE_BT 87 706 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_INQ_WLAN 88 707 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_PAGE_WLAN 89 708 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_CONN_WLAN 90 709 #define WCN36XX_HAL_CFG_BTC_STATIC_LEN_LE_WLAN 91 710 #define WCN36XX_HAL_CFG_BTC_DYN_MAX_LEN_BT 92 711 #define WCN36XX_HAL_CFG_BTC_DYN_MAX_LEN_WLAN 93 712 #define WCN36XX_HAL_CFG_BTC_MAX_SCO_BLOCK_PERC 94 713 #define WCN36XX_HAL_CFG_BTC_DHCP_PROT_ON_A2DP 95 714 #define WCN36XX_HAL_CFG_BTC_DHCP_PROT_ON_SCO 96 715 #define WCN36XX_HAL_CFG_ENABLE_UNICAST_FILTER 97 716 #define WCN36XX_HAL_CFG_MAX_ASSOC_LIMIT 98 717 #define WCN36XX_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION 99 718 #define WCN36XX_HAL_CFG_ENABLE_MCC_ADAPTIVE_SCHEDULER 100 719 #define WCN36XX_HAL_CFG_ENABLE_DETECT_PS_SUPPORT 101 720 #define WCN36XX_HAL_CFG_AP_LINK_MONITOR_TIMEOUT 102 721 #define WCN36XX_HAL_CFG_BTC_DWELL_TIME_MULTIPLIER 103 722 #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE 104 723 #define WCN36XX_HAL_CFG_MAX_PARAMS 105 724 725 /* Message definitons - All the messages below need to be packed */ 726 727 /* Definition for HAL API Version. */ 728 struct wcnss_wlan_version { 729 u8 revision; 730 u8 version; 731 u8 minor; 732 u8 major; 733 } __packed; 734 735 /* Definition for Encryption Keys */ 736 struct wcn36xx_hal_keys { 737 u8 id; 738 739 /* 0 for multicast */ 740 u8 unicast; 741 742 enum ani_key_direction direction; 743 744 /* Usage is unknown */ 745 u8 rsc[WLAN_MAX_KEY_RSC_LEN]; 746 747 /* =1 for authenticator,=0 for supplicant */ 748 u8 pae_role; 749 750 u16 length; 751 u8 key[WCN36XX_HAL_MAC_MAX_KEY_LENGTH]; 752 } __packed; 753 754 /* 755 * set_sta_key_params Moving here since it is shared by 756 * configbss/setstakey msgs 757 */ 758 struct wcn36xx_hal_set_sta_key_params { 759 /* STA Index */ 760 u16 sta_index; 761 762 /* Encryption Type used with peer */ 763 enum ani_ed_type enc_type; 764 765 /* STATIC/DYNAMIC - valid only for WEP */ 766 enum ani_wep_type wep_type; 767 768 /* Default WEP key, valid only for static WEP, must between 0 and 3. */ 769 u8 def_wep_idx; 770 771 /* valid only for non-static WEP encyrptions */ 772 struct wcn36xx_hal_keys key[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS]; 773 774 /* 775 * Control for Replay Count, 1= Single TID based replay count on Tx 776 * 0 = Per TID based replay count on TX 777 */ 778 u8 single_tid_rc; 779 780 } __packed; 781 782 /* 4-byte control message header used by HAL*/ 783 struct wcn36xx_hal_msg_header { 784 enum wcn36xx_hal_host_msg_type msg_type:16; 785 enum wcn36xx_hal_host_msg_version msg_version:16; 786 u32 len; 787 } __packed; 788 789 /* Config format required by HAL for each CFG item*/ 790 struct wcn36xx_hal_cfg { 791 /* Cfg Id. The Id required by HAL is exported by HAL 792 * in shared header file between UMAC and HAL.*/ 793 u16 id; 794 795 /* Length of the Cfg. This parameter is used to go to next cfg 796 * in the TLV format.*/ 797 u16 len; 798 799 /* Padding bytes for unaligned address's */ 800 u16 pad_bytes; 801 802 /* Reserve bytes for making cfgVal to align address */ 803 u16 reserve; 804 805 /* Following the uCfgLen field there should be a 'uCfgLen' bytes 806 * containing the uCfgValue ; u8 uCfgValue[uCfgLen] */ 807 } __packed; 808 809 struct wcn36xx_hal_mac_start_parameters { 810 /* Drive Type - Production or FTM etc */ 811 enum driver_type type; 812 813 /* Length of the config buffer */ 814 u32 len; 815 816 /* Following this there is a TLV formatted buffer of length 817 * "len" bytes containing all config values. 818 * The TLV is expected to be formatted like this: 819 * 0 15 31 31+CFG_LEN-1 length-1 820 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......| 821 */ 822 } __packed; 823 824 struct wcn36xx_hal_mac_start_req_msg { 825 /* config buffer must start in TLV format just here */ 826 struct wcn36xx_hal_msg_header header; 827 struct wcn36xx_hal_mac_start_parameters params; 828 } __packed; 829 830 struct wcn36xx_hal_mac_start_rsp_params { 831 /* success or failure */ 832 u16 status; 833 834 /* Max number of STA supported by the device */ 835 u8 stations; 836 837 /* Max number of BSS supported by the device */ 838 u8 bssids; 839 840 /* API Version */ 841 struct wcnss_wlan_version version; 842 843 /* CRM build information */ 844 u8 crm_version[WCN36XX_HAL_VERSION_LENGTH]; 845 846 /* hardware/chipset/misc version information */ 847 u8 wlan_version[WCN36XX_HAL_VERSION_LENGTH]; 848 849 } __packed; 850 851 struct wcn36xx_hal_mac_start_rsp_msg { 852 struct wcn36xx_hal_msg_header header; 853 struct wcn36xx_hal_mac_start_rsp_params start_rsp_params; 854 } __packed; 855 856 struct wcn36xx_hal_mac_stop_req_params { 857 /* The reason for which the device is being stopped */ 858 enum wcn36xx_hal_stop_type reason; 859 860 } __packed; 861 862 struct wcn36xx_hal_mac_stop_req_msg { 863 struct wcn36xx_hal_msg_header header; 864 struct wcn36xx_hal_mac_stop_req_params stop_req_params; 865 } __packed; 866 867 struct wcn36xx_hal_mac_stop_rsp_msg { 868 struct wcn36xx_hal_msg_header header; 869 870 /* success or failure */ 871 u32 status; 872 } __packed; 873 874 struct wcn36xx_hal_update_cfg_req_msg { 875 /* 876 * Note: The length specified in tHalUpdateCfgReqMsg messages should be 877 * header.msgLen = sizeof(tHalUpdateCfgReqMsg) + uConfigBufferLen 878 */ 879 struct wcn36xx_hal_msg_header header; 880 881 /* Length of the config buffer. Allows UMAC to update multiple CFGs */ 882 u32 len; 883 884 /* 885 * Following this there is a TLV formatted buffer of length 886 * "uConfigBufferLen" bytes containing all config values. 887 * The TLV is expected to be formatted like this: 888 * 0 15 31 31+CFG_LEN-1 length-1 889 * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......| 890 */ 891 892 } __packed; 893 894 struct wcn36xx_hal_update_cfg_rsp_msg { 895 struct wcn36xx_hal_msg_header header; 896 897 /* success or failure */ 898 u32 status; 899 900 } __packed; 901 902 /* Frame control field format (2 bytes) */ 903 struct wcn36xx_hal_mac_frame_ctl { 904 905 #ifndef ANI_LITTLE_BIT_ENDIAN 906 907 u8 subType:4; 908 u8 type:2; 909 u8 protVer:2; 910 911 u8 order:1; 912 u8 wep:1; 913 u8 moreData:1; 914 u8 powerMgmt:1; 915 u8 retry:1; 916 u8 moreFrag:1; 917 u8 fromDS:1; 918 u8 toDS:1; 919 920 #else 921 922 u8 protVer:2; 923 u8 type:2; 924 u8 subType:4; 925 926 u8 toDS:1; 927 u8 fromDS:1; 928 u8 moreFrag:1; 929 u8 retry:1; 930 u8 powerMgmt:1; 931 u8 moreData:1; 932 u8 wep:1; 933 u8 order:1; 934 935 #endif 936 937 }; 938 939 /* Sequence control field */ 940 struct wcn36xx_hal_mac_seq_ctl { 941 u8 fragNum:4; 942 u8 seqNumLo:4; 943 u8 seqNumHi:8; 944 }; 945 946 /* Management header format */ 947 struct wcn36xx_hal_mac_mgmt_hdr { 948 struct wcn36xx_hal_mac_frame_ctl fc; 949 u8 durationLo; 950 u8 durationHi; 951 u8 da[6]; 952 u8 sa[6]; 953 u8 bssId[6]; 954 struct wcn36xx_hal_mac_seq_ctl seqControl; 955 }; 956 957 /* FIXME: pronto v1 apparently has 4 */ 958 #define WCN36XX_HAL_NUM_BSSID 2 959 960 /* Scan Entry to hold active BSS idx's */ 961 struct wcn36xx_hal_scan_entry { 962 u8 bss_index[WCN36XX_HAL_NUM_BSSID]; 963 u8 active_bss_count; 964 }; 965 966 struct wcn36xx_hal_init_scan_req_msg { 967 struct wcn36xx_hal_msg_header header; 968 969 /* LEARN - AP Role 970 SCAN - STA Role */ 971 enum wcn36xx_hal_sys_mode mode; 972 973 /* BSSID of the BSS */ 974 u8 bssid[ETH_ALEN]; 975 976 /* Whether BSS needs to be notified */ 977 u8 notify; 978 979 /* Kind of frame to be used for notifying the BSS (Data Null, QoS 980 * Null, or CTS to Self). Must always be a valid frame type. */ 981 u8 frame_type; 982 983 /* UMAC has the option of passing the MAC frame to be used for 984 * notifying the BSS. If non-zero, HAL will use the MAC frame 985 * buffer pointed to by macMgmtHdr. If zero, HAL will generate the 986 * appropriate MAC frame based on frameType. */ 987 u8 frame_len; 988 989 /* Following the framelength there is a MAC frame buffer if 990 * frameLength is non-zero. */ 991 struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr; 992 993 /* Entry to hold number of active BSS idx's */ 994 struct wcn36xx_hal_scan_entry scan_entry; 995 }; 996 997 struct wcn36xx_hal_init_scan_con_req_msg { 998 struct wcn36xx_hal_msg_header header; 999 1000 /* LEARN - AP Role 1001 SCAN - STA Role */ 1002 enum wcn36xx_hal_sys_mode mode; 1003 1004 /* BSSID of the BSS */ 1005 u8 bssid[ETH_ALEN]; 1006 1007 /* Whether BSS needs to be notified */ 1008 u8 notify; 1009 1010 /* Kind of frame to be used for notifying the BSS (Data Null, QoS 1011 * Null, or CTS to Self). Must always be a valid frame type. */ 1012 u8 frame_type; 1013 1014 /* UMAC has the option of passing the MAC frame to be used for 1015 * notifying the BSS. If non-zero, HAL will use the MAC frame 1016 * buffer pointed to by macMgmtHdr. If zero, HAL will generate the 1017 * appropriate MAC frame based on frameType. */ 1018 u8 frame_length; 1019 1020 /* Following the framelength there is a MAC frame buffer if 1021 * frameLength is non-zero. */ 1022 struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr; 1023 1024 /* Entry to hold number of active BSS idx's */ 1025 struct wcn36xx_hal_scan_entry scan_entry; 1026 1027 /* Single NoA usage in Scanning */ 1028 u8 use_noa; 1029 1030 /* Indicates the scan duration (in ms) */ 1031 u16 scan_duration; 1032 1033 }; 1034 1035 struct wcn36xx_hal_init_scan_rsp_msg { 1036 struct wcn36xx_hal_msg_header header; 1037 1038 /* success or failure */ 1039 u32 status; 1040 1041 } __packed; 1042 1043 struct wcn36xx_hal_start_scan_req_msg { 1044 struct wcn36xx_hal_msg_header header; 1045 1046 /* Indicates the channel to scan */ 1047 u8 scan_channel; 1048 } __packed; 1049 1050 struct wcn36xx_hal_start_rsp_msg { 1051 struct wcn36xx_hal_msg_header header; 1052 1053 /* success or failure */ 1054 u32 status; 1055 1056 u32 start_tsf[2]; 1057 u8 tx_mgmt_power; 1058 1059 } __packed; 1060 1061 struct wcn36xx_hal_end_scan_req_msg { 1062 struct wcn36xx_hal_msg_header header; 1063 1064 /* Indicates the channel to stop scanning. Not used really. But 1065 * retained for symmetry with "start Scan" message. It can also 1066 * help in error check if needed. */ 1067 u8 scan_channel; 1068 } __packed; 1069 1070 struct wcn36xx_hal_end_scan_rsp_msg { 1071 struct wcn36xx_hal_msg_header header; 1072 1073 /* success or failure */ 1074 u32 status; 1075 } __packed; 1076 1077 struct wcn36xx_hal_finish_scan_req_msg { 1078 struct wcn36xx_hal_msg_header header; 1079 1080 /* Identifies the operational state of the AP/STA 1081 * LEARN - AP Role SCAN - STA Role */ 1082 enum wcn36xx_hal_sys_mode mode; 1083 1084 /* Operating channel to tune to. */ 1085 u8 oper_channel; 1086 1087 /* Channel Bonding state If 20/40 MHz is operational, this will 1088 * indicate the 40 MHz extension channel in combination with the 1089 * control channel */ 1090 enum phy_chan_bond_state cb_state; 1091 1092 /* BSSID of the BSS */ 1093 u8 bssid[ETH_ALEN]; 1094 1095 /* Whether BSS needs to be notified */ 1096 u8 notify; 1097 1098 /* Kind of frame to be used for notifying the BSS (Data Null, QoS 1099 * Null, or CTS to Self). Must always be a valid frame type. */ 1100 u8 frame_type; 1101 1102 /* UMAC has the option of passing the MAC frame to be used for 1103 * notifying the BSS. If non-zero, HAL will use the MAC frame 1104 * buffer pointed to by macMgmtHdr. If zero, HAL will generate the 1105 * appropriate MAC frame based on frameType. */ 1106 u8 frame_length; 1107 1108 /* Following the framelength there is a MAC frame buffer if 1109 * frameLength is non-zero. */ 1110 struct wcn36xx_hal_mac_mgmt_hdr mac_mgmt_hdr; 1111 1112 /* Entry to hold number of active BSS idx's */ 1113 struct wcn36xx_hal_scan_entry scan_entry; 1114 1115 } __packed; 1116 1117 struct wcn36xx_hal_finish_scan_rsp_msg { 1118 struct wcn36xx_hal_msg_header header; 1119 1120 /* success or failure */ 1121 u32 status; 1122 1123 } __packed; 1124 1125 enum wcn36xx_hal_scan_type { 1126 WCN36XX_HAL_SCAN_TYPE_PASSIVE = 0x00, 1127 WCN36XX_HAL_SCAN_TYPE_ACTIVE = WCN36XX_HAL_MAX_ENUM_SIZE 1128 }; 1129 1130 struct wcn36xx_hal_mac_ssid { 1131 u8 length; 1132 u8 ssid[32]; 1133 } __packed; 1134 1135 struct wcn36xx_hal_start_scan_offload_req_msg { 1136 struct wcn36xx_hal_msg_header header; 1137 1138 /* BSSIDs hot list */ 1139 u8 num_bssid; 1140 u8 bssids[4][ETH_ALEN]; 1141 1142 /* Directed probe-requests will be sent for listed SSIDs (max 10)*/ 1143 u8 num_ssid; 1144 struct wcn36xx_hal_mac_ssid ssids[10]; 1145 1146 /* Report AP with hidden ssid */ 1147 u8 scan_hidden; 1148 1149 /* Self MAC address */ 1150 u8 mac[ETH_ALEN]; 1151 1152 /* BSS type */ 1153 enum wcn36xx_hal_bss_type bss_type; 1154 1155 /* Scan type */ 1156 enum wcn36xx_hal_scan_type scan_type; 1157 1158 /* Minimum scanning time on each channel (ms) */ 1159 u32 min_ch_time; 1160 1161 /* Maximum scanning time on each channel */ 1162 u32 max_ch_time; 1163 1164 /* Is a p2p search */ 1165 u8 p2p_search; 1166 1167 /* Channels to scan */ 1168 u8 num_channel; 1169 u8 channels[80]; 1170 1171 /* IE field */ 1172 u16 ie_len; 1173 u8 ie[0]; 1174 } __packed; 1175 1176 struct wcn36xx_hal_start_scan_offload_rsp_msg { 1177 struct wcn36xx_hal_msg_header header; 1178 1179 /* success or failure */ 1180 u32 status; 1181 } __packed; 1182 1183 enum wcn36xx_hal_scan_offload_ind_type { 1184 /* Scan has been started */ 1185 WCN36XX_HAL_SCAN_IND_STARTED = 0x01, 1186 /* Scan has been completed */ 1187 WCN36XX_HAL_SCAN_IND_COMPLETED = 0x02, 1188 /* Moved to foreign channel */ 1189 WCN36XX_HAL_SCAN_IND_FOREIGN_CHANNEL = 0x08, 1190 /* scan request has been dequeued */ 1191 WCN36XX_HAL_SCAN_IND_DEQUEUED = 0x10, 1192 /* preempted by other high priority scan */ 1193 WCN36XX_HAL_SCAN_IND_PREEMPTED = 0x20, 1194 /* scan start failed */ 1195 WCN36XX_HAL_SCAN_IND_FAILED = 0x40, 1196 /*scan restarted */ 1197 WCN36XX_HAL_SCAN_IND_RESTARTED = 0x80, 1198 WCN36XX_HAL_SCAN_IND_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 1199 }; 1200 1201 struct wcn36xx_hal_scan_offload_ind { 1202 struct wcn36xx_hal_msg_header header; 1203 1204 u32 type; 1205 u32 channel_mhz; 1206 u32 scan_id; 1207 } __packed; 1208 1209 struct wcn36xx_hal_stop_scan_offload_req_msg { 1210 struct wcn36xx_hal_msg_header header; 1211 } __packed; 1212 1213 struct wcn36xx_hal_stop_scan_offload_rsp_msg { 1214 struct wcn36xx_hal_msg_header header; 1215 1216 /* success or failure */ 1217 u32 status; 1218 } __packed; 1219 1220 enum wcn36xx_hal_rate_index { 1221 HW_RATE_INDEX_1MBPS = 0x82, 1222 HW_RATE_INDEX_2MBPS = 0x84, 1223 HW_RATE_INDEX_5_5MBPS = 0x8B, 1224 HW_RATE_INDEX_6MBPS = 0x0C, 1225 HW_RATE_INDEX_9MBPS = 0x12, 1226 HW_RATE_INDEX_11MBPS = 0x96, 1227 HW_RATE_INDEX_12MBPS = 0x18, 1228 HW_RATE_INDEX_18MBPS = 0x24, 1229 HW_RATE_INDEX_24MBPS = 0x30, 1230 HW_RATE_INDEX_36MBPS = 0x48, 1231 HW_RATE_INDEX_48MBPS = 0x60, 1232 HW_RATE_INDEX_54MBPS = 0x6C 1233 }; 1234 1235 struct wcn36xx_hal_supported_rates { 1236 /* 1237 * For Self STA Entry: this represents Self Mode. 1238 * For Peer Stations, this represents the mode of the peer. 1239 * On Station: 1240 * 1241 * --this mode is updated when PE adds the Self Entry. 1242 * 1243 * -- OR when PE sends 'ADD_BSS' message and station context in BSS 1244 * is used to indicate the mode of the AP. 1245 * 1246 * ON AP: 1247 * 1248 * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry 1249 * for that BSS is used to indicate the self mode of the AP. 1250 * 1251 * -- OR when a station is associated, PE sends 'ADD_STA' message 1252 * with this mode updated. 1253 */ 1254 1255 enum sta_rate_mode op_rate_mode; 1256 1257 /* 11b, 11a and aniLegacyRates are IE rates which gives rate in 1258 * unit of 500Kbps */ 1259 u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES]; 1260 u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES]; 1261 u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES]; 1262 u16 reserved; 1263 1264 /* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be 1265 * supported) First 26 bits are reserved for those Titan rates and 1266 * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are 1267 * reserved. */ 1268 /* Titan and Taurus Rates */ 1269 u32 enhanced_rate_bitmap; 1270 1271 /* 1272 * 0-76 bits used, remaining reserved 1273 * bits 0-15 and 32 should be set. 1274 */ 1275 u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET]; 1276 1277 /* 1278 * RX Highest Supported Data Rate defines the highest data 1279 * rate that the STA is able to receive, in unites of 1Mbps. 1280 * This value is derived from "Supported MCS Set field" inside 1281 * the HT capability element. 1282 */ 1283 u16 rx_highest_data_rate; 1284 1285 } __packed; 1286 1287 struct wcn36xx_hal_config_sta_params { 1288 /* BSSID of STA */ 1289 u8 bssid[ETH_ALEN]; 1290 1291 /* ASSOC ID, as assigned by UMAC */ 1292 u16 aid; 1293 1294 /* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */ 1295 u8 type; 1296 1297 /* Short Preamble Supported. */ 1298 u8 short_preamble_supported; 1299 1300 /* MAC Address of STA */ 1301 u8 mac[ETH_ALEN]; 1302 1303 /* Listen interval of the STA */ 1304 u16 listen_interval; 1305 1306 /* Support for 11e/WMM */ 1307 u8 wmm_enabled; 1308 1309 /* 11n HT capable STA */ 1310 u8 ht_capable; 1311 1312 /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */ 1313 u8 tx_channel_width_set; 1314 1315 /* RIFS mode 0 - NA, 1 - Allowed */ 1316 u8 rifs_mode; 1317 1318 /* L-SIG TXOP Protection mechanism 1319 0 - No Support, 1 - Supported 1320 SG - there is global field */ 1321 u8 lsig_txop_protection; 1322 1323 /* Max Ampdu Size supported by STA. TPE programming. 1324 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */ 1325 u8 max_ampdu_size; 1326 1327 /* Max Ampdu density. Used by RA. 3 : 0~7 : 2^(11nAMPDUdensity -4) */ 1328 u8 max_ampdu_density; 1329 1330 /* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */ 1331 u8 max_amsdu_size; 1332 1333 /* Short GI support for 40Mhz packets */ 1334 u8 sgi_40mhz; 1335 1336 /* Short GI support for 20Mhz packets */ 1337 u8 sgi_20Mhz; 1338 1339 /* TODO move this parameter to the end for 3680 */ 1340 /* These rates are the intersection of peer and self capabilities. */ 1341 struct wcn36xx_hal_supported_rates supported_rates; 1342 1343 /* Robust Management Frame (RMF) enabled/disabled */ 1344 u8 rmf; 1345 1346 /* The unicast encryption type in the association */ 1347 u32 encrypt_type; 1348 1349 /* HAL should update the existing STA entry, if this flag is set. UMAC 1350 will set this flag in case of RE-ASSOC, where we want to reuse the 1351 old STA ID. 0 = Add, 1 = Update */ 1352 u8 action; 1353 1354 /* U-APSD Flags: 1b per AC. Encoded as follows: 1355 b7 b6 b5 b4 b3 b2 b1 b0 = 1356 X X X X BE BK VI VO */ 1357 u8 uapsd; 1358 1359 /* Max SP Length */ 1360 u8 max_sp_len; 1361 1362 /* 11n Green Field preamble support 1363 0 - Not supported, 1 - Supported */ 1364 u8 green_field_capable; 1365 1366 /* MIMO Power Save mode */ 1367 enum wcn36xx_hal_ht_mimo_state mimo_ps; 1368 1369 /* Delayed BA Support */ 1370 u8 delayed_ba_support; 1371 1372 /* Max AMPDU duration in 32us */ 1373 u8 max_ampdu_duration; 1374 1375 /* HT STA should set it to 1 if it is enabled in BSS. HT STA should 1376 * set it to 0 if AP does not support it. This indication is sent 1377 * to HAL and HAL uses this flag to pickup up appropriate 40Mhz 1378 * rates. */ 1379 u8 dsss_cck_mode_40mhz; 1380 1381 /* Valid STA Idx when action=Update. Set to 0xFF when invalid! 1382 * Retained for backward compalibity with existing HAL code */ 1383 u8 sta_index; 1384 1385 /* BSSID of BSS to which station is associated. Set to 0xFF when 1386 * invalid. Retained for backward compalibity with existing HAL 1387 * code */ 1388 u8 bssid_index; 1389 1390 u8 p2p; 1391 1392 /* TODO add this parameter for 3680. */ 1393 /* Reserved to align next field on a dword boundary */ 1394 /* u8 reserved; */ 1395 } __packed; 1396 1397 struct wcn36xx_hal_config_sta_req_msg { 1398 struct wcn36xx_hal_msg_header header; 1399 struct wcn36xx_hal_config_sta_params sta_params; 1400 } __packed; 1401 1402 struct wcn36xx_hal_config_sta_params_v1 { 1403 /* BSSID of STA */ 1404 u8 bssid[ETH_ALEN]; 1405 1406 /* ASSOC ID, as assigned by UMAC */ 1407 u16 aid; 1408 1409 /* STA entry Type: 0 - Self, 1 - Other/Peer, 2 - BSSID, 3 - BCAST */ 1410 u8 type; 1411 1412 /* Short Preamble Supported. */ 1413 u8 short_preamble_supported; 1414 1415 /* MAC Address of STA */ 1416 u8 mac[ETH_ALEN]; 1417 1418 /* Listen interval of the STA */ 1419 u16 listen_interval; 1420 1421 /* Support for 11e/WMM */ 1422 u8 wmm_enabled; 1423 1424 /* 11n HT capable STA */ 1425 u8 ht_capable; 1426 1427 /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */ 1428 u8 tx_channel_width_set; 1429 1430 /* RIFS mode 0 - NA, 1 - Allowed */ 1431 u8 rifs_mode; 1432 1433 /* L-SIG TXOP Protection mechanism 1434 0 - No Support, 1 - Supported 1435 SG - there is global field */ 1436 u8 lsig_txop_protection; 1437 1438 /* Max Ampdu Size supported by STA. TPE programming. 1439 0 : 8k , 1 : 16k, 2 : 32k, 3 : 64k */ 1440 u8 max_ampdu_size; 1441 1442 /* Max Ampdu density. Used by RA. 3 : 0~7 : 2^(11nAMPDUdensity -4) */ 1443 u8 max_ampdu_density; 1444 1445 /* Max AMSDU size 1 : 3839 bytes, 0 : 7935 bytes */ 1446 u8 max_amsdu_size; 1447 1448 /* Short GI support for 40Mhz packets */ 1449 u8 sgi_40mhz; 1450 1451 /* Short GI support for 20Mhz packets */ 1452 u8 sgi_20Mhz; 1453 1454 /* Robust Management Frame (RMF) enabled/disabled */ 1455 u8 rmf; 1456 1457 /* The unicast encryption type in the association */ 1458 u32 encrypt_type; 1459 1460 /* HAL should update the existing STA entry, if this flag is set. UMAC 1461 will set this flag in case of RE-ASSOC, where we want to reuse the 1462 old STA ID. 0 = Add, 1 = Update */ 1463 u8 action; 1464 1465 /* U-APSD Flags: 1b per AC. Encoded as follows: 1466 b7 b6 b5 b4 b3 b2 b1 b0 = 1467 X X X X BE BK VI VO */ 1468 u8 uapsd; 1469 1470 /* Max SP Length */ 1471 u8 max_sp_len; 1472 1473 /* 11n Green Field preamble support 1474 0 - Not supported, 1 - Supported */ 1475 u8 green_field_capable; 1476 1477 /* MIMO Power Save mode */ 1478 enum wcn36xx_hal_ht_mimo_state mimo_ps; 1479 1480 /* Delayed BA Support */ 1481 u8 delayed_ba_support; 1482 1483 /* Max AMPDU duration in 32us */ 1484 u8 max_ampdu_duration; 1485 1486 /* HT STA should set it to 1 if it is enabled in BSS. HT STA should 1487 * set it to 0 if AP does not support it. This indication is sent 1488 * to HAL and HAL uses this flag to pickup up appropriate 40Mhz 1489 * rates. */ 1490 u8 dsss_cck_mode_40mhz; 1491 1492 /* Valid STA Idx when action=Update. Set to 0xFF when invalid! 1493 * Retained for backward compalibity with existing HAL code */ 1494 u8 sta_index; 1495 1496 /* BSSID of BSS to which station is associated. Set to 0xFF when 1497 * invalid. Retained for backward compalibity with existing HAL 1498 * code */ 1499 u8 bssid_index; 1500 1501 u8 p2p; 1502 1503 /* Reserved to align next field on a dword boundary */ 1504 u8 reserved; 1505 1506 /* These rates are the intersection of peer and self capabilities. */ 1507 struct wcn36xx_hal_supported_rates supported_rates; 1508 } __packed; 1509 1510 struct wcn36xx_hal_config_sta_req_msg_v1 { 1511 struct wcn36xx_hal_msg_header header; 1512 struct wcn36xx_hal_config_sta_params_v1 sta_params; 1513 } __packed; 1514 1515 struct config_sta_rsp_params { 1516 /* success or failure */ 1517 u32 status; 1518 1519 /* Station index; valid only when 'status' field value SUCCESS */ 1520 u8 sta_index; 1521 1522 /* BSSID Index of BSS to which the station is associated */ 1523 u8 bssid_index; 1524 1525 /* DPU Index for PTK */ 1526 u8 dpu_index; 1527 1528 /* DPU Index for GTK */ 1529 u8 bcast_dpu_index; 1530 1531 /* DPU Index for IGTK */ 1532 u8 bcast_mgmt_dpu_idx; 1533 1534 /* PTK DPU signature */ 1535 u8 uc_ucast_sig; 1536 1537 /* GTK DPU isignature */ 1538 u8 uc_bcast_sig; 1539 1540 /* IGTK DPU signature */ 1541 u8 uc_mgmt_sig; 1542 1543 u8 p2p; 1544 1545 } __packed; 1546 1547 struct wcn36xx_hal_config_sta_rsp_msg { 1548 struct wcn36xx_hal_msg_header header; 1549 1550 struct config_sta_rsp_params params; 1551 } __packed; 1552 1553 /* Delete STA Request message */ 1554 struct wcn36xx_hal_delete_sta_req_msg { 1555 struct wcn36xx_hal_msg_header header; 1556 1557 /* Index of STA to delete */ 1558 u8 sta_index; 1559 1560 } __packed; 1561 1562 /* Delete STA Response message */ 1563 struct wcn36xx_hal_delete_sta_rsp_msg { 1564 struct wcn36xx_hal_msg_header header; 1565 1566 /* success or failure */ 1567 u32 status; 1568 1569 /* Index of STA deleted */ 1570 u8 sta_id; 1571 } __packed; 1572 1573 /* 12 Bytes long because this structure can be used to represent rate and 1574 * extended rate set IEs. The parser assume this to be at least 12 */ 1575 struct wcn36xx_hal_rate_set { 1576 u8 num_rates; 1577 u8 rate[WCN36XX_HAL_MAC_RATESET_EID_MAX]; 1578 } __packed; 1579 1580 /* access category record */ 1581 struct wcn36xx_hal_aci_aifsn { 1582 #ifndef ANI_LITTLE_BIT_ENDIAN 1583 u8 rsvd:1; 1584 u8 aci:2; 1585 u8 acm:1; 1586 u8 aifsn:4; 1587 #else 1588 u8 aifsn:4; 1589 u8 acm:1; 1590 u8 aci:2; 1591 u8 rsvd:1; 1592 #endif 1593 } __packed; 1594 1595 /* contention window size */ 1596 struct wcn36xx_hal_mac_cw { 1597 #ifndef ANI_LITTLE_BIT_ENDIAN 1598 u8 max:4; 1599 u8 min:4; 1600 #else 1601 u8 min:4; 1602 u8 max:4; 1603 #endif 1604 } __packed; 1605 1606 struct wcn36xx_hal_edca_param_record { 1607 struct wcn36xx_hal_aci_aifsn aci; 1608 struct wcn36xx_hal_mac_cw cw; 1609 u16 txop_limit; 1610 } __packed; 1611 1612 /* Concurrency role. These are generic IDs that identify the various roles 1613 * in the software system. */ 1614 enum wcn36xx_hal_con_mode { 1615 WCN36XX_HAL_STA_MODE = 0, 1616 1617 /* to support softAp mode . This is misleading. 1618 It means AP MODE only. */ 1619 WCN36XX_HAL_STA_SAP_MODE = 1, 1620 1621 WCN36XX_HAL_P2P_CLIENT_MODE, 1622 WCN36XX_HAL_P2P_GO_MODE, 1623 WCN36XX_HAL_MONITOR_MODE, 1624 }; 1625 1626 /* This is a bit pattern to be set for each mode 1627 * bit 0 - sta mode 1628 * bit 1 - ap mode 1629 * bit 2 - p2p client mode 1630 * bit 3 - p2p go mode */ 1631 enum wcn36xx_hal_concurrency_mode { 1632 HAL_STA = 1, 1633 HAL_SAP = 2, 1634 1635 /* to support sta, softAp mode . This means STA+AP mode */ 1636 HAL_STA_SAP = 3, 1637 1638 HAL_P2P_CLIENT = 4, 1639 HAL_P2P_GO = 8, 1640 HAL_MAX_CONCURRENCY_PERSONA = 4 1641 }; 1642 1643 struct wcn36xx_hal_config_bss_params { 1644 /* BSSID */ 1645 u8 bssid[ETH_ALEN]; 1646 1647 /* Self Mac Address */ 1648 u8 self_mac_addr[ETH_ALEN]; 1649 1650 /* BSS type */ 1651 enum wcn36xx_hal_bss_type bss_type; 1652 1653 /* Operational Mode: AP =0, STA = 1 */ 1654 u8 oper_mode; 1655 1656 /* Network Type */ 1657 enum wcn36xx_hal_nw_type nw_type; 1658 1659 /* Used to classify PURE_11G/11G_MIXED to program MTU */ 1660 u8 short_slot_time_supported; 1661 1662 /* Co-exist with 11a STA */ 1663 u8 lla_coexist; 1664 1665 /* Co-exist with 11b STA */ 1666 u8 llb_coexist; 1667 1668 /* Co-exist with 11g STA */ 1669 u8 llg_coexist; 1670 1671 /* Coexistence with 11n STA */ 1672 u8 ht20_coexist; 1673 1674 /* Non GF coexist flag */ 1675 u8 lln_non_gf_coexist; 1676 1677 /* TXOP protection support */ 1678 u8 lsig_tx_op_protection_full_support; 1679 1680 /* RIFS mode */ 1681 u8 rifs_mode; 1682 1683 /* Beacon Interval in TU */ 1684 u16 beacon_interval; 1685 1686 /* DTIM period */ 1687 u8 dtim_period; 1688 1689 /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */ 1690 u8 tx_channel_width_set; 1691 1692 /* Operating channel */ 1693 u8 oper_channel; 1694 1695 /* Extension channel for channel bonding */ 1696 u8 ext_channel; 1697 1698 /* Reserved to align next field on a dword boundary */ 1699 u8 reserved; 1700 1701 /* TODO move sta to the end for 3680 */ 1702 /* Context of the station being added in HW 1703 * Add a STA entry for "itself" - 1704 * 1705 * On AP - Add the AP itself in an "STA context" 1706 * 1707 * On STA - Add the AP to which this STA is joining in an 1708 * "STA context" 1709 */ 1710 struct wcn36xx_hal_config_sta_params sta; 1711 /* SSID of the BSS */ 1712 struct wcn36xx_hal_mac_ssid ssid; 1713 1714 /* HAL should update the existing BSS entry, if this flag is set. 1715 * UMAC will set this flag in case of reassoc, where we want to 1716 * resue the the old BSSID and still return success 0 = Add, 1 = 1717 * Update */ 1718 u8 action; 1719 1720 /* MAC Rate Set */ 1721 struct wcn36xx_hal_rate_set rateset; 1722 1723 /* Enable/Disable HT capabilities of the BSS */ 1724 u8 ht; 1725 1726 /* Enable/Disable OBSS protection */ 1727 u8 obss_prot_enabled; 1728 1729 /* RMF enabled/disabled */ 1730 u8 rmf; 1731 1732 /* HT Operating Mode operating mode of the 802.11n STA */ 1733 enum wcn36xx_hal_ht_operating_mode ht_oper_mode; 1734 1735 /* Dual CTS Protection: 0 - Unused, 1 - Used */ 1736 u8 dual_cts_protection; 1737 1738 /* Probe Response Max retries */ 1739 u8 max_probe_resp_retry_limit; 1740 1741 /* To Enable Hidden ssid */ 1742 u8 hidden_ssid; 1743 1744 /* To Enable Disable FW Proxy Probe Resp */ 1745 u8 proxy_probe_resp; 1746 1747 /* Boolean to indicate if EDCA params are valid. UMAC might not 1748 * have valid EDCA params or might not desire to apply EDCA params 1749 * during config BSS. 0 implies Not Valid ; Non-Zero implies 1750 * valid */ 1751 u8 edca_params_valid; 1752 1753 /* EDCA Parameters for Best Effort Access Category */ 1754 struct wcn36xx_hal_edca_param_record acbe; 1755 1756 /* EDCA Parameters forBackground Access Category */ 1757 struct wcn36xx_hal_edca_param_record acbk; 1758 1759 /* EDCA Parameters for Video Access Category */ 1760 struct wcn36xx_hal_edca_param_record acvi; 1761 1762 /* EDCA Parameters for Voice Access Category */ 1763 struct wcn36xx_hal_edca_param_record acvo; 1764 1765 /* Ext Bss Config Msg if set */ 1766 u8 ext_set_sta_key_param_valid; 1767 1768 /* SetStaKeyParams for ext bss msg */ 1769 struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param; 1770 1771 /* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum 1772 * wcn36xx_hal_con_mode */ 1773 u8 wcn36xx_hal_persona; 1774 1775 u8 spectrum_mgt_enable; 1776 1777 /* HAL fills in the tx power used for mgmt frames in txMgmtPower */ 1778 s8 tx_mgmt_power; 1779 1780 /* maxTxPower has max power to be used after applying the power 1781 * constraint if any */ 1782 s8 max_tx_power; 1783 } __packed; 1784 1785 struct wcn36xx_hal_config_bss_req_msg { 1786 struct wcn36xx_hal_msg_header header; 1787 struct wcn36xx_hal_config_bss_params bss_params; 1788 } __packed; 1789 1790 struct wcn36xx_hal_config_bss_params_v1 { 1791 /* BSSID */ 1792 u8 bssid[ETH_ALEN]; 1793 1794 /* Self Mac Address */ 1795 u8 self_mac_addr[ETH_ALEN]; 1796 1797 /* BSS type */ 1798 enum wcn36xx_hal_bss_type bss_type; 1799 1800 /* Operational Mode: AP =0, STA = 1 */ 1801 u8 oper_mode; 1802 1803 /* Network Type */ 1804 enum wcn36xx_hal_nw_type nw_type; 1805 1806 /* Used to classify PURE_11G/11G_MIXED to program MTU */ 1807 u8 short_slot_time_supported; 1808 1809 /* Co-exist with 11a STA */ 1810 u8 lla_coexist; 1811 1812 /* Co-exist with 11b STA */ 1813 u8 llb_coexist; 1814 1815 /* Co-exist with 11g STA */ 1816 u8 llg_coexist; 1817 1818 /* Coexistence with 11n STA */ 1819 u8 ht20_coexist; 1820 1821 /* Non GF coexist flag */ 1822 u8 lln_non_gf_coexist; 1823 1824 /* TXOP protection support */ 1825 u8 lsig_tx_op_protection_full_support; 1826 1827 /* RIFS mode */ 1828 u8 rifs_mode; 1829 1830 /* Beacon Interval in TU */ 1831 u16 beacon_interval; 1832 1833 /* DTIM period */ 1834 u8 dtim_period; 1835 1836 /* TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz */ 1837 u8 tx_channel_width_set; 1838 1839 /* Operating channel */ 1840 u8 oper_channel; 1841 1842 /* Extension channel for channel bonding */ 1843 u8 ext_channel; 1844 1845 /* Reserved to align next field on a dword boundary */ 1846 u8 reserved; 1847 1848 /* SSID of the BSS */ 1849 struct wcn36xx_hal_mac_ssid ssid; 1850 1851 /* HAL should update the existing BSS entry, if this flag is set. 1852 * UMAC will set this flag in case of reassoc, where we want to 1853 * resue the the old BSSID and still return success 0 = Add, 1 = 1854 * Update */ 1855 u8 action; 1856 1857 /* MAC Rate Set */ 1858 struct wcn36xx_hal_rate_set rateset; 1859 1860 /* Enable/Disable HT capabilities of the BSS */ 1861 u8 ht; 1862 1863 /* Enable/Disable OBSS protection */ 1864 u8 obss_prot_enabled; 1865 1866 /* RMF enabled/disabled */ 1867 u8 rmf; 1868 1869 /* HT Operating Mode operating mode of the 802.11n STA */ 1870 enum wcn36xx_hal_ht_operating_mode ht_oper_mode; 1871 1872 /* Dual CTS Protection: 0 - Unused, 1 - Used */ 1873 u8 dual_cts_protection; 1874 1875 /* Probe Response Max retries */ 1876 u8 max_probe_resp_retry_limit; 1877 1878 /* To Enable Hidden ssid */ 1879 u8 hidden_ssid; 1880 1881 /* To Enable Disable FW Proxy Probe Resp */ 1882 u8 proxy_probe_resp; 1883 1884 /* Boolean to indicate if EDCA params are valid. UMAC might not 1885 * have valid EDCA params or might not desire to apply EDCA params 1886 * during config BSS. 0 implies Not Valid ; Non-Zero implies 1887 * valid */ 1888 u8 edca_params_valid; 1889 1890 /* EDCA Parameters for Best Effort Access Category */ 1891 struct wcn36xx_hal_edca_param_record acbe; 1892 1893 /* EDCA Parameters forBackground Access Category */ 1894 struct wcn36xx_hal_edca_param_record acbk; 1895 1896 /* EDCA Parameters for Video Access Category */ 1897 struct wcn36xx_hal_edca_param_record acvi; 1898 1899 /* EDCA Parameters for Voice Access Category */ 1900 struct wcn36xx_hal_edca_param_record acvo; 1901 1902 /* Ext Bss Config Msg if set */ 1903 u8 ext_set_sta_key_param_valid; 1904 1905 /* SetStaKeyParams for ext bss msg */ 1906 struct wcn36xx_hal_set_sta_key_params ext_set_sta_key_param; 1907 1908 /* Persona for the BSS can be STA,AP,GO,CLIENT value same as enum 1909 * wcn36xx_hal_con_mode */ 1910 u8 wcn36xx_hal_persona; 1911 1912 u8 spectrum_mgt_enable; 1913 1914 /* HAL fills in the tx power used for mgmt frames in txMgmtPower */ 1915 s8 tx_mgmt_power; 1916 1917 /* maxTxPower has max power to be used after applying the power 1918 * constraint if any */ 1919 s8 max_tx_power; 1920 1921 /* Context of the station being added in HW 1922 * Add a STA entry for "itself" - 1923 * 1924 * On AP - Add the AP itself in an "STA context" 1925 * 1926 * On STA - Add the AP to which this STA is joining in an 1927 * "STA context" 1928 */ 1929 struct wcn36xx_hal_config_sta_params_v1 sta; 1930 } __packed; 1931 1932 struct wcn36xx_hal_config_bss_req_msg_v1 { 1933 struct wcn36xx_hal_msg_header header; 1934 struct wcn36xx_hal_config_bss_params_v1 bss_params; 1935 } __packed; 1936 1937 struct wcn36xx_hal_config_bss_rsp_params { 1938 /* Success or Failure */ 1939 u32 status; 1940 1941 /* BSS index allocated by HAL */ 1942 u8 bss_index; 1943 1944 /* DPU descriptor index for PTK */ 1945 u8 dpu_desc_index; 1946 1947 /* PTK DPU signature */ 1948 u8 ucast_dpu_signature; 1949 1950 /* DPU descriptor index for GTK */ 1951 u8 bcast_dpu_desc_indx; 1952 1953 /* GTK DPU signature */ 1954 u8 bcast_dpu_signature; 1955 1956 /* DPU descriptor for IGTK */ 1957 u8 mgmt_dpu_desc_index; 1958 1959 /* IGTK DPU signature */ 1960 u8 mgmt_dpu_signature; 1961 1962 /* Station Index for BSS entry */ 1963 u8 bss_sta_index; 1964 1965 /* Self station index for this BSS */ 1966 u8 bss_self_sta_index; 1967 1968 /* Bcast station for buffering bcast frames in AP role */ 1969 u8 bss_bcast_sta_idx; 1970 1971 /* MAC Address of STA(PEER/SELF) in staContext of configBSSReq */ 1972 u8 mac[ETH_ALEN]; 1973 1974 /* HAL fills in the tx power used for mgmt frames in this field. */ 1975 s8 tx_mgmt_power; 1976 1977 } __packed; 1978 1979 struct wcn36xx_hal_config_bss_rsp_msg { 1980 struct wcn36xx_hal_msg_header header; 1981 struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params; 1982 } __packed; 1983 1984 struct wcn36xx_hal_delete_bss_req_msg { 1985 struct wcn36xx_hal_msg_header header; 1986 1987 /* BSS index to be deleted */ 1988 u8 bss_index; 1989 1990 } __packed; 1991 1992 struct wcn36xx_hal_delete_bss_rsp_msg { 1993 struct wcn36xx_hal_msg_header header; 1994 1995 /* Success or Failure */ 1996 u32 status; 1997 1998 /* BSS index that has been deleted */ 1999 u8 bss_index; 2000 2001 } __packed; 2002 2003 struct wcn36xx_hal_join_req_msg { 2004 struct wcn36xx_hal_msg_header header; 2005 2006 /* Indicates the BSSID to which STA is going to associate */ 2007 u8 bssid[ETH_ALEN]; 2008 2009 /* Indicates the channel to switch to. */ 2010 u8 channel; 2011 2012 /* Self STA MAC */ 2013 u8 self_sta_mac_addr[ETH_ALEN]; 2014 2015 /* Local power constraint */ 2016 u8 local_power_constraint; 2017 2018 /* Secondary channel offset */ 2019 enum phy_chan_bond_state secondary_channel_offset; 2020 2021 /* link State */ 2022 enum wcn36xx_hal_link_state link_state; 2023 2024 /* Max TX power */ 2025 s8 max_tx_power; 2026 } __packed; 2027 2028 struct wcn36xx_hal_join_rsp_msg { 2029 struct wcn36xx_hal_msg_header header; 2030 2031 /* success or failure */ 2032 u32 status; 2033 2034 /* HAL fills in the tx power used for mgmt frames in this field */ 2035 u8 tx_mgmt_power; 2036 } __packed; 2037 2038 struct post_assoc_req_msg { 2039 struct wcn36xx_hal_msg_header header; 2040 2041 struct wcn36xx_hal_config_sta_params sta_params; 2042 struct wcn36xx_hal_config_bss_params bss_params; 2043 }; 2044 2045 struct post_assoc_rsp_msg { 2046 struct wcn36xx_hal_msg_header header; 2047 struct config_sta_rsp_params sta_rsp_params; 2048 struct wcn36xx_hal_config_bss_rsp_params bss_rsp_params; 2049 }; 2050 2051 /* This is used to create a set of WEP keys for a given BSS. */ 2052 struct wcn36xx_hal_set_bss_key_req_msg { 2053 struct wcn36xx_hal_msg_header header; 2054 2055 /* BSS Index of the BSS */ 2056 u8 bss_idx; 2057 2058 /* Encryption Type used with peer */ 2059 enum ani_ed_type enc_type; 2060 2061 /* Number of keys */ 2062 u8 num_keys; 2063 2064 /* Array of keys. */ 2065 struct wcn36xx_hal_keys keys[WCN36XX_HAL_MAC_MAX_NUM_OF_DEFAULT_KEYS]; 2066 2067 /* Control for Replay Count, 1= Single TID based replay count on Tx 2068 * 0 = Per TID based replay count on TX */ 2069 u8 single_tid_rc; 2070 } __packed; 2071 2072 /* tagged version of set bss key */ 2073 struct wcn36xx_hal_set_bss_key_req_msg_tagged { 2074 struct wcn36xx_hal_set_bss_key_req_msg Msg; 2075 u32 tag; 2076 } __packed; 2077 2078 struct wcn36xx_hal_set_bss_key_rsp_msg { 2079 struct wcn36xx_hal_msg_header header; 2080 2081 /* success or failure */ 2082 u32 status; 2083 } __packed; 2084 2085 /* 2086 * This is used configure the key information on a given station. 2087 * When the sec_type is WEP40 or WEP104, the def_wep_idx is used to locate 2088 * a preconfigured key from a BSS the station assoicated with; otherwise 2089 * a new key descriptor is created based on the key field. 2090 */ 2091 struct wcn36xx_hal_set_sta_key_req_msg { 2092 struct wcn36xx_hal_msg_header header; 2093 struct wcn36xx_hal_set_sta_key_params set_sta_key_params; 2094 } __packed; 2095 2096 struct wcn36xx_hal_set_sta_key_rsp_msg { 2097 struct wcn36xx_hal_msg_header header; 2098 2099 /* success or failure */ 2100 u32 status; 2101 } __packed; 2102 2103 struct wcn36xx_hal_remove_bss_key_req_msg { 2104 struct wcn36xx_hal_msg_header header; 2105 2106 /* BSS Index of the BSS */ 2107 u8 bss_idx; 2108 2109 /* Encryption Type used with peer */ 2110 enum ani_ed_type enc_type; 2111 2112 /* Key Id */ 2113 u8 key_id; 2114 2115 /* STATIC/DYNAMIC. Used in Nullifying in Key Descriptors for 2116 * Static/Dynamic keys */ 2117 enum ani_wep_type wep_type; 2118 } __packed; 2119 2120 struct wcn36xx_hal_remove_bss_key_rsp_msg { 2121 struct wcn36xx_hal_msg_header header; 2122 2123 /* success or failure */ 2124 u32 status; 2125 } __packed; 2126 2127 /* 2128 * This is used by PE to Remove the key information on a given station. 2129 */ 2130 struct wcn36xx_hal_remove_sta_key_req_msg { 2131 struct wcn36xx_hal_msg_header header; 2132 2133 /* STA Index */ 2134 u16 sta_idx; 2135 2136 /* Encryption Type used with peer */ 2137 enum ani_ed_type enc_type; 2138 2139 /* Key Id */ 2140 u8 key_id; 2141 2142 /* Whether to invalidate the Broadcast key or Unicast key. In case 2143 * of WEP, the same key is used for both broadcast and unicast. */ 2144 u8 unicast; 2145 2146 } __packed; 2147 2148 struct wcn36xx_hal_remove_sta_key_rsp_msg { 2149 struct wcn36xx_hal_msg_header header; 2150 2151 /*success or failure */ 2152 u32 status; 2153 2154 } __packed; 2155 2156 #ifdef FEATURE_OEM_DATA_SUPPORT 2157 2158 #ifndef OEM_DATA_REQ_SIZE 2159 #define OEM_DATA_REQ_SIZE 134 2160 #endif 2161 2162 #ifndef OEM_DATA_RSP_SIZE 2163 #define OEM_DATA_RSP_SIZE 1968 2164 #endif 2165 2166 struct start_oem_data_req_msg { 2167 struct wcn36xx_hal_msg_header header; 2168 2169 u32 status; 2170 tSirMacAddr self_mac_addr; 2171 u8 oem_data_req[OEM_DATA_REQ_SIZE]; 2172 2173 }; 2174 2175 struct start_oem_data_rsp_msg { 2176 struct wcn36xx_hal_msg_header header; 2177 2178 u8 oem_data_rsp[OEM_DATA_RSP_SIZE]; 2179 }; 2180 2181 #endif 2182 2183 struct wcn36xx_hal_switch_channel_req_msg { 2184 struct wcn36xx_hal_msg_header header; 2185 2186 /* Channel number */ 2187 u8 channel_number; 2188 2189 /* Local power constraint */ 2190 u8 local_power_constraint; 2191 2192 /* Secondary channel offset */ 2193 enum phy_chan_bond_state secondary_channel_offset; 2194 2195 /* HAL fills in the tx power used for mgmt frames in this field. */ 2196 u8 tx_mgmt_power; 2197 2198 /* Max TX power */ 2199 u8 max_tx_power; 2200 2201 /* Self STA MAC */ 2202 u8 self_sta_mac_addr[ETH_ALEN]; 2203 2204 /* VO WIFI comment: BSSID needed to identify session. As the 2205 * request has power constraints, this should be applied only to 2206 * that session Since MTU timing and EDCA are sessionized, this 2207 * struct needs to be sessionized and bssid needs to be out of the 2208 * VOWifi feature flag V IMP: Keep bssId field at the end of this 2209 * msg. It is used to mantain backward compatbility by way of 2210 * ignoring if using new host/old FW or old host/new FW since it is 2211 * at the end of this struct 2212 */ 2213 u8 bssid[ETH_ALEN]; 2214 } __packed; 2215 2216 struct wcn36xx_hal_switch_channel_rsp_msg { 2217 struct wcn36xx_hal_msg_header header; 2218 2219 /* Status */ 2220 u32 status; 2221 2222 /* Channel number - same as in request */ 2223 u8 channel_number; 2224 2225 /* HAL fills in the tx power used for mgmt frames in this field */ 2226 u8 tx_mgmt_power; 2227 2228 /* BSSID needed to identify session - same as in request */ 2229 u8 bssid[ETH_ALEN]; 2230 2231 } __packed; 2232 2233 struct update_edca_params_req_msg { 2234 struct wcn36xx_hal_msg_header header; 2235 2236 /*BSS Index */ 2237 u16 bss_index; 2238 2239 /* Best Effort */ 2240 struct wcn36xx_hal_edca_param_record acbe; 2241 2242 /* Background */ 2243 struct wcn36xx_hal_edca_param_record acbk; 2244 2245 /* Video */ 2246 struct wcn36xx_hal_edca_param_record acvi; 2247 2248 /* Voice */ 2249 struct wcn36xx_hal_edca_param_record acvo; 2250 }; 2251 2252 struct update_edca_params_rsp_msg { 2253 struct wcn36xx_hal_msg_header header; 2254 2255 /* success or failure */ 2256 u32 status; 2257 }; 2258 2259 struct dpu_stats_params { 2260 /* Index of STA to which the statistics */ 2261 u16 sta_index; 2262 2263 /* Encryption mode */ 2264 u8 enc_mode; 2265 2266 /* status */ 2267 u32 status; 2268 2269 /* Statistics */ 2270 u32 send_blocks; 2271 u32 recv_blocks; 2272 u32 replays; 2273 u8 mic_error_cnt; 2274 u32 prot_excl_cnt; 2275 u16 format_err_cnt; 2276 u16 un_decryptable_cnt; 2277 u32 decrypt_err_cnt; 2278 u32 decrypt_ok_cnt; 2279 }; 2280 2281 struct wcn36xx_hal_stats_req_msg { 2282 struct wcn36xx_hal_msg_header header; 2283 2284 /* Valid STA Idx for per STA stats request */ 2285 u32 sta_id; 2286 2287 /* Categories of stats requested as specified in eHalStatsMask */ 2288 u32 stats_mask; 2289 }; 2290 2291 struct ani_summary_stats_info { 2292 /* Total number of packets(per AC) that were successfully 2293 * transmitted with retries */ 2294 u32 retry_cnt[4]; 2295 2296 /* The number of MSDU packets and MMPDU frames per AC that the 2297 * 802.11 station successfully transmitted after more than one 2298 * retransmission attempt */ 2299 u32 multiple_retry_cnt[4]; 2300 2301 /* Total number of packets(per AC) that were successfully 2302 * transmitted (with and without retries, including multi-cast, 2303 * broadcast) */ 2304 u32 tx_frm_cnt[4]; 2305 2306 /* Total number of packets that were successfully received (after 2307 * appropriate filter rules including multi-cast, broadcast) */ 2308 u32 rx_frm_cnt; 2309 2310 /* Total number of duplicate frames received successfully */ 2311 u32 frm_dup_cnt; 2312 2313 /* Total number packets(per AC) failed to transmit */ 2314 u32 fail_cnt[4]; 2315 2316 /* Total number of RTS/CTS sequence failures for transmission of a 2317 * packet */ 2318 u32 rts_fail_cnt; 2319 2320 /* Total number packets failed transmit because of no ACK from the 2321 * remote entity */ 2322 u32 ack_fail_cnt; 2323 2324 /* Total number of RTS/CTS sequence success for transmission of a 2325 * packet */ 2326 u32 rts_succ_cnt; 2327 2328 /* The sum of the receive error count and dropped-receive-buffer 2329 * error count. HAL will provide this as a sum of (FCS error) + 2330 * (Fail get BD/PDU in HW) */ 2331 u32 rx_discard_cnt; 2332 2333 /* 2334 * The receive error count. HAL will provide the RxP FCS error 2335 * global counter. */ 2336 u32 rx_error_cnt; 2337 2338 /* The sum of the transmit-directed byte count, transmit-multicast 2339 * byte count and transmit-broadcast byte count. HAL will sum TPE 2340 * UC/MC/BCAST global counters to provide this. */ 2341 u32 tx_byte_cnt; 2342 }; 2343 2344 /* defines tx_rate_flags */ 2345 enum tx_rate_info { 2346 /* Legacy rates */ 2347 HAL_TX_RATE_LEGACY = 0x1, 2348 2349 /* HT20 rates */ 2350 HAL_TX_RATE_HT20 = 0x2, 2351 2352 /* HT40 rates */ 2353 HAL_TX_RATE_HT40 = 0x4, 2354 2355 /* Rate with Short guard interval */ 2356 HAL_TX_RATE_SGI = 0x8, 2357 2358 /* Rate with Long guard interval */ 2359 HAL_TX_RATE_LGI = 0x10 2360 }; 2361 2362 struct ani_global_class_a_stats_info { 2363 /* The number of MPDU frames received by the 802.11 station for 2364 * MSDU packets or MMPDU frames */ 2365 u32 rx_frag_cnt; 2366 2367 /* The number of MPDU frames received by the 802.11 station for 2368 * MSDU packets or MMPDU frames when a promiscuous packet filter 2369 * was enabled */ 2370 u32 promiscuous_rx_frag_cnt; 2371 2372 /* The receiver input sensitivity referenced to a FER of 8% at an 2373 * MPDU length of 1024 bytes at the antenna connector. Each element 2374 * of the array shall correspond to a supported rate and the order 2375 * shall be the same as the supporteRates parameter. */ 2376 u32 rx_input_sensitivity; 2377 2378 /* The maximum transmit power in dBm upto one decimal. for eg: if 2379 * it is 10.5dBm, the value would be 105 */ 2380 u32 max_pwr; 2381 2382 /* Number of times the receiver failed to synchronize with the 2383 * incoming signal after detecting the sync in the preamble of the 2384 * transmitted PLCP protocol data unit. */ 2385 u32 sync_fail_cnt; 2386 2387 /* Legacy transmit rate, in units of 500 kbit/sec, for the most 2388 * recently transmitted frame */ 2389 u32 tx_rate; 2390 2391 /* mcs index for HT20 and HT40 rates */ 2392 u32 mcs_index; 2393 2394 /* to differentiate between HT20 and HT40 rates; short and long 2395 * guard interval */ 2396 u32 tx_rate_flags; 2397 }; 2398 2399 struct ani_global_security_stats { 2400 /* The number of unencrypted received MPDU frames that the MAC 2401 * layer discarded when the IEEE 802.11 dot11ExcludeUnencrypted 2402 * management information base (MIB) object is enabled */ 2403 u32 rx_wep_unencrypted_frm_cnt; 2404 2405 /* The number of received MSDU packets that that the 802.11 station 2406 * discarded because of MIC failures */ 2407 u32 rx_mic_fail_cnt; 2408 2409 /* The number of encrypted MPDU frames that the 802.11 station 2410 * failed to decrypt because of a TKIP ICV error */ 2411 u32 tkip_icv_err; 2412 2413 /* The number of received MPDU frames that the 802.11 discarded 2414 * because of an invalid AES-CCMP format */ 2415 u32 aes_ccmp_format_err; 2416 2417 /* The number of received MPDU frames that the 802.11 station 2418 * discarded because of the AES-CCMP replay protection procedure */ 2419 u32 aes_ccmp_replay_cnt; 2420 2421 /* The number of received MPDU frames that the 802.11 station 2422 * discarded because of errors detected by the AES-CCMP decryption 2423 * algorithm */ 2424 u32 aes_ccmp_decrpt_err; 2425 2426 /* The number of encrypted MPDU frames received for which a WEP 2427 * decryption key was not available on the 802.11 station */ 2428 u32 wep_undecryptable_cnt; 2429 2430 /* The number of encrypted MPDU frames that the 802.11 station 2431 * failed to decrypt because of a WEP ICV error */ 2432 u32 wep_icv_err; 2433 2434 /* The number of received encrypted packets that the 802.11 station 2435 * successfully decrypted */ 2436 u32 rx_decrypt_succ_cnt; 2437 2438 /* The number of encrypted packets that the 802.11 station failed 2439 * to decrypt */ 2440 u32 rx_decrypt_fail_cnt; 2441 }; 2442 2443 struct ani_global_class_b_stats_info { 2444 struct ani_global_security_stats uc_stats; 2445 struct ani_global_security_stats mc_bc_stats; 2446 }; 2447 2448 struct ani_global_class_c_stats_info { 2449 /* This counter shall be incremented for a received A-MSDU frame 2450 * with the stations MAC address in the address 1 field or an 2451 * A-MSDU frame with a group address in the address 1 field */ 2452 u32 rx_amsdu_cnt; 2453 2454 /* This counter shall be incremented when the MAC receives an AMPDU 2455 * from the PHY */ 2456 u32 rx_ampdu_cnt; 2457 2458 /* This counter shall be incremented when a Frame is transmitted 2459 * only on the primary channel */ 2460 u32 tx_20_frm_cnt; 2461 2462 /* This counter shall be incremented when a Frame is received only 2463 * on the primary channel */ 2464 u32 rx_20_frm_cnt; 2465 2466 /* This counter shall be incremented by the number of MPDUs 2467 * received in the A-MPDU when an A-MPDU is received */ 2468 u32 rx_mpdu_in_ampdu_cnt; 2469 2470 /* This counter shall be incremented when an MPDU delimiter has a 2471 * CRC error when this is the first CRC error in the received AMPDU 2472 * or when the previous delimiter has been decoded correctly */ 2473 u32 ampdu_delimiter_crc_err; 2474 }; 2475 2476 struct ani_per_sta_stats_info { 2477 /* The number of MPDU frames that the 802.11 station transmitted 2478 * and acknowledged through a received 802.11 ACK frame */ 2479 u32 tx_frag_cnt[4]; 2480 2481 /* This counter shall be incremented when an A-MPDU is transmitted */ 2482 u32 tx_ampdu_cnt; 2483 2484 /* This counter shall increment by the number of MPDUs in the AMPDU 2485 * when an A-MPDU is transmitted */ 2486 u32 tx_mpdu_in_ampdu_cnt; 2487 }; 2488 2489 struct wcn36xx_hal_stats_rsp_msg { 2490 struct wcn36xx_hal_msg_header header; 2491 2492 /* Success or Failure */ 2493 u32 status; 2494 2495 /* STA Idx */ 2496 u32 sta_index; 2497 2498 /* Categories of STATS being returned as per eHalStatsMask */ 2499 u32 stats_mask; 2500 2501 /* message type is same as the request type */ 2502 u16 msg_type; 2503 2504 /* length of the entire request, includes the pStatsBuf length too */ 2505 u16 msg_len; 2506 }; 2507 2508 struct wcn36xx_hal_set_link_state_req_msg { 2509 struct wcn36xx_hal_msg_header header; 2510 2511 u8 bssid[ETH_ALEN]; 2512 enum wcn36xx_hal_link_state state; 2513 u8 self_mac_addr[ETH_ALEN]; 2514 2515 } __packed; 2516 2517 struct set_link_state_rsp_msg { 2518 struct wcn36xx_hal_msg_header header; 2519 2520 /* success or failure */ 2521 u32 status; 2522 }; 2523 2524 /* TSPEC Params */ 2525 struct wcn36xx_hal_ts_info_tfc { 2526 #ifndef ANI_LITTLE_BIT_ENDIAN 2527 u16 ackPolicy:2; 2528 u16 userPrio:3; 2529 u16 psb:1; 2530 u16 aggregation:1; 2531 u16 accessPolicy:2; 2532 u16 direction:2; 2533 u16 tsid:4; 2534 u16 trafficType:1; 2535 #else 2536 u16 trafficType:1; 2537 u16 tsid:4; 2538 u16 direction:2; 2539 u16 accessPolicy:2; 2540 u16 aggregation:1; 2541 u16 psb:1; 2542 u16 userPrio:3; 2543 u16 ackPolicy:2; 2544 #endif 2545 }; 2546 2547 /* Flag to schedule the traffic type */ 2548 struct wcn36xx_hal_ts_info_sch { 2549 #ifndef ANI_LITTLE_BIT_ENDIAN 2550 u8 rsvd:7; 2551 u8 schedule:1; 2552 #else 2553 u8 schedule:1; 2554 u8 rsvd:7; 2555 #endif 2556 }; 2557 2558 /* Traffic and scheduling info */ 2559 struct wcn36xx_hal_ts_info { 2560 struct wcn36xx_hal_ts_info_tfc traffic; 2561 struct wcn36xx_hal_ts_info_sch schedule; 2562 }; 2563 2564 /* Information elements */ 2565 struct wcn36xx_hal_tspec_ie { 2566 u8 type; 2567 u8 length; 2568 struct wcn36xx_hal_ts_info ts_info; 2569 u16 nom_msdu_size; 2570 u16 max_msdu_size; 2571 u32 min_svc_interval; 2572 u32 max_svc_interval; 2573 u32 inact_interval; 2574 u32 suspend_interval; 2575 u32 svc_start_time; 2576 u32 min_data_rate; 2577 u32 mean_data_rate; 2578 u32 peak_data_rate; 2579 u32 max_burst_sz; 2580 u32 delay_bound; 2581 u32 min_phy_rate; 2582 u16 surplus_bw; 2583 u16 medium_time; 2584 }; 2585 2586 struct add_ts_req_msg { 2587 struct wcn36xx_hal_msg_header header; 2588 2589 /* Station Index */ 2590 u16 sta_index; 2591 2592 /* TSPEC handler uniquely identifying a TSPEC for a STA in a BSS */ 2593 u16 tspec_index; 2594 2595 /* To program TPE with required parameters */ 2596 struct wcn36xx_hal_tspec_ie tspec; 2597 2598 /* U-APSD Flags: 1b per AC. Encoded as follows: 2599 b7 b6 b5 b4 b3 b2 b1 b0 = 2600 X X X X BE BK VI VO */ 2601 u8 uapsd; 2602 2603 /* These parameters are for all the access categories */ 2604 2605 /* Service Interval */ 2606 u32 service_interval[WCN36XX_HAL_MAX_AC]; 2607 2608 /* Suspend Interval */ 2609 u32 suspend_interval[WCN36XX_HAL_MAX_AC]; 2610 2611 /* Delay Interval */ 2612 u32 delay_interval[WCN36XX_HAL_MAX_AC]; 2613 }; 2614 2615 struct add_rs_rsp_msg { 2616 struct wcn36xx_hal_msg_header header; 2617 2618 /* success or failure */ 2619 u32 status; 2620 }; 2621 2622 struct del_ts_req_msg { 2623 struct wcn36xx_hal_msg_header header; 2624 2625 /* Station Index */ 2626 u16 sta_index; 2627 2628 /* TSPEC identifier uniquely identifying a TSPEC for a STA in a BSS */ 2629 u16 tspec_index; 2630 2631 /* To lookup station id using the mac address */ 2632 u8 bssid[ETH_ALEN]; 2633 }; 2634 2635 struct del_ts_rsp_msg { 2636 struct wcn36xx_hal_msg_header header; 2637 2638 /* success or failure */ 2639 u32 status; 2640 }; 2641 2642 /* End of TSpec Parameters */ 2643 2644 /* Start of BLOCK ACK related Parameters */ 2645 2646 struct wcn36xx_hal_add_ba_session_req_msg { 2647 struct wcn36xx_hal_msg_header header; 2648 2649 /* Station Index */ 2650 u16 sta_index; 2651 2652 /* Peer MAC Address */ 2653 u8 mac_addr[ETH_ALEN]; 2654 2655 /* ADDBA Action Frame dialog token 2656 HAL will not interpret this object */ 2657 u8 dialog_token; 2658 2659 /* TID for which the BA is being setup 2660 This identifies the TC or TS of interest */ 2661 u8 tid; 2662 2663 /* 0 - Delayed BA (Not supported) 2664 1 - Immediate BA */ 2665 u8 policy; 2666 2667 /* Indicates the number of buffers for this TID (baTID) 2668 NOTE - This is the requested buffer size. When this 2669 is processed by HAL and subsequently by HDD, it is 2670 possible that HDD may change this buffer size. Any 2671 change in the buffer size should be noted by PE and 2672 advertized appropriately in the ADDBA response */ 2673 u16 buffer_size; 2674 2675 /* BA timeout in TU's 0 means no timeout will occur */ 2676 u16 timeout; 2677 2678 /* b0..b3 - Fragment Number - Always set to 0 2679 b4..b15 - Starting Sequence Number of first MSDU 2680 for which this BA is setup */ 2681 u16 ssn; 2682 2683 /* ADDBA direction 2684 1 - Originator 2685 0 - Recipient */ 2686 u8 direction; 2687 } __packed; 2688 2689 struct wcn36xx_hal_add_ba_session_rsp_msg { 2690 struct wcn36xx_hal_msg_header header; 2691 2692 /* success or failure */ 2693 u32 status; 2694 2695 /* Dialog token */ 2696 u8 dialog_token; 2697 2698 /* TID for which the BA session has been setup */ 2699 u8 ba_tid; 2700 2701 /* BA Buffer Size allocated for the current BA session */ 2702 u8 ba_buffer_size; 2703 2704 u8 ba_session_id; 2705 2706 /* Reordering Window buffer */ 2707 u8 win_size; 2708 2709 /* Station Index to id the sta */ 2710 u8 sta_index; 2711 2712 /* Starting Sequence Number */ 2713 u16 ssn; 2714 } __packed; 2715 2716 struct wcn36xx_hal_add_ba_req_msg { 2717 struct wcn36xx_hal_msg_header header; 2718 2719 /* Session Id */ 2720 u8 session_id; 2721 2722 /* Reorder Window Size */ 2723 u8 win_size; 2724 /* Old FW 1.2.2.4 does not support this*/ 2725 #ifdef FEATURE_ON_CHIP_REORDERING 2726 u8 reordering_done_on_chip; 2727 #endif 2728 } __packed; 2729 2730 struct wcn36xx_hal_add_ba_rsp_msg { 2731 struct wcn36xx_hal_msg_header header; 2732 2733 /* success or failure */ 2734 u32 status; 2735 2736 /* Dialog token */ 2737 u8 dialog_token; 2738 } __packed; 2739 2740 struct add_ba_info { 2741 u16 ba_enable:1; 2742 u16 starting_seq_num:12; 2743 u16 reserved:3; 2744 }; 2745 2746 struct wcn36xx_hal_trigger_ba_rsp_candidate { 2747 u8 sta_addr[ETH_ALEN]; 2748 struct add_ba_info ba_info[STACFG_MAX_TC]; 2749 } __packed; 2750 2751 struct wcn36xx_hal_trigger_ba_req_candidate { 2752 u8 sta_index; 2753 u8 tid_bitmap; 2754 } __packed; 2755 2756 struct wcn36xx_hal_trigger_ba_req_msg { 2757 struct wcn36xx_hal_msg_header header; 2758 2759 /* Session Id */ 2760 u8 session_id; 2761 2762 /* baCandidateCnt is followed by trigger BA 2763 * Candidate List(tTriggerBaCandidate) 2764 */ 2765 u16 candidate_cnt; 2766 2767 } __packed; 2768 2769 struct wcn36xx_hal_trigger_ba_rsp_msg { 2770 struct wcn36xx_hal_msg_header header; 2771 2772 /* TO SUPPORT BT-AMP */ 2773 u8 bssid[ETH_ALEN]; 2774 2775 /* success or failure */ 2776 u32 status; 2777 2778 /* baCandidateCnt is followed by trigger BA 2779 * Rsp Candidate List(tTriggerRspBaCandidate) 2780 */ 2781 u16 candidate_cnt; 2782 } __packed; 2783 2784 struct wcn36xx_hal_del_ba_req_msg { 2785 struct wcn36xx_hal_msg_header header; 2786 2787 /* Station Index */ 2788 u16 sta_index; 2789 2790 /* TID for which the BA session is being deleted */ 2791 u8 tid; 2792 2793 /* DELBA direction 2794 1 - Originator 2795 0 - Recipient */ 2796 u8 direction; 2797 } __packed; 2798 2799 struct wcn36xx_hal_del_ba_rsp_msg { 2800 struct wcn36xx_hal_msg_header header; 2801 2802 /* success or failure */ 2803 u32 status; 2804 } __packed; 2805 2806 struct tsm_stats_req_msg { 2807 struct wcn36xx_hal_msg_header header; 2808 2809 /* Traffic Id */ 2810 u8 tid; 2811 2812 u8 bssid[ETH_ALEN]; 2813 }; 2814 2815 struct tsm_stats_rsp_msg { 2816 struct wcn36xx_hal_msg_header header; 2817 2818 /*success or failure */ 2819 u32 status; 2820 2821 /* Uplink Packet Queue delay */ 2822 u16 uplink_pkt_queue_delay; 2823 2824 /* Uplink Packet Queue delay histogram */ 2825 u16 uplink_pkt_queue_delay_hist[4]; 2826 2827 /* Uplink Packet Transmit delay */ 2828 u32 uplink_pkt_tx_delay; 2829 2830 /* Uplink Packet loss */ 2831 u16 uplink_pkt_loss; 2832 2833 /* Uplink Packet count */ 2834 u16 uplink_pkt_count; 2835 2836 /* Roaming count */ 2837 u8 roaming_count; 2838 2839 /* Roaming Delay */ 2840 u16 roaming_delay; 2841 }; 2842 2843 struct set_key_done_msg { 2844 struct wcn36xx_hal_msg_header header; 2845 2846 /*bssid of the keys */ 2847 u8 bssidx; 2848 u8 enc_type; 2849 }; 2850 2851 struct wcn36xx_hal_nv_img_download_req_msg { 2852 /* Note: The length specified in wcn36xx_hal_nv_img_download_req_msg 2853 * messages should be 2854 * header.len = sizeof(wcn36xx_hal_nv_img_download_req_msg) + 2855 * nv_img_buffer_size */ 2856 struct wcn36xx_hal_msg_header header; 2857 2858 /* Fragment sequence number of the NV Image. Note that NV Image 2859 * might not fit into one message due to size limitation of the SMD 2860 * channel FIFO. UMAC can hence choose to chop the NV blob into 2861 * multiple fragments starting with seqeunce number 0, 1, 2 etc. 2862 * The last fragment MUST be indicated by marking the 2863 * isLastFragment field to 1. Note that all the NV blobs would be 2864 * concatenated together by HAL without any padding bytes in 2865 * between.*/ 2866 u16 frag_number; 2867 2868 /* Is this the last fragment? When set to 1 it indicates that no 2869 * more fragments will be sent by UMAC and HAL can concatenate all 2870 * the NV blobs rcvd & proceed with the parsing. HAL would generate 2871 * a WCN36XX_HAL_DOWNLOAD_NV_RSP to the WCN36XX_HAL_DOWNLOAD_NV_REQ 2872 * after it receives each fragment */ 2873 u16 last_fragment; 2874 2875 /* NV Image size (number of bytes) */ 2876 u32 nv_img_buffer_size; 2877 2878 /* Following the 'nv_img_buffer_size', there should be 2879 * nv_img_buffer_size bytes of NV Image i.e. 2880 * u8[nv_img_buffer_size] */ 2881 } __packed; 2882 2883 struct wcn36xx_hal_nv_img_download_rsp_msg { 2884 struct wcn36xx_hal_msg_header header; 2885 2886 /* Success or Failure. HAL would generate a 2887 * WCN36XX_HAL_DOWNLOAD_NV_RSP after each fragment */ 2888 u32 status; 2889 } __packed; 2890 2891 struct wcn36xx_hal_nv_store_ind { 2892 /* Note: The length specified in tHalNvStoreInd messages should be 2893 * header.msgLen = sizeof(tHalNvStoreInd) + nvBlobSize */ 2894 struct wcn36xx_hal_msg_header header; 2895 2896 /* NV Item */ 2897 u32 table_id; 2898 2899 /* Size of NV Blob */ 2900 u32 nv_blob_size; 2901 2902 /* Following the 'nvBlobSize', there should be nvBlobSize bytes of 2903 * NV blob i.e. u8[nvBlobSize] */ 2904 }; 2905 2906 /* End of Block Ack Related Parameters */ 2907 2908 #define WCN36XX_HAL_CIPHER_SEQ_CTR_SIZE 6 2909 2910 /* Definition for MIC failure indication MAC reports this each time a MIC 2911 * failure occures on Rx TKIP packet 2912 */ 2913 struct mic_failure_ind_msg { 2914 struct wcn36xx_hal_msg_header header; 2915 2916 u8 bssid[ETH_ALEN]; 2917 2918 /* address used to compute MIC */ 2919 u8 src_addr[ETH_ALEN]; 2920 2921 /* transmitter address */ 2922 u8 ta_addr[ETH_ALEN]; 2923 2924 u8 dst_addr[ETH_ALEN]; 2925 2926 u8 multicast; 2927 2928 /* first byte of IV */ 2929 u8 iv1; 2930 2931 /* second byte of IV */ 2932 u8 key_id; 2933 2934 /* sequence number */ 2935 u8 tsc[WCN36XX_HAL_CIPHER_SEQ_CTR_SIZE]; 2936 2937 /* receive address */ 2938 u8 rx_addr[ETH_ALEN]; 2939 }; 2940 2941 struct update_vht_op_mode_req_msg { 2942 struct wcn36xx_hal_msg_header header; 2943 2944 u16 op_mode; 2945 u16 sta_id; 2946 }; 2947 2948 struct update_vht_op_mode_params_rsp_msg { 2949 struct wcn36xx_hal_msg_header header; 2950 2951 u32 status; 2952 }; 2953 2954 struct update_beacon_req_msg { 2955 struct wcn36xx_hal_msg_header header; 2956 2957 u8 bss_index; 2958 2959 /* shortPreamble mode. HAL should update all the STA rates when it 2960 * receives this message */ 2961 u8 short_preamble; 2962 2963 /* short Slot time. */ 2964 u8 short_slot_time; 2965 2966 /* Beacon Interval */ 2967 u16 beacon_interval; 2968 2969 /* Protection related */ 2970 u8 lla_coexist; 2971 u8 llb_coexist; 2972 u8 llg_coexist; 2973 u8 ht20_coexist; 2974 u8 lln_non_gf_coexist; 2975 u8 lsig_tx_op_protection_full_support; 2976 u8 rifs_mode; 2977 2978 u16 param_change_bitmap; 2979 }; 2980 2981 struct update_beacon_rsp_msg { 2982 struct wcn36xx_hal_msg_header header; 2983 u32 status; 2984 }; 2985 2986 struct wcn36xx_hal_send_beacon_req_msg { 2987 struct wcn36xx_hal_msg_header header; 2988 2989 /* length of the template + 6. Only qcom knows why */ 2990 u32 beacon_length6; 2991 2992 /* length of the template. */ 2993 u32 beacon_length; 2994 2995 /* Beacon data. */ 2996 u8 beacon[BEACON_TEMPLATE_SIZE - sizeof(u32)]; 2997 2998 u8 bssid[ETH_ALEN]; 2999 3000 /* TIM IE offset from the beginning of the template. */ 3001 u32 tim_ie_offset; 3002 3003 /* P2P IE offset from the begining of the template */ 3004 u16 p2p_ie_offset; 3005 } __packed; 3006 3007 struct send_beacon_rsp_msg { 3008 struct wcn36xx_hal_msg_header header; 3009 u32 status; 3010 } __packed; 3011 3012 struct enable_radar_req_msg { 3013 struct wcn36xx_hal_msg_header header; 3014 3015 u8 bssid[ETH_ALEN]; 3016 u8 channel; 3017 }; 3018 3019 struct enable_radar_rsp_msg { 3020 struct wcn36xx_hal_msg_header header; 3021 3022 /* Link Parameters */ 3023 u8 bssid[ETH_ALEN]; 3024 3025 /* success or failure */ 3026 u32 status; 3027 }; 3028 3029 struct radar_detect_intr_ind_msg { 3030 struct wcn36xx_hal_msg_header header; 3031 3032 u8 radar_det_channel; 3033 }; 3034 3035 struct radar_detect_ind_msg { 3036 struct wcn36xx_hal_msg_header header; 3037 3038 /* channel number in which the RADAR detected */ 3039 u8 channel_number; 3040 3041 /* RADAR pulse width in usecond */ 3042 u16 radar_pulse_width; 3043 3044 /* Number of RADAR pulses */ 3045 u16 num_radar_pulse; 3046 }; 3047 3048 struct wcn36xx_hal_get_tpc_report_req_msg { 3049 struct wcn36xx_hal_msg_header header; 3050 3051 u8 sta[ETH_ALEN]; 3052 u8 dialog_token; 3053 u8 txpower; 3054 }; 3055 3056 struct wcn36xx_hal_get_tpc_report_rsp_msg { 3057 struct wcn36xx_hal_msg_header header; 3058 3059 /* success or failure */ 3060 u32 status; 3061 }; 3062 3063 struct wcn36xx_hal_send_probe_resp_req_msg { 3064 struct wcn36xx_hal_msg_header header; 3065 3066 u8 probe_resp_template[BEACON_TEMPLATE_SIZE]; 3067 u32 probe_resp_template_len; 3068 u32 proxy_probe_req_valid_ie_bmap[8]; 3069 u8 bssid[ETH_ALEN]; 3070 }; 3071 3072 struct send_probe_resp_rsp_msg { 3073 struct wcn36xx_hal_msg_header header; 3074 3075 /* success or failure */ 3076 u32 status; 3077 }; 3078 3079 struct send_unknown_frame_rx_ind_msg { 3080 struct wcn36xx_hal_msg_header header; 3081 3082 /* success or failure */ 3083 u32 status; 3084 }; 3085 3086 struct wcn36xx_hal_delete_sta_context_ind_msg { 3087 struct wcn36xx_hal_msg_header header; 3088 3089 u16 aid; 3090 u16 sta_id; 3091 3092 /* TO SUPPORT BT-AMP */ 3093 u8 bssid[ETH_ALEN]; 3094 3095 /* HAL copies bssid from the sta table. */ 3096 u8 addr2[ETH_ALEN]; 3097 3098 /* To unify the keepalive / unknown A2 / tim-based disa */ 3099 u16 reason_code; 3100 } __packed; 3101 3102 struct indicate_del_sta { 3103 struct wcn36xx_hal_msg_header header; 3104 u8 aid; 3105 u8 sta_index; 3106 u8 bss_index; 3107 u8 reason_code; 3108 u32 status; 3109 }; 3110 3111 struct bt_amp_event_msg { 3112 struct wcn36xx_hal_msg_header header; 3113 3114 enum bt_amp_event_type btAmpEventType; 3115 }; 3116 3117 struct bt_amp_event_rsp { 3118 struct wcn36xx_hal_msg_header header; 3119 3120 /* success or failure */ 3121 u32 status; 3122 }; 3123 3124 struct tl_hal_flush_ac_req_msg { 3125 struct wcn36xx_hal_msg_header header; 3126 3127 /* Station Index. originates from HAL */ 3128 u8 sta_id; 3129 3130 /* TID for which the transmit queue is being flushed */ 3131 u8 tid; 3132 }; 3133 3134 struct tl_hal_flush_ac_rsp_msg { 3135 struct wcn36xx_hal_msg_header header; 3136 3137 /* Station Index. originates from HAL */ 3138 u8 sta_id; 3139 3140 /* TID for which the transmit queue is being flushed */ 3141 u8 tid; 3142 3143 /* success or failure */ 3144 u32 status; 3145 }; 3146 3147 struct wcn36xx_hal_enter_imps_req_msg { 3148 struct wcn36xx_hal_msg_header header; 3149 }; 3150 3151 struct wcn36xx_hal_exit_imps_req { 3152 struct wcn36xx_hal_msg_header header; 3153 }; 3154 3155 struct wcn36xx_hal_enter_bmps_req_msg { 3156 struct wcn36xx_hal_msg_header header; 3157 3158 u8 bss_index; 3159 3160 /* TBTT value derived from the last beacon */ 3161 #ifndef BUILD_QWPTTSTATIC 3162 u64 tbtt; 3163 #endif 3164 u8 dtim_count; 3165 3166 /* DTIM period given to HAL during association may not be valid, if 3167 * association is based on ProbeRsp instead of beacon. */ 3168 u8 dtim_period; 3169 3170 /* For CCX and 11R Roaming */ 3171 u32 rssi_filter_period; 3172 3173 u32 num_beacon_per_rssi_average; 3174 u8 rssi_filter_enable; 3175 } __packed; 3176 3177 struct wcn36xx_hal_exit_bmps_req_msg { 3178 struct wcn36xx_hal_msg_header header; 3179 3180 u8 send_data_null; 3181 u8 bss_index; 3182 } __packed; 3183 3184 struct wcn36xx_hal_missed_beacon_ind_msg { 3185 struct wcn36xx_hal_msg_header header; 3186 3187 u8 bss_index; 3188 } __packed; 3189 3190 /* Beacon Filtering data structures */ 3191 3192 /* The above structure would be followed by multiple of below mentioned 3193 * structure 3194 */ 3195 struct beacon_filter_ie { 3196 u8 element_id; 3197 u8 check_ie_presence; 3198 u8 offset; 3199 u8 value; 3200 u8 bitmask; 3201 u8 ref; 3202 }; 3203 3204 struct wcn36xx_hal_add_bcn_filter_req_msg { 3205 struct wcn36xx_hal_msg_header header; 3206 3207 u16 capability_info; 3208 u16 capability_mask; 3209 u16 beacon_interval; 3210 u16 ie_num; 3211 u8 bss_index; 3212 u8 reserved; 3213 }; 3214 3215 struct wcn36xx_hal_rem_bcn_filter_req { 3216 struct wcn36xx_hal_msg_header header; 3217 3218 u8 ie_Count; 3219 u8 rem_ie_id[1]; 3220 }; 3221 3222 #define WCN36XX_HAL_IPV4_ARP_REPLY_OFFLOAD 0 3223 #define WCN36XX_HAL_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD 1 3224 #define WCN36XX_HAL_IPV6_NS_OFFLOAD 2 3225 #define WCN36XX_HAL_IPV6_ADDR_LEN 16 3226 #define WCN36XX_HAL_OFFLOAD_DISABLE 0 3227 #define WCN36XX_HAL_OFFLOAD_ENABLE 1 3228 #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 3229 #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \ 3230 (HAL_OFFLOAD_ENABLE|HAL_OFFLOAD_BCAST_FILTER_ENABLE) 3231 3232 struct wcn36xx_hal_ns_offload_params { 3233 u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; 3234 u8 self_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; 3235 3236 /* Only support 2 possible Network Advertisement IPv6 address */ 3237 u8 target_ipv6_addr1[WCN36XX_HAL_IPV6_ADDR_LEN]; 3238 u8 target_ipv6_addr2[WCN36XX_HAL_IPV6_ADDR_LEN]; 3239 3240 u8 self_addr[ETH_ALEN]; 3241 u8 src_ipv6_addr_valid:1; 3242 u8 target_ipv6_addr1_valid:1; 3243 u8 target_ipv6_addr2_valid:1; 3244 u8 reserved1:5; 3245 3246 /* make it DWORD aligned */ 3247 u8 reserved2; 3248 3249 /* slot index for this offload */ 3250 u32 slot_index; 3251 u8 bss_index; 3252 }; 3253 3254 struct wcn36xx_hal_host_offload_req { 3255 u8 offload_Type; 3256 3257 /* enable or disable */ 3258 u8 enable; 3259 3260 union { 3261 u8 host_ipv4_addr[4]; 3262 u8 host_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; 3263 } u; 3264 }; 3265 3266 struct wcn36xx_hal_host_offload_req_msg { 3267 struct wcn36xx_hal_msg_header header; 3268 struct wcn36xx_hal_host_offload_req host_offload_params; 3269 struct wcn36xx_hal_ns_offload_params ns_offload_params; 3270 }; 3271 3272 /* Packet Types. */ 3273 #define WCN36XX_HAL_KEEP_ALIVE_NULL_PKT 1 3274 #define WCN36XX_HAL_KEEP_ALIVE_UNSOLICIT_ARP_RSP 2 3275 3276 /* Enable or disable keep alive */ 3277 #define WCN36XX_HAL_KEEP_ALIVE_DISABLE 0 3278 #define WCN36XX_HAL_KEEP_ALIVE_ENABLE 1 3279 #define WCN36XX_KEEP_ALIVE_TIME_PERIOD 30 /* unit: s */ 3280 3281 /* Keep Alive request. */ 3282 struct wcn36xx_hal_keep_alive_req_msg { 3283 struct wcn36xx_hal_msg_header header; 3284 3285 u8 packet_type; 3286 u32 time_period; 3287 u8 host_ipv4_addr[WCN36XX_HAL_IPV4_ADDR_LEN]; 3288 u8 dest_ipv4_addr[WCN36XX_HAL_IPV4_ADDR_LEN]; 3289 u8 dest_addr[ETH_ALEN]; 3290 u8 bss_index; 3291 } __packed; 3292 3293 struct wcn36xx_hal_rssi_threshold_req_msg { 3294 struct wcn36xx_hal_msg_header header; 3295 3296 s8 threshold1:8; 3297 s8 threshold2:8; 3298 s8 threshold3:8; 3299 u8 thres1_pos_notify:1; 3300 u8 thres1_neg_notify:1; 3301 u8 thres2_pos_notify:1; 3302 u8 thres2_neg_notify:1; 3303 u8 thres3_pos_notify:1; 3304 u8 thres3_neg_notify:1; 3305 u8 reserved10:2; 3306 }; 3307 3308 struct wcn36xx_hal_enter_uapsd_req_msg { 3309 struct wcn36xx_hal_msg_header header; 3310 3311 u8 bk_delivery:1; 3312 u8 be_delivery:1; 3313 u8 vi_delivery:1; 3314 u8 vo_delivery:1; 3315 u8 bk_trigger:1; 3316 u8 be_trigger:1; 3317 u8 vi_trigger:1; 3318 u8 vo_trigger:1; 3319 u8 bss_index; 3320 }; 3321 3322 struct wcn36xx_hal_exit_uapsd_req_msg { 3323 struct wcn36xx_hal_msg_header header; 3324 u8 bss_index; 3325 }; 3326 3327 #define WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE 128 3328 #define WCN36XX_HAL_WOWL_BCAST_MAX_NUM_PATTERNS 16 3329 3330 struct wcn36xx_hal_wowl_add_bcast_ptrn_req_msg { 3331 struct wcn36xx_hal_msg_header header; 3332 3333 /* Pattern ID */ 3334 u8 id; 3335 3336 /* Pattern byte offset from beginning of the 802.11 packet to start 3337 * of the wake-up pattern */ 3338 u8 byte_Offset; 3339 3340 /* Non-Zero Pattern size */ 3341 u8 size; 3342 3343 /* Pattern */ 3344 u8 pattern[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE]; 3345 3346 /* Non-zero pattern mask size */ 3347 u8 mask_size; 3348 3349 /* Pattern mask */ 3350 u8 mask[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE]; 3351 3352 /* Extra pattern */ 3353 u8 extra[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE]; 3354 3355 /* Extra pattern mask */ 3356 u8 mask_extra[WCN36XX_HAL_WOWL_BCAST_PATTERN_MAX_SIZE]; 3357 3358 u8 bss_index; 3359 }; 3360 3361 struct wcn36xx_hal_wow_del_bcast_ptrn_req_msg { 3362 struct wcn36xx_hal_msg_header header; 3363 3364 /* Pattern ID of the wakeup pattern to be deleted */ 3365 u8 id; 3366 u8 bss_index; 3367 }; 3368 3369 struct wcn36xx_hal_wowl_enter_req_msg { 3370 struct wcn36xx_hal_msg_header header; 3371 3372 /* Enables/disables magic packet filtering */ 3373 u8 magic_packet_enable; 3374 3375 /* Magic pattern */ 3376 u8 magic_pattern[ETH_ALEN]; 3377 3378 /* Enables/disables packet pattern filtering in firmware. Enabling 3379 * this flag enables broadcast pattern matching in Firmware. If 3380 * unicast pattern matching is also desired, 3381 * ucUcastPatternFilteringEnable flag must be set tot true as well 3382 */ 3383 u8 pattern_filtering_enable; 3384 3385 /* Enables/disables unicast packet pattern filtering. This flag 3386 * specifies whether we want to do pattern match on unicast packets 3387 * as well and not just broadcast packets. This flag has no effect 3388 * if the ucPatternFilteringEnable (main controlling flag) is set 3389 * to false 3390 */ 3391 u8 ucast_pattern_filtering_enable; 3392 3393 /* This configuration is valid only when magicPktEnable=1. It 3394 * requests hardware to wake up when it receives the Channel Switch 3395 * Action Frame. 3396 */ 3397 u8 wow_channel_switch_receive; 3398 3399 /* This configuration is valid only when magicPktEnable=1. It 3400 * requests hardware to wake up when it receives the 3401 * Deauthentication Frame. 3402 */ 3403 u8 wow_deauth_receive; 3404 3405 /* This configuration is valid only when magicPktEnable=1. It 3406 * requests hardware to wake up when it receives the Disassociation 3407 * Frame. 3408 */ 3409 u8 wow_disassoc_receive; 3410 3411 /* This configuration is valid only when magicPktEnable=1. It 3412 * requests hardware to wake up when it has missed consecutive 3413 * beacons. This is a hardware register configuration (NOT a 3414 * firmware configuration). 3415 */ 3416 u8 wow_max_missed_beacons; 3417 3418 /* This configuration is valid only when magicPktEnable=1. This is 3419 * a timeout value in units of microsec. It requests hardware to 3420 * unconditionally wake up after it has stayed in WoWLAN mode for 3421 * some time. Set 0 to disable this feature. 3422 */ 3423 u8 wow_max_sleep; 3424 3425 /* This configuration directs the WoW packet filtering to look for 3426 * EAP-ID requests embedded in EAPOL frames and use this as a wake 3427 * source. 3428 */ 3429 u8 wow_eap_id_request_enable; 3430 3431 /* This configuration directs the WoW packet filtering to look for 3432 * EAPOL-4WAY requests and use this as a wake source. 3433 */ 3434 u8 wow_eapol_4way_enable; 3435 3436 /* This configuration allows a host wakeup on an network scan 3437 * offload match. 3438 */ 3439 u8 wow_net_scan_offload_match; 3440 3441 /* This configuration allows a host wakeup on any GTK rekeying 3442 * error. 3443 */ 3444 u8 wow_gtk_rekey_error; 3445 3446 /* This configuration allows a host wakeup on BSS connection loss. 3447 */ 3448 u8 wow_bss_connection_loss; 3449 3450 u8 bss_index; 3451 }; 3452 3453 struct wcn36xx_hal_wowl_exit_req_msg { 3454 struct wcn36xx_hal_msg_header header; 3455 3456 u8 bss_index; 3457 }; 3458 3459 struct wcn36xx_hal_get_rssi_req_msg { 3460 struct wcn36xx_hal_msg_header header; 3461 }; 3462 3463 struct wcn36xx_hal_get_roam_rssi_req_msg { 3464 struct wcn36xx_hal_msg_header header; 3465 3466 /* Valid STA Idx for per STA stats request */ 3467 u32 sta_id; 3468 }; 3469 3470 struct wcn36xx_hal_set_uapsd_ac_params_req_msg { 3471 struct wcn36xx_hal_msg_header header; 3472 3473 /* STA index */ 3474 u8 sta_idx; 3475 3476 /* Access Category */ 3477 u8 ac; 3478 3479 /* User Priority */ 3480 u8 up; 3481 3482 /* Service Interval */ 3483 u32 service_interval; 3484 3485 /* Suspend Interval */ 3486 u32 suspend_interval; 3487 3488 /* Delay Interval */ 3489 u32 delay_interval; 3490 }; 3491 3492 struct wcn36xx_hal_configure_rxp_filter_req_msg { 3493 struct wcn36xx_hal_msg_header header; 3494 3495 u8 set_mcst_bcst_filter_setting; 3496 u8 set_mcst_bcst_filter; 3497 }; 3498 3499 struct wcn36xx_hal_enter_imps_rsp_msg { 3500 struct wcn36xx_hal_msg_header header; 3501 3502 /* success or failure */ 3503 u32 status; 3504 }; 3505 3506 struct wcn36xx_hal_exit_imps_rsp_msg { 3507 struct wcn36xx_hal_msg_header header; 3508 3509 /* success or failure */ 3510 u32 status; 3511 }; 3512 3513 struct wcn36xx_hal_enter_bmps_rsp_msg { 3514 struct wcn36xx_hal_msg_header header; 3515 3516 /* success or failure */ 3517 u32 status; 3518 3519 u8 bss_index; 3520 } __packed; 3521 3522 struct wcn36xx_hal_exit_bmps_rsp_msg { 3523 struct wcn36xx_hal_msg_header header; 3524 3525 /* success or failure */ 3526 u32 status; 3527 3528 u8 bss_index; 3529 } __packed; 3530 3531 struct wcn36xx_hal_enter_uapsd_rsp_msg { 3532 struct wcn36xx_hal_msg_header header; 3533 3534 /* success or failure */ 3535 u32 status; 3536 3537 u8 bss_index; 3538 }; 3539 3540 struct wcn36xx_hal_exit_uapsd_rsp_msg { 3541 struct wcn36xx_hal_msg_header header; 3542 3543 /* success or failure */ 3544 u32 status; 3545 3546 u8 bss_index; 3547 }; 3548 3549 struct wcn36xx_hal_rssi_notification_ind_msg { 3550 struct wcn36xx_hal_msg_header header; 3551 3552 u32 rssi_thres1_pos_cross:1; 3553 u32 rssi_thres1_neg_cross:1; 3554 u32 rssi_thres2_pos_cross:1; 3555 u32 rssi_thres2_neg_cross:1; 3556 u32 rssi_thres3_pos_cross:1; 3557 u32 rssi_thres3_neg_cross:1; 3558 u32 avg_rssi:8; 3559 u32 reserved:18; 3560 3561 }; 3562 3563 struct wcn36xx_hal_get_rssio_rsp_msg { 3564 struct wcn36xx_hal_msg_header header; 3565 3566 /* success or failure */ 3567 u32 status; 3568 s8 rssi; 3569 3570 }; 3571 3572 struct wcn36xx_hal_get_roam_rssi_rsp_msg { 3573 struct wcn36xx_hal_msg_header header; 3574 3575 /* success or failure */ 3576 u32 status; 3577 3578 u8 sta_id; 3579 s8 rssi; 3580 }; 3581 3582 struct wcn36xx_hal_wowl_enter_rsp_msg { 3583 struct wcn36xx_hal_msg_header header; 3584 3585 /* success or failure */ 3586 u32 status; 3587 u8 bss_index; 3588 }; 3589 3590 struct wcn36xx_hal_wowl_exit_rsp_msg { 3591 struct wcn36xx_hal_msg_header header; 3592 3593 /* success or failure */ 3594 u32 status; 3595 u8 bss_index; 3596 }; 3597 3598 struct wcn36xx_hal_add_bcn_filter_rsp_msg { 3599 struct wcn36xx_hal_msg_header header; 3600 3601 /* success or failure */ 3602 u32 status; 3603 }; 3604 3605 struct wcn36xx_hal_rem_bcn_filter_rsp_msg { 3606 struct wcn36xx_hal_msg_header header; 3607 3608 /* success or failure */ 3609 u32 status; 3610 }; 3611 3612 struct wcn36xx_hal_add_wowl_bcast_ptrn_rsp_msg { 3613 struct wcn36xx_hal_msg_header header; 3614 3615 /* success or failure */ 3616 u32 status; 3617 u8 bss_index; 3618 }; 3619 3620 struct wcn36xx_hal_del_wowl_bcast_ptrn_rsp_msg { 3621 struct wcn36xx_hal_msg_header header; 3622 3623 /* success or failure */ 3624 u32 status; 3625 u8 bss_index; 3626 }; 3627 3628 struct wcn36xx_hal_host_offload_rsp_msg { 3629 struct wcn36xx_hal_msg_header header; 3630 3631 /* success or failure */ 3632 u32 status; 3633 }; 3634 3635 struct wcn36xx_hal_keep_alive_rsp_msg { 3636 struct wcn36xx_hal_msg_header header; 3637 3638 /* success or failure */ 3639 u32 status; 3640 }; 3641 3642 struct wcn36xx_hal_set_rssi_thresh_rsp_msg { 3643 struct wcn36xx_hal_msg_header header; 3644 3645 /* success or failure */ 3646 u32 status; 3647 }; 3648 3649 struct wcn36xx_hal_set_uapsd_ac_params_rsp_msg { 3650 struct wcn36xx_hal_msg_header header; 3651 3652 /* success or failure */ 3653 u32 status; 3654 }; 3655 3656 struct wcn36xx_hal_configure_rxp_filter_rsp_msg { 3657 struct wcn36xx_hal_msg_header header; 3658 3659 /* success or failure */ 3660 u32 status; 3661 }; 3662 3663 struct set_max_tx_pwr_req { 3664 struct wcn36xx_hal_msg_header header; 3665 3666 /* BSSID is needed to identify which session issued this request. 3667 * As the request has power constraints, this should be applied 3668 * only to that session */ 3669 u8 bssid[ETH_ALEN]; 3670 3671 u8 self_addr[ETH_ALEN]; 3672 3673 /* In request, power == MaxTx power to be used. */ 3674 u8 power; 3675 }; 3676 3677 struct set_max_tx_pwr_rsp_msg { 3678 struct wcn36xx_hal_msg_header header; 3679 3680 /* power == tx power used for management frames */ 3681 u8 power; 3682 3683 /* success or failure */ 3684 u32 status; 3685 }; 3686 3687 struct set_tx_pwr_req_msg { 3688 struct wcn36xx_hal_msg_header header; 3689 3690 /* TX Power in milli watts */ 3691 u32 tx_power; 3692 3693 u8 bss_index; 3694 }; 3695 3696 struct set_tx_pwr_rsp_msg { 3697 struct wcn36xx_hal_msg_header header; 3698 3699 /* success or failure */ 3700 u32 status; 3701 }; 3702 3703 struct get_tx_pwr_req_msg { 3704 struct wcn36xx_hal_msg_header header; 3705 3706 u8 sta_id; 3707 }; 3708 3709 struct get_tx_pwr_rsp_msg { 3710 struct wcn36xx_hal_msg_header header; 3711 3712 /* success or failure */ 3713 u32 status; 3714 3715 /* TX Power in milli watts */ 3716 u32 tx_power; 3717 }; 3718 3719 struct set_p2p_gonoa_req_msg { 3720 struct wcn36xx_hal_msg_header header; 3721 3722 u8 opp_ps; 3723 u32 ct_window; 3724 u8 count; 3725 u32 duration; 3726 u32 interval; 3727 u32 single_noa_duration; 3728 u8 ps_selection; 3729 }; 3730 3731 struct set_p2p_gonoa_rsp_msg { 3732 struct wcn36xx_hal_msg_header header; 3733 3734 /* success or failure */ 3735 u32 status; 3736 }; 3737 3738 struct wcn36xx_hal_add_sta_self_req { 3739 struct wcn36xx_hal_msg_header header; 3740 3741 u8 self_addr[ETH_ALEN]; 3742 u32 status; 3743 } __packed; 3744 3745 struct wcn36xx_hal_add_sta_self_rsp_msg { 3746 struct wcn36xx_hal_msg_header header; 3747 3748 /* success or failure */ 3749 u32 status; 3750 3751 /* Self STA Index */ 3752 u8 self_sta_index; 3753 3754 /* DPU Index (IGTK, PTK, GTK all same) */ 3755 u8 dpu_index; 3756 3757 /* DPU Signature */ 3758 u8 dpu_signature; 3759 } __packed; 3760 3761 struct wcn36xx_hal_del_sta_self_req_msg { 3762 struct wcn36xx_hal_msg_header header; 3763 3764 u8 self_addr[ETH_ALEN]; 3765 } __packed; 3766 3767 struct wcn36xx_hal_del_sta_self_rsp_msg { 3768 struct wcn36xx_hal_msg_header header; 3769 3770 /*success or failure */ 3771 u32 status; 3772 3773 u8 self_addr[ETH_ALEN]; 3774 } __packed; 3775 3776 struct aggr_add_ts_req { 3777 struct wcn36xx_hal_msg_header header; 3778 3779 /* Station Index */ 3780 u16 sta_idx; 3781 3782 /* TSPEC handler uniquely identifying a TSPEC for a STA in a BSS. 3783 * This will carry the bitmap with the bit positions representing 3784 * different AC.s */ 3785 u16 tspec_index; 3786 3787 /* Tspec info per AC To program TPE with required parameters */ 3788 struct wcn36xx_hal_tspec_ie tspec[WCN36XX_HAL_MAX_AC]; 3789 3790 /* U-APSD Flags: 1b per AC. Encoded as follows: 3791 b7 b6 b5 b4 b3 b2 b1 b0 = 3792 X X X X BE BK VI VO */ 3793 u8 uapsd; 3794 3795 /* These parameters are for all the access categories */ 3796 3797 /* Service Interval */ 3798 u32 service_interval[WCN36XX_HAL_MAX_AC]; 3799 3800 /* Suspend Interval */ 3801 u32 suspend_interval[WCN36XX_HAL_MAX_AC]; 3802 3803 /* Delay Interval */ 3804 u32 delay_interval[WCN36XX_HAL_MAX_AC]; 3805 }; 3806 3807 struct aggr_add_ts_rsp_msg { 3808 struct wcn36xx_hal_msg_header header; 3809 3810 /* success or failure */ 3811 u32 status0; 3812 3813 /* FIXME PRIMA for future use for 11R */ 3814 u32 status1; 3815 }; 3816 3817 struct wcn36xx_hal_configure_apps_cpu_wakeup_state_req_msg { 3818 struct wcn36xx_hal_msg_header header; 3819 3820 u8 is_apps_cpu_awake; 3821 }; 3822 3823 struct wcn36xx_hal_configure_apps_cpu_wakeup_state_rsp_msg { 3824 struct wcn36xx_hal_msg_header header; 3825 3826 /* success or failure */ 3827 u32 status; 3828 }; 3829 3830 struct wcn36xx_hal_dump_cmd_req_msg { 3831 struct wcn36xx_hal_msg_header header; 3832 3833 u32 arg1; 3834 u32 arg2; 3835 u32 arg3; 3836 u32 arg4; 3837 u32 arg5; 3838 } __packed; 3839 3840 struct wcn36xx_hal_dump_cmd_rsp_msg { 3841 struct wcn36xx_hal_msg_header header; 3842 3843 /* success or failure */ 3844 u32 status; 3845 3846 /* Length of the responce message */ 3847 u32 rsp_length; 3848 3849 /* FIXME: Currently considering the the responce will be less than 3850 * 100bytes */ 3851 u8 rsp_buffer[DUMPCMD_RSP_BUFFER]; 3852 } __packed; 3853 3854 #define WLAN_COEX_IND_DATA_SIZE (4) 3855 #define WLAN_COEX_IND_TYPE_DISABLE_HB_MONITOR (0) 3856 #define WLAN_COEX_IND_TYPE_ENABLE_HB_MONITOR (1) 3857 3858 struct coex_ind_msg { 3859 struct wcn36xx_hal_msg_header header; 3860 3861 /* Coex Indication Type */ 3862 u32 type; 3863 3864 /* Coex Indication Data */ 3865 u32 data[WLAN_COEX_IND_DATA_SIZE]; 3866 }; 3867 3868 struct wcn36xx_hal_tx_compl_ind_msg { 3869 struct wcn36xx_hal_msg_header header; 3870 3871 /* Tx Complete Indication Success or Failure */ 3872 u32 status; 3873 }; 3874 3875 struct wcn36xx_hal_wlan_host_suspend_ind_msg { 3876 struct wcn36xx_hal_msg_header header; 3877 3878 u32 configured_mcst_bcst_filter_setting; 3879 u32 active_session_count; 3880 }; 3881 3882 struct wcn36xx_hal_wlan_exclude_unencrpted_ind_msg { 3883 struct wcn36xx_hal_msg_header header; 3884 3885 u8 dot11_exclude_unencrypted; 3886 u8 bssid[ETH_ALEN]; 3887 }; 3888 3889 struct noa_attr_ind_msg { 3890 struct wcn36xx_hal_msg_header header; 3891 3892 u8 index; 3893 u8 opp_ps_flag; 3894 u16 ctwin; 3895 3896 u16 noa1_interval_count; 3897 u16 bss_index; 3898 u32 noa1_duration; 3899 u32 noa1_interval; 3900 u32 noa1_starttime; 3901 3902 u16 noa2_interval_count; 3903 u16 reserved2; 3904 u32 noa2_duration; 3905 u32 noa2_interval; 3906 u32 noa2_start_time; 3907 3908 u32 status; 3909 }; 3910 3911 struct noa_start_ind_msg { 3912 struct wcn36xx_hal_msg_header header; 3913 3914 u32 status; 3915 u32 bss_index; 3916 }; 3917 3918 struct wcn36xx_hal_wlan_host_resume_req_msg { 3919 struct wcn36xx_hal_msg_header header; 3920 3921 u8 configured_mcst_bcst_filter_setting; 3922 }; 3923 3924 struct wcn36xx_hal_host_resume_rsp_msg { 3925 struct wcn36xx_hal_msg_header header; 3926 3927 /* success or failure */ 3928 u32 status; 3929 }; 3930 3931 struct wcn36xx_hal_del_ba_ind_msg { 3932 struct wcn36xx_hal_msg_header header; 3933 3934 u16 sta_idx; 3935 3936 /* Peer MAC Address, whose BA session has timed out */ 3937 u8 peer_addr[ETH_ALEN]; 3938 3939 /* TID for which a BA session timeout is being triggered */ 3940 u8 ba_tid; 3941 3942 /* DELBA direction 3943 * 1 - Originator 3944 * 0 - Recipient 3945 */ 3946 u8 direction; 3947 3948 u32 reason_code; 3949 3950 /* TO SUPPORT BT-AMP */ 3951 u8 bssid[ETH_ALEN]; 3952 }; 3953 3954 /* PNO Messages */ 3955 3956 /* Max number of channels that a network can be found on */ 3957 #define WCN36XX_HAL_PNO_MAX_NETW_CHANNELS 26 3958 3959 /* Max number of channels that a network can be found on */ 3960 #define WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX 60 3961 3962 /* Maximum numbers of networks supported by PNO */ 3963 #define WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS 16 3964 3965 /* The number of scan time intervals that can be programmed into PNO */ 3966 #define WCN36XX_HAL_PNO_MAX_SCAN_TIMERS 10 3967 3968 /* Maximum size of the probe template */ 3969 #define WCN36XX_HAL_PNO_MAX_PROBE_SIZE 450 3970 3971 /* Type of PNO enabling: 3972 * 3973 * Immediate - scanning will start immediately and PNO procedure will be 3974 * repeated based on timer 3975 * 3976 * Suspend - scanning will start at suspend 3977 * 3978 * Resume - scanning will start on system resume 3979 */ 3980 enum pno_mode { 3981 PNO_MODE_IMMEDIATE, 3982 PNO_MODE_ON_SUSPEND, 3983 PNO_MODE_ON_RESUME, 3984 PNO_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 3985 }; 3986 3987 /* Authentication type */ 3988 enum auth_type { 3989 AUTH_TYPE_ANY = 0, 3990 AUTH_TYPE_OPEN_SYSTEM = 1, 3991 3992 /* Upper layer authentication types */ 3993 AUTH_TYPE_WPA = 2, 3994 AUTH_TYPE_WPA_PSK = 3, 3995 3996 AUTH_TYPE_RSN = 4, 3997 AUTH_TYPE_RSN_PSK = 5, 3998 AUTH_TYPE_FT_RSN = 6, 3999 AUTH_TYPE_FT_RSN_PSK = 7, 4000 AUTH_TYPE_WAPI_WAI_CERTIFICATE = 8, 4001 AUTH_TYPE_WAPI_WAI_PSK = 9, 4002 4003 AUTH_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 4004 }; 4005 4006 /* Encryption type */ 4007 enum ed_type { 4008 ED_ANY = 0, 4009 ED_NONE = 1, 4010 ED_WEP = 2, 4011 ED_TKIP = 3, 4012 ED_CCMP = 4, 4013 ED_WPI = 5, 4014 4015 ED_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 4016 }; 4017 4018 /* SSID broadcast type */ 4019 enum ssid_bcast_type { 4020 BCAST_UNKNOWN = 0, 4021 BCAST_NORMAL = 1, 4022 BCAST_HIDDEN = 2, 4023 4024 BCAST_TYPE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE 4025 }; 4026 4027 /* The network description for which PNO will have to look for */ 4028 struct network_type { 4029 /* SSID of the BSS */ 4030 struct wcn36xx_hal_mac_ssid ssid; 4031 4032 /* Authentication type for the network */ 4033 enum auth_type authentication; 4034 4035 /* Encryption type for the network */ 4036 enum ed_type encryption; 4037 4038 /* Indicate the channel on which the Network can be found 0 - if 4039 * all channels */ 4040 u8 channel_count; 4041 u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS]; 4042 4043 /* Indicates the RSSI threshold for the network to be considered */ 4044 u8 rssi_threshold; 4045 }; 4046 4047 struct scan_timer { 4048 /* How much it should wait */ 4049 u32 value; 4050 4051 /* How many times it should repeat that wait value 0 - keep using 4052 * this timer until PNO is disabled */ 4053 u32 repeat; 4054 4055 /* e.g: 2 3 4 0 - it will wait 2s between consecutive scans for 3 4056 * times - after that it will wait 4s between consecutive scans 4057 * until disabled */ 4058 }; 4059 4060 /* The network parameters to be sent to the PNO algorithm */ 4061 struct scan_timers_type { 4062 /* set to 0 if you wish for PNO to use its default telescopic timer */ 4063 u8 count; 4064 4065 /* A set value represents the amount of time that PNO will wait 4066 * between two consecutive scan procedures If the desired is for a 4067 * uniform timer that fires always at the exact same interval - one 4068 * single value is to be set If there is a desire for a more 4069 * complex - telescopic like timer multiple values can be set - 4070 * once PNO reaches the end of the array it will continue scanning 4071 * at intervals presented by the last value */ 4072 struct scan_timer values[WCN36XX_HAL_PNO_MAX_SCAN_TIMERS]; 4073 }; 4074 4075 /* Preferred network list request */ 4076 struct set_pref_netw_list_req { 4077 struct wcn36xx_hal_msg_header header; 4078 4079 /* Enable PNO */ 4080 u32 enable; 4081 4082 /* Immediate, On Suspend, On Resume */ 4083 enum pno_mode mode; 4084 4085 /* Number of networks sent for PNO */ 4086 u32 networks_count; 4087 4088 /* The networks that PNO needs to look for */ 4089 struct network_type networks[WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS]; 4090 4091 /* The scan timers required for PNO */ 4092 struct scan_timers_type scan_timers; 4093 4094 /* Probe template for 2.4GHz band */ 4095 u16 band_24g_probe_size; 4096 u8 band_24g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE]; 4097 4098 /* Probe template for 5GHz band */ 4099 u16 band_5g_probe_size; 4100 u8 band_5g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE]; 4101 }; 4102 4103 /* The network description for which PNO will have to look for */ 4104 struct network_type_new { 4105 /* SSID of the BSS */ 4106 struct wcn36xx_hal_mac_ssid ssid; 4107 4108 /* Authentication type for the network */ 4109 enum auth_type authentication; 4110 4111 /* Encryption type for the network */ 4112 enum ed_type encryption; 4113 4114 /* SSID broadcast type, normal, hidden or unknown */ 4115 enum ssid_bcast_type bcast_network_type; 4116 4117 /* Indicate the channel on which the Network can be found 0 - if 4118 * all channels */ 4119 u8 channel_count; 4120 u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS]; 4121 4122 /* Indicates the RSSI threshold for the network to be considered */ 4123 u8 rssi_threshold; 4124 }; 4125 4126 /* Preferred network list request new */ 4127 struct set_pref_netw_list_req_new { 4128 struct wcn36xx_hal_msg_header header; 4129 4130 /* Enable PNO */ 4131 u32 enable; 4132 4133 /* Immediate, On Suspend, On Resume */ 4134 enum pno_mode mode; 4135 4136 /* Number of networks sent for PNO */ 4137 u32 networks_count; 4138 4139 /* The networks that PNO needs to look for */ 4140 struct network_type_new networks[WCN36XX_HAL_PNO_MAX_SUPP_NETWORKS]; 4141 4142 /* The scan timers required for PNO */ 4143 struct scan_timers_type scan_timers; 4144 4145 /* Probe template for 2.4GHz band */ 4146 u16 band_24g_probe_size; 4147 u8 band_24g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE]; 4148 4149 /* Probe template for 5GHz band */ 4150 u16 band_5g_probe_size; 4151 u8 band_5g_probe_template[WCN36XX_HAL_PNO_MAX_PROBE_SIZE]; 4152 }; 4153 4154 /* Preferred network list response */ 4155 struct set_pref_netw_list_resp { 4156 struct wcn36xx_hal_msg_header header; 4157 4158 /* status of the request - just to indicate that PNO has 4159 * acknowledged the request and will start scanning */ 4160 u32 status; 4161 }; 4162 4163 /* Preferred network found indication */ 4164 struct pref_netw_found_ind { 4165 4166 struct wcn36xx_hal_msg_header header; 4167 4168 /* Network that was found with the highest RSSI */ 4169 struct wcn36xx_hal_mac_ssid ssid; 4170 4171 /* Indicates the RSSI */ 4172 u8 rssi; 4173 }; 4174 4175 /* RSSI Filter request */ 4176 struct set_rssi_filter_req { 4177 struct wcn36xx_hal_msg_header header; 4178 4179 /* RSSI Threshold */ 4180 u8 rssi_threshold; 4181 }; 4182 4183 /* Set RSSI filter resp */ 4184 struct set_rssi_filter_resp { 4185 struct wcn36xx_hal_msg_header header; 4186 4187 /* status of the request */ 4188 u32 status; 4189 }; 4190 4191 /* Update scan params - sent from host to PNO to be used during PNO 4192 * scanningx */ 4193 struct wcn36xx_hal_update_scan_params_req { 4194 4195 struct wcn36xx_hal_msg_header header; 4196 4197 /* Host setting for 11d */ 4198 u8 dot11d_enabled; 4199 4200 /* Lets PNO know that host has determined the regulatory domain */ 4201 u8 dot11d_resolved; 4202 4203 /* Channels on which PNO is allowed to scan */ 4204 u8 channel_count; 4205 u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS]; 4206 4207 /* Minimum channel time */ 4208 u16 active_min_ch_time; 4209 4210 /* Maximum channel time */ 4211 u16 active_max_ch_time; 4212 4213 /* Minimum channel time */ 4214 u16 passive_min_ch_time; 4215 4216 /* Maximum channel time */ 4217 u16 passive_max_ch_time; 4218 4219 /* Cb State */ 4220 enum phy_chan_bond_state state; 4221 } __packed; 4222 4223 /* Update scan params - sent from host to PNO to be used during PNO 4224 * scanningx */ 4225 struct wcn36xx_hal_update_scan_params_req_ex { 4226 4227 struct wcn36xx_hal_msg_header header; 4228 4229 /* Host setting for 11d */ 4230 u8 dot11d_enabled; 4231 4232 /* Lets PNO know that host has determined the regulatory domain */ 4233 u8 dot11d_resolved; 4234 4235 /* Channels on which PNO is allowed to scan */ 4236 u8 channel_count; 4237 u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX]; 4238 4239 /* Minimum channel time */ 4240 u16 active_min_ch_time; 4241 4242 /* Maximum channel time */ 4243 u16 active_max_ch_time; 4244 4245 /* Minimum channel time */ 4246 u16 passive_min_ch_time; 4247 4248 /* Maximum channel time */ 4249 u16 passive_max_ch_time; 4250 4251 /* Cb State */ 4252 enum phy_chan_bond_state state; 4253 } __packed; 4254 4255 /* Update scan params - sent from host to PNO to be used during PNO 4256 * scanningx */ 4257 struct wcn36xx_hal_update_scan_params_resp { 4258 4259 struct wcn36xx_hal_msg_header header; 4260 4261 /* status of the request */ 4262 u32 status; 4263 } __packed; 4264 4265 struct wcn36xx_hal_set_tx_per_tracking_req_msg { 4266 struct wcn36xx_hal_msg_header header; 4267 4268 /* 0: disable, 1:enable */ 4269 u8 tx_per_tracking_enable; 4270 4271 /* Check period, unit is sec. */ 4272 u8 tx_per_tracking_period; 4273 4274 /* (Fail TX packet)/(Total TX packet) ratio, the unit is 10%. */ 4275 u8 tx_per_tracking_ratio; 4276 4277 /* A watermark of check number, once the tx packet exceed this 4278 * number, we do the check, default is 5 */ 4279 u32 tx_per_tracking_watermark; 4280 }; 4281 4282 struct wcn36xx_hal_set_tx_per_tracking_rsp_msg { 4283 struct wcn36xx_hal_msg_header header; 4284 4285 /* success or failure */ 4286 u32 status; 4287 4288 }; 4289 4290 struct tx_per_hit_ind_msg { 4291 struct wcn36xx_hal_msg_header header; 4292 }; 4293 4294 /* Packet Filtering Definitions Begin */ 4295 #define WCN36XX_HAL_PROTOCOL_DATA_LEN 8 4296 #define WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS 240 4297 #define WCN36XX_HAL_MAX_NUM_FILTERS 20 4298 #define WCN36XX_HAL_MAX_CMP_PER_FILTER 10 4299 4300 enum wcn36xx_hal_receive_packet_filter_type { 4301 HAL_RCV_FILTER_TYPE_INVALID, 4302 HAL_RCV_FILTER_TYPE_FILTER_PKT, 4303 HAL_RCV_FILTER_TYPE_BUFFER_PKT, 4304 HAL_RCV_FILTER_TYPE_MAX_ENUM_SIZE 4305 }; 4306 4307 enum wcn36xx_hal_rcv_pkt_flt_protocol_type { 4308 HAL_FILTER_PROTO_TYPE_INVALID, 4309 HAL_FILTER_PROTO_TYPE_MAC, 4310 HAL_FILTER_PROTO_TYPE_ARP, 4311 HAL_FILTER_PROTO_TYPE_IPV4, 4312 HAL_FILTER_PROTO_TYPE_IPV6, 4313 HAL_FILTER_PROTO_TYPE_UDP, 4314 HAL_FILTER_PROTO_TYPE_MAX 4315 }; 4316 4317 enum wcn36xx_hal_rcv_pkt_flt_cmp_flag_type { 4318 HAL_FILTER_CMP_TYPE_INVALID, 4319 HAL_FILTER_CMP_TYPE_EQUAL, 4320 HAL_FILTER_CMP_TYPE_MASK_EQUAL, 4321 HAL_FILTER_CMP_TYPE_NOT_EQUAL, 4322 HAL_FILTER_CMP_TYPE_MAX 4323 }; 4324 4325 struct wcn36xx_hal_rcv_pkt_filter_params { 4326 u8 protocol_layer; 4327 u8 cmp_flag; 4328 4329 /* Length of the data to compare */ 4330 u16 data_length; 4331 4332 /* from start of the respective frame header */ 4333 u8 data_offset; 4334 4335 /* Reserved field */ 4336 u8 reserved; 4337 4338 /* Data to compare */ 4339 u8 compare_data[WCN36XX_HAL_PROTOCOL_DATA_LEN]; 4340 4341 /* Mask to be applied on the received packet data before compare */ 4342 u8 data_mask[WCN36XX_HAL_PROTOCOL_DATA_LEN]; 4343 }; 4344 4345 struct wcn36xx_hal_sessionized_rcv_pkt_filter_cfg_type { 4346 u8 id; 4347 u8 type; 4348 u8 params_count; 4349 u32 coleasce_time; 4350 u8 bss_index; 4351 struct wcn36xx_hal_rcv_pkt_filter_params params[1]; 4352 }; 4353 4354 struct wcn36xx_hal_set_rcv_pkt_filter_req_msg { 4355 struct wcn36xx_hal_msg_header header; 4356 4357 u8 id; 4358 u8 type; 4359 u8 params_count; 4360 u32 coalesce_time; 4361 struct wcn36xx_hal_rcv_pkt_filter_params params[1]; 4362 }; 4363 4364 struct wcn36xx_hal_rcv_flt_mc_addr_list_type { 4365 /* from start of the respective frame header */ 4366 u8 data_offset; 4367 4368 u32 mc_addr_count; 4369 u8 mc_addr[WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS][ETH_ALEN]; 4370 u8 bss_index; 4371 } __packed; 4372 4373 struct wcn36xx_hal_set_pkt_filter_rsp_msg { 4374 struct wcn36xx_hal_msg_header header; 4375 4376 /* success or failure */ 4377 u32 status; 4378 4379 u8 bss_index; 4380 }; 4381 4382 struct wcn36xx_hal_rcv_flt_pkt_match_cnt_req_msg { 4383 struct wcn36xx_hal_msg_header header; 4384 4385 u8 bss_index; 4386 }; 4387 4388 struct wcn36xx_hal_rcv_flt_pkt_match_cnt { 4389 u8 id; 4390 u32 match_cnt; 4391 }; 4392 4393 struct wcn36xx_hal_rcv_flt_pkt_match_cnt_rsp_msg { 4394 struct wcn36xx_hal_msg_header header; 4395 4396 /* Success or Failure */ 4397 u32 status; 4398 4399 u32 match_count; 4400 struct wcn36xx_hal_rcv_flt_pkt_match_cnt 4401 matches[WCN36XX_HAL_MAX_NUM_FILTERS]; 4402 u8 bss_index; 4403 }; 4404 4405 struct wcn36xx_hal_rcv_flt_pkt_clear_param { 4406 /* only valid for response message */ 4407 u32 status; 4408 u8 id; 4409 u8 bss_index; 4410 }; 4411 4412 struct wcn36xx_hal_rcv_flt_pkt_clear_req_msg { 4413 struct wcn36xx_hal_msg_header header; 4414 struct wcn36xx_hal_rcv_flt_pkt_clear_param param; 4415 }; 4416 4417 struct wcn36xx_hal_rcv_flt_pkt_clear_rsp_msg { 4418 struct wcn36xx_hal_msg_header header; 4419 struct wcn36xx_hal_rcv_flt_pkt_clear_param param; 4420 }; 4421 4422 struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_req_msg { 4423 struct wcn36xx_hal_msg_header header; 4424 struct wcn36xx_hal_rcv_flt_mc_addr_list_type mc_addr_list; 4425 } __packed; 4426 4427 struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_rsp_msg { 4428 struct wcn36xx_hal_msg_header header; 4429 u32 status; 4430 u8 bss_index; 4431 }; 4432 4433 /* Packet Filtering Definitions End */ 4434 4435 struct wcn36xx_hal_set_power_params_req_msg { 4436 struct wcn36xx_hal_msg_header header; 4437 4438 /* Ignore DTIM */ 4439 u32 ignore_dtim; 4440 4441 /* DTIM Period */ 4442 u32 dtim_period; 4443 4444 /* Listen Interval */ 4445 u32 listen_interval; 4446 4447 /* Broadcast Multicast Filter */ 4448 u32 bcast_mcast_filter; 4449 4450 /* Beacon Early Termination */ 4451 u32 enable_bet; 4452 4453 /* Beacon Early Termination Interval */ 4454 u32 bet_interval; 4455 } __packed; 4456 4457 struct wcn36xx_hal_set_power_params_resp { 4458 4459 struct wcn36xx_hal_msg_header header; 4460 4461 /* status of the request */ 4462 u32 status; 4463 } __packed; 4464 4465 /* Capability bitmap exchange definitions and macros starts */ 4466 4467 enum place_holder_in_cap_bitmap { 4468 MCC = 0, 4469 P2P = 1, 4470 DOT11AC = 2, 4471 SLM_SESSIONIZATION = 3, 4472 DOT11AC_OPMODE = 4, 4473 SAP32STA = 5, 4474 TDLS = 6, 4475 P2P_GO_NOA_DECOUPLE_INIT_SCAN = 7, 4476 WLANACTIVE_OFFLOAD = 8, 4477 BEACON_OFFLOAD = 9, 4478 SCAN_OFFLOAD = 10, 4479 ROAM_OFFLOAD = 11, 4480 BCN_MISS_OFFLOAD = 12, 4481 STA_POWERSAVE = 13, 4482 STA_ADVANCED_PWRSAVE = 14, 4483 AP_UAPSD = 15, 4484 AP_DFS = 16, 4485 BLOCKACK = 17, 4486 PHY_ERR = 18, 4487 BCN_FILTER = 19, 4488 RTT = 20, 4489 RATECTRL = 21, 4490 WOW = 22, 4491 WLAN_ROAM_SCAN_OFFLOAD = 23, 4492 SPECULATIVE_PS_POLL = 24, 4493 SCAN_SCH = 25, 4494 IBSS_HEARTBEAT_OFFLOAD = 26, 4495 WLAN_SCAN_OFFLOAD = 27, 4496 WLAN_PERIODIC_TX_PTRN = 28, 4497 ADVANCE_TDLS = 29, 4498 BATCH_SCAN = 30, 4499 FW_IN_TX_PATH = 31, 4500 EXTENDED_NSOFFLOAD_SLOT = 32, 4501 CH_SWITCH_V1 = 33, 4502 HT40_OBSS_SCAN = 34, 4503 UPDATE_CHANNEL_LIST = 35, 4504 WLAN_MCADDR_FLT = 36, 4505 WLAN_CH144 = 37, 4506 NAN = 38, 4507 TDLS_SCAN_COEXISTENCE = 39, 4508 LINK_LAYER_STATS_MEAS = 40, 4509 MU_MIMO = 41, 4510 EXTENDED_SCAN = 42, 4511 DYNAMIC_WMM_PS = 43, 4512 MAC_SPOOFED_SCAN = 44, 4513 BMU_ERROR_GENERIC_RECOVERY = 45, 4514 DISA = 46, 4515 FW_STATS = 47, 4516 WPS_PRBRSP_TMPL = 48, 4517 BCN_IE_FLT_DELTA = 49, 4518 TDLS_OFF_CHANNEL = 51, 4519 RTT3 = 52, 4520 MGMT_FRAME_LOGGING = 53, 4521 ENHANCED_TXBD_COMPLETION = 54, 4522 LOGGING_ENHANCEMENT = 55, 4523 EXT_SCAN_ENHANCED = 56, 4524 MEMORY_DUMP_SUPPORTED = 57, 4525 PER_PKT_STATS_SUPPORTED = 58, 4526 EXT_LL_STAT = 60, 4527 WIFI_CONFIG = 61, 4528 ANTENNA_DIVERSITY_SELECTION = 62, 4529 4530 MAX_FEATURE_SUPPORTED = 128, 4531 }; 4532 4533 #define WCN36XX_HAL_CAPS_SIZE 4 4534 4535 struct wcn36xx_hal_feat_caps_msg { 4536 4537 struct wcn36xx_hal_msg_header header; 4538 4539 u32 feat_caps[WCN36XX_HAL_CAPS_SIZE]; 4540 } __packed; 4541 4542 /* status codes to help debug rekey failures */ 4543 enum gtk_rekey_status { 4544 WCN36XX_HAL_GTK_REKEY_STATUS_SUCCESS = 0, 4545 4546 /* rekey detected, but not handled */ 4547 WCN36XX_HAL_GTK_REKEY_STATUS_NOT_HANDLED = 1, 4548 4549 /* MIC check error on M1 */ 4550 WCN36XX_HAL_GTK_REKEY_STATUS_MIC_ERROR = 2, 4551 4552 /* decryption error on M1 */ 4553 WCN36XX_HAL_GTK_REKEY_STATUS_DECRYPT_ERROR = 3, 4554 4555 /* M1 replay detected */ 4556 WCN36XX_HAL_GTK_REKEY_STATUS_REPLAY_ERROR = 4, 4557 4558 /* missing GTK key descriptor in M1 */ 4559 WCN36XX_HAL_GTK_REKEY_STATUS_MISSING_KDE = 5, 4560 4561 /* missing iGTK key descriptor in M1 */ 4562 WCN36XX_HAL_GTK_REKEY_STATUS_MISSING_IGTK_KDE = 6, 4563 4564 /* key installation error */ 4565 WCN36XX_HAL_GTK_REKEY_STATUS_INSTALL_ERROR = 7, 4566 4567 /* iGTK key installation error */ 4568 WCN36XX_HAL_GTK_REKEY_STATUS_IGTK_INSTALL_ERROR = 8, 4569 4570 /* GTK rekey M2 response TX error */ 4571 WCN36XX_HAL_GTK_REKEY_STATUS_RESP_TX_ERROR = 9, 4572 4573 /* non-specific general error */ 4574 WCN36XX_HAL_GTK_REKEY_STATUS_GEN_ERROR = 255 4575 }; 4576 4577 /* wake reason types */ 4578 enum wake_reason_type { 4579 WCN36XX_HAL_WAKE_REASON_NONE = 0, 4580 4581 /* magic packet match */ 4582 WCN36XX_HAL_WAKE_REASON_MAGIC_PACKET = 1, 4583 4584 /* host defined pattern match */ 4585 WCN36XX_HAL_WAKE_REASON_PATTERN_MATCH = 2, 4586 4587 /* EAP-ID frame detected */ 4588 WCN36XX_HAL_WAKE_REASON_EAPID_PACKET = 3, 4589 4590 /* start of EAPOL 4-way handshake detected */ 4591 WCN36XX_HAL_WAKE_REASON_EAPOL4WAY_PACKET = 4, 4592 4593 /* network scan offload match */ 4594 WCN36XX_HAL_WAKE_REASON_NETSCAN_OFFL_MATCH = 5, 4595 4596 /* GTK rekey status wakeup (see status) */ 4597 WCN36XX_HAL_WAKE_REASON_GTK_REKEY_STATUS = 6, 4598 4599 /* BSS connection lost */ 4600 WCN36XX_HAL_WAKE_REASON_BSS_CONN_LOST = 7, 4601 }; 4602 4603 /* 4604 Wake Packet which is saved at tWakeReasonParams.DataStart 4605 This data is sent for any wake reasons that involve a packet-based wakeup : 4606 4607 WCN36XX_HAL_WAKE_REASON_TYPE_MAGIC_PACKET 4608 WCN36XX_HAL_WAKE_REASON_TYPE_PATTERN_MATCH 4609 WCN36XX_HAL_WAKE_REASON_TYPE_EAPID_PACKET 4610 WCN36XX_HAL_WAKE_REASON_TYPE_EAPOL4WAY_PACKET 4611 WCN36XX_HAL_WAKE_REASON_TYPE_GTK_REKEY_STATUS 4612 4613 The information is provided to the host for auditing and debug purposes 4614 4615 */ 4616 4617 /* Wake reason indication */ 4618 struct wcn36xx_hal_wake_reason_ind { 4619 struct wcn36xx_hal_msg_header header; 4620 4621 /* see tWakeReasonType */ 4622 u32 reason; 4623 4624 /* argument specific to the reason type */ 4625 u32 reason_arg; 4626 4627 /* length of optional data stored in this message, in case HAL 4628 * truncates the data (i.e. data packets) this length will be less 4629 * than the actual length */ 4630 u32 stored_data_len; 4631 4632 /* actual length of data */ 4633 u32 actual_data_len; 4634 4635 /* variable length start of data (length == storedDataLen) see 4636 * specific wake type */ 4637 u8 data_start[1]; 4638 4639 u32 bss_index:8; 4640 u32 reserved:24; 4641 }; 4642 4643 #define WCN36XX_HAL_GTK_KEK_BYTES 16 4644 #define WCN36XX_HAL_GTK_KCK_BYTES 16 4645 4646 #define WCN36XX_HAL_GTK_OFFLOAD_FLAGS_DISABLE (1 << 0) 4647 4648 #define GTK_SET_BSS_KEY_TAG 0x1234AA55 4649 4650 struct wcn36xx_hal_gtk_offload_req_msg { 4651 struct wcn36xx_hal_msg_header header; 4652 4653 /* optional flags */ 4654 u32 flags; 4655 4656 /* Key confirmation key */ 4657 u8 kck[WCN36XX_HAL_GTK_KCK_BYTES]; 4658 4659 /* key encryption key */ 4660 u8 kek[WCN36XX_HAL_GTK_KEK_BYTES]; 4661 4662 /* replay counter */ 4663 u64 key_replay_counter; 4664 4665 u8 bss_index; 4666 }; 4667 4668 struct wcn36xx_hal_gtk_offload_rsp_msg { 4669 struct wcn36xx_hal_msg_header header; 4670 4671 /* success or failure */ 4672 u32 status; 4673 4674 u8 bss_index; 4675 }; 4676 4677 struct wcn36xx_hal_gtk_offload_get_info_req_msg { 4678 struct wcn36xx_hal_msg_header header; 4679 u8 bss_index; 4680 }; 4681 4682 struct wcn36xx_hal_gtk_offload_get_info_rsp_msg { 4683 struct wcn36xx_hal_msg_header header; 4684 4685 /* success or failure */ 4686 u32 status; 4687 4688 /* last rekey status when the rekey was offloaded */ 4689 u32 last_rekey_status; 4690 4691 /* current replay counter value */ 4692 u64 key_replay_counter; 4693 4694 /* total rekey attempts */ 4695 u32 total_rekey_count; 4696 4697 /* successful GTK rekeys */ 4698 u32 gtk_rekey_count; 4699 4700 /* successful iGTK rekeys */ 4701 u32 igtk_rekey_count; 4702 4703 u8 bss_index; 4704 }; 4705 4706 struct dhcp_info { 4707 /* Indicates the device mode which indicates about the DHCP activity */ 4708 u8 device_mode; 4709 4710 u8 addr[ETH_ALEN]; 4711 }; 4712 4713 struct dhcp_ind_status { 4714 struct wcn36xx_hal_msg_header header; 4715 4716 /* success or failure */ 4717 u32 status; 4718 }; 4719 4720 /* 4721 * Thermal Mitigation mode of operation. 4722 * 4723 * WCN36XX_HAL_THERMAL_MITIGATION_MODE_0 - Based on AMPDU disabling aggregation 4724 * 4725 * WCN36XX_HAL_THERMAL_MITIGATION_MODE_1 - Based on AMPDU disabling aggregation 4726 * and reducing transmit power 4727 * 4728 * WCN36XX_HAL_THERMAL_MITIGATION_MODE_2 - Not supported */ 4729 enum wcn36xx_hal_thermal_mitigation_mode_type { 4730 HAL_THERMAL_MITIGATION_MODE_INVALID = -1, 4731 HAL_THERMAL_MITIGATION_MODE_0, 4732 HAL_THERMAL_MITIGATION_MODE_1, 4733 HAL_THERMAL_MITIGATION_MODE_2, 4734 HAL_THERMAL_MITIGATION_MODE_MAX = WCN36XX_HAL_MAX_ENUM_SIZE, 4735 }; 4736 4737 4738 /* 4739 * Thermal Mitigation level. 4740 * Note the levels are incremental i.e WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_2 = 4741 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_0 + 4742 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_1 4743 * 4744 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_0 - lowest level of thermal mitigation. 4745 * This level indicates normal mode of operation 4746 * 4747 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_1 - 1st level of thermal mitigation 4748 * 4749 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_2 - 2nd level of thermal mitigation 4750 * 4751 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_3 - 3rd level of thermal mitigation 4752 * 4753 * WCN36XX_HAL_THERMAL_MITIGATION_LEVEL_4 - 4th level of thermal mitigation 4754 */ 4755 enum wcn36xx_hal_thermal_mitigation_level_type { 4756 HAL_THERMAL_MITIGATION_LEVEL_INVALID = -1, 4757 HAL_THERMAL_MITIGATION_LEVEL_0, 4758 HAL_THERMAL_MITIGATION_LEVEL_1, 4759 HAL_THERMAL_MITIGATION_LEVEL_2, 4760 HAL_THERMAL_MITIGATION_LEVEL_3, 4761 HAL_THERMAL_MITIGATION_LEVEL_4, 4762 HAL_THERMAL_MITIGATION_LEVEL_MAX = WCN36XX_HAL_MAX_ENUM_SIZE, 4763 }; 4764 4765 4766 /* WCN36XX_HAL_SET_THERMAL_MITIGATION_REQ */ 4767 struct set_thermal_mitigation_req_msg { 4768 struct wcn36xx_hal_msg_header header; 4769 4770 /* Thermal Mitigation Operation Mode */ 4771 enum wcn36xx_hal_thermal_mitigation_mode_type mode; 4772 4773 /* Thermal Mitigation Level */ 4774 enum wcn36xx_hal_thermal_mitigation_level_type level; 4775 }; 4776 4777 struct set_thermal_mitigation_resp { 4778 4779 struct wcn36xx_hal_msg_header header; 4780 4781 /* status of the request */ 4782 u32 status; 4783 }; 4784 4785 /* Per STA Class B Statistics. Class B statistics are STA TX/RX stats 4786 * provided to FW from Host via periodic messages */ 4787 struct stats_class_b_ind { 4788 struct wcn36xx_hal_msg_header header; 4789 4790 /* Duration over which this stats was collected */ 4791 u32 duration; 4792 4793 /* Per STA Stats */ 4794 4795 /* TX stats */ 4796 u32 tx_bytes_pushed; 4797 u32 tx_packets_pushed; 4798 4799 /* RX stats */ 4800 u32 rx_bytes_rcvd; 4801 u32 rx_packets_rcvd; 4802 u32 rx_time_total; 4803 }; 4804 4805 /* WCN36XX_HAL_PRINT_REG_INFO_IND */ 4806 struct wcn36xx_hal_print_reg_info_ind { 4807 struct wcn36xx_hal_msg_header header; 4808 4809 u32 count; 4810 u32 scenario; 4811 u32 reason; 4812 4813 struct { 4814 u32 addr; 4815 u32 value; 4816 } regs[]; 4817 } __packed; 4818 4819 #endif /* _HAL_H_ */ 4820