Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Abhishek Singh | 5432c35 | 2019-01-02 17:11:44 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | /* |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 20 | * This file lim_utils.h contains the utility definitions |
| 21 | * LIM uses. |
| 22 | * Author: Chandra Modumudi |
| 23 | * Date: 02/13/02 |
| 24 | * History:- |
| 25 | * Date Modified by Modification Information |
| 26 | * -------------------------------------------------------------------- |
| 27 | */ |
| 28 | #ifndef __LIM_UTILS_H |
| 29 | #define __LIM_UTILS_H |
| 30 | |
| 31 | #include "sir_api.h" |
| 32 | #include "sir_debug.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 33 | |
| 34 | #include "lim_types.h" |
| 35 | #include "lim_scan_result_utils.h" |
| 36 | #include "lim_timer_utils.h" |
| 37 | #include "lim_trace.h" |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 38 | #include "include/wlan_vdev_mlme.h" |
Abhishek Singh | 20a8e44 | 2018-09-12 15:50:44 +0530 | [diff] [blame] | 39 | #include "wlan_mlme_vdev_mgr_interface.h" |
Jeff Johnson | b07230f | 2019-02-19 17:47:39 -0800 | [diff] [blame] | 40 | #include "wlan_qct_sys.h" |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 41 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 42 | typedef enum { |
| 43 | ONE_BYTE = 1, |
| 44 | TWO_BYTE = 2 |
| 45 | } eSizeOfLenField; |
| 46 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | #define LIM_AID_MASK 0xC000 |
| 48 | #define LIM_SPECTRUM_MANAGEMENT_BIT_MASK 0x0100 |
| 49 | #define LIM_RRM_BIT_MASK 0x1000 |
| 50 | #define LIM_SHORT_PREAMBLE_BIT_MASK 0x0020 |
| 51 | #define LIM_IMMEDIATE_BLOCK_ACK_MASK 0x8000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 52 | #define LIM_MAX_REASSOC_RETRY_LIMIT 2 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 53 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | #define VHT_MCS_3x3_MASK 0x30 |
| 55 | #define VHT_MCS_2x2_MASK 0x0C |
| 56 | |
Kiran Kumar Lokere | e38f4d2 | 2016-10-20 17:30:59 -0700 | [diff] [blame] | 57 | #define CENTER_FREQ_DIFF_160MHz 8 |
| 58 | #define CENTER_FREQ_DIFF_80P80MHz 16 |
| 59 | |
Kiran Kumar Lokere | 05a0658a | 2018-02-01 21:34:27 -0800 | [diff] [blame] | 60 | #define CH_TO_CNTR_FREQ_DIFF_160MHz 14 |
| 61 | #define CH_TO_CNTR_FREQ_DIFF_80MHz 6 |
| 62 | |
Kiran Kumar Lokere | 9e58d23 | 2016-08-23 18:49:16 -0700 | [diff] [blame] | 63 | #define IS_VHT_NSS_1x1(__mcs_map) ((__mcs_map & 0xFFFC) == 0xFFFC) |
| 64 | |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 65 | #define MGMT_RX_PACKETS_THRESHOLD 200 |
| 66 | |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 67 | /* 11B AP detection bit position */ |
| 68 | #define OBSS_DETECTION_11B_AP_BIT_MASK 0x0001 |
| 69 | /* 11B STA detection bit position */ |
| 70 | #define OBSS_DETECTION_11B_STA_BIT_MASK 0x0002 |
| 71 | /* 11G AP detection bit position */ |
| 72 | #define OBSS_DETECTION_11G_AP_BIT_MASK 0x0004 |
| 73 | /* 11A AP detection bit position */ |
| 74 | #define OBSS_DETECTION_11A_BIT_MASK 0x0008 |
| 75 | /* HT legacy detection bit position */ |
| 76 | #define OBSS_DETECTION_HT_LEGACY_BIT_MASK 0x0010 |
| 77 | /* HT mixed detection bit position */ |
| 78 | #define OBSS_DETECTION_HT_MIXED_BIT_MASK 0x0020 |
| 79 | /* HT 20mhz detection bit position */ |
| 80 | #define OBSS_DETECTION_HT_20MHZ_BIT_MASK 0x0040 |
| 81 | |
| 82 | /** |
| 83 | * OBSS detection period in ms, used by firmware to decide |
| 84 | * absent detection and also gap between same detection ind. |
| 85 | */ |
| 86 | #define OBSS_DETECTION_PERIOD_MS 4000 |
| 87 | |
| 88 | /* To check if 11B AP detection bit set */ |
| 89 | #define OBSS_DETECTION_IS_11B_AP(_m) ((_m) & OBSS_DETECTION_11B_AP_BIT_MASK) |
| 90 | /* To check if 11B STA detection bit set */ |
| 91 | #define OBSS_DETECTION_IS_11B_STA(_m) ((_m) & OBSS_DETECTION_11B_STA_BIT_MASK) |
| 92 | /* To check if 11G AP detection bit set */ |
| 93 | #define OBSS_DETECTION_IS_11G_AP(_m) ((_m) & OBSS_DETECTION_11G_AP_BIT_MASK) |
| 94 | /* To check if 11A AP detection bit set */ |
| 95 | #define OBSS_DETECTION_IS_11A(_m) ((_m) & OBSS_DETECTION_11A_BIT_MASK) |
| 96 | /* To check if HT legacy detection bit set */ |
| 97 | #define OBSS_DETECTION_IS_HT_LEGACY(_m) \ |
| 98 | ((_m) & OBSS_DETECTION_HT_LEGACY_BIT_MASK) |
| 99 | /* To check if HT mixed detection bit set */ |
| 100 | #define OBSS_DETECTION_IS_HT_MIXED(_m) ((_m) & OBSS_DETECTION_HT_MIXED_BIT_MASK) |
| 101 | /* To check if HT 20mhz detection bit set */ |
| 102 | #define OBSS_DETECTION_IS_HT_20MHZ(_m) ((_m) & OBSS_DETECTION_HT_20MHZ_BIT_MASK) |
| 103 | |
Abhishek Singh | 8c54e38 | 2019-03-19 17:43:43 +0530 | [diff] [blame] | 104 | #define MAX_WAIT_FOR_BCN_TX_COMPLETE 4000 |
| 105 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 106 | #ifdef WLAN_FEATURE_11W |
| 107 | typedef union uPmfSaQueryTimerId { |
| 108 | struct { |
| 109 | uint8_t sessionId; |
| 110 | uint16_t peerIdx; |
| 111 | } fields; |
| 112 | uint32_t value; |
| 113 | } tPmfSaQueryTimerId, *tpPmfSaQueryTimerId; |
| 114 | #endif |
| 115 | |
Arif Hussain | 776ee7a | 2016-11-10 20:28:50 -0800 | [diff] [blame] | 116 | typedef struct last_processed_frame { |
| 117 | tSirMacAddr sa; |
| 118 | uint16_t seq_num; |
| 119 | } last_processed_msg; |
| 120 | |
Rajeev Kumar Sirasanagandla | 1a21bf6 | 2019-04-08 15:28:57 +0530 | [diff] [blame] | 121 | /** |
| 122 | * struct lim_max_tx_pwr_attr - List of tx powers from various sources |
| 123 | * @reg_max: power from regulatory database |
| 124 | * @ap_tx_power: local power constraint adjusted value |
| 125 | * @ini_tx_power: Max tx power from ini config |
| 126 | * @frequency: current operating frequency for which above powers are defined |
| 127 | */ |
| 128 | struct lim_max_tx_pwr_attr { |
| 129 | int8_t reg_max; |
| 130 | int8_t ap_tx_power; |
| 131 | uint8_t ini_tx_power; |
| 132 | uint32_t frequency; |
| 133 | }; |
| 134 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 135 | /* LIM utility functions */ |
Arif Hussain | 776ee7a | 2016-11-10 20:28:50 -0800 | [diff] [blame] | 136 | bool lim_is_valid_frame(last_processed_msg *last_processed_frm, |
| 137 | uint8_t *pRxPacketInfo); |
| 138 | void lim_update_last_processed_frame(last_processed_msg *last_processed_frm, |
| 139 | uint8_t *pRxPacketInfo); |
Jeff Johnson | c184723 | 2018-12-27 16:49:31 -0800 | [diff] [blame] | 140 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 141 | char *lim_dot11_reason_str(uint16_t reasonCode); |
| 142 | char *lim_mlm_state_str(tLimMlmStates state); |
| 143 | char *lim_sme_state_str(tLimSmeStates state); |
| 144 | char *lim_msg_str(uint32_t msgType); |
| 145 | char *lim_result_code_str(tSirResultCodes resultCode); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 146 | char *lim_dot11_mode_str(struct mac_context *mac, uint8_t dot11Mode); |
| 147 | void lim_print_mlm_state(struct mac_context *mac, uint16_t logLevel, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 148 | tLimMlmStates state); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 149 | void lim_print_sme_state(struct mac_context *mac, uint16_t logLevel, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 150 | tLimSmeStates state); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 151 | void lim_print_msg_name(struct mac_context *mac, uint16_t logLevel, uint32_t msgType); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 152 | |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 153 | QDF_STATUS lim_send_set_max_tx_power_req(struct mac_context *mac, |
Amar Singhal | a297bfa | 2015-10-15 15:07:29 -0700 | [diff] [blame] | 154 | int8_t txPower, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 155 | struct pe_session *pe_session); |
Rajeev Kumar Sirasanagandla | 1a21bf6 | 2019-04-08 15:28:57 +0530 | [diff] [blame] | 156 | |
| 157 | /** |
| 158 | * lim_get_max_tx_power() - Utility to get maximum tx power |
| 159 | * @mac: mac handle |
| 160 | * @attr: pointer to buffer containing list of tx powers |
| 161 | * |
| 162 | * This function is used to get the maximum possible tx power from the list |
| 163 | * of tx powers mentioned in @attr. |
| 164 | * |
| 165 | * Return: Max tx power |
| 166 | */ |
| 167 | uint8_t lim_get_max_tx_power(struct mac_context *mac, |
| 168 | struct lim_max_tx_pwr_attr *attr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 169 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 170 | /* AID pool management functions */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 171 | void lim_init_peer_idxpool(struct mac_context *, struct pe_session *); |
| 172 | uint16_t lim_assign_peer_idx(struct mac_context *, struct pe_session *); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 173 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 174 | void lim_enable_overlap11g_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 175 | tpUpdateBeaconParams pBeaconParams, |
| 176 | tpSirMacMgmtHdr pMh, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 177 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 178 | void lim_update_overlap_sta_param(struct mac_context *mac, tSirMacAddr bssId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 179 | tpLimProtStaParams pStaParams); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 180 | void lim_update_short_preamble(struct mac_context *mac, tSirMacAddr peerMacAddr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 181 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 182 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 183 | void lim_update_short_slot_time(struct mac_context *mac, tSirMacAddr peerMacAddr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 185 | struct pe_session *pe_session); |
Abhinav Kumar | 49d08a7 | 2018-02-14 17:36:12 +0530 | [diff] [blame] | 186 | |
| 187 | /* |
| 188 | * lim_send_sme_mgmt_frame_ind() - Function to send mgmt frame ind to HDD |
Srinivas Dasari | ea1c133 | 2019-02-18 12:43:23 +0530 | [diff] [blame] | 189 | * @mac_ctx: Pointer to Global MAC structure |
| 190 | * @frame_type: Type of mgmt frame |
| 191 | * @frame: Frame pointer |
| 192 | * @frame_len: Length og mgmt frame |
| 193 | * @session_id: session id |
| 194 | * @psession_entry: PE Session Entry |
| 195 | * @rx_channel: Channel of where packet is received |
| 196 | * @rx_rssi: rssi value |
| 197 | * @rx_flags: RXMGMT flags to be set for the frame. Defined in enum rxmgmt_flags |
Abhinav Kumar | 49d08a7 | 2018-02-14 17:36:12 +0530 | [diff] [blame] | 198 | * |
| 199 | * Indicate the Mgmt Frame received to SME to HDD callback |
| 200 | * handle Probe_req/Action frame currently |
| 201 | * |
| 202 | * Return: None |
| 203 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 204 | void lim_send_sme_mgmt_frame_ind(struct mac_context *mac_ctx, uint8_t frame_type, |
Abhinav Kumar | 49d08a7 | 2018-02-14 17:36:12 +0530 | [diff] [blame] | 205 | uint8_t *frame, uint32_t frame_len, |
| 206 | uint16_t session_id, uint32_t rx_channel, |
Srinivas Dasari | ea1c133 | 2019-02-18 12:43:23 +0530 | [diff] [blame] | 207 | struct pe_session *psession_entry, |
| 208 | int8_t rx_rssi, enum rxmgmt_flags rx_flags); |
Abhinav Kumar | 49d08a7 | 2018-02-14 17:36:12 +0530 | [diff] [blame] | 209 | |
| 210 | /* |
yeshwanth sriram guntuka | 7112fad | 2017-07-27 19:00:08 +0530 | [diff] [blame] | 211 | * lim_deactivate_timers() - Function to deactivate lim timers |
| 212 | * @mac_ctx: Pointer to global mac structure |
| 213 | * |
| 214 | * This function is used to deactivate lim timers |
| 215 | * |
| 216 | * Return: None |
| 217 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 218 | void lim_deactivate_timers(struct mac_context *mac_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 219 | |
| 220 | /* |
| 221 | * The below 'product' check tobe removed if 'Association' is |
| 222 | * allowed in IBSS. |
| 223 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 224 | void lim_release_peer_idx(struct mac_context *, uint16_t, struct pe_session *); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 225 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 226 | void lim_decide_ap_protection(struct mac_context *mac, tSirMacAddr peerMacAddr, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 227 | tpUpdateBeaconParams pBeaconParams, struct pe_session *); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 228 | void lim_decide_ap_protection_on_delete(struct mac_context *mac, |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 229 | tpDphHashNode sta, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 230 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 231 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 232 | |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 233 | QDF_STATUS lim_update_11a_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 234 | uint8_t enable, |
| 235 | uint8_t overlap, |
| 236 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 237 | struct pe_session *); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 238 | QDF_STATUS lim_enable11g_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 239 | uint8_t enable, |
| 240 | uint8_t overlap, |
| 241 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 242 | struct pe_session *pe_session); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 243 | QDF_STATUS lim_enable_ht_protection_from11g(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 244 | uint8_t enable, |
| 245 | uint8_t overlap, |
| 246 | tpUpdateBeaconParams |
| 247 | pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 248 | struct pe_session *pe_session); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 249 | QDF_STATUS lim_enable_ht20_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 250 | uint8_t enable, uint8_t overlap, |
| 251 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 252 | struct pe_session *pe_session); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 253 | QDF_STATUS lim_enable_ht_non_gf_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 254 | uint8_t enable, uint8_t overlap, |
| 255 | tpUpdateBeaconParams |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 256 | pBeaconParams, struct pe_session *); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 257 | QDF_STATUS lim_enable_ht_rifs_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 258 | uint8_t enable, uint8_t overlap, |
| 259 | tpUpdateBeaconParams |
| 260 | pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 261 | struct pe_session *pe_session); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 262 | QDF_STATUS lim_enable_ht_lsig_txop_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 263 | uint8_t enable, |
| 264 | uint8_t overlap, |
| 265 | tpUpdateBeaconParams |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 266 | pBeaconParams, struct pe_session *); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 267 | QDF_STATUS lim_enable_short_preamble(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 268 | uint8_t enable, |
| 269 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 270 | struct pe_session *pe_session); |
Jeff Johnson | 4749845 | 2019-03-07 10:32:49 -0800 | [diff] [blame] | 271 | QDF_STATUS lim_enable_ht_obss_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 272 | uint8_t enable, uint8_t overlap, |
| 273 | tpUpdateBeaconParams |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 274 | pBeaconParams, struct pe_session *); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 275 | void lim_decide_sta_protection(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 276 | tpSchBeaconStruct pBeaconStruct, |
| 277 | tpUpdateBeaconParams pBeaconParams, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 278 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 279 | void lim_decide_sta_protection_on_assoc(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 280 | tpSchBeaconStruct pBeaconStruct, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 281 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 282 | void lim_update_sta_run_time_ht_switch_chnl_params(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 283 | tDot11fIEHTInfo *pHTInfo, |
Pragaspathi Thilagaraj | e05162d | 2019-05-23 13:10:46 +0530 | [diff] [blame] | 284 | uint8_t bss_idx, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 285 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 286 | /* Print MAC address utility function */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 287 | void lim_print_mac_addr(struct mac_context *, tSirMacAddr, uint8_t); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 288 | |
| 289 | /* Deferred Message Queue read/write */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 290 | uint8_t lim_write_deferred_msg_q(struct mac_context *mac, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 291 | struct scheduler_msg *limMsg); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 292 | struct scheduler_msg *lim_read_deferred_msg_q(struct mac_context *mac); |
| 293 | void lim_handle_defer_msg_error(struct mac_context *mac, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 294 | struct scheduler_msg *pLimMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 295 | |
| 296 | /* Deferred Message Queue Reset */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 297 | void lim_reset_deferred_msg_q(struct mac_context *mac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 298 | |
Harprit Chhabada | e20b556 | 2019-03-11 14:13:42 -0700 | [diff] [blame] | 299 | static inline void lim_sys_process_mmh_msg_api(struct mac_context *mac, |
| 300 | struct scheduler_msg *msg) |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 301 | { |
| 302 | sys_process_mmh_msg(mac, msg); |
Jeff Johnson | a5abe27 | 2019-01-06 12:52:02 -0800 | [diff] [blame] | 303 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 304 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 305 | void lim_handle_update_olbc_cache(struct mac_context *mac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 306 | |
| 307 | uint8_t lim_is_null_ssid(tSirMacSSid *pSsid); |
| 308 | |
| 309 | /* 11h Support */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 310 | void lim_stop_tx_and_switch_channel(struct mac_context *mac, uint8_t sessionId); |
Jianmin Zhu | a9005b3 | 2018-12-06 21:30:45 +0800 | [diff] [blame] | 311 | |
| 312 | /** |
| 313 | * lim_process_channel_switch_timeout() - Process chanel switch timeout |
| 314 | * @mac: pointer to Global MAC structure |
| 315 | * |
| 316 | * Return: none |
| 317 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 318 | void lim_process_channel_switch_timeout(struct mac_context *); |
| 319 | QDF_STATUS lim_start_channel_switch(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 320 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 321 | void lim_update_channel_switch(struct mac_context *, tpSirProbeRespBeacon, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 322 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 323 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 324 | void lim_switch_primary_channel(struct mac_context *, uint8_t, struct pe_session *); |
| 325 | void lim_switch_primary_secondary_channel(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 326 | struct pe_session *pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 327 | uint8_t newChannel, |
| 328 | uint8_t ch_center_freq_seg0, |
| 329 | uint8_t ch_center_freq_seg1, |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 330 | enum phy_ch_width ch_width); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 331 | void lim_update_sta_run_time_ht_capability(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 332 | tDot11fIEHTCaps *pHTCaps); |
Jeff Johnson | 0a0f42a | 2018-11-21 20:42:36 -0800 | [diff] [blame] | 333 | void lim_update_sta_run_time_ht_info(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 334 | tDot11fIEHTInfo *pRcvdHTInfo, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 335 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 336 | void lim_cancel_dot11h_channel_switch(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 337 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 338 | bool lim_is_channel_valid_for_channel_switch(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 339 | uint8_t channel); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 340 | QDF_STATUS lim_restore_pre_channel_switch_state(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 341 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 342 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 343 | void lim_prepare_for11h_channel_switch(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 344 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 345 | void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 346 | uint32_t *data, struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 347 | |
Arif Hussain | 7631afa | 2017-02-08 14:35:00 -0800 | [diff] [blame] | 348 | /** |
Pragaspathi Thilagaraj | 30251ec | 2018-12-18 17:22:57 +0530 | [diff] [blame] | 349 | * lim_assoc_rej_get_remaining_delta() - Get remaining time delta for |
| 350 | * the rssi based disallowed list entry |
| 351 | * @node: rssi based disallowed list entry |
| 352 | * |
| 353 | * Return: remaining delta, can be -ve if time has already expired. |
| 354 | */ |
| 355 | int |
| 356 | lim_assoc_rej_get_remaining_delta(struct sir_rssi_disallow_lst *node); |
| 357 | |
| 358 | /** |
| 359 | * lim_rem_blacklist_entry_with_lowest_delta() - Remove the entry with lowest |
| 360 | * time delta |
| 361 | * @list: rssi based rejected BSSID list |
| 362 | * |
| 363 | * Return: QDF_STATUS |
| 364 | */ |
| 365 | QDF_STATUS |
| 366 | lim_rem_blacklist_entry_with_lowest_delta(qdf_list_t *list); |
| 367 | |
| 368 | /** |
Arif Hussain | 7631afa | 2017-02-08 14:35:00 -0800 | [diff] [blame] | 369 | * lim_get_session_by_macaddr() - api to find session based on MAC |
| 370 | * @mac_ctx: Pointer to global mac structure. |
| 371 | * @self_mac: MAC address. |
| 372 | * |
| 373 | * This function is used to get session for given MAC address. |
| 374 | * |
| 375 | * Return: session pointer if exists, NULL otherwise. |
| 376 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 377 | struct csr_roam_session *lim_get_session_by_macaddr(struct mac_context *mac_ctx, |
Arif Hussain | 7631afa | 2017-02-08 14:35:00 -0800 | [diff] [blame] | 378 | tSirMacAddr self_mac); |
| 379 | |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 380 | static inline enum band_info lim_get_rf_band(uint8_t channel) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 381 | { |
| 382 | if ((channel >= SIR_11A_CHANNEL_BEGIN) && |
| 383 | (channel <= SIR_11A_CHANNEL_END)) |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 384 | return BAND_5G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 385 | |
| 386 | if ((channel >= SIR_11B_CHANNEL_BEGIN) && |
| 387 | (channel <= SIR_11B_CHANNEL_END)) |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 388 | return BAND_2G; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 389 | |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 390 | return BAND_UNKNOWN; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 391 | } |
| 392 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 393 | static inline QDF_STATUS |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 394 | lim_get_mgmt_staid(struct mac_context *mac, uint16_t *staid, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 395 | struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 396 | { |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 397 | if (LIM_IS_AP_ROLE(pe_session)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 398 | *staid = 1; |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 399 | else if (LIM_IS_STA_ROLE(pe_session)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 400 | *staid = 0; |
| 401 | else |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 402 | return QDF_STATUS_E_FAILURE; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 403 | |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 404 | return QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 405 | } |
| 406 | |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 407 | static inline int lim_select_cb_mode(tDphHashNode *sta, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 408 | struct pe_session *pe_session, uint8_t channel, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 409 | uint8_t chan_bw) |
| 410 | { |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 411 | if (sta->mlmStaContext.vhtCapability && chan_bw) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 412 | if (channel == 36 || channel == 52 || channel == 100 || |
| 413 | channel == 116 || channel == 149) { |
| 414 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW - 1; |
| 415 | } else if (channel == 40 || channel == 56 || channel == 104 || |
| 416 | channel == 120 || channel == 153) { |
| 417 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW - 1; |
| 418 | } else if (channel == 44 || channel == 60 || channel == 108 || |
| 419 | channel == 124 || channel == 157) { |
| 420 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH - 1; |
| 421 | } else if (channel == 48 || channel == 64 || channel == 112 || |
| 422 | channel == 128 || channel == 161) { |
| 423 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH - 1; |
| 424 | } else if (channel == 165) { |
| 425 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 426 | } |
Jeff Johnson | bddc03e | 2019-01-17 15:37:09 -0800 | [diff] [blame] | 427 | } else if (sta->mlmStaContext.htCapability) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 428 | if (channel == 40 || channel == 48 || channel == 56 || |
| 429 | channel == 64 || channel == 104 || channel == 112 || |
| 430 | channel == 120 || channel == 128 || channel == 136 || |
| 431 | channel == 144 || channel == 153 || channel == 161) { |
| 432 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 433 | } else if (channel == 36 || channel == 44 || channel == 52 || |
| 434 | channel == 60 || channel == 100 || |
| 435 | channel == 108 || channel == 116 || |
| 436 | channel == 124 || channel == 132 || |
| 437 | channel == 140 || channel == 149 || |
| 438 | channel == 157) { |
| 439 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 440 | } else if (channel == 165) { |
| 441 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 442 | } |
| 443 | } |
| 444 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 445 | } |
| 446 | |
| 447 | /* ANI peer station count management and associated actions */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 448 | void lim_util_count_sta_add(struct mac_context *mac, tpDphHashNode pSta, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 449 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 450 | void lim_util_count_sta_del(struct mac_context *mac, tpDphHashNode pSta, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 451 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 452 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 453 | uint8_t lim_get_ht_capability(struct mac_context *, uint32_t, struct pe_session *); |
Jeff Johnson | 8390fe2 | 2018-06-09 21:59:32 -0700 | [diff] [blame] | 454 | QDF_STATUS lim_tx_complete(void *context, qdf_nbuf_t buf, bool free); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 455 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 456 | QDF_STATUS lim_validate_delts_req(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 457 | tpSirDeltsReq pDeltsReq, |
| 458 | tSirMacAddr peerMacAddr, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 459 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 460 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 461 | void lim_pkt_free(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 462 | eFrameType frmType, uint8_t *pBD, void *body); |
| 463 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 464 | void lim_get_b_dfrom_rx_packet(struct mac_context *mac, void *body, uint32_t **pBD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 465 | |
| 466 | /** |
| 467 | * utils_power_xy() - calc result of base raised to power |
| 468 | * @base: Base value |
| 469 | * @power: Base raised to this Power value |
| 470 | * |
| 471 | * Given a base(X) and power(Y), this API will return |
| 472 | * the result of base raised to power - (X ^ Y) |
| 473 | * |
| 474 | * Return: Result of X^Y |
| 475 | * |
| 476 | */ |
| 477 | static inline uint32_t utils_power_xy(uint16_t base, uint16_t power) |
| 478 | { |
| 479 | uint32_t result = 1, i; |
| 480 | |
| 481 | for (i = 0; i < power; i++) |
| 482 | result *= base; |
| 483 | |
| 484 | return result; |
| 485 | } |
| 486 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 487 | QDF_STATUS lim_post_sm_state_update(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 488 | uint16_t StaIdx, |
| 489 | tSirMacHTMIMOPowerSaveState MIMOPSState, |
| 490 | uint8_t *pPeerStaMac, uint8_t sessionId); |
| 491 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 492 | void lim_delete_sta_context(struct mac_context *mac, struct scheduler_msg *limMsg); |
| 493 | void lim_delete_dialogue_token_list(struct mac_context *mac); |
gaolez | e510894 | 2017-03-31 16:56:42 +0800 | [diff] [blame] | 494 | |
| 495 | /** |
| 496 | * lim_add_channel_status_info() - store |
| 497 | * chan status info into Global MAC structure |
| 498 | * @p_mac: Pointer to Global MAC structure |
| 499 | * @channel_stat: Pointer to chan status info reported by firmware |
| 500 | * @channel_id: current channel id |
| 501 | * |
| 502 | * Return: None |
| 503 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 504 | void lim_add_channel_status_info(struct mac_context *p_mac, |
gaolez | e510894 | 2017-03-31 16:56:42 +0800 | [diff] [blame] | 505 | struct lim_channel_status *channel_stat, |
| 506 | uint8_t channel_id); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 507 | uint8_t lim_get_channel_from_beacon(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 508 | tpSchBeaconStruct pBeacon); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 509 | tSirNwType lim_get_nw_type(struct mac_context *mac, uint8_t channelNum, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 510 | uint32_t type, tpSchBeaconStruct pBeacon); |
| 511 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 512 | void lim_set_tspec_uapsd_mask_per_session(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 513 | struct pe_session *pe_session, |
Jeff Johnson | 312348f | 2018-12-22 13:33:54 -0800 | [diff] [blame] | 514 | struct mac_ts_info *pTsInfo, uint32_t action); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 515 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 516 | void lim_handle_heart_beat_timeout_for_session(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 517 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 518 | |
Jeff Johnson | 579fcdc | 2018-12-29 20:32:26 -0800 | [diff] [blame] | 519 | /** |
| 520 | * lim_process_add_sta_rsp() - process WDA_ADD_STA_RSP from WMA |
| 521 | * @mac_ctx: Pointer to Global MAC structure |
| 522 | * @msg: msg from WMA |
| 523 | * |
| 524 | * Return: void |
| 525 | */ |
| 526 | void lim_process_add_sta_rsp(struct mac_context *mac_ctx, |
| 527 | struct scheduler_msg *msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 528 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 529 | void lim_update_beacon(struct mac_context *mac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 530 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 531 | void lim_process_ap_mlm_add_sta_rsp(struct mac_context *mac, |
Rajeev Kumar | feb9638 | 2017-01-22 19:42:09 -0800 | [diff] [blame] | 532 | struct scheduler_msg *limMsgQ, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 533 | struct pe_session *pe_session); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 534 | void lim_process_ap_mlm_del_bss_rsp(struct mac_context *mac, |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 535 | struct scheduler_msg *limMsgQ, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 536 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 537 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 538 | void lim_process_ap_mlm_del_sta_rsp(struct mac_context *mac, |
Rajeev Kumar | 416b73f | 2017-01-21 16:45:21 -0800 | [diff] [blame] | 539 | struct scheduler_msg *limMsgQ, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 540 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 541 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 542 | struct pe_session *lim_is_ibss_session_active(struct mac_context *mac); |
| 543 | struct pe_session *lim_is_ap_session_active(struct mac_context *mac); |
| 544 | void lim_handle_heart_beat_failure_timeout(struct mac_context *mac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 545 | |
Jeff Johnson | 0a0f42a | 2018-11-21 20:42:36 -0800 | [diff] [blame] | 546 | #define limGetWscIEPtr(mac, ie, ie_len) \ |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 547 | wlan_get_vendor_ie_ptr_from_oui(SIR_MAC_WSC_OUI, \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 548 | SIR_MAC_WSC_OUI_SIZE, ie, ie_len) |
| 549 | |
Jeff Johnson | 0a0f42a | 2018-11-21 20:42:36 -0800 | [diff] [blame] | 550 | #define limGetP2pIEPtr(mac, ie, ie_len) \ |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 551 | wlan_get_vendor_ie_ptr_from_oui(SIR_MAC_P2P_OUI, \ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 552 | SIR_MAC_P2P_OUI_SIZE, ie, ie_len) |
| 553 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 554 | uint8_t lim_get_noa_attr_stream(struct mac_context *mac, uint8_t *pNoaStream, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 555 | struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 556 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 557 | uint8_t lim_build_p2p_ie(struct mac_context *mac, uint8_t *ie, uint8_t *data, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 558 | uint8_t ie_len); |
Jeff Johnson | 47ead06 | 2018-12-16 15:01:06 -0800 | [diff] [blame] | 559 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 560 | bool lim_isconnected_on_dfs_channel(struct mac_context *mac_ctx, |
Jeff Johnson | 81b6065 | 2018-12-16 14:40:42 -0800 | [diff] [blame] | 561 | uint8_t currentChannel); |
| 562 | |
| 563 | uint32_t lim_get_max_rate_flags(struct mac_context *mac_ctx, |
| 564 | tpDphHashNode sta_ds); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 565 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 566 | bool lim_check_vht_op_mode_change(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 567 | struct pe_session *pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 568 | uint8_t chanWidth, uint8_t staId, |
| 569 | uint8_t *peerMac); |
Krunal Soni | b7f2043 | 2017-04-27 13:01:02 -0700 | [diff] [blame] | 570 | #ifdef WLAN_FEATURE_11AX_BSS_COLOR |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 571 | bool lim_send_he_ie_update(struct mac_context *mac_ctx, struct pe_session *pe_session); |
Krunal Soni | b7f2043 | 2017-04-27 13:01:02 -0700 | [diff] [blame] | 572 | #endif |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 573 | bool lim_set_nss_change(struct mac_context *mac, struct pe_session *pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 574 | uint8_t rxNss, uint8_t staId, uint8_t *peerMac); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 575 | bool lim_check_membership_user_position(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 576 | struct pe_session *pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 577 | uint32_t membership, uint32_t userPosition, |
| 578 | uint8_t staId); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 579 | |
Abhishek Singh | dd2cb57 | 2017-08-11 11:10:19 +0530 | [diff] [blame] | 580 | /** |
| 581 | * enum ack_status - Indicate TX status of ASSOC/AUTH |
| 582 | * @ACKED : Ack is received. |
| 583 | * @NOT_ACKED : No Ack received. |
| 584 | * @SENT_FAIL : Failure while sending. |
| 585 | * |
| 586 | * Indicate if driver is waiting for ACK status of assoc/auth or ACK received |
| 587 | * for ASSOC/AUTH OR NO ACK is received for the assoc/auth sent or assoc/auth |
| 588 | * sent failed. |
| 589 | */ |
| 590 | enum assoc_ack_status { |
| 591 | ACKED, |
| 592 | NOT_ACKED, |
| 593 | SENT_FAIL, |
| 594 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 595 | |
| 596 | typedef enum { |
| 597 | WLAN_PE_DIAG_SCAN_REQ_EVENT = 0, |
| 598 | WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, |
| 599 | WLAN_PE_DIAG_SCAN_RSP_EVENT, |
| 600 | WLAN_PE_DIAG_JOIN_REQ_EVENT, |
| 601 | WLAN_PE_DIAG_JOIN_RSP_EVENT, |
| 602 | WLAN_PE_DIAG_SETCONTEXT_REQ_EVENT, |
| 603 | WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, |
| 604 | WLAN_PE_DIAG_REASSOC_REQ_EVENT, |
| 605 | WLAN_PE_DIAG_REASSOC_RSP_EVENT, |
| 606 | WLAN_PE_DIAG_AUTH_REQ_EVENT, |
| 607 | WLAN_PE_DIAG_AUTH_RSP_EVENT = 10, |
| 608 | WLAN_PE_DIAG_DISASSOC_REQ_EVENT, |
| 609 | WLAN_PE_DIAG_DISASSOC_RSP_EVENT, |
| 610 | WLAN_PE_DIAG_DISASSOC_IND_EVENT, |
| 611 | WLAN_PE_DIAG_DISASSOC_CNF_EVENT, |
| 612 | WLAN_PE_DIAG_DEAUTH_REQ_EVENT, |
| 613 | WLAN_PE_DIAG_DEAUTH_RSP_EVENT, |
| 614 | WLAN_PE_DIAG_DEAUTH_IND_EVENT, |
| 615 | WLAN_PE_DIAG_START_BSS_REQ_EVENT, |
| 616 | WLAN_PE_DIAG_START_BSS_RSP_EVENT, |
| 617 | WLAN_PE_DIAG_AUTH_IND_EVENT = 20, |
| 618 | WLAN_PE_DIAG_ASSOC_IND_EVENT, |
| 619 | WLAN_PE_DIAG_ASSOC_CNF_EVENT, |
| 620 | WLAN_PE_DIAG_REASSOC_IND_EVENT, |
| 621 | WLAN_PE_DIAG_SWITCH_CHL_IND_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 622 | WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 623 | WLAN_PE_DIAG_STOP_BSS_REQ_EVENT, |
| 624 | WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, |
| 625 | WLAN_PE_DIAG_DEAUTH_CNF_EVENT, |
| 626 | WLAN_PE_DIAG_ADDTS_REQ_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 627 | WLAN_PE_DIAG_ADDTS_RSP_EVENT = 30, |
Jeff Johnson | 66ebf15 | 2017-10-11 14:17:55 -0700 | [diff] [blame] | 628 | WLAN_PE_DIAG_DELTS_REQ_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 629 | WLAN_PE_DIAG_DELTS_RSP_EVENT, |
| 630 | WLAN_PE_DIAG_DELTS_IND_EVENT, |
| 631 | WLAN_PE_DIAG_ENTER_BMPS_REQ_EVENT, |
| 632 | WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT, |
| 633 | WLAN_PE_DIAG_EXIT_BMPS_REQ_EVENT, |
| 634 | WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT, |
| 635 | WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 636 | WLAN_PE_DIAG_ENTER_IMPS_REQ_EVENT, |
| 637 | WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT = 40, |
| 638 | WLAN_PE_DIAG_EXIT_IMPS_REQ_EVENT, |
| 639 | WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 640 | WLAN_PE_DIAG_ENTER_UAPSD_REQ_EVENT, |
| 641 | WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT, |
Jeff Johnson | 66ebf15 | 2017-10-11 14:17:55 -0700 | [diff] [blame] | 642 | WLAN_PE_DIAG_EXIT_UAPSD_REQ_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 643 | WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT, |
| 644 | WLAN_PE_DIAG_WOWL_ADD_BCAST_PTRN_EVENT, |
| 645 | WLAN_PE_DIAG_WOWL_DEL_BCAST_PTRN_EVENT, |
| 646 | WLAN_PE_DIAG_ENTER_WOWL_REQ_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 647 | WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT = 50, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 648 | WLAN_PE_DIAG_EXIT_WOWL_REQ_EVENT, |
| 649 | WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 650 | WLAN_PE_DIAG_HAL_ADDBA_REQ_EVENT, |
| 651 | WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT, |
| 652 | WLAN_PE_DIAG_HAL_DELBA_IND_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 653 | WLAN_PE_DIAG_HB_FAILURE_TIMEOUT, |
| 654 | WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 655 | WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 656 | WLAN_PE_DIAG_PREAUTH_DONE, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 657 | WLAN_PE_DIAG_REASSOCIATING = 60, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 658 | WLAN_PE_DIAG_CONNECTED, |
| 659 | WLAN_PE_DIAG_ASSOC_REQ_EVENT, |
| 660 | WLAN_PE_DIAG_AUTH_COMP_EVENT, |
| 661 | WLAN_PE_DIAG_ASSOC_COMP_EVENT, |
| 662 | WLAN_PE_DIAG_AUTH_START_EVENT, |
| 663 | WLAN_PE_DIAG_ASSOC_START_EVENT, |
| 664 | WLAN_PE_DIAG_REASSOC_START_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 665 | WLAN_PE_DIAG_ROAM_AUTH_START_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 666 | WLAN_PE_DIAG_ROAM_AUTH_COMP_EVENT, |
Prakash Dhavali | d8e666c | 2016-11-24 16:36:57 +0530 | [diff] [blame] | 667 | WLAN_PE_DIAG_ROAM_ASSOC_START_EVENT = 70, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 668 | WLAN_PE_DIAG_ROAM_ASSOC_COMP_EVENT, |
Sreelakshmi Konamki | 1bb6f31 | 2016-12-08 12:32:01 +0530 | [diff] [blame] | 669 | WLAN_PE_DIAG_SCAN_COMPLETE_EVENT, |
| 670 | WLAN_PE_DIAG_SCAN_RESULT_FOUND_EVENT, |
Padma, Santhosh Kumar | e783565 | 2016-08-10 19:11:40 +0530 | [diff] [blame] | 671 | WLAN_PE_DIAG_ASSOC_TIMEOUT, |
| 672 | WLAN_PE_DIAG_AUTH_TIMEOUT, |
Sen, Devendra | 154b3c4 | 2017-02-13 20:44:15 +0530 | [diff] [blame] | 673 | WLAN_PE_DIAG_DEAUTH_FRAME_EVENT, |
| 674 | WLAN_PE_DIAG_DISASSOC_FRAME_EVENT, |
Abhishek Singh | dd2cb57 | 2017-08-11 11:10:19 +0530 | [diff] [blame] | 675 | WLAN_PE_DIAG_AUTH_ACK_EVENT, |
| 676 | WLAN_PE_DIAG_ASSOC_ACK_EVENT, |
Abhinav Kumar | 8556167 | 2018-04-17 12:48:51 +0530 | [diff] [blame] | 677 | WLAN_PE_DIAG_AUTH_ALGO_NUM, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 678 | } WLAN_PE_DIAG_EVENT_TYPE; |
| 679 | |
Abhishek Singh | dd2cb57 | 2017-08-11 11:10:19 +0530 | [diff] [blame] | 680 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 681 | void lim_diag_event_report(struct mac_context *mac, uint16_t eventType, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 682 | struct pe_session *pe_session, uint16_t status, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 683 | uint16_t reasonCode); |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 684 | /** |
| 685 | * lim_diag_mgmt_tx_event_report() - to log TX event to external application |
| 686 | * @mac_ctx: mac context |
| 687 | * @mgmt_hdr: 802.11 mgmt header of given frame |
| 688 | * @session: PE session for given frame |
| 689 | * @result_code: result code of to be populated in TX frame |
| 690 | * @reason_code: reason code if TX OTA status |
| 691 | * |
| 692 | * Anytime driver sends some mgmt frame down to firmware for OTA delivery, |
| 693 | * log mgmt frame through DIAG utility. Don't log frames which come too |
| 694 | * excessively. |
| 695 | * |
| 696 | * Return: void |
| 697 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 698 | void lim_diag_mgmt_tx_event_report(struct mac_context *mac_ctx, void *mgmt_hdr, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 699 | struct pe_session *session, uint16_t result_code, |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 700 | uint16_t reason_code); |
| 701 | /** |
| 702 | * lim_diag_mgmt_rx_event_report() - to log RX event to external application |
| 703 | * @mac_ctx: mac context |
| 704 | * @mgmt_hdr: 802.11 mgmt header of given frame |
| 705 | * @session: PE session for given frame |
| 706 | * @result_code: result code given in RX frame |
| 707 | * @reason_code: reason code for RX OTA status |
| 708 | * |
| 709 | * Anytime driver receives some mgmt frame from firmware OTA, |
| 710 | * log mgmt frame through DIAG utility. Don't log frames which come too |
| 711 | * excessively. |
| 712 | * |
| 713 | * Return: void |
| 714 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 715 | void lim_diag_mgmt_rx_event_report(struct mac_context *mac_ctx, void *mgmt_hdr, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 716 | struct pe_session *session, uint16_t result_code, |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 717 | uint16_t reason_code); |
Abhishek Singh | dd2cb57 | 2017-08-11 11:10:19 +0530 | [diff] [blame] | 718 | #else |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 719 | static inline void lim_diag_event_report(struct mac_context *mac, uint16_t |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 720 | eventType, struct pe_session *pe_session, uint16_t status, |
Abhishek Singh | dd2cb57 | 2017-08-11 11:10:19 +0530 | [diff] [blame] | 721 | uint16_t reasonCode) {} |
Qiwei Cai | ba95ce6 | 2018-08-23 10:43:16 +0800 | [diff] [blame] | 722 | static inline |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 723 | void lim_diag_mgmt_tx_event_report(struct mac_context *mac_ctx, void *mgmt_hdr, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 724 | struct pe_session *session, uint16_t result_code, |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 725 | uint16_t reason_code) {} |
Qiwei Cai | ba95ce6 | 2018-08-23 10:43:16 +0800 | [diff] [blame] | 726 | static inline |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 727 | void lim_diag_mgmt_rx_event_report(struct mac_context *mac_ctx, void *mgmt_hdr, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 728 | struct pe_session *session, uint16_t result_code, |
Krunal Soni | c65fc49 | 2018-03-09 15:53:28 -0800 | [diff] [blame] | 729 | uint16_t reason_code) {} |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 730 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 731 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 732 | void pe_set_resume_channel(struct mac_context *mac, uint16_t channel, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 733 | ePhyChanBondState cbState); |
| 734 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 735 | void lim_get_short_slot_from_phy_mode(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 736 | struct pe_session *pe_session, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 737 | uint32_t phyMode, uint8_t *pShortSlotEnable); |
| 738 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 739 | void lim_clean_up_disassoc_deauth_req(struct mac_context *mac, uint8_t *staMac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 740 | bool cleanRxPath); |
| 741 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 742 | bool lim_check_disassoc_deauth_ack_pending(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 743 | uint8_t *staMac); |
| 744 | |
| 745 | #ifdef WLAN_FEATURE_11W |
| 746 | void lim_pmf_sa_query_timer_handler(void *pMacGlobal, uint32_t param); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 747 | void lim_set_protected_bit(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 748 | struct pe_session *pe_session, |
Abhishek Singh | cfb4448 | 2017-03-10 12:42:37 +0530 | [diff] [blame] | 749 | tSirMacAddr peer, tpSirMacMgmtHdr pMacHdr); |
| 750 | #else |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 751 | static inline void lim_set_protected_bit(struct mac_context *mac, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 752 | struct pe_session *pe_session, |
Abhishek Singh | cfb4448 | 2017-03-10 12:42:37 +0530 | [diff] [blame] | 753 | tSirMacAddr peer, tpSirMacMgmtHdr pMacHdr) {} |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 754 | #endif /* WLAN_FEATURE_11W */ |
| 755 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 756 | void lim_set_ht_caps(struct mac_context *p_mac, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 757 | struct pe_session *p_session_ntry, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 758 | uint8_t *p_ie_start, |
| 759 | uint32_t num_bytes); |
| 760 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 761 | void lim_set_vht_caps(struct mac_context *p_mac, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 762 | struct pe_session *p_session_entry, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 763 | uint8_t *p_ie_start, |
| 764 | uint32_t num_bytes); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 765 | bool lim_validate_received_frame_a1_addr(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 766 | tSirMacAddr a1, struct pe_session *session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 767 | void lim_set_stads_rtt_cap(tpDphHashNode sta_ds, struct s_ext_cap *ext_cap, |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 768 | struct mac_context *mac_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 769 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 770 | void lim_check_and_reset_protection_params(struct mac_context *mac_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 771 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 772 | QDF_STATUS lim_send_ext_cap_ie(struct mac_context *mac_ctx, uint32_t session_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 773 | tDot11fIEExtCap *extracted_extcap, bool merge); |
| 774 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 775 | QDF_STATUS lim_send_ies_per_band(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 776 | struct pe_session *session, uint8_t vdev_id); |
Naveen Rawat | 03e8d95 | 2016-08-01 15:22:20 -0700 | [diff] [blame] | 777 | |
Kiran Kumar Lokere | ee20577 | 2018-09-27 00:27:27 -0700 | [diff] [blame] | 778 | /** |
| 779 | * lim_send_action_frm_tb_ppdu_cfg() - sets action frame in TB PPDU cfg to FW |
| 780 | * @mac_ctx: global MAC context |
| 781 | * @session_id: SME session id |
| 782 | * @cfg: config setting |
| 783 | * |
| 784 | * Preapres the vendor action frame and send action frame in HE TB PPDU |
| 785 | * configuration to FW. |
| 786 | * |
| 787 | * Return: QDF_STATUS |
| 788 | */ |
| 789 | QDF_STATUS lim_send_action_frm_tb_ppdu_cfg(struct mac_context *mac_ctx, |
| 790 | uint32_t session_id, |
| 791 | uint8_t cfg); |
| 792 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 793 | void lim_update_extcap_struct(struct mac_context *mac_ctx, uint8_t *buf, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 794 | tDot11fIEExtCap *ext_cap); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 795 | QDF_STATUS lim_strip_extcap_update_struct(struct mac_context *mac_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 796 | uint8_t *addn_ie, uint16_t *addn_ielen, tDot11fIEExtCap *dst); |
Hu Wang | fbd279d | 2016-10-31 18:24:34 +0800 | [diff] [blame] | 797 | void lim_merge_extcap_struct(tDot11fIEExtCap *dst, tDot11fIEExtCap *src, |
| 798 | bool add); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 799 | |
Krunal Soni | d3c86d4 | 2017-10-19 12:12:21 -0700 | [diff] [blame] | 800 | #ifdef WLAN_FEATURE_11W |
| 801 | /** |
| 802 | * lim_del_pmf_sa_query_timer() - This function deletes SA query timer |
| 803 | * @mac_ctx: pointer to mac context |
| 804 | * @pe_session: pointer to PE session |
| 805 | * |
| 806 | * This API is to delete the PMF SA query timer created for each associated STA |
| 807 | * |
| 808 | * Return: none |
| 809 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 810 | void lim_del_pmf_sa_query_timer(struct mac_context *mac_ctx, struct pe_session *pe_session); |
Krunal Soni | d3c86d4 | 2017-10-19 12:12:21 -0700 | [diff] [blame] | 811 | #else |
| 812 | /** |
| 813 | * lim_del_pmf_sa_query_timer() - This function deletes SA query timer |
| 814 | * @mac_ctx: pointer to mac context |
| 815 | * @pe_session: pointer to PE session |
| 816 | * |
| 817 | * This API is to delete the PMF SA query timer created for each associated STA |
| 818 | * |
| 819 | * Return: none |
| 820 | */ |
| 821 | static inline void |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 822 | lim_del_pmf_sa_query_timer(struct mac_context *mac_ctx, struct pe_session *pe_session) |
Krunal Soni | d3c86d4 | 2017-10-19 12:12:21 -0700 | [diff] [blame] | 823 | { |
| 824 | } |
| 825 | #endif |
| 826 | |
Arif Hussain | 6cec6bc | 2017-02-14 13:46:26 -0800 | [diff] [blame] | 827 | /** |
gaurank kathpalia | 3ebc17b | 2019-05-29 10:25:09 +0530 | [diff] [blame^] | 828 | * lim_add_bssid_to_reject_list:- Add rssi reject Ap info to blacklist mgr. |
| 829 | * @pdev: pdev |
| 830 | * @entry: info of the BSSID to be put in rssi reject list. |
| 831 | * |
| 832 | * This API will add the passed ap info to the rssi reject list. |
| 833 | * |
| 834 | */ |
| 835 | void |
| 836 | lim_add_bssid_to_reject_list(struct wlan_objmgr_pdev *pdev, |
| 837 | struct sir_rssi_disallow_lst *entry); |
| 838 | |
| 839 | /** |
Arif Hussain | 6cec6bc | 2017-02-14 13:46:26 -0800 | [diff] [blame] | 840 | * lim_strip_op_class_update_struct - strip sup op class IE and populate |
| 841 | * the dot11f structure |
| 842 | * @mac_ctx: global MAC context |
| 843 | * @addn_ie: Additional IE buffer |
| 844 | * @addn_ielen: Length of additional IE |
| 845 | * @dst: Supp operating class IE structure to be updated |
| 846 | * |
| 847 | * This function is used to strip supp op class IE from IE buffer and |
| 848 | * update the passed structure. |
| 849 | * |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 850 | * Return: QDF_STATUS |
Arif Hussain | 6cec6bc | 2017-02-14 13:46:26 -0800 | [diff] [blame] | 851 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 852 | QDF_STATUS lim_strip_supp_op_class_update_struct(struct mac_context *mac_ctx, |
Arif Hussain | 6cec6bc | 2017-02-14 13:46:26 -0800 | [diff] [blame] | 853 | uint8_t *addn_ie, uint16_t *addn_ielen, |
| 854 | tDot11fIESuppOperatingClasses *dst); |
| 855 | |
Naveen Rawat | c0c91cd | 2015-11-05 14:27:37 -0800 | [diff] [blame] | 856 | uint8_t lim_get_80Mhz_center_channel(uint8_t primary_channel); |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 857 | void lim_update_obss_scanparams(struct pe_session *session, |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 858 | tDot11fIEOBSSScanParameters *scan_params); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 859 | void lim_init_obss_params(struct mac_context *mac_ctx, struct pe_session *session); |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 860 | #ifdef WLAN_FEATURE_HOST_ROAM |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 861 | uint32_t lim_create_timers_host_roam(struct mac_context *mac_ctx); |
Abhishek Singh | 748d8a2 | 2017-08-21 15:19:37 +0530 | [diff] [blame] | 862 | /** |
| 863 | * lim_delete_timers_host_roam() - Delete timers used in host based roaming |
| 864 | * @mac_ctx: Global MAC context |
| 865 | * |
| 866 | * Delete reassoc and preauth timers |
| 867 | * |
| 868 | * Return: none |
| 869 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 870 | void lim_delete_timers_host_roam(struct mac_context *mac_ctx); |
Abhishek Singh | 748d8a2 | 2017-08-21 15:19:37 +0530 | [diff] [blame] | 871 | /** |
| 872 | * lim_deactivate_timers_host_roam() - deactivate timers used in host based |
| 873 | * roaming |
| 874 | * @mac_ctx: Global MAC context |
| 875 | * |
| 876 | * Delete reassoc and preauth timers |
| 877 | * |
| 878 | * Return: none |
| 879 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 880 | void lim_deactivate_timers_host_roam(struct mac_context *mac_ctx); |
| 881 | void lim_deactivate_and_change_timer_host_roam(struct mac_context *mac_ctx, |
Varun Reddy Yeturu | 32de0e4 | 2016-04-15 14:25:59 +0530 | [diff] [blame] | 882 | uint32_t timer_id); |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 883 | #else |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 884 | static inline uint32_t lim_create_timers_host_roam(struct mac_context *mac_ctx) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 885 | { |
| 886 | return 0; |
| 887 | } |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 888 | static inline void lim_delete_timers_host_roam(struct mac_context *mac_ctx) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 889 | {} |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 890 | static inline void lim_deactivate_timers_host_roam(struct mac_context *mac_ctx) {} |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 891 | static inline void lim_deactivate_and_change_timer_host_roam( |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 892 | struct mac_context *mac_ctx, uint32_t timer_id) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 893 | {} |
| 894 | #endif |
Sandeep Puligilla | e087566 | 2016-02-12 16:09:21 -0800 | [diff] [blame] | 895 | |
Rajeev Kumar | 0320080 | 2016-04-15 13:59:36 -0700 | [diff] [blame] | 896 | bool lim_is_robust_mgmt_action_frame(uint8_t action_category); |
Hu Wang | 411e0cc | 2016-10-28 14:56:01 +0800 | [diff] [blame] | 897 | uint8_t lim_compute_ext_cap_ie_length(tDot11fIEExtCap *ext_cap); |
Himanshu Agarwal | 2fdf77a | 2016-12-29 11:41:00 +0530 | [diff] [blame] | 898 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 899 | void lim_update_caps_info_for_bss(struct mac_context *mac_ctx, |
Selvaraj, Sridhar | af54e2e | 2016-06-24 12:25:02 +0530 | [diff] [blame] | 900 | uint16_t *caps, uint16_t bss_caps); |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 901 | void lim_send_set_dtim_period(struct mac_context *mac_ctx, uint8_t dtim_period, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 902 | struct pe_session *session); |
Naveen Rawat | 30b8450 | 2016-10-13 17:44:48 -0700 | [diff] [blame] | 903 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 904 | QDF_STATUS lim_strip_ie(struct mac_context *mac_ctx, |
Naveen Rawat | 30b8450 | 2016-10-13 17:44:48 -0700 | [diff] [blame] | 905 | uint8_t *addn_ie, uint16_t *addn_ielen, |
| 906 | uint8_t eid, eSizeOfLenField size_of_len_field, |
Arif Hussain | 6cec6bc | 2017-02-14 13:46:26 -0800 | [diff] [blame] | 907 | uint8_t *oui, uint8_t out_len, uint8_t *extracted_ie, |
| 908 | uint32_t eid_max_len); |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 909 | |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 910 | #define MCSMAPMASK1x1 0x3 |
| 911 | #define MCSMAPMASK2x2 0xC |
| 912 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 913 | #ifdef WLAN_FEATURE_11AX |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 914 | |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 915 | /** |
| 916 | * lim_intersect_ap_he_caps() - Intersect AP capability with self STA capability |
| 917 | * @session: pointer to PE session |
| 918 | * @add_bss: pointer to ADD BSS params |
| 919 | * @beacon: pointer to beacon |
| 920 | * @assoc_rsp: pointer to assoc response |
| 921 | * |
| 922 | * Return: None |
| 923 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 924 | void lim_intersect_ap_he_caps(struct pe_session *session, tpAddBssParams add_bss, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 925 | tSchBeaconStruct *pBeaconStruct, tpSirAssocRsp assoc_rsp); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 926 | |
| 927 | /** |
| 928 | * lim_intersect_sta_he_caps() - Intersect STA capability with SAP capability |
| 929 | * @assoc_req: pointer to assoc request |
| 930 | * @session: pointer to PE session |
| 931 | * @sta_ds: pointer to STA dph hash table entry |
| 932 | * |
| 933 | * Return: None |
| 934 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 935 | void lim_intersect_sta_he_caps(tpSirAssocReq assoc_req, struct pe_session *session, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 936 | tpDphHashNode sta_ds); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 937 | |
| 938 | /** |
| 939 | * lim_add_he_cap() - Copy HE capability into Add sta params |
| 940 | * @add_sta_params: pointer to add sta params |
| 941 | * @assoc_req: pointer to Assoc request |
| 942 | * |
| 943 | * Return: None |
| 944 | */ |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 945 | void lim_add_he_cap(tpAddStaParams add_sta_params, tpSirAssocReq assoc_req); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 946 | |
| 947 | /** |
| 948 | * lim_add_self_he_cap() - Copy HE capability into add sta from PE session |
| 949 | * @add_sta_params: pointer to add sta params |
| 950 | * @session: pointer to PE Session |
| 951 | * |
| 952 | * Return: None |
| 953 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 954 | void lim_add_self_he_cap(tpAddStaParams add_sta_params, struct pe_session *session); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 955 | |
| 956 | /** |
| 957 | * lim_add_bss_he_cap() - Copy HE capability into ADD BSS params |
| 958 | * @add_bss: pointer to add bss params |
| 959 | * @assoc_rsp: pointer to assoc response |
| 960 | * |
| 961 | * Return: None |
| 962 | */ |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 963 | void lim_add_bss_he_cap(tpAddBssParams add_bss, tpSirAssocRsp assoc_rsp); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 964 | |
| 965 | /** |
Manikandan Mohan | 39accff | 2017-05-02 16:09:00 -0700 | [diff] [blame] | 966 | * lim_add_bss_he_cfg() - Set HE config to BSS params |
| 967 | * @add_bss: pointer to add bss params |
| 968 | * @session: Pointer to Session entry struct |
| 969 | * |
| 970 | * Return: None |
| 971 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 972 | void lim_add_bss_he_cfg(tpAddBssParams add_bss, struct pe_session *session); |
Manikandan Mohan | 39accff | 2017-05-02 16:09:00 -0700 | [diff] [blame] | 973 | |
| 974 | /** |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 975 | * lim_copy_bss_he_cap() - Copy HE capability into PE session from start bss |
| 976 | * @session: pointer to PE session |
| 977 | * @sme_start_bss_req: pointer to start BSS request |
| 978 | * |
| 979 | * Return: None |
| 980 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 981 | void lim_copy_bss_he_cap(struct pe_session *session, |
Jeff Johnson | 704b891 | 2019-02-02 14:38:14 -0800 | [diff] [blame] | 982 | struct start_bss_req *sme_start_bss_req); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 983 | |
| 984 | /** |
| 985 | * lim_copy_join_req_he_cap() - Copy HE capability to PE session from Join req |
Naveen Rawat | aeca1b9 | 2017-10-16 16:55:31 -0700 | [diff] [blame] | 986 | * and update as per bandwidth supported |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 987 | * @session: pointer to PE session |
| 988 | * @sme_join_req: pointer to SME join request |
| 989 | * |
| 990 | * Return: None |
| 991 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 992 | void lim_copy_join_req_he_cap(struct pe_session *session, |
Jeff Johnson | 701444f | 2019-02-02 22:35:13 -0800 | [diff] [blame] | 993 | struct join_req *sme_join_req); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 994 | |
| 995 | /** |
| 996 | * lim_log_he_op() - Print HE Operation |
| 997 | * @mac: pointer to MAC context |
| 998 | * @he_op: pointer to HE Operation |
| 999 | * |
| 1000 | * Print HE operation stored as dot11f structure |
| 1001 | * |
| 1002 | * Return: None |
| 1003 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1004 | void lim_log_he_op(struct mac_context *mac, tDot11fIEhe_op *he_ops); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1005 | |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 1006 | #ifdef WLAN_FEATURE_11AX_BSS_COLOR |
| 1007 | /** |
| 1008 | * lim_log_he_bss_color() - Print HE bss color |
| 1009 | * @mac: pointer to MAC context |
| 1010 | * @he_bss_color: pointer to HE bss color |
| 1011 | * |
| 1012 | * Print HE bss color IE |
| 1013 | * |
| 1014 | * Return: None |
| 1015 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1016 | void lim_log_he_bss_color(struct mac_context *mac, |
Peng Xu | 6363ec6 | 2017-05-15 11:06:33 -0700 | [diff] [blame] | 1017 | tDot11fIEbss_color_change *he_bss_color); |
| 1018 | #endif |
| 1019 | |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1020 | /** |
| 1021 | * lim_log_he_cap() - Print HE capabilities |
| 1022 | * @mac: pointer to MAC context |
| 1023 | * @he_cap: pointer to HE Capability |
| 1024 | * |
| 1025 | * Received HE capabilities are converted into dot11f structure. |
| 1026 | * This function will print all the HE capabilities as stored |
| 1027 | * in the dot11f structure. |
| 1028 | * |
| 1029 | * Return: None |
| 1030 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1031 | void lim_log_he_cap(struct mac_context *mac, tDot11fIEhe_cap *he_cap); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1032 | |
| 1033 | /** |
| 1034 | * lim_update_stads_he_caps() - Copy HE capability into STA DPH hash table entry |
| 1035 | * @sta_ds: pointer to sta dph hash table entry |
| 1036 | * @assoc_rsp: pointer to assoc response |
| 1037 | * @session_entry: pointer to PE session |
| 1038 | * |
| 1039 | * Return: None |
| 1040 | */ |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1041 | void lim_update_stads_he_caps(tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1042 | struct pe_session *session_entry); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1043 | |
| 1044 | /** |
| 1045 | * lim_update_usr_he_cap() - Update HE capability based on userspace |
| 1046 | * @mac_ctx: global mac context |
| 1047 | * @session: PE session entry |
| 1048 | * |
| 1049 | * Parse the HE Capability IE and populate the fields to be |
| 1050 | * sent to FW as part of add bss and update PE session. |
| 1051 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1052 | void lim_update_usr_he_cap(struct mac_context *mac_ctx, struct pe_session *session); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1053 | |
| 1054 | /** |
| 1055 | * lim_decide_he_op() - Determine HE operation elements |
| 1056 | * @mac_ctx: global mac context |
| 1057 | * @he_ops: pointer to HE operation IE |
| 1058 | * @session: PE session entry |
| 1059 | * |
| 1060 | * Parse the HE Operation IE and populate the fields to be |
| 1061 | * sent to FW as part of add bss. |
| 1062 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1063 | void lim_decide_he_op(struct mac_context *mac_ctx, tpAddBssParams add_bss, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1064 | struct pe_session *session); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1065 | |
| 1066 | /** |
| 1067 | * lim_update_sta_he_capable(): Update he_capable in add sta params |
| 1068 | * @mac: pointer to MAC context |
| 1069 | * @add_sta_params: pointer to add sta params |
| 1070 | * @sta_ds: pointer to dph hash table entry |
| 1071 | * @session_entry: pointer to PE session |
| 1072 | * |
| 1073 | * Return: None |
| 1074 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1075 | void lim_update_sta_he_capable(struct mac_context *mac, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1076 | tpAddStaParams add_sta_params, tpDphHashNode sta_ds, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1077 | struct pe_session *session_entry); |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1078 | |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1079 | static inline bool lim_is_session_he_capable(struct pe_session *session) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1080 | { |
| 1081 | return session->he_capable; |
| 1082 | } |
| 1083 | |
Kiran Kumar Lokere | 4087585 | 2018-01-15 12:36:19 -0800 | [diff] [blame] | 1084 | /** |
| 1085 | * lim_get_session_he_frag_cap(): Get session HE fragmentation cap |
| 1086 | * @session: pointer to session |
| 1087 | * |
| 1088 | * Return: HE fragmentation value |
| 1089 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1090 | static inline uint8_t lim_get_session_he_frag_cap(struct pe_session *session) |
Kiran Kumar Lokere | 4087585 | 2018-01-15 12:36:19 -0800 | [diff] [blame] | 1091 | { |
| 1092 | return session->he_config.fragmentation; |
| 1093 | } |
| 1094 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1095 | static inline bool lim_is_sta_he_capable(tpDphHashNode sta_ds) |
| 1096 | { |
| 1097 | return sta_ds->mlmStaContext.he_capable; |
| 1098 | } |
| 1099 | |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1100 | /** |
| 1101 | * lim_update_bss_he_capable(): Update he_capable in add BSS params |
| 1102 | * @mac: pointer to MAC context |
| 1103 | * @add_bss: pointer to add BSS params |
| 1104 | * |
| 1105 | * Return: None |
| 1106 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1107 | void lim_update_bss_he_capable(struct mac_context *mac, tpAddBssParams add_bss); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1108 | |
| 1109 | /** |
| 1110 | * lim_update_stads_he_capable() - Update he_capable in sta ds context |
| 1111 | * @sta_ds: pointer to sta ds |
| 1112 | * @assoc_req: pointer to assoc request |
| 1113 | * |
| 1114 | * Return: None |
| 1115 | */ |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1116 | void lim_update_stads_he_capable(tpDphHashNode sta_ds, tpSirAssocReq assoc_req); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1117 | |
| 1118 | /** |
| 1119 | * lim_update_session_he_capable(): Update he_capable in PE session |
| 1120 | * @mac: pointer to MAC context |
| 1121 | * @session: pointer to PE session |
| 1122 | * |
| 1123 | * Return: None |
| 1124 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1125 | void lim_update_session_he_capable(struct mac_context *mac, struct pe_session *session); |
Krishna Kumaar Natarajan | 6677ed9 | 2017-03-23 11:52:38 -0700 | [diff] [blame] | 1126 | |
| 1127 | /** |
| 1128 | * lim_update_chan_he_capable(): Update he_capable in chan switch params |
| 1129 | * @mac: pointer to MAC context |
| 1130 | * @chan: pointer to channel switch params |
| 1131 | * |
| 1132 | * Return: None |
| 1133 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1134 | void lim_update_chan_he_capable(struct mac_context *mac, tpSwitchChannelParams chan); |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1135 | |
Krishna Kumaar Natarajan | 1cd73ae | 2017-02-22 15:56:00 -0800 | [diff] [blame] | 1136 | /** |
| 1137 | * lim_set_he_caps() - update HE caps to be sent to FW as part of scan IE |
| 1138 | * @mac: pointer to MAC |
| 1139 | * @session: pointer to PE session |
| 1140 | * @ie_start: pointer to start of IE buffer |
| 1141 | * @num_bytes: length of IE buffer |
| 1142 | * |
| 1143 | * Return: None |
| 1144 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1145 | void lim_set_he_caps(struct mac_context *mac, struct pe_session *session, |
Krishna Kumaar Natarajan | 1cd73ae | 2017-02-22 15:56:00 -0800 | [diff] [blame] | 1146 | uint8_t *ie_start, uint32_t num_bytes); |
| 1147 | |
| 1148 | /** |
| 1149 | * lim_send_he_caps_ie() - gets HE capability and send to firmware via wma |
| 1150 | * @mac_ctx: global mac context |
| 1151 | * @session: pe session. This can be NULL. In that case self cap will be sent |
| 1152 | * @vdev_id: vdev for which IE is targeted |
| 1153 | * |
| 1154 | * This function gets HE capability and send to firmware via wma |
| 1155 | * |
| 1156 | * Return: QDF_STATUS |
| 1157 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1158 | QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, struct pe_session *session, |
Krishna Kumaar Natarajan | 1cd73ae | 2017-02-22 15:56:00 -0800 | [diff] [blame] | 1159 | uint8_t vdev_id); |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 1160 | |
| 1161 | /** |
Jeff Johnson | ecd4f21 | 2019-02-01 19:36:34 -0800 | [diff] [blame] | 1162 | * lim_populate_he_mcs_set() - function to populate HE mcs rate set |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 1163 | * @mac_ctx: pointer to global mac structure |
| 1164 | * @rates: pointer to supported rate set |
| 1165 | * @peer_vht_caps: pointer to peer HE capabilities |
| 1166 | * @session_entry: pe session entry |
Jeff Johnson | ecd4f21 | 2019-02-01 19:36:34 -0800 | [diff] [blame] | 1167 | * @nss: number of spatial streams |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 1168 | * |
| 1169 | * Populates HE mcs rate set based on peer and self capabilities |
| 1170 | * |
| 1171 | * Return: QDF_STATUS |
| 1172 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1173 | QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx, |
Jeff Johnson | ecd4f21 | 2019-02-01 19:36:34 -0800 | [diff] [blame] | 1174 | struct supported_rates *rates, |
| 1175 | tDot11fIEhe_cap *peer_he_caps, |
| 1176 | struct pe_session *session_entry, |
| 1177 | uint8_t nss); |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 1178 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1179 | #else |
| 1180 | static inline void lim_add_he_cap(tpAddStaParams add_sta_params, |
| 1181 | tpSirAssocReq assoc_req) |
| 1182 | { |
| 1183 | } |
| 1184 | |
| 1185 | static inline void lim_add_self_he_cap(tpAddStaParams add_sta_params, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1186 | struct pe_session *session) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1187 | { |
| 1188 | } |
| 1189 | |
| 1190 | static inline void lim_add_bss_he_cap(tpAddBssParams add_bss, |
| 1191 | tpSirAssocRsp assoc_rsp) |
| 1192 | { |
| 1193 | return; |
| 1194 | } |
| 1195 | |
Manikandan Mohan | 39accff | 2017-05-02 16:09:00 -0700 | [diff] [blame] | 1196 | static inline void lim_add_bss_he_cfg(tpAddBssParams add_bss, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1197 | struct pe_session *session) |
Manikandan Mohan | 39accff | 2017-05-02 16:09:00 -0700 | [diff] [blame] | 1198 | { |
| 1199 | } |
| 1200 | |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1201 | static inline void lim_intersect_ap_he_caps(struct pe_session *session, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1202 | tpAddBssParams add_bss, tSchBeaconStruct *pBeaconStruct, |
| 1203 | tpSirAssocRsp assoc_rsp) |
| 1204 | { |
| 1205 | return; |
| 1206 | } |
| 1207 | |
| 1208 | static inline void lim_intersect_sta_he_caps(tpSirAssocReq assoc_req, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1209 | struct pe_session *session, tpDphHashNode sta_ds) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1210 | { |
| 1211 | } |
| 1212 | |
| 1213 | static inline void lim_update_stads_he_caps(tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1214 | struct pe_session *session_entry) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1215 | { |
| 1216 | return; |
| 1217 | } |
| 1218 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1219 | static inline void lim_update_usr_he_cap(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1220 | struct pe_session *session) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1221 | { |
| 1222 | } |
| 1223 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1224 | static inline void lim_decide_he_op(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1225 | tpAddBssParams add_bss, struct pe_session *session) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1226 | { |
| 1227 | } |
| 1228 | |
Jeff Johnson | 704b891 | 2019-02-02 14:38:14 -0800 | [diff] [blame] | 1229 | static inline |
| 1230 | void lim_copy_bss_he_cap(struct pe_session *session, |
| 1231 | struct start_bss_req *sme_start_bss_req) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1232 | { |
| 1233 | } |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 1234 | |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1235 | static inline void lim_copy_join_req_he_cap(struct pe_session *session, |
Jeff Johnson | 701444f | 2019-02-02 22:35:13 -0800 | [diff] [blame] | 1236 | struct join_req *sme_join_req) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1237 | { |
| 1238 | } |
| 1239 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1240 | static inline void lim_log_he_op(struct mac_context *mac, |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 1241 | tDot11fIEhe_op *he_ops) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1242 | { |
| 1243 | } |
| 1244 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1245 | static inline void lim_log_he_cap(struct mac_context *mac, |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 1246 | tDot11fIEhe_cap *he_cap) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1247 | { |
| 1248 | } |
| 1249 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1250 | static inline void lim_update_sta_he_capable(struct mac_context *mac, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1251 | tpAddStaParams add_sta_params, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1252 | tpDphHashNode sta_ds, struct pe_session *session_entry) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1253 | { |
| 1254 | } |
| 1255 | |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1256 | static inline bool lim_is_session_he_capable(struct pe_session *session) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1257 | { |
| 1258 | return false; |
| 1259 | } |
| 1260 | |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1261 | static inline uint8_t lim_get_session_he_frag_cap(struct pe_session *session) |
Kiran Kumar Lokere | 4087585 | 2018-01-15 12:36:19 -0800 | [diff] [blame] | 1262 | { |
| 1263 | return 0; |
| 1264 | } |
| 1265 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1266 | static inline bool lim_is_sta_he_capable(tpDphHashNode sta_ds) |
| 1267 | { |
| 1268 | return false; |
| 1269 | } |
| 1270 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1271 | static inline void lim_update_bss_he_capable(struct mac_context *mac, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1272 | tpAddBssParams add_bss) |
| 1273 | { |
| 1274 | } |
| 1275 | |
| 1276 | static inline void lim_update_stads_he_capable(tpDphHashNode sta_ds, |
| 1277 | tpSirAssocReq assoc_req) |
| 1278 | { |
| 1279 | } |
| 1280 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1281 | static inline void lim_update_session_he_capable(struct mac_context *mac, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1282 | struct pe_session *session) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1283 | { |
| 1284 | } |
| 1285 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1286 | static inline void lim_update_chan_he_capable(struct mac_context *mac, |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1287 | tpSwitchChannelParams chan) |
| 1288 | { |
| 1289 | } |
Krishna Kumaar Natarajan | 1cd73ae | 2017-02-22 15:56:00 -0800 | [diff] [blame] | 1290 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1291 | static inline void lim_set_he_caps(struct mac_context *mac, struct pe_session *session, |
Krishna Kumaar Natarajan | 1cd73ae | 2017-02-22 15:56:00 -0800 | [diff] [blame] | 1292 | uint8_t *ie_start, uint32_t num_bytes) |
| 1293 | { |
| 1294 | } |
| 1295 | |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1296 | static inline QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1297 | struct pe_session *session, |
Krishna Kumaar Natarajan | 1cd73ae | 2017-02-22 15:56:00 -0800 | [diff] [blame] | 1298 | uint8_t vdev_id) |
| 1299 | { |
| 1300 | return QDF_STATUS_SUCCESS; |
| 1301 | } |
| 1302 | |
Jeff Johnson | ecd4f21 | 2019-02-01 19:36:34 -0800 | [diff] [blame] | 1303 | static inline |
| 1304 | QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx, |
| 1305 | struct supported_rates *rates, |
| 1306 | tDot11fIEhe_cap *peer_he_caps, |
| 1307 | struct pe_session *session_entry, |
| 1308 | uint8_t nss) |
Krishna Kumaar Natarajan | d1cd56e | 2016-09-30 08:43:03 -0700 | [diff] [blame] | 1309 | { |
| 1310 | return QDF_STATUS_SUCCESS; |
| 1311 | } |
| 1312 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 1313 | #endif |
Sreelakshmi Konamki | 6d478cd | 2017-03-28 11:59:25 +0530 | [diff] [blame] | 1314 | |
| 1315 | /** |
| 1316 | * lim_decrement_pending_mgmt_count: Decrement mgmt frame count |
| 1317 | * @mac_ctx: Pointer to global MAC structure |
| 1318 | * |
| 1319 | * This function is used to decrement pe mgmt count once frame |
| 1320 | * removed from queue |
| 1321 | * |
| 1322 | * Return: None |
| 1323 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1324 | void lim_decrement_pending_mgmt_count(struct mac_context *mac_ctx); |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 1325 | |
| 1326 | /** |
| 1327 | * lim_check_if_vendor_oui_match() - Check if the given OUI match in IE buffer |
| 1328 | * @mac_ctx: MAC context |
| 1329 | * @ie: IE buffer |
| 1330 | * @ie_len: length of @ie |
| 1331 | * |
| 1332 | * This API is used to check if given vendor OUI |
| 1333 | * matches in given IE buffer |
| 1334 | * |
| 1335 | * Return: True, if mataches. False otherwise |
| 1336 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1337 | bool lim_check_if_vendor_oui_match(struct mac_context *mac_ctx, |
Sridhar Selvaraj | 0d5d2c7 | 2017-08-17 17:30:01 +0530 | [diff] [blame] | 1338 | uint8_t *oui, uint8_t oui_len, |
| 1339 | uint8_t *ie, uint8_t ie_len); |
Naveen Rawat | 296a518 | 2017-09-25 14:02:48 -0700 | [diff] [blame] | 1340 | |
Sandeep Puligilla | d9f88ce | 2017-04-11 19:41:57 -0700 | [diff] [blame] | 1341 | QDF_STATUS lim_util_get_type_subtype(void *pkt, uint8_t *type, |
| 1342 | uint8_t *subtype); |
| 1343 | |
Naveen Rawat | 296a518 | 2017-09-25 14:02:48 -0700 | [diff] [blame] | 1344 | /** |
| 1345 | * lim_get_min_session_txrate() - Get the minimum rate supported in the session |
| 1346 | * @session: Pointer to PE session |
| 1347 | * |
| 1348 | * This API will find the minimum rate supported by the given PE session and |
| 1349 | * return the enum rateid corresponding to the rate. |
| 1350 | * |
| 1351 | * Return: enum rateid |
| 1352 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1353 | enum rateid lim_get_min_session_txrate(struct pe_session *session); |
Naveen Rawat | 296a518 | 2017-09-25 14:02:48 -0700 | [diff] [blame] | 1354 | |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 1355 | /** |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 1356 | * lim_send_dfs_chan_sw_ie_update() - updates the channel switch IE in beacon |
| 1357 | * template |
| 1358 | * |
| 1359 | * @mac_ctx - pointer to global mac context |
| 1360 | * @session - A pointer to pesession |
| 1361 | * Return None |
| 1362 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1363 | void lim_send_dfs_chan_sw_ie_update(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1364 | struct pe_session *session); |
Pragaspathi Thilagaraj | 934275c | 2018-08-07 14:55:35 +0530 | [diff] [blame] | 1365 | |
| 1366 | /** |
| 1367 | * lim_process_ap_ecsa_timeout() -process ECSA timeout which decrement csa count |
| 1368 | * in beacon and update beacon template in firmware |
| 1369 | * |
| 1370 | * @data - A pointer to pesession |
| 1371 | * Return None |
| 1372 | */ |
| 1373 | void lim_process_ap_ecsa_timeout(void *session); |
| 1374 | |
| 1375 | /** |
Rajeev Kumar Sirasanagandla | 2f17f8d | 2018-10-03 17:24:20 +0530 | [diff] [blame] | 1376 | * lim_send_stop_bss_failure_resp() -send failure delete bss resp to sme |
| 1377 | * @mac_ctx: mac ctx |
| 1378 | * @session: session pointer |
| 1379 | * |
| 1380 | * Return None |
| 1381 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1382 | void lim_send_stop_bss_failure_resp(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1383 | struct pe_session *session); |
Rajeev Kumar Sirasanagandla | 2f17f8d | 2018-10-03 17:24:20 +0530 | [diff] [blame] | 1384 | |
| 1385 | /** |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 1386 | * lim_delete_all_peers() -delete all connected peers |
| 1387 | * @session: session pointer |
| 1388 | * |
| 1389 | * Return None |
| 1390 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1391 | void lim_delete_all_peers(struct pe_session *session); |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 1392 | |
| 1393 | /** |
| 1394 | * lim_send_vdev_stop() -send delete bss/stop vdev req |
| 1395 | * @session: session pointer |
| 1396 | * |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 1397 | * Return QDF_STATUS |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 1398 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1399 | QDF_STATUS lim_send_vdev_stop(struct pe_session *session); |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 1400 | |
Abhishek Singh | 1df5088 | 2018-08-30 18:04:29 +0530 | [diff] [blame] | 1401 | /** |
Sandeep Puligilla | 30bb840 | 2018-09-23 22:01:08 -0700 | [diff] [blame] | 1402 | * lim_send_vdev_stop() -send delete bss/stop vdev req for STA |
| 1403 | * @session: session pointer |
| 1404 | * |
| 1405 | * Return QDF_STATUS |
| 1406 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1407 | QDF_STATUS lim_sta_send_del_bss(struct pe_session *session); |
Sandeep Puligilla | 30bb840 | 2018-09-23 22:01:08 -0700 | [diff] [blame] | 1408 | |
| 1409 | /** |
Abhishek Singh | 1df5088 | 2018-08-30 18:04:29 +0530 | [diff] [blame] | 1410 | * lim_send_start_bss_confirm() -send start bss confirm req |
| 1411 | * @mac_ctx: pointer to global mac structure |
| 1412 | * @start_cnf: start confirm structure pointer |
| 1413 | * |
| 1414 | * Return None |
| 1415 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1416 | void lim_send_start_bss_confirm(struct mac_context *mac_ctx, |
Abhishek Singh | 1df5088 | 2018-08-30 18:04:29 +0530 | [diff] [blame] | 1417 | tLimMlmStartCnf *start_cnf); |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 1418 | |
| 1419 | /** |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 1420 | * lim_send_chan_switch_action_frame()- Send an action frame |
| 1421 | * containing CSA IE or ECSA IE depending on the connected |
| 1422 | * sta capability. |
| 1423 | * |
| 1424 | * @mac_ctx: pointer to global mac structure |
| 1425 | * @new_channel: new channel to switch to. |
| 1426 | * @ch_bandwidth: BW of channel to calculate op_class |
| 1427 | * @session_entry: pe session |
| 1428 | * |
| 1429 | * Return: void |
| 1430 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1431 | void lim_send_chan_switch_action_frame(struct mac_context *mac_ctx, |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 1432 | uint16_t new_channel, |
| 1433 | uint8_t ch_bandwidth, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1434 | struct pe_session *session_entry); |
lifeng | 1c16b6b | 2017-09-25 13:59:55 +0800 | [diff] [blame] | 1435 | |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 1436 | /** |
| 1437 | * lim_process_obss_detection_ind() - Process obss detection indication |
| 1438 | * @mac_ctx: Pointer to Global MAC structure. |
| 1439 | * @obss_detection: obss detection info. |
| 1440 | * |
| 1441 | * Process obss detection indication and apply necessary protection for |
| 1442 | * the given AP session. |
| 1443 | * |
| 1444 | * Return: QDF_STATUS |
| 1445 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1446 | QDF_STATUS lim_process_obss_detection_ind(struct mac_context *mac_ctx, |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 1447 | struct wmi_obss_detect_info |
| 1448 | *obss_detection); |
| 1449 | |
| 1450 | /** |
| 1451 | * lim_obss_send_detection_cfg() - Send obss detection configuration to firmware |
| 1452 | * @mac_ctx: Pointer to Global MAC structure |
| 1453 | * @session: Pointer to session |
| 1454 | * @force: Force to send new configuration even if new cfg same as old |
| 1455 | * |
| 1456 | * Generate new cfg based on current protection status and send new cfg to |
| 1457 | * firmware. |
| 1458 | * |
| 1459 | * Return: QDF_STATUS |
| 1460 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1461 | QDF_STATUS lim_obss_send_detection_cfg(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1462 | struct pe_session *session, |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 1463 | bool force); |
| 1464 | |
| 1465 | /** |
| 1466 | * lim_obss_generate_detection_config() - get new obss offload detection cfg |
| 1467 | * @mac_ctx: Pointer to Global MAC structure |
| 1468 | * @session: Pointer to session |
| 1469 | * @cfg: Obss detection cfg buffer pointer |
| 1470 | * |
| 1471 | * Generate new cfg based on current protection status. |
| 1472 | * |
| 1473 | * Return: QDF_STATUS |
| 1474 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1475 | QDF_STATUS lim_obss_generate_detection_config(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1476 | struct pe_session *session, |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 1477 | struct obss_detection_cfg *cfg); |
| 1478 | |
| 1479 | /** |
| 1480 | * lim_enable_obss_detection_config() - Enable obss detection |
| 1481 | * @mac_ctx: Pointer to Global MAC structure |
| 1482 | * @session: Pointer to session |
| 1483 | * |
| 1484 | * This function will enable legacy obss detection (by starting timer) |
| 1485 | * or also offload based detection based on support. |
| 1486 | * |
| 1487 | * Return: None |
| 1488 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1489 | void lim_enable_obss_detection_config(struct mac_context *mac_ctx, |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1490 | struct pe_session *session); |
Arif Hussain | 1513cb2 | 2018-01-05 19:56:31 -0800 | [diff] [blame] | 1491 | |
Varun Reddy Yeturu | 4f849e5 | 2018-06-15 18:08:37 -0700 | [diff] [blame] | 1492 | #ifdef WLAN_SUPPORT_TWT |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1493 | void lim_set_peer_twt_cap(struct pe_session *session, struct s_ext_cap *ext_cap); |
Varun Reddy Yeturu | 4f849e5 | 2018-06-15 18:08:37 -0700 | [diff] [blame] | 1494 | #else |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1495 | static inline void lim_set_peer_twt_cap(struct pe_session *session, |
Varun Reddy Yeturu | 4f849e5 | 2018-06-15 18:08:37 -0700 | [diff] [blame] | 1496 | struct s_ext_cap *ext_cap) |
| 1497 | { |
| 1498 | } |
| 1499 | #endif |
| 1500 | |
Jinwei Chen | 1850d9c | 2018-08-20 15:59:06 +0800 | [diff] [blame] | 1501 | /** |
| 1502 | * lim_rx_invalid_peer_process() - process rx invalid peer indication |
| 1503 | * @mac_ctx: Pointer to Global MAC structure |
| 1504 | * @lim_msg: Pointer to scheduler message |
| 1505 | * |
| 1506 | * This function will process the rx data invalid peer indication, |
| 1507 | * if the vdev operation mode is SAP, then send the deauth mgmt frame |
| 1508 | * to STA. |
| 1509 | * |
| 1510 | * Return: None |
| 1511 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1512 | void lim_rx_invalid_peer_process(struct mac_context *mac_ctx, |
Jinwei Chen | 1850d9c | 2018-08-20 15:59:06 +0800 | [diff] [blame] | 1513 | struct scheduler_msg *lim_msg); |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 1514 | |
| 1515 | /** |
| 1516 | * lim_send_beacon() - send beacon indication to firmware |
| 1517 | * @mac_ctx: Pointer to Global MAC structure |
| 1518 | * @session: session pointer |
| 1519 | * |
| 1520 | * Return: None |
| 1521 | */ |
Jeff Johnson | d01da6b | 2018-12-02 12:10:22 -0800 | [diff] [blame] | 1522 | void lim_send_beacon(struct mac_context *mac_ctx, struct pe_session *session); |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 1523 | |
Manikandan Mohan | 4cc1c5a | 2018-10-09 13:25:30 -0700 | [diff] [blame] | 1524 | /** |
| 1525 | * lim_ndi_mlme_vdev_up_transition() - Send event to transistion NDI VDEV to UP |
| 1526 | * @session: session pointer |
| 1527 | * |
| 1528 | * Return: None |
| 1529 | */ |
Jeff Johnson | c8baa90 | 2018-11-18 21:59:07 -0800 | [diff] [blame] | 1530 | void lim_ndi_mlme_vdev_up_transition(struct pe_session *session); |
Manikandan Mohan | 4cc1c5a | 2018-10-09 13:25:30 -0700 | [diff] [blame] | 1531 | |
Jianmin Zhu | a9005b3 | 2018-12-06 21:30:45 +0800 | [diff] [blame] | 1532 | /** |
| 1533 | * lim_disconnect_complete - Deliver vdev disconnect complete event or |
| 1534 | * STA send deleting bss |
| 1535 | * @session: PE session pointer |
| 1536 | * @del_bss: Whether to call lim_sta_send_del_bss |
| 1537 | * |
| 1538 | * API delivers vdev disconnect complete event |
| 1539 | * |
| 1540 | * Return: None |
| 1541 | */ |
| 1542 | void lim_disconnect_complete(struct pe_session *session, bool del_bss); |
| 1543 | |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 1544 | /** |
Sandeep Puligilla | 30bb840 | 2018-09-23 22:01:08 -0700 | [diff] [blame] | 1545 | * lim_sta_mlme_vdev_stop_send() - send VDEV stop |
| 1546 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1547 | * @data_len: data size |
| 1548 | * @data: event data |
| 1549 | * |
| 1550 | * API invokes vdev stop |
| 1551 | * |
| 1552 | * Return: SUCCESS on successful completion of vdev stop |
| 1553 | * FAILURE, if it fails due to any |
| 1554 | */ |
| 1555 | QDF_STATUS lim_sta_mlme_vdev_stop_send(struct vdev_mlme_obj *vdev_mlme, |
| 1556 | uint16_t data_len, void *data); |
| 1557 | |
| 1558 | /** |
Jianmin Zhu | 69e7bf3 | 2018-11-22 11:56:10 +0800 | [diff] [blame] | 1559 | * lim_sta_mlme_vdev_start_send() - send VDEV start |
| 1560 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1561 | * @data_len: data size |
| 1562 | * @data: event data |
| 1563 | * |
| 1564 | * API invokes vdev start |
| 1565 | * |
| 1566 | * Return: SUCCESS on successful completion of vdev start |
| 1567 | * FAILURE, if it fails due to any |
| 1568 | */ |
| 1569 | QDF_STATUS lim_sta_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme, |
| 1570 | uint16_t data_len, void *data); |
| 1571 | |
| 1572 | /** |
| 1573 | * lim_sta_mlme_vdev_restart_send() - send VDEV restart |
| 1574 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1575 | * @data_len: data size |
| 1576 | * @data: event data |
| 1577 | * |
| 1578 | * API invokes vdev restart |
| 1579 | * |
| 1580 | * Return: SUCCESS on successful completion of vdev restart |
| 1581 | * FAILURE, if it fails due to any |
| 1582 | */ |
| 1583 | QDF_STATUS lim_sta_mlme_vdev_restart_send(struct vdev_mlme_obj *vdev_mlme, |
| 1584 | uint16_t data_len, void *data); |
| 1585 | |
| 1586 | /** |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 1587 | * lim_ap_mlme_vdev_start_send() - Invokes VDEV start operation |
| 1588 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1589 | * @data_len: data size |
| 1590 | * @data: event data |
| 1591 | * |
| 1592 | * API invokes VDEV start operation |
| 1593 | * |
| 1594 | * Return: SUCCESS on successful completion of start operation |
| 1595 | * FAILURE, if it fails due to any |
| 1596 | */ |
| 1597 | QDF_STATUS lim_ap_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme, |
| 1598 | uint16_t data_len, void *event); |
| 1599 | /* |
| 1600 | * lim_ap_mlme_vdev_update_beacon() - Updates beacon |
| 1601 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1602 | * @op: beacon update type |
| 1603 | * @data_len: data size |
| 1604 | * @data: event data |
| 1605 | * |
| 1606 | * API updates/allocates/frees the beacon |
| 1607 | * |
| 1608 | * Return: SUCCESS on successful update of beacon |
| 1609 | * FAILURE, if it fails due to any |
| 1610 | */ |
| 1611 | QDF_STATUS lim_ap_mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme, |
| 1612 | enum beacon_update_op op, |
| 1613 | uint16_t data_len, void *data); |
| 1614 | |
| 1615 | /** |
| 1616 | * lim_ap_mlme_vdev_up_send() - VDEV up operation |
| 1617 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1618 | * @data_len: data size |
| 1619 | * @data: event data |
| 1620 | * |
| 1621 | * API invokes VDEV up operations |
| 1622 | * |
| 1623 | * Return: SUCCESS on successful completion of up operation |
| 1624 | * FAILURE, if it fails due to any |
| 1625 | */ |
| 1626 | QDF_STATUS lim_ap_mlme_vdev_up_send(struct vdev_mlme_obj *vdev_mlme, |
| 1627 | uint16_t data_len, void *data); |
| 1628 | |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 1629 | /** |
| 1630 | * lim_ap_mlme_vdev_disconnect_peers - Disconnect peers |
| 1631 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1632 | * @data_len: data size |
| 1633 | * @data: event data |
| 1634 | * |
| 1635 | * API trigger stations disconnection connected with AP |
| 1636 | * |
| 1637 | * Return: SUCCESS on successful invocation of station disconnection |
| 1638 | * FAILURE, if it fails due to any |
| 1639 | */ |
| 1640 | QDF_STATUS lim_ap_mlme_vdev_disconnect_peers(struct vdev_mlme_obj *vdev_mlme, |
| 1641 | uint16_t data_len, void *data); |
| 1642 | |
| 1643 | /** |
| 1644 | * lim_ap_mlme_vdev_stop_send - Invokes VDEV stop operation |
| 1645 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1646 | * @data_len: data size |
| 1647 | * @data: event data |
| 1648 | * |
| 1649 | * API invokes VDEV stop operation |
| 1650 | * |
| 1651 | * Return: SUCCESS on successful completion of stop operation |
| 1652 | * FAILURE, if it fails due to any |
| 1653 | */ |
| 1654 | QDF_STATUS lim_ap_mlme_vdev_stop_send(struct vdev_mlme_obj *vdev_mlme, |
| 1655 | uint16_t data_len, void *data); |
Abhishek Singh | 20a8e44 | 2018-09-12 15:50:44 +0530 | [diff] [blame] | 1656 | |
| 1657 | /** |
| 1658 | * lim_ap_mlme_vdev_restart_send - Invokes VDEV restart operation |
| 1659 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1660 | * @data_len: data size |
| 1661 | * @data: event data |
| 1662 | * |
| 1663 | * API invokes VDEV restart operation |
| 1664 | * |
| 1665 | * Return: SUCCESS on successful completion of restart operation |
| 1666 | * FAILURE, if it fails due to any |
| 1667 | */ |
| 1668 | QDF_STATUS lim_ap_mlme_vdev_restart_send(struct vdev_mlme_obj *vdev_mlme, |
| 1669 | uint16_t data_len, void *data); |
| 1670 | |
Abhishek Singh | c5a5408 | 2018-09-12 16:08:03 +0530 | [diff] [blame] | 1671 | /** |
| 1672 | * lim_ap_mlme_vdev_start_req_failed - handle vdev start req failure |
| 1673 | * @vdev_mlme_obj: VDEV MLME comp object |
| 1674 | * @data_len: data size |
| 1675 | * @data: event data |
| 1676 | * |
| 1677 | * API invokes on START fail response |
| 1678 | * |
| 1679 | * Return: SUCCESS on successful invocation of callback |
| 1680 | * FAILURE, if it fails due to any |
| 1681 | */ |
| 1682 | QDF_STATUS lim_ap_mlme_vdev_start_req_failed(struct vdev_mlme_obj *vdev_mlme, |
| 1683 | uint16_t data_len, void *data); |
| 1684 | |
Kiran Kumar Lokere | 7d6e4c9 | 2018-09-19 13:45:47 -0700 | [diff] [blame] | 1685 | #ifdef CRYPTO_SET_KEY_CONVERGED |
| 1686 | static inline bool lim_is_set_key_req_converged(void) |
| 1687 | { |
| 1688 | return true; |
| 1689 | } |
| 1690 | |
| 1691 | static inline void lim_copy_set_key_req_mac_addr(struct qdf_mac_addr *dst, |
| 1692 | struct qdf_mac_addr *src) |
| 1693 | { |
| 1694 | qdf_copy_macaddr(dst, src); |
| 1695 | } |
| 1696 | #else |
| 1697 | static inline bool lim_is_set_key_req_converged(void) |
| 1698 | { |
| 1699 | return false; |
| 1700 | } |
| 1701 | |
| 1702 | static inline void lim_copy_set_key_req_mac_addr(struct qdf_mac_addr *dst, |
| 1703 | struct qdf_mac_addr *src) |
| 1704 | { |
| 1705 | } |
| 1706 | #endif |
Wu Gao | 5c3d94b | 2019-01-17 21:15:54 +0800 | [diff] [blame] | 1707 | |
| 1708 | /** |
| 1709 | * lim_get_regulatory_max_transmit_power() - Get regulatory max transmit |
| 1710 | * power on given channel |
| 1711 | * @mac: pointer to mac data |
| 1712 | * @channel: channel number |
| 1713 | * |
| 1714 | * Return: int8_t - power |
| 1715 | */ |
| 1716 | int8_t lim_get_regulatory_max_transmit_power(struct mac_context *mac, |
| 1717 | uint8_t channel); |
| 1718 | |
| 1719 | /** |
| 1720 | * lim_get_capability_info() - Get capability information |
| 1721 | * @mac: pointer to mac data |
| 1722 | * @pcap: pointer to return capability information |
| 1723 | * @pe_session: pointer to pe session |
| 1724 | * |
| 1725 | * Return: SUCCESS on successful get capability information |
| 1726 | * FAILURE, if it fails due to any |
| 1727 | */ |
| 1728 | QDF_STATUS lim_get_capability_info(struct mac_context *mac, uint16_t *pCap, |
| 1729 | struct pe_session *pe_session); |
| 1730 | |
Abhishek Singh | ecc2c75 | 2019-03-18 11:05:39 +0530 | [diff] [blame] | 1731 | /** |
| 1732 | * lim_flush_bssid() - flush bssid from scan cache |
| 1733 | * @mac_ctx: pointer to mac data |
| 1734 | * @bssid: bssid to be flushed |
| 1735 | * |
| 1736 | * Return: void |
| 1737 | */ |
| 1738 | void lim_flush_bssid(struct mac_context *mac_ctx, uint8_t *bssid); |
| 1739 | |
Pragaspathi Thilagaraj | 0bd369d | 2019-04-08 00:07:53 +0530 | [diff] [blame] | 1740 | /** |
| 1741 | * lim_is_sha384_akm() - Function to check if the negotiated AKM for the |
| 1742 | * current session is based on sha384 key derivation function. |
| 1743 | * @mac_ctx: pointer to mac data |
| 1744 | * @akm: negotiated AKM for the current session |
| 1745 | * |
| 1746 | * Return: true if akm is sha384 based kdf or false |
| 1747 | */ |
| 1748 | bool lim_is_sha384_akm(enum ani_akm_type akm); |
| 1749 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1750 | #endif /* __LIM_UTILS_H */ |