Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Jeff Johnson | 5ec4d8c | 2018-03-24 15:04:36 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012-2018 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_process_probe_req_frame.cc contains the code |
| 21 | * for processing Probe Request Frame. |
| 22 | * Author: Chandra Modumudi |
| 23 | * Date: 02/28/02 |
| 24 | * History:- |
| 25 | * Date Modified by Modification Information |
| 26 | * -------------------------------------------------------------------- |
| 27 | * |
| 28 | */ |
| 29 | |
| 30 | #include "wni_cfg.h" |
| 31 | #include "ani_global.h" |
| 32 | #include "cfg_api.h" |
| 33 | |
| 34 | #include "utils_api.h" |
| 35 | #include "lim_types.h" |
| 36 | #include "lim_utils.h" |
| 37 | #include "lim_assoc_utils.h" |
| 38 | #include "lim_ser_des_utils.h" |
| 39 | #include "parser_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 40 | #include "lim_ft_defs.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | #include "lim_session.h" |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 42 | #include "wlan_utility.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 43 | |
| 44 | void |
| 45 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 46 | lim_send_sme_probe_req_ind(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | tSirMacAddr peerMacAddr, |
| 48 | uint8_t *pProbeReqIE, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 49 | uint32_t ProbeReqIELen, struct pe_session *pe_session); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * lim_get_wpspbc_sessions() - to get wps pbs sessions |
| 53 | * @mac_ctx: Pointer to Global MAC structure |
Jeff Johnson | be7f4fd | 2018-05-11 21:05:54 -0700 | [diff] [blame] | 54 | * @addr: probe request source MAC address |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | * @uuid_e: A pointer to UUIDE element of WPS IE in WPS PBC probe request |
| 56 | * @session: A pointer to station PE session |
| 57 | * |
| 58 | * This function is called to query the WPS PBC overlap. This function |
| 59 | * check WPS PBC probe request link list for PBC overlap |
| 60 | * |
| 61 | * @return None |
| 62 | */ |
| 63 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 64 | void lim_get_wpspbc_sessions(struct mac_context *mac_ctx, struct qdf_mac_addr addr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 65 | uint8_t *uuid_e, eWPSPBCOverlap *overlap, |
Jeff Johnson | 202e328 | 2018-11-18 22:57:39 -0800 | [diff] [blame] | 66 | struct pe_session *session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 67 | { |
| 68 | int count = 0; |
| 69 | tSirWPSPBCSession *pbc; |
| 70 | uint32_t cur_time; |
| 71 | |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 72 | cur_time = (uint32_t) (qdf_mc_timer_get_system_ticks() / |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 73 | QDF_TICKS_PER_SECOND); |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 74 | qdf_zero_macaddr(&addr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 75 | qdf_mem_set((uint8_t *) uuid_e, SIR_WPS_UUID_LEN, 0); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 76 | for (pbc = session->pAPWPSPBCSession; pbc; pbc = pbc->next) { |
| 77 | if (cur_time > pbc->timestamp + SIR_WPS_PBC_WALK_TIME) |
| 78 | break; |
| 79 | count++; |
| 80 | if (count > 1) |
| 81 | break; |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 82 | qdf_copy_macaddr(&addr, &pbc->addr); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 83 | qdf_mem_copy((uint8_t *) uuid_e, (uint8_t *) pbc->uuid_e, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | SIR_WPS_UUID_LEN); |
| 85 | } |
| 86 | if (count > 1) |
| 87 | /* Overlap */ |
| 88 | *overlap = eSAP_WPSPBC_OVERLAP_IN120S; |
| 89 | else if (count == 0) |
| 90 | /* no WPS probe request in 120 second */ |
| 91 | *overlap = eSAP_WPSPBC_NO_WPSPBC_PROBE_REQ_IN120S; |
| 92 | else |
| 93 | /* One WPS probe request in 120 second */ |
| 94 | *overlap = eSAP_WPSPBC_ONE_WPSPBC_PROBE_REQ_IN120S; |
| 95 | |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 96 | pe_debug("overlap: %d", *overlap); |
Srinivas Girigowda | b896a56 | 2017-03-16 17:41:26 -0700 | [diff] [blame] | 97 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
| 98 | addr.bytes, QDF_MAC_ADDR_SIZE); |
| 99 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
| 100 | uuid_e, SIR_WPS_UUID_LEN); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 101 | return; |
| 102 | } |
| 103 | |
| 104 | /** |
Krishna Kumaar Natarajan | d913190 | 2015-10-19 11:52:47 -0700 | [diff] [blame] | 105 | * lim_remove_timeout_pbc_sessions() - remove pbc probe req entries. |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 106 | * @mac - Pointer to Global MAC structure |
Krishna Kumaar Natarajan | d913190 | 2015-10-19 11:52:47 -0700 | [diff] [blame] | 107 | * @pbc - The beginning entry in WPS PBC probe request link list |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 108 | * |
Krishna Kumaar Natarajan | d913190 | 2015-10-19 11:52:47 -0700 | [diff] [blame] | 109 | * This function is called to remove the WPS PBC probe request entries from |
| 110 | * specific entry to end. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 111 | * |
Krishna Kumaar Natarajan | d913190 | 2015-10-19 11:52:47 -0700 | [diff] [blame] | 112 | * Return - None |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 113 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 114 | static void lim_remove_timeout_pbc_sessions(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 115 | tSirWPSPBCSession *pbc) |
| 116 | { |
| 117 | tSirWPSPBCSession *prev; |
| 118 | |
| 119 | while (pbc) { |
| 120 | prev = pbc; |
| 121 | pbc = pbc->next; |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 122 | pe_debug("WPS PBC sessions remove"); |
Srinivas Girigowda | b896a56 | 2017-03-16 17:41:26 -0700 | [diff] [blame] | 123 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
| 124 | prev->addr.bytes, QDF_MAC_ADDR_SIZE); |
| 125 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
| 126 | prev->uuid_e, SIR_WPS_UUID_LEN); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 127 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 128 | qdf_mem_free(prev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 129 | } |
| 130 | } |
| 131 | |
Srinivas Girigowda | edcfab9 | 2015-11-24 15:21:41 -0800 | [diff] [blame] | 132 | /** |
| 133 | * lim_remove_pbc_sessions() - Remove PBC sessions |
| 134 | * @mac: Pointer to Global MAC structure |
| 135 | * @remove_mac: MAC Address of STA in WPS Session to be removed |
| 136 | * @session_entry: session entry |
| 137 | * |
| 138 | * Return: none |
| 139 | */ |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 140 | void lim_remove_pbc_sessions(struct mac_context *mac, struct qdf_mac_addr remove_mac, |
Jeff Johnson | 202e328 | 2018-11-18 22:57:39 -0800 | [diff] [blame] | 141 | struct pe_session *session_entry) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 142 | { |
| 143 | tSirWPSPBCSession *pbc, *prev = NULL; |
Srinivas Girigowda | 4d65ebe | 2017-10-13 21:41:42 -0700 | [diff] [blame] | 144 | |
Srinivas Girigowda | edcfab9 | 2015-11-24 15:21:41 -0800 | [diff] [blame] | 145 | prev = pbc = session_entry->pAPWPSPBCSession; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 146 | |
| 147 | while (pbc) { |
Anurag Chouhan | c554842 | 2016-02-24 18:33:27 +0530 | [diff] [blame] | 148 | if (qdf_is_macaddr_equal(&pbc->addr, &remove_mac)) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 149 | prev->next = pbc->next; |
Srinivas Girigowda | edcfab9 | 2015-11-24 15:21:41 -0800 | [diff] [blame] | 150 | if (pbc == session_entry->pAPWPSPBCSession) |
| 151 | session_entry->pAPWPSPBCSession = pbc->next; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 152 | qdf_mem_free(pbc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 153 | return; |
| 154 | } |
| 155 | prev = pbc; |
| 156 | pbc = pbc->next; |
| 157 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | /** |
| 161 | * lim_update_pbc_session_entry |
| 162 | * |
| 163 | ***FUNCTION: |
| 164 | * This function is called when probe request with WPS PBC IE is received |
| 165 | * |
| 166 | ***LOGIC: |
| 167 | * This function add the WPS PBC probe request in the WPS PBC probe request link list |
| 168 | * The link list is in decreased time order of probe request that is received. |
| 169 | * The entry that is more than 120 second is removed. |
| 170 | * |
| 171 | ***ASSUMPTIONS: |
| 172 | * |
| 173 | * |
| 174 | ***NOTE: |
| 175 | * |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 176 | * @param mac Pointer to Global MAC structure |
Jeff Johnson | be7f4fd | 2018-05-11 21:05:54 -0700 | [diff] [blame] | 177 | * @param addr A pointer to probe request source MAC address |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 178 | * @param uuid_e A pointer to UUIDE element of WPS IE |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 179 | * @param pe_session A pointer to station PE session |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 180 | * |
| 181 | * @return None |
| 182 | */ |
| 183 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 184 | static void lim_update_pbc_session_entry(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | uint8_t *addr, uint8_t *uuid_e, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 186 | struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 187 | { |
| 188 | tSirWPSPBCSession *pbc, *prev = NULL; |
| 189 | |
| 190 | uint32_t curTime; |
| 191 | |
| 192 | curTime = |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 193 | (uint32_t) (qdf_mc_timer_get_system_ticks() / |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 194 | QDF_TICKS_PER_SECOND); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 195 | |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 196 | pe_debug("Receive WPS probe reques curTime: %d", curTime); |
Srinivas Girigowda | b896a56 | 2017-03-16 17:41:26 -0700 | [diff] [blame] | 197 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
| 198 | addr, QDF_MAC_ADDR_SIZE); |
| 199 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, |
| 200 | uuid_e, SIR_WPS_UUID_LEN); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 201 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 202 | pbc = pe_session->pAPWPSPBCSession; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 203 | |
| 204 | while (pbc) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 205 | if ((!qdf_mem_cmp |
Srinivas Girigowda | 419e36b | 2015-11-24 15:39:54 -0800 | [diff] [blame] | 206 | ((uint8_t *) pbc->addr.bytes, (uint8_t *) addr, |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 207 | QDF_MAC_ADDR_SIZE)) |
| 208 | && (!qdf_mem_cmp((uint8_t *) pbc->uuid_e, |
| 209 | (uint8_t *) uuid_e, SIR_WPS_UUID_LEN))) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 210 | if (prev) |
| 211 | prev->next = pbc->next; |
| 212 | else |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 213 | pe_session->pAPWPSPBCSession = pbc->next; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 214 | break; |
| 215 | } |
| 216 | prev = pbc; |
| 217 | pbc = pbc->next; |
| 218 | } |
| 219 | |
| 220 | if (!pbc) { |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 221 | pbc = qdf_mem_malloc(sizeof(tSirWPSPBCSession)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 222 | if (!pbc) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 223 | return; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 224 | qdf_mem_copy((uint8_t *) pbc->addr.bytes, (uint8_t *) addr, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 225 | QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 226 | |
| 227 | if (uuid_e) |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 228 | qdf_mem_copy((uint8_t *) pbc->uuid_e, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 229 | (uint8_t *) uuid_e, SIR_WPS_UUID_LEN); |
| 230 | } |
| 231 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 232 | pbc->next = pe_session->pAPWPSPBCSession; |
| 233 | pe_session->pAPWPSPBCSession = pbc; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 234 | pbc->timestamp = curTime; |
| 235 | |
| 236 | /* remove entries that have timed out */ |
| 237 | prev = pbc; |
| 238 | pbc = pbc->next; |
| 239 | |
| 240 | while (pbc) { |
| 241 | if (curTime > pbc->timestamp + SIR_WPS_PBC_WALK_TIME) { |
| 242 | prev->next = NULL; |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 243 | lim_remove_timeout_pbc_sessions(mac, pbc); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 244 | break; |
| 245 | } |
| 246 | prev = pbc; |
| 247 | pbc = pbc->next; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * lim_wpspbc_close |
| 253 | * |
| 254 | ***FUNCTION: |
| 255 | * This function is called when BSS is closed |
| 256 | * |
| 257 | ***LOGIC: |
| 258 | * This function remove all the WPS PBC entries |
| 259 | * |
| 260 | ***ASSUMPTIONS: |
| 261 | * |
| 262 | * |
| 263 | ***NOTE: |
| 264 | * |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 265 | * @param mac Pointer to Global MAC structure |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 266 | * @param pe_session A pointer to station PE session |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 267 | * |
| 268 | * @return None |
| 269 | */ |
| 270 | |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 271 | void lim_wpspbc_close(struct mac_context *mac, struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 272 | { |
| 273 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 274 | lim_remove_timeout_pbc_sessions(mac, pe_session->pAPWPSPBCSession); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 275 | |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * lim_check11b_rates |
| 280 | * |
| 281 | ***FUNCTION: |
| 282 | * This function is called by lim_process_probe_req_frame() upon |
| 283 | * Probe Request frame reception. |
| 284 | * |
| 285 | ***LOGIC: |
| 286 | * This function check 11b rates in supportedRates and extendedRates rates |
| 287 | * |
| 288 | ***NOTE: |
| 289 | * |
| 290 | * @param rate |
| 291 | * |
| 292 | * @return BOOLEAN |
| 293 | */ |
| 294 | |
Jeff Johnson | 662ba06 | 2016-10-07 07:26:47 -0700 | [diff] [blame] | 295 | static bool lim_check11b_rates(uint8_t rate) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 296 | { |
| 297 | if ((0x02 == (rate)) |
| 298 | || (0x04 == (rate)) |
| 299 | || (0x0b == (rate)) |
| 300 | || (0x16 == (rate)) |
| 301 | ) { |
| 302 | return true; |
| 303 | } |
| 304 | return false; |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * lim_process_probe_req_frame: to process probe req frame |
| 309 | * @mac_ctx: Pointer to Global MAC structure |
| 310 | * @rx_pkt_info: A pointer to Buffer descriptor + associated PDUs |
| 311 | * @session: a ponter to session entry |
| 312 | * |
| 313 | * This function is called by limProcessMessageQueue() upon |
| 314 | * Probe Request frame reception. This function processes received |
| 315 | * Probe Request frame and responds with Probe Response. |
| 316 | * Only AP or STA in IBSS mode that sent last Beacon will respond to |
| 317 | * Probe Request. |
| 318 | * ASSUMPTIONS: |
| 319 | * 1. AP or STA in IBSS mode that sent last Beacon will always respond |
| 320 | * to Probe Request received with broadcast SSID. |
| 321 | * NOTE: |
| 322 | * 1. Dunno what to do with Rates received in Probe Request frame |
| 323 | * 2. Frames with out-of-order fields/IEs are dropped. |
| 324 | * |
| 325 | * |
| 326 | * Return: none |
| 327 | */ |
| 328 | |
| 329 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 330 | lim_process_probe_req_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info, |
Jeff Johnson | 202e328 | 2018-11-18 22:57:39 -0800 | [diff] [blame] | 331 | struct pe_session *session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 332 | { |
| 333 | uint8_t *body_ptr; |
| 334 | tpSirMacMgmtHdr mac_hdr; |
| 335 | uint32_t frame_len; |
| 336 | tSirProbeReq probe_req; |
| 337 | tAniSSID ssid; |
| 338 | |
| 339 | /* Don't send probe responses if disabled */ |
| 340 | if (mac_ctx->lim.gLimProbeRespDisableFlag) |
| 341 | return; |
| 342 | |
| 343 | /* |
| 344 | * Don't send probe response if P2P go is scanning till scan |
| 345 | * come to idle state. |
| 346 | */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 347 | if ((session->pePersona == QDF_P2P_GO_MODE) && |
Jeff Johnson | 5ec4d8c | 2018-03-24 15:04:36 -0700 | [diff] [blame] | 348 | mac_ctx->lim.gpLimRemainOnChanReq) { |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 349 | pe_debug("GO is scanning, don't send probersp on diff chnl"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 350 | return; |
| 351 | } |
| 352 | mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info); |
| 353 | if (LIM_IS_AP_ROLE(session) || |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 354 | (LIM_IS_IBSS_ROLE(session) && |
| 355 | (WMA_GET_RX_BEACON_SENT(rx_pkt_info)))) { |
| 356 | frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info); |
| 357 | |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 358 | pe_debug("Received Probe Request: %d bytes from", |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 359 | frame_len); |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 360 | lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 361 | /* Get pointer to Probe Request frame body */ |
| 362 | body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info); |
| 363 | |
Kondabattini, Ganesh | e4f18e0 | 2016-09-13 13:01:22 +0530 | [diff] [blame] | 364 | /* check for vendor IE presence */ |
| 365 | if ((session->access_policy_vendor_ie) && |
| 366 | (session->access_policy == |
| 367 | LIM_ACCESS_POLICY_RESPOND_IF_IE_IS_PRESENT)) { |
Naveen Rawat | 08db88f | 2017-09-08 15:07:48 -0700 | [diff] [blame] | 368 | if (!wlan_get_vendor_ie_ptr_from_oui( |
Kondabattini, Ganesh | e4f18e0 | 2016-09-13 13:01:22 +0530 | [diff] [blame] | 369 | &session->access_policy_vendor_ie[2], |
| 370 | 3, body_ptr, frame_len)) { |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 371 | pe_warn("Vendor IE is not present and access policy is: %x dropping probe request", |
Kondabattini, Ganesh | e4f18e0 | 2016-09-13 13:01:22 +0530 | [diff] [blame] | 372 | session->access_policy); |
| 373 | return; |
| 374 | } |
| 375 | } |
| 376 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 377 | /* Parse Probe Request frame */ |
| 378 | if (sir_convert_probe_req_frame2_struct(mac_ctx, body_ptr, |
Jeff Johnson | 0301ecb | 2018-06-29 09:36:23 -0700 | [diff] [blame] | 379 | frame_len, &probe_req) == QDF_STATUS_E_FAILURE) { |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 380 | pe_err("Parse error ProbeReq, length: %d, SA is: " |
| 381 | MAC_ADDRESS_STR, frame_len, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 382 | MAC_ADDR_ARRAY(mac_hdr->sa)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 383 | return; |
| 384 | } |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 385 | if (session->pePersona == QDF_P2P_GO_MODE) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 386 | uint8_t i = 0, rate_11b = 0, other_rates = 0; |
| 387 | /* Check 11b rates in supported rates */ |
| 388 | for (i = 0; i < probe_req.supportedRates.numRates; |
| 389 | i++) { |
| 390 | if (lim_check11b_rates( |
| 391 | probe_req.supportedRates.rate[i] & |
| 392 | 0x7f)) |
| 393 | rate_11b++; |
| 394 | else |
| 395 | other_rates++; |
| 396 | } |
| 397 | |
| 398 | /* Check 11b rates in extended rates */ |
| 399 | for (i = 0; i < probe_req.extendedRates.numRates; i++) { |
| 400 | if (lim_check11b_rates( |
| 401 | probe_req.extendedRates.rate[i] & 0x7f)) |
| 402 | rate_11b++; |
| 403 | else |
| 404 | other_rates++; |
| 405 | } |
| 406 | |
| 407 | if ((rate_11b > 0) && (other_rates == 0)) { |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 408 | pe_debug("Received a probe req frame with only 11b rates, SA is: "); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 409 | lim_print_mac_addr(mac_ctx, |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 410 | mac_hdr->sa, LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 411 | return; |
| 412 | } |
| 413 | } |
| 414 | if (LIM_IS_AP_ROLE(session) && |
| 415 | ((session->APWPSIEs.SirWPSProbeRspIE.FieldPresent |
| 416 | & SIR_WPS_PROBRSP_VER_PRESENT) |
| 417 | && (probe_req.wscIePresent == 1) |
| 418 | && (probe_req.probeReqWscIeInfo.DevicePasswordID.id == |
| 419 | WSC_PASSWD_ID_PUSH_BUTTON) |
| 420 | && (probe_req.probeReqWscIeInfo.UUID_E.present == 1))) { |
| 421 | if (session->fwdWPSPBCProbeReq) { |
Srinivas Girigowda | b896a56 | 2017-03-16 17:41:26 -0700 | [diff] [blame] | 422 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, |
| 423 | QDF_TRACE_LEVEL_DEBUG, |
| 424 | mac_hdr->sa, |
| 425 | QDF_MAC_ADDR_SIZE); |
| 426 | QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, |
| 427 | QDF_TRACE_LEVEL_DEBUG, |
| 428 | body_ptr, frame_len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 429 | lim_send_sme_probe_req_ind(mac_ctx, mac_hdr->sa, |
| 430 | body_ptr, frame_len, session); |
| 431 | } else { |
| 432 | lim_update_pbc_session_entry(mac_ctx, |
| 433 | mac_hdr->sa, |
| 434 | probe_req.probeReqWscIeInfo.UUID_E.uuid, |
| 435 | session); |
| 436 | } |
| 437 | } |
| 438 | ssid.length = session->ssId.length; |
| 439 | /* Copy the SSID from sessio entry to local variable */ |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 440 | qdf_mem_copy(ssid.ssId, session->ssId.ssId, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 441 | session->ssId.length); |
| 442 | |
| 443 | /* |
| 444 | * Compare received SSID with current SSID. If they match, |
| 445 | * reply with Probe Response |
| 446 | */ |
| 447 | if (probe_req.ssId.length) { |
| 448 | if (!ssid.length) |
| 449 | goto multipleSSIDcheck; |
| 450 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 451 | if (!qdf_mem_cmp((uint8_t *) &ssid, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 452 | (uint8_t *) &(probe_req.ssId), |
| 453 | (uint8_t) (ssid.length + 1))) { |
| 454 | lim_send_probe_rsp_mgmt_frame(mac_ctx, |
| 455 | mac_hdr->sa, &ssid, |
| 456 | DPH_USE_MGMT_STAID, |
| 457 | DPH_NON_KEEPALIVE_FRAME, |
| 458 | session, |
| 459 | probe_req.p2pIePresent); |
| 460 | return; |
| 461 | } else if (session->pePersona == |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 462 | QDF_P2P_GO_MODE) { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 463 | uint8_t direct_ssid[7] = "DIRECT-"; |
| 464 | uint8_t direct_ssid_len = 7; |
Srinivas Girigowda | 4d65ebe | 2017-10-13 21:41:42 -0700 | [diff] [blame] | 465 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 466 | if (!qdf_mem_cmp((uint8_t *) &direct_ssid, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 467 | (uint8_t *) &(probe_req.ssId.ssId), |
| 468 | (uint8_t) (direct_ssid_len))) { |
| 469 | lim_send_probe_rsp_mgmt_frame(mac_ctx, |
| 470 | mac_hdr->sa, |
| 471 | &ssid, |
| 472 | DPH_USE_MGMT_STAID, |
| 473 | DPH_NON_KEEPALIVE_FRAME, |
| 474 | session, |
| 475 | probe_req.p2pIePresent); |
| 476 | return; |
| 477 | } |
| 478 | } else { |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 479 | pe_debug("Ignore ProbeReq frm with unmatch SSID received from"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 480 | lim_print_mac_addr(mac_ctx, mac_hdr->sa, |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 481 | LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 482 | } |
| 483 | } else { |
| 484 | /* |
| 485 | * Broadcast SSID in the Probe Request. |
| 486 | * Reply with SSID we're configured with. |
| 487 | * Turn off the SSID length to 0 if hidden SSID feature |
| 488 | * is present |
| 489 | */ |
| 490 | if (session->ssidHidden) |
| 491 | /* |
| 492 | * We are returning from here as probe request |
| 493 | * contains the broadcast SSID. So no need to |
| 494 | * send the probe resp |
| 495 | */ |
| 496 | return; |
| 497 | lim_send_probe_rsp_mgmt_frame(mac_ctx, mac_hdr->sa, |
| 498 | &ssid, |
| 499 | DPH_USE_MGMT_STAID, |
| 500 | DPH_NON_KEEPALIVE_FRAME, |
| 501 | session, |
| 502 | probe_req.p2pIePresent); |
| 503 | return; |
| 504 | } |
| 505 | multipleSSIDcheck: |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 506 | pe_debug("Ignore ProbeReq frm with unmatch SSID rcved from"); |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 507 | lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 508 | } else { |
| 509 | /* Ignore received Probe Request frame */ |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 510 | pe_debug("Ignoring Probe Request frame received from"); |
Nishank Aggarwal | abfd70b | 2017-03-11 16:48:25 +0530 | [diff] [blame] | 511 | lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOGD); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 512 | } |
| 513 | return; |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * lim_indicate_probe_req_to_hdd |
| 518 | * |
| 519 | ***FUNCTION: |
| 520 | * This function is called by lim_process_probe_req_frame_multiple_bss() upon |
| 521 | * Probe Request frame reception. |
| 522 | * |
| 523 | ***LOGIC: |
| 524 | * This function processes received Probe Request frame and Pass |
| 525 | * Probe Request Frame to HDD. |
| 526 | * |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 527 | * @param mac Pointer to Global MAC structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 528 | * @param *pBd A pointer to Buffer descriptor + associated PDUs |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 529 | * @param pe_session A pointer to PE session |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 530 | * |
| 531 | * @return None |
| 532 | */ |
| 533 | |
| 534 | static void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 535 | lim_indicate_probe_req_to_hdd(struct mac_context *mac, uint8_t *pBd, |
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 | { |
| 538 | tpSirMacMgmtHdr pHdr; |
| 539 | uint32_t frameLen; |
| 540 | |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 541 | pe_debug("Received a probe request frame"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 542 | |
| 543 | pHdr = WMA_GET_RX_MAC_HEADER(pBd); |
| 544 | frameLen = WMA_GET_RX_PAYLOAD_LEN(pBd); |
| 545 | |
| 546 | /* send the probe req to SME. */ |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 547 | lim_send_sme_mgmt_frame_ind(mac, pHdr->fc.subType, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 548 | (uint8_t *) pHdr, |
| 549 | (frameLen + sizeof(tSirMacMgmtHdr)), |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 550 | pe_session->smeSessionId, WMA_GET_RX_CH(pBd), |
| 551 | pe_session, |
yeshwanth sriram guntuka | 2bc1435 | 2017-04-26 13:07:32 +0530 | [diff] [blame] | 552 | WMA_GET_RX_RSSI_NORMALIZED(pBd)); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 553 | } /*** end lim_indicate_probe_req_to_hdd() ***/ |
| 554 | |
| 555 | /** |
| 556 | * lim_process_probe_req_frame_multiple_bss() - to process probe req |
| 557 | * @mac_ctx: Pointer to Global MAC structure |
| 558 | * @buf_descr: A pointer to Buffer descriptor + associated PDUs |
| 559 | * @session: A pointer to PE session |
| 560 | * |
| 561 | * This function is called by limProcessMessageQueue() upon |
| 562 | * Probe Request frame reception. This function call |
| 563 | * lim_indicate_probe_req_to_hdd function to indicate |
| 564 | * Probe Request frame to HDD. It also call lim_process_probe_req_frame |
| 565 | * function which process received Probe Request frame and responds |
| 566 | * with Probe Response. |
| 567 | * |
| 568 | * @return None |
| 569 | */ |
| 570 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 571 | lim_process_probe_req_frame_multiple_bss(struct mac_context *mac_ctx, |
Jeff Johnson | 202e328 | 2018-11-18 22:57:39 -0800 | [diff] [blame] | 572 | uint8_t *buf_descr, struct pe_session *session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 573 | { |
| 574 | uint8_t i; |
| 575 | |
| 576 | if (session != NULL) { |
| 577 | if (LIM_IS_AP_ROLE(session)) { |
| 578 | lim_indicate_probe_req_to_hdd(mac_ctx, |
| 579 | buf_descr, session); |
| 580 | } |
| 581 | lim_process_probe_req_frame(mac_ctx, buf_descr, session); |
| 582 | return; |
| 583 | } |
| 584 | |
| 585 | for (i = 0; i < mac_ctx->lim.maxBssId; i++) { |
| 586 | session = pe_find_session_by_session_id(mac_ctx, i); |
| 587 | if (session == NULL) |
| 588 | continue; |
| 589 | if (LIM_IS_AP_ROLE(session)) |
| 590 | lim_indicate_probe_req_to_hdd(mac_ctx, |
| 591 | buf_descr, session); |
| 592 | if (LIM_IS_AP_ROLE(session) || |
Rajeev Kumar | cf835a0 | 2016-04-15 15:01:31 -0700 | [diff] [blame] | 593 | LIM_IS_IBSS_ROLE(session)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 594 | lim_process_probe_req_frame(mac_ctx, |
| 595 | buf_descr, session); |
| 596 | } |
| 597 | } |
| 598 | |
| 599 | /** |
| 600 | * lim_send_sme_probe_req_ind() |
| 601 | * |
| 602 | ***FUNCTION: |
| 603 | * This function is to send |
| 604 | * eWNI_SME_WPS_PBC_PROBE_REQ_IND message to host |
| 605 | * |
| 606 | ***PARAMS: |
| 607 | * |
| 608 | ***LOGIC: |
| 609 | * |
| 610 | ***ASSUMPTIONS: |
| 611 | * NA |
| 612 | * |
| 613 | ***NOTE: |
| 614 | * This function is used for sending eWNI_SME_WPS_PBC_PROBE_REQ_IND |
| 615 | * to host. |
| 616 | * |
| 617 | * @param peerMacAddr Indicates the peer MAC addr that the probe request |
| 618 | * is generated. |
| 619 | * @param pProbeReqIE pointer to RAW probe request IE |
| 620 | * @param ProbeReqIELen The length of probe request IE. |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 621 | * @param pe_session A pointer to PE session |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 622 | * |
| 623 | * @return None |
| 624 | */ |
| 625 | void |
Jeff Johnson | 9320c1e | 2018-12-02 13:09:20 -0800 | [diff] [blame] | 626 | lim_send_sme_probe_req_ind(struct mac_context *mac, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 627 | tSirMacAddr peerMacAddr, |
| 628 | uint8_t *pProbeReqIE, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 629 | uint32_t ProbeReqIELen, struct pe_session *pe_session) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 630 | { |
| 631 | tSirSmeProbeReqInd *pSirSmeProbeReqInd; |
Rajeev Kumar | 37d478b | 2017-04-17 16:59:28 -0700 | [diff] [blame] | 632 | struct scheduler_msg msgQ = {0}; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 633 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 634 | pSirSmeProbeReqInd = qdf_mem_malloc(sizeof(tSirSmeProbeReqInd)); |
Arif Hussain | f5b6c41 | 2018-10-10 19:41:09 -0700 | [diff] [blame] | 635 | if (!pSirSmeProbeReqInd) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 636 | return; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 637 | |
| 638 | msgQ.type = eWNI_SME_WPS_PBC_PROBE_REQ_IND; |
| 639 | msgQ.bodyval = 0; |
| 640 | msgQ.bodyptr = pSirSmeProbeReqInd; |
| 641 | |
| 642 | pSirSmeProbeReqInd->messageType = eWNI_SME_WPS_PBC_PROBE_REQ_IND; |
| 643 | pSirSmeProbeReqInd->length = sizeof(tSirSmeProbeReq); |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 644 | pSirSmeProbeReqInd->sessionId = pe_session->smeSessionId; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 645 | |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 646 | qdf_mem_copy(pSirSmeProbeReqInd->bssid.bytes, pe_session->bssId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 647 | QDF_MAC_ADDR_SIZE); |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 648 | qdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.peer_macaddr.bytes, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 649 | peerMacAddr, QDF_MAC_ADDR_SIZE); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 650 | |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 651 | MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG, |
Jeff Johnson | b5c1333 | 2018-12-03 09:54:51 -0800 | [diff] [blame] | 652 | pe_session->peSessionId, msgQ.type)); |
Padma, Santhosh Kumar | 8472cb8 | 2017-11-07 18:40:17 +0530 | [diff] [blame] | 653 | |
| 654 | if (ProbeReqIELen > sizeof(pSirSmeProbeReqInd->WPSPBCProbeReq. |
| 655 | probeReqIE)) { |
| 656 | ProbeReqIELen = sizeof(pSirSmeProbeReqInd->WPSPBCProbeReq. |
| 657 | probeReqIE); |
| 658 | } |
| 659 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 660 | pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIELen = |
| 661 | (uint16_t) ProbeReqIELen; |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame] | 662 | qdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE, pProbeReqIE, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 663 | ProbeReqIELen); |
| 664 | |
Jeff Johnson | 348973e | 2018-11-22 16:51:12 -0800 | [diff] [blame] | 665 | if (lim_sys_process_mmh_msg_api(mac, &msgQ, ePROT) != QDF_STATUS_SUCCESS) |
Nishank Aggarwal | 2f2ac28 | 2017-03-23 15:24:00 +0530 | [diff] [blame] | 666 | pe_err("couldnt send the probe req to hdd"); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 667 | |
| 668 | } /*** end lim_send_sme_probe_req_ind() ***/ |