1 /* 2 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. 3 * 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 /* 20 * DOC: contains scan public utility functions 21 */ 22 23 #ifndef _WLAN_SCAN_UTILS_H_ 24 #define _WLAN_SCAN_UTILS_H_ 25 26 #include <wlan_objmgr_cmn.h> 27 #include <qdf_mc_timer.h> 28 #include <wlan_objmgr_psoc_obj.h> 29 #include <wlan_objmgr_pdev_obj.h> 30 #include <wlan_objmgr_vdev_obj.h> 31 #include <wlan_scan_public_structs.h> 32 #include<wlan_mgmt_txrx_utils_api.h> 33 34 /** 35 * util_is_scan_entry_match() - func to check if both scan entry 36 * are from same AP 37 * @entry1: scan entry 1 38 * @entry2: scan entry 2 39 * 40 * match the two scan entries 41 * 42 * Return: true if entry match else false. 43 */ 44 bool util_is_scan_entry_match( 45 struct scan_cache_entry *entry1, 46 struct scan_cache_entry *entry2); 47 48 /** 49 * util_scan_unpack_beacon_frame() - func to unpack beacon frame to scan entry 50 * @pdev: pdev pointer 51 * @frame: beacon/probe frame 52 * @frame_len: beacon frame len 53 * @frm_subtype: beacon or probe 54 * @rx_param: rx meta data 55 * 56 * get the defaults scan params 57 * 58 * Return: unpacked list of scan entries. 59 */ 60 qdf_list_t *util_scan_unpack_beacon_frame( 61 struct wlan_objmgr_pdev *pdev, 62 uint8_t *frame, qdf_size_t frame_len, uint32_t frm_subtype, 63 struct mgmt_rx_event_params *rx_param); 64 65 /** 66 * util_scan_get_ev_type_name() - converts enum event to printable string 67 * @event: event of type scan_event_type 68 * 69 * API, converts enum event to printable character string 70 * 71 * Return: pointer to printable string 72 */ 73 const char *util_scan_get_ev_type_name(enum scan_event_type event); 74 75 /** 76 * util_scan_get_ev_reason_name() - converts enum reason to printable string 77 * @reason enum of scan completion reason 78 * 79 * API, converts enum event to printable character string 80 * 81 * Return: pointer to printable string 82 */ 83 const char *util_scan_get_ev_reason_name(enum scan_completion_reason reason); 84 85 /** 86 * util_scan_entry_macaddr() - function to read transmitter address 87 * @scan_entry: scan entry 88 * 89 * API, function to read transmitter address of scan entry 90 * 91 * Return: pointer to mac address 92 */ 93 static inline uint8_t* 94 util_scan_entry_macaddr(struct scan_cache_entry *scan_entry) 95 { 96 return &(scan_entry->mac_addr.bytes[0]); 97 } 98 99 /** 100 * util_scan_entry_bssid() - function to read bssid 101 * @scan_entry: scan entry 102 * 103 * API, function to read bssid of scan entry 104 * 105 * Return: pointer to mac address 106 */ 107 static inline uint8_t* 108 util_scan_entry_bssid(struct scan_cache_entry *scan_entry) 109 { 110 return &(scan_entry->bssid.bytes[0]); 111 } 112 113 /** 114 * util_scan_entry_capinfo() - function to read capibility info 115 * @scan_entry: scan entry 116 * 117 * API, function to read capibility info of scan entry 118 * 119 * Return: capability info 120 */ 121 static inline union wlan_capability 122 util_scan_entry_capinfo(struct scan_cache_entry *scan_entry) 123 { 124 return scan_entry->cap_info; 125 } 126 127 /** 128 * util_scan_entry_beacon_interval() - function to read beacon interval 129 * @scan_entry: scan entry 130 * 131 * API, function to read beacon interval of scan entry 132 * 133 * Return: beacon interval 134 */ 135 static inline uint16_t 136 util_scan_entry_beacon_interval(struct scan_cache_entry *scan_entry) 137 { 138 return scan_entry->bcn_int; 139 } 140 141 /** 142 * util_scan_entry_sequence_number() - function to read sequence number 143 * @scan_entry: scan entry 144 * 145 * API, function to read sequence number of scan entry 146 * 147 * Return: sequence number 148 */ 149 static inline uint16_t 150 util_scan_entry_sequence_number(struct scan_cache_entry *scan_entry) 151 { 152 return scan_entry->seq_num; 153 } 154 155 /** 156 * util_scan_entry_tsf() - function to read tsf 157 * @scan_entry: scan entry 158 * 159 * API, function to read tsf of scan entry 160 * 161 * Return: tsf 162 */ 163 static inline uint8_t* 164 util_scan_entry_tsf(struct scan_cache_entry *scan_entry) 165 { 166 return scan_entry->tsf_info.data; 167 } 168 169 /** 170 * util_scan_entry_reset_timestamp() - function to reset bcn receive timestamp 171 * @scan_entry: scan entry 172 * 173 * API, function to reset bcn receive timestamp of scan entry 174 * 175 * Return: void 176 */ 177 static inline void 178 util_scan_entry_reset_timestamp(struct scan_cache_entry *scan_entry) 179 { 180 scan_entry->scan_entry_time = 0; 181 } 182 183 /* 184 * Macros used for RSSI calculation. 185 */ 186 #define WLAN_RSSI_AVERAGING_TIME (5 * 1000) /* 5 seconds */ 187 188 #define WLAN_RSSI_EP_MULTIPLIER (1<<7) /* pow2 to optimize out * and / */ 189 190 #define WLAN_RSSI_LPF_LEN 10 191 #define WLAN_RSSI_DUMMY_MARKER 0x127 192 193 #define WLAN_EP_MUL(x, mul) ((x) * (mul)) 194 195 #define WLAN_EP_RND(x, mul) ((((x)%(mul)) >= ((mul)/2)) ?\ 196 ((x) + ((mul) - 1)) / (mul) : (x)/(mul)) 197 198 #define WLAN_RSSI_GET(x) WLAN_EP_RND(x, WLAN_RSSI_EP_MULTIPLIER) 199 200 #define RSSI_LPF_THRESHOLD -20 201 202 203 #define WLAN_RSSI_OUT(x) (((x) != WLAN_RSSI_DUMMY_MARKER) ? \ 204 (WLAN_EP_RND((x), WLAN_RSSI_EP_MULTIPLIER)) : WLAN_RSSI_DUMMY_MARKER) 205 206 207 #define WLAN_RSSI_IN(x) (WLAN_EP_MUL((x), WLAN_RSSI_EP_MULTIPLIER)) 208 209 #define WLAN_LPF_RSSI(x, y, len) \ 210 ((x != WLAN_RSSI_DUMMY_MARKER) ? ((((x) << 3) + (y) - (x)) >> 3) : (y)) 211 212 #define WLAN_RSSI_LPF(x, y) do { \ 213 if ((y) >= RSSI_LPF_THRESHOLD) \ 214 x = WLAN_LPF_RSSI((x), WLAN_RSSI_IN((y)), WLAN_RSSI_LPF_LEN); \ 215 } while (0) 216 217 #define WLAN_ABS_RSSI_LPF(x, y) do { \ 218 if ((y) >= (RSSI_LPF_THRESHOLD + WLAN_DEFAULT_NOISE_FLOOR)) \ 219 x = WLAN_LPF_RSSI((x), WLAN_RSSI_IN((y)), WLAN_RSSI_LPF_LEN); \ 220 } while (0) 221 222 /** 223 * util_scan_entry_rssi() - function to read rssi of scan entry 224 * @scan_entry: scan entry 225 * 226 * API, function to read rssi value of scan entry 227 * 228 * Return: rssi 229 */ 230 static inline uint8_t 231 util_scan_entry_rssi(struct scan_cache_entry *scan_entry) 232 { 233 uint32_t rssi = WLAN_RSSI_OUT(scan_entry->avg_rssi); 234 /* 235 * An entry is in the BSS list means we've received at least one beacon 236 * from the corresponding AP, so the rssi must be initialized. 237 * 238 * If the RSSI is not initialized, return 0 (i.e. RSSI == Noise Floor). 239 * Once se_avgrssi field has been initialized, ATH_RSSI_OUT always 240 * returns values that fit in an 8-bit variable 241 * (RSSI values are typically 0-90). 242 */ 243 return (rssi >= WLAN_RSSI_DUMMY_MARKER) ? 0 : (uint8_t) rssi; 244 } 245 246 /** 247 * util_scan_entry_phymode() - function to read phymode of scan entry 248 * @scan_entry: scan entry 249 * 250 * API, function to read phymode of scan entry 251 * 252 * Return: phymode 253 */ 254 static inline enum wlan_phymode 255 util_scan_entry_phymode(struct scan_cache_entry *scan_entry) 256 { 257 return scan_entry->phy_mode; 258 } 259 260 /** 261 * util_is_ssid_match() - to check if ssid match 262 * @ssid1: ssid 1 263 * @ssid2: ssid 2 264 * 265 * Return: true if ssid match 266 */ 267 static inline bool 268 util_is_ssid_match(struct wlan_ssid *ssid1, 269 struct wlan_ssid *ssid2) 270 { 271 272 if (ssid1->length == 0) 273 return true; 274 275 if (ssid1->length != ssid2->length) 276 return false; 277 278 if (!qdf_mem_cmp(ssid1->ssid, 279 ssid2->ssid, ssid1->length)) 280 return true; 281 282 return false; 283 } 284 285 /** 286 * util_is_bssid_match() - to check if bssid match 287 * @bssid1: bssid 1 288 * @bssid2: bssid 2 289 * 290 * Return: true if bssid match 291 */ 292 static inline bool util_is_bssid_match(struct qdf_mac_addr *bssid1, 293 struct qdf_mac_addr *bssid2) 294 { 295 296 if (qdf_is_macaddr_zero(bssid1) || 297 qdf_is_macaddr_broadcast(bssid1)) 298 return true; 299 300 if (qdf_is_macaddr_equal(bssid1, bssid2)) 301 return true; 302 303 return false; 304 } 305 306 /** 307 * util_is_bss_type_match() - to check if bss type 308 * @bss_type: bss type 309 * @cap: capability 310 * 311 * Return: true if bss type match 312 */ 313 static inline bool util_is_bss_type_match(enum wlan_bss_type bss_type, 314 union wlan_capability cap) 315 { 316 bool match = true; 317 318 switch (bss_type) { 319 case WLAN_TYPE_ANY: 320 break; 321 case WLAN_TYPE_IBSS: 322 if (!cap.wlan_caps.ibss) 323 match = false; 324 break; 325 case WLAN_TYPE_BSS: 326 if (!cap.wlan_caps.ess) 327 match = false; 328 break; 329 default: 330 match = false; 331 } 332 333 return match; 334 } 335 336 /** 337 * util_country_code_match() - to check if country match 338 * @country: country code pointer 339 * @country_ie: country IE in beacon 340 * 341 * Return: true if country match 342 */ 343 static inline bool util_country_code_match(uint8_t *country, 344 struct wlan_country_ie *cc) 345 { 346 if (!country || !country[0]) 347 return true; 348 349 if (!cc) 350 return false; 351 352 if (cc->cc[0] == country[0] && 353 cc->cc[1] == country[1]) 354 return true; 355 356 return false; 357 } 358 359 /** 360 * util_mdie_match() - to check if mdie match 361 * @mobility_domain: mobility domain 362 * @mdie: mobility domain ie 363 * 364 * Return: true if country match 365 */ 366 static inline bool util_mdie_match(uint16_t mobility_domain, 367 struct rsn_mdie *mdie) 368 { 369 uint16_t md; 370 371 if (!mobility_domain) 372 return true; 373 374 if (!mdie) 375 return false; 376 377 md = 378 (mdie->mobility_domain[1] << 8) | 379 mdie->mobility_domain[0]; 380 381 if (md == mobility_domain) 382 return true; 383 384 return false; 385 } 386 387 /** 388 * util_scan_entry_ssid() - function to read ssid of scan entry 389 * @scan_entry: scan entry 390 * 391 * API, function to read ssid of scan entry 392 * 393 * Return: ssid 394 */ 395 static inline struct wlan_ssid* 396 util_scan_entry_ssid(struct scan_cache_entry *scan_entry) 397 { 398 return &(scan_entry->ssid); 399 } 400 401 /** 402 * util_scan_entry_dtimperiod() - function to read dtim period of scan entry 403 * @scan_entry: scan entry 404 * 405 * API, function to read dtim period of scan entry 406 * 407 * Return: dtim period 408 */ 409 static inline uint8_t 410 util_scan_entry_dtimperiod(struct scan_cache_entry *scan_entry) 411 { 412 return scan_entry->dtim_period; 413 } 414 415 /** 416 * util_scan_entry_tim() - function to read tim ie of scan entry 417 * @scan_entry: scan entry 418 * 419 * API, function to read tim ie of scan entry 420 * 421 * Return: timie or NULL if ie is not present 422 */ 423 static inline uint8_t* 424 util_scan_entry_tim(struct scan_cache_entry *scan_entry) 425 { 426 return scan_entry->ie_list.tim; 427 } 428 429 /** 430 * util_scan_entry_beacon_frame() - function to read full beacon or 431 * probe resp frame 432 * @scan_entry: scan entry 433 * 434 * API, function to read full beacon or probe resp frame including frame header 435 * 436 * Return: beacon/probe resp frame 437 */ 438 static inline struct element_info 439 util_scan_entry_beacon_frame(struct scan_cache_entry *scan_entry) 440 { 441 /* util_scan_entry_beacon_data */ 442 return scan_entry->raw_frame; 443 } 444 445 /** 446 * util_scan_entry_ie_data() - function to read tagged IEs 447 * @scan_entry: scan entry 448 * 449 * API, function to read beacon/probe response frames starting from tagged IEs 450 * (excluding frame header and fixed parameters) 451 * 452 * Return: tagged IES of beacon/probe resp frame 453 */ 454 static inline uint8_t* 455 util_scan_entry_ie_data(struct scan_cache_entry *scan_entry) 456 { 457 struct element_info bcn_frm; 458 uint8_t *ie_data = NULL; 459 460 bcn_frm = util_scan_entry_beacon_frame(scan_entry); 461 ie_data = (uint8_t *) (bcn_frm.ptr + 462 sizeof(struct wlan_frame_hdr) + 463 offsetof(struct wlan_bcn_frame, ie)); 464 return ie_data; 465 } 466 467 /** 468 * util_scan_entry_ie_len() - function to read length of all tagged IEs 469 * @scan_entry: scan entry 470 * 471 * API, function to read length of all tagged IEs 472 * 473 * Return: length of all tagged IEs 474 */ 475 static inline uint16_t 476 util_scan_entry_ie_len(struct scan_cache_entry *scan_entry) 477 { 478 struct element_info bcn_frm; 479 uint16_t ie_len = 0; 480 481 bcn_frm = util_scan_entry_beacon_frame(scan_entry); 482 ie_len = (uint16_t) (bcn_frm.len - 483 sizeof(struct wlan_frame_hdr) - 484 offsetof(struct wlan_bcn_frame, ie)); 485 return ie_len; 486 } 487 488 /** 489 * util_scan_entry_frame_len() - function to frame length 490 * @scan_entry: scan entry 491 * 492 * API, function to read frame length 493 * 494 * Return: frame length 495 */ 496 static inline uint32_t 497 util_scan_entry_frame_len(struct scan_cache_entry *scan_entry) 498 { 499 return scan_entry->raw_frame.len; 500 } 501 502 /** 503 * util_scan_entry_frame_ptr() - function to get frame ptr 504 * @scan_entry: scan entry 505 * 506 * API, function to read frame ptr 507 * 508 * Return: frame ptr 509 */ 510 static inline uint8_t* 511 util_scan_entry_frame_ptr(struct scan_cache_entry *scan_entry) 512 { 513 return scan_entry->raw_frame.ptr; 514 } 515 516 /** 517 * util_scan_entry_copy_ie_data() - function to get a copy of all tagged IEs 518 * @scan_entry: scan entry 519 * 520 * API, function to get a copy of all tagged IEs in passed memory 521 * 522 * Return: QDF_STATUS_SUCCESS if tagged IEs copied successfully 523 * QDF_STATUS_E_NOMEM if passed memory/length can't hold all tagged IEs 524 */ 525 static inline QDF_STATUS 526 util_scan_entry_copy_ie_data(struct scan_cache_entry *scan_entry, 527 uint8_t *iebuf, uint16_t *ie_len) 528 { 529 u_int8_t *buff; 530 u_int16_t buff_len; 531 532 /* iebuf can be NULL, ie_len must be a valid pointer. */ 533 QDF_ASSERT(ie_len != NULL); 534 if (!ie_len) 535 return QDF_STATUS_E_NULL_VALUE; 536 537 buff = util_scan_entry_ie_data(scan_entry); 538 buff_len = util_scan_entry_ie_len(scan_entry); 539 /* 540 * If caller passed a buffer, check the length to make sure 541 * it's large enough. 542 * If no buffer is passed, just return the length of the IE blob. 543 */ 544 if (iebuf != NULL) { 545 if (*ie_len >= buff_len) { 546 qdf_mem_copy(iebuf, buff, buff_len); 547 *ie_len = buff_len; 548 return QDF_STATUS_SUCCESS; 549 } 550 } 551 552 *ie_len = buff_len; 553 return QDF_STATUS_E_NOMEM; 554 } 555 556 /** 557 * util_scan_free_cache_entry() - function to free scan 558 * cache entry 559 * @scan_entry: scan entry 560 * 561 * API, function to free scan cache entry 562 * 563 * Return: void 564 */ 565 static inline void 566 util_scan_free_cache_entry(struct scan_cache_entry *scan_entry) 567 { 568 if (!scan_entry) 569 return; 570 if (scan_entry->alt_wcn_ie.ptr) 571 qdf_mem_free(scan_entry->alt_wcn_ie.ptr); 572 if (scan_entry->raw_frame.ptr) 573 qdf_mem_free(scan_entry->raw_frame.ptr); 574 qdf_mem_free(scan_entry); 575 } 576 577 #define conv_ptr(_address, _base1, _base2) \ 578 ((_address != NULL) ? (((u_int8_t *) (_address) - \ 579 (u_int8_t *) (_base1)) + (u_int8_t *) (_base2)) : NULL) 580 581 /** 582 * util_scan_copy_beacon_data() - copy beacon and update ie ptrs 583 * cache entry 584 * @new_entry: new scan entry 585 * @scan_entry: entry from where data is copied 586 * 587 * API, function to copy beacon and update ie ptrs 588 * 589 * Return: QDF_STATUS 590 */ 591 static inline QDF_STATUS 592 util_scan_copy_beacon_data(struct scan_cache_entry *new_entry, 593 struct scan_cache_entry *scan_entry) 594 { 595 u_int8_t *new_ptr, *old_ptr; 596 struct ie_list *ie_lst; 597 598 new_entry->raw_frame.ptr = 599 qdf_mem_malloc(scan_entry->raw_frame.len); 600 if (!new_entry->raw_frame.ptr) 601 return QDF_STATUS_E_NOMEM; 602 603 qdf_mem_copy(new_entry->raw_frame.ptr, 604 scan_entry->raw_frame.ptr, 605 scan_entry->raw_frame.len); 606 new_entry->raw_frame.len = scan_entry->raw_frame.len; 607 new_ptr = new_entry->raw_frame.ptr; 608 old_ptr = scan_entry->raw_frame.ptr; 609 610 new_entry->ie_list = scan_entry->ie_list; 611 612 ie_lst = &new_entry->ie_list; 613 614 /* New info_element needs also be added in ieee80211_parse_beacon */ 615 ie_lst->tim = conv_ptr(ie_lst->tim, old_ptr, new_ptr); 616 ie_lst->country = conv_ptr(ie_lst->country, old_ptr, new_ptr); 617 ie_lst->ssid = conv_ptr(ie_lst->ssid, old_ptr, new_ptr); 618 ie_lst->rates = conv_ptr(ie_lst->rates, old_ptr, new_ptr); 619 ie_lst->xrates = conv_ptr(ie_lst->xrates, old_ptr, new_ptr); 620 ie_lst->ds_param = conv_ptr(ie_lst->ds_param, old_ptr, new_ptr); 621 ie_lst->csa = conv_ptr(ie_lst->csa, old_ptr, new_ptr); 622 ie_lst->xcsa = conv_ptr(ie_lst->xcsa, old_ptr, new_ptr); 623 ie_lst->secchanoff = conv_ptr(ie_lst->secchanoff, old_ptr, new_ptr); 624 ie_lst->wpa = conv_ptr(ie_lst->wpa, old_ptr, new_ptr); 625 ie_lst->wcn = conv_ptr(ie_lst->wcn, old_ptr, new_ptr); 626 ie_lst->rsn = conv_ptr(ie_lst->rsn, old_ptr, new_ptr); 627 ie_lst->wps = conv_ptr(ie_lst->wps, old_ptr, new_ptr); 628 ie_lst->wmeinfo = conv_ptr(ie_lst->wmeinfo, old_ptr, new_ptr); 629 ie_lst->wmeparam = conv_ptr(ie_lst->wmeparam, old_ptr, new_ptr); 630 ie_lst->quiet = conv_ptr(ie_lst->quiet, old_ptr, new_ptr); 631 ie_lst->htcap = conv_ptr(ie_lst->htcap, old_ptr, new_ptr); 632 ie_lst->htinfo = conv_ptr(ie_lst->htinfo, old_ptr, new_ptr); 633 ie_lst->athcaps = conv_ptr(ie_lst->athcaps, old_ptr, new_ptr); 634 ie_lst->athextcaps = conv_ptr(ie_lst->athextcaps, old_ptr, new_ptr); 635 ie_lst->sfa = conv_ptr(ie_lst->sfa, old_ptr, new_ptr); 636 ie_lst->vendor = conv_ptr(ie_lst->vendor, old_ptr, new_ptr); 637 ie_lst->qbssload = conv_ptr(ie_lst->qbssload, old_ptr, new_ptr); 638 ie_lst->wapi = conv_ptr(ie_lst->wapi, old_ptr, new_ptr); 639 ie_lst->p2p = conv_ptr(ie_lst->p2p, old_ptr, new_ptr); 640 ie_lst->alt_wcn = conv_ptr(ie_lst->alt_wcn, old_ptr, new_ptr); 641 ie_lst->extcaps = conv_ptr(ie_lst->extcaps, old_ptr, new_ptr); 642 ie_lst->ibssdfs = conv_ptr(ie_lst->ibssdfs, old_ptr, new_ptr); 643 ie_lst->sonadv = conv_ptr(ie_lst->sonadv, old_ptr, new_ptr); 644 ie_lst->vhtcap = conv_ptr(ie_lst->vhtcap, old_ptr, new_ptr); 645 ie_lst->vhtop = conv_ptr(ie_lst->vhtop, old_ptr, new_ptr); 646 ie_lst->opmode = conv_ptr(ie_lst->opmode, old_ptr, new_ptr); 647 ie_lst->cswrp = conv_ptr(ie_lst->cswrp, old_ptr, new_ptr); 648 ie_lst->widebw = conv_ptr(ie_lst->widebw, old_ptr, new_ptr); 649 ie_lst->txpwrenvlp = conv_ptr(ie_lst->txpwrenvlp, old_ptr, new_ptr); 650 ie_lst->bwnss_map = conv_ptr(ie_lst->bwnss_map, old_ptr, new_ptr); 651 ie_lst->mdie = conv_ptr(ie_lst->mdie, old_ptr, new_ptr); 652 ie_lst->hecap = conv_ptr(ie_lst->hecap, old_ptr, new_ptr); 653 ie_lst->heop = conv_ptr(ie_lst->heop, old_ptr, new_ptr); 654 ie_lst->fils_indication = conv_ptr(ie_lst->fils_indication, 655 old_ptr, new_ptr); 656 ie_lst->esp = conv_ptr(ie_lst->esp, old_ptr, new_ptr); 657 ie_lst->mbo_oce = conv_ptr(ie_lst->mbo_oce, old_ptr, new_ptr); 658 659 return QDF_STATUS_SUCCESS; 660 } 661 /** 662 * util_scan_copy_cache_entry() - function to create a copy 663 * of scan cache entry 664 * @scan_entry: scan entry 665 * 666 * API, function to create a copy of scan cache entry 667 * 668 * Return: copy of scan_entry 669 */ 670 static inline struct scan_cache_entry * 671 util_scan_copy_cache_entry(struct scan_cache_entry *scan_entry) 672 { 673 struct scan_cache_entry *new_entry; 674 QDF_STATUS status; 675 676 if (!scan_entry) 677 return NULL; 678 679 new_entry = 680 qdf_mem_malloc(sizeof(*scan_entry)); 681 if (!new_entry) 682 return NULL; 683 684 qdf_mem_copy(new_entry, 685 scan_entry, sizeof(*scan_entry)); 686 687 if (scan_entry->alt_wcn_ie.ptr) { 688 new_entry->alt_wcn_ie.ptr = 689 qdf_mem_malloc(scan_entry->alt_wcn_ie.len); 690 if (!new_entry->alt_wcn_ie.ptr) { 691 qdf_mem_free(new_entry); 692 return NULL; 693 } 694 qdf_mem_copy(new_entry->alt_wcn_ie.ptr, 695 scan_entry->alt_wcn_ie.ptr, 696 scan_entry->alt_wcn_ie.len); 697 new_entry->alt_wcn_ie.len = 698 scan_entry->alt_wcn_ie.len; 699 } 700 701 status = util_scan_copy_beacon_data(new_entry, scan_entry); 702 if (QDF_IS_STATUS_ERROR(status)) { 703 util_scan_free_cache_entry(new_entry); 704 return NULL; 705 } 706 707 return new_entry; 708 } 709 710 /** 711 * util_scan_entry_channel() - function to read channel info 712 * @scan_entry: scan entry 713 * 714 * API, function to read channel info 715 * 716 * Return: channel info 717 */ 718 static inline struct channel_info* 719 util_scan_entry_channel(struct scan_cache_entry *scan_entry) 720 { 721 return &(scan_entry->channel); 722 } 723 724 /** 725 * util_scan_entry_channel_num() - function to read channel number 726 * @scan_entry: scan entry 727 * 728 * API, function to read channel number 729 * 730 * Return: channel number 731 */ 732 static inline uint8_t 733 util_scan_entry_channel_num(struct scan_cache_entry *scan_entry) 734 { 735 return scan_entry->channel.chan_idx; 736 } 737 738 /** 739 * util_scan_entry_erpinfo() - function to read erp info 740 * @scan_entry: scan entry 741 * 742 * API, function to read erp info 743 * 744 * Return: erp info 745 */ 746 static inline uint8_t 747 util_scan_entry_erpinfo(struct scan_cache_entry *scan_entry) 748 { 749 return scan_entry->erp; 750 } 751 752 /** 753 * util_scan_entry_rates() - function to read supported rates IE 754 * @scan_entry: scan entry 755 * 756 * API, function to read supported rates IE 757 * 758 * Return: basic ratesie or NULL if ie is not present 759 */ 760 static inline uint8_t* 761 util_scan_entry_rates(struct scan_cache_entry *scan_entry) 762 { 763 return scan_entry->ie_list.rates; 764 } 765 766 /** 767 * util_scan_entry_xrates()- function to read extended supported rates IE 768 * @scan_entry: scan entry 769 * 770 * API, function to read extended supported rates IE 771 * 772 * Return: extended supported ratesie or NULL if ie is not present 773 */ 774 static inline uint8_t* 775 util_scan_entry_xrates(struct scan_cache_entry *scan_entry) 776 { 777 return scan_entry->ie_list.xrates; 778 } 779 780 /** 781 * util_scan_entry_rsn()- function to read rsn IE 782 * @scan_entry: scan entry 783 * 784 * API, function to read rsn IE 785 * 786 * Return: rsnie or NULL if ie is not present 787 */ 788 static inline uint8_t* 789 util_scan_entry_rsn(struct scan_cache_entry *scan_entry) 790 { 791 return scan_entry->ie_list.rsn; 792 } 793 794 /** 795 * util_scan_get_rsn_len()- function to read rsn IE length if present 796 * @scan_entry: scan entry 797 * 798 * API, function to read rsn length if present 799 * 800 * Return: rsnie length 801 */ 802 static inline uint8_t 803 util_scan_get_rsn_len(struct scan_cache_entry *scan_entry) 804 { 805 if (scan_entry && scan_entry->ie_list.rsn) 806 return scan_entry->ie_list.rsn[1] + 2; 807 else 808 return 0; 809 } 810 811 812 /** 813 * util_scan_entry_wpa() - function to read wpa IE 814 * @scan_entry: scan entry 815 * 816 * API, function to read wpa IE 817 * 818 * Return: wpaie or NULL if ie is not present 819 */ 820 static inline uint8_t* 821 util_scan_entry_wpa(struct scan_cache_entry *scan_entry) 822 { 823 return scan_entry->ie_list.wpa; 824 } 825 826 /** 827 * util_scan_get_wpa_len()- function to read wpa IE length if present 828 * @scan_entry: scan entry 829 * 830 * API, function to read wpa ie length if present 831 * 832 * Return: wpa ie length 833 */ 834 static inline uint8_t 835 util_scan_get_wpa_len(struct scan_cache_entry *scan_entry) 836 { 837 if (scan_entry && scan_entry->ie_list.wpa) 838 return scan_entry->ie_list.wpa[1] + 2; 839 else 840 return 0; 841 } 842 843 844 /** 845 * util_scan_entry_wapi() - function to read wapi IE 846 * @scan_entry: scan entry 847 * 848 * API, function to read wapi IE 849 * 850 * Return: wapiie or NULL if ie is not present 851 */ 852 static inline uint8_t* 853 util_scan_entry_wapi(struct scan_cache_entry *scan_entry) 854 { 855 return scan_entry->ie_list.wapi; 856 } 857 858 /** 859 * util_scan_entry_wps() - function to read wps IE 860 * @scan_entry: scan entry 861 * 862 * API, function to read wps IE 863 * 864 * Return: wpsie or NULL if ie is not present 865 */ 866 static inline uint8_t* 867 util_scan_entry_wps(struct scan_cache_entry *scan_entry) 868 { 869 return scan_entry->ie_list.wps; 870 } 871 872 /** 873 * util_scan_entry_sfa() - function to read sfa IE 874 * @scan_entry: scan entry 875 * 876 * API, function to read sfa IE 877 * 878 * Return: sfaie or NULL if ie is not present 879 */ 880 static inline uint8_t* 881 util_scan_entry_sfa(struct scan_cache_entry *scan_entry) 882 { 883 return scan_entry->ie_list.sfa; 884 } 885 886 /** 887 * util_scan_entry_ds_param() - function to read ds params 888 * @scan_entry: scan entry 889 * 890 * API, function to read ds params 891 * 892 * Return: ds params or NULL if ie is not present 893 */ 894 static inline uint8_t* 895 util_scan_entry_ds_param(struct scan_cache_entry *scan_entry) 896 { 897 if (scan_entry) 898 return scan_entry->ie_list.ds_param; 899 else 900 return NULL; 901 } 902 903 /** 904 * util_scan_entry_csa() - function to read csa IE 905 * @scan_entry: scan entry 906 * 907 * API, function to read csa IE 908 * 909 * Return: csaie or NULL if ie is not present 910 */ 911 static inline uint8_t* 912 util_scan_entry_csa(struct scan_cache_entry *scan_entry) 913 { 914 return scan_entry->ie_list.csa; 915 } 916 917 /** 918 * util_scan_entry_xcsa() - function to read extended csa IE 919 * @scan_entry: scan entry 920 * 921 * API, function to read extended csa IE 922 * 923 * Return: extended csaie or NULL if ie is not present 924 */ 925 static inline uint8_t* 926 util_scan_entry_xcsa(struct scan_cache_entry *scan_entry) 927 { 928 return scan_entry->ie_list.xcsa; 929 } 930 931 /** 932 * util_scan_entry_htinfo() - function to read htinfo IE 933 * @scan_entry: scan entry 934 * 935 * API, function to read htinfo IE 936 * 937 * Return: htinfoie or NULL if ie is not present 938 */ 939 static inline uint8_t* 940 util_scan_entry_htinfo(struct scan_cache_entry *scan_entry) 941 { 942 return scan_entry->ie_list.htinfo; 943 } 944 945 946 /** 947 * util_scan_entry_htcap() - function to read htcap IE 948 * @scan_entry: scan entry 949 * 950 * API, function to read htcap IE 951 * 952 * Return: htcapie or NULL if ie is not present 953 */ 954 static inline uint8_t* 955 util_scan_entry_htcap(struct scan_cache_entry *scan_entry) 956 { 957 return scan_entry->ie_list.htcap; 958 } 959 960 /** 961 * util_scan_entry_vhtcap() - function to read vhtcap IE 962 * @scan_entry: scan entry 963 * 964 * API, function to read vhtcap IE 965 * 966 * Return: vhtcapie or NULL if ie is not present 967 */ 968 static inline uint8_t* 969 util_scan_entry_vhtcap(struct scan_cache_entry *scan_entry) 970 { 971 return scan_entry->ie_list.vhtcap; 972 } 973 974 /** 975 * util_scan_entry_vhtop() - function to read vhtop IE 976 * @scan_entry: scan entry 977 * 978 * API, function to read vhtop IE 979 * 980 * Return: vhtopie or NULL if ie is not present 981 */ 982 static inline uint8_t* 983 util_scan_entry_vhtop(struct scan_cache_entry *scan_entry) 984 { 985 return scan_entry->ie_list.vhtop; 986 } 987 988 /** 989 * util_scan_entry_quiet() - function to read quiet IE 990 * @scan_entry: scan entry 991 * 992 * API, function to read quiet IE 993 * 994 * Return: quietie or NULL if ie is not present 995 */ 996 static inline uint8_t* 997 util_scan_entry_quiet(struct scan_cache_entry *scan_entry) 998 { 999 return scan_entry->ie_list.quiet; 1000 } 1001 1002 /** 1003 * util_scan_entry_qbssload() - function to read qbss load IE 1004 * @scan_entry: scan entry 1005 * 1006 * API, function to read qbss load IE 1007 * 1008 * Return: qbss loadie or NULL if ie is not present 1009 */ 1010 static inline uint8_t* 1011 util_scan_entry_qbssload(struct scan_cache_entry *scan_entry) 1012 { 1013 return scan_entry->ie_list.qbssload; 1014 } 1015 1016 /** 1017 * util_scan_entry_vendor() - function to read vendor IE 1018 * @scan_entry: scan entry 1019 * 1020 * API, function to read vendor IE 1021 * 1022 * Return: vendorie or NULL if ie is not present 1023 */ 1024 static inline uint8_t* 1025 util_scan_entry_vendor(struct scan_cache_entry *scan_entry) 1026 { 1027 return scan_entry->ie_list.vendor; 1028 } 1029 1030 /** 1031 * util_scan_entry_country() - function to read country IE 1032 * @scan_entry: scan entry 1033 * 1034 * API, function to read country IE 1035 * 1036 * Return: countryie or NULL if ie is not present 1037 */ 1038 static inline struct wlan_country_ie* 1039 util_scan_entry_country(struct scan_cache_entry *scan_entry) 1040 { 1041 return (struct wlan_country_ie *)scan_entry->ie_list.country; 1042 } 1043 1044 /** 1045 * util_scan_entry_copy_country() - function to copy country name 1046 * @scan_entry: scan entry 1047 * @cntry: out buffer 1048 * 1049 * API, function to copy country name code string in given memory @centry 1050 * 1051 * Return: QDF_STATUS_SUCCESS if successfully copied country name 1052 * QDF_STATUS_E_INVAL if passed buffer is null 1053 * QDF_STATUS_E_NOMEM if scan entry dont have country IE 1054 */ 1055 static inline QDF_STATUS 1056 util_scan_entry_copy_country(struct scan_cache_entry *scan_entry, 1057 uint8_t *cntry) 1058 { 1059 struct wlan_country_ie *country_ie; 1060 1061 if (!cntry) 1062 return QDF_STATUS_E_INVAL; 1063 1064 country_ie = util_scan_entry_country(scan_entry); 1065 1066 if (!country_ie) 1067 return QDF_STATUS_E_NOMEM; 1068 1069 qdf_mem_copy(cntry, country_ie->cc, 3); 1070 1071 return QDF_STATUS_SUCCESS; 1072 } 1073 1074 /** 1075 * util_scan_entry_wmeinfo() - function to read wme info ie 1076 * @scan_entry: scan entry 1077 * 1078 * API, function to read wme info ie 1079 * 1080 * Return: wme infoie or NULL if ie is not present 1081 */ 1082 static inline uint8_t* 1083 util_scan_entry_wmeinfo(struct scan_cache_entry *scan_entry) 1084 { 1085 return scan_entry->ie_list.wmeinfo; 1086 } 1087 1088 /** 1089 * util_scan_entry_wmeparam() - function to read wme param ie 1090 * @scan_entry: scan entry 1091 * 1092 * API, function to read wme param ie 1093 * 1094 * Return: wme paramie or NULL if ie is not present 1095 */ 1096 static inline uint8_t* 1097 util_scan_entry_wmeparam(struct scan_cache_entry *scan_entry) 1098 { 1099 return scan_entry->ie_list.wmeparam; 1100 } 1101 1102 /** 1103 * util_scan_entry_age() - function to read age of scan entry 1104 * @scan_entry: scan entry 1105 * 1106 * API, function to read age of scan entry 1107 * 1108 * Return: age in ms 1109 */ 1110 static inline uint32_t 1111 util_scan_entry_age(struct scan_cache_entry *scan_entry) 1112 { 1113 unsigned long ts = scan_entry->scan_entry_time; 1114 1115 return qdf_mc_timer_get_system_time() - ts; 1116 } 1117 1118 /** 1119 * util_scan_mlme_info() - function to read mlme info struct 1120 * @scan_entry: scan entry 1121 * 1122 * API, function to read mlme info struct 1123 * 1124 * Return: mlme info 1125 */ 1126 static inline struct mlme_info* 1127 util_scan_mlme_info(struct scan_cache_entry *scan_entry) 1128 { 1129 return &scan_entry->mlme_info; 1130 } 1131 1132 /** 1133 * util_scan_entry_bss_type() - function to read bss type 1134 * @scan_entry: scan entry 1135 * 1136 * API, function to read bss type 1137 * 1138 * Return: bss type 1139 */ 1140 static inline enum wlan_bss_type 1141 util_scan_entry_bss_type(struct scan_cache_entry *scan_entry) 1142 { 1143 if (scan_entry->cap_info.value & WLAN_CAPINFO_ESS) 1144 return WLAN_TYPE_BSS; 1145 else if (scan_entry->cap_info.value & WLAN_CAPINFO_IBSS) 1146 return WLAN_TYPE_IBSS; 1147 else 1148 return WLAN_TYPE_ANY; 1149 } 1150 1151 /** 1152 * util_scan_entry_privacy() - function to check if privacy is enebled 1153 * @scan_entry: scan entry 1154 * 1155 * API, function to check if privacy is enebled 1156 * 1157 * Return: true if privacy is enabled, false other wise 1158 */ 1159 static inline bool 1160 util_scan_entry_privacy(struct scan_cache_entry *scan_entry) 1161 { 1162 return (scan_entry->cap_info.value & 1163 WLAN_CAPINFO_PRIVACY) ? true : false; 1164 } 1165 1166 /** 1167 * util_scan_entry_athcaps() - function to read ath caps vendor ie 1168 * @scan_entry: scan entry 1169 * 1170 * API, function to read ath caps vendor ie 1171 * 1172 * Return: ath caps vendorie or NULL if ie is not present 1173 */ 1174 static inline uint8_t* 1175 util_scan_entry_athcaps(struct scan_cache_entry *scan_entry) 1176 { 1177 return scan_entry->ie_list.athcaps; 1178 } 1179 1180 /** 1181 * util_scan_entry_athextcaps() - function to read ath extcaps vendor ie 1182 * @scan_entry: scan entry 1183 * 1184 * API, function to read ath extcaps vendor ie 1185 * 1186 * Return: ath extcaps vendorie or NULL if ie is not present 1187 */ 1188 static inline uint8_t* 1189 util_scan_entry_athextcaps(struct scan_cache_entry *scan_entry) 1190 { 1191 return scan_entry->ie_list.athextcaps; 1192 } 1193 1194 /** 1195 * util_scan_entry_bwnss_map() - function to read bwnss_map ie 1196 * @scan_entry: scan entry 1197 * 1198 * API, function to read bwnss_map ie 1199 * 1200 * Return: bwnss_map ie or NULL if ie is not present 1201 */ 1202 static inline uint8_t* 1203 util_scan_entry_bwnss_map(struct scan_cache_entry *scan_entry) 1204 { 1205 return scan_entry->ie_list.bwnss_map; 1206 } 1207 1208 /** 1209 * util_scan_entry_sonie() - function to read son ie 1210 * @scan_entry: scan entry 1211 * 1212 * API, function to read son ie 1213 * 1214 * Return: son ie or NULL if ie is not present 1215 */ 1216 static inline uint8_t* 1217 util_scan_entry_sonie(struct scan_cache_entry *scan_entry) 1218 { 1219 return scan_entry->ie_list.sonadv; 1220 } 1221 1222 /** 1223 * util_scan_entry_widebw() - function to read wide band chan switch sub elem ie 1224 * @scan_entry: scan entry 1225 * 1226 * API, function to read wide band chan switch sub elem ie 1227 * 1228 * Return: wide band chan switch sub elem or NULL if ie is not present 1229 */ 1230 static inline uint8_t* 1231 util_scan_entry_widebw(struct scan_cache_entry *scan_entry) 1232 { 1233 return scan_entry->ie_list.widebw; 1234 } 1235 1236 /** 1237 * util_scan_entry_secchanoff() - function to read secondary channel offset ie 1238 * @scan_entry: scan entry 1239 * 1240 * API, function to read secondary channel offset ie 1241 * 1242 * Return: secondary channel offset element or NULL if ie is not present 1243 */ 1244 static inline uint8_t* 1245 util_scan_entry_secchanoff(struct scan_cache_entry *scan_entry) 1246 { 1247 return scan_entry->ie_list.secchanoff; 1248 } 1249 1250 /** 1251 * util_scan_entry_cswrp() - function to read channel switch wrapper ie 1252 * @scan_entry: scan entry 1253 * 1254 * API, function to read channel switch wrapper ie 1255 * 1256 * Return: channel switch wrapper element or NULL if ie is not present 1257 */ 1258 static inline uint8_t* 1259 util_scan_entry_cswrp(struct scan_cache_entry *scan_entry) 1260 { 1261 return scan_entry->ie_list.cswrp; 1262 } 1263 1264 /** 1265 * util_scan_entry_omn() - function to read operating mode notification ie 1266 * @scan_entry: scan entry 1267 * 1268 * API, function to read operating mode notification 1269 * 1270 * Return: operating mode notification element or NULL if ie is not present 1271 */ 1272 static inline uint8_t* 1273 util_scan_entry_omn(struct scan_cache_entry *scan_entry) 1274 { 1275 return scan_entry->ie_list.opmode; 1276 } 1277 1278 /** 1279 * util_scan_entry_extcaps() - function to read extcap ie 1280 * @scan_entry: scan entry 1281 * 1282 * API, function to read extcap ie 1283 * 1284 * Return: extcap element or NULL if ie is not present 1285 */ 1286 static inline uint8_t* 1287 util_scan_entry_extcaps(struct scan_cache_entry *scan_entry) 1288 { 1289 return scan_entry->ie_list.extcaps; 1290 } 1291 1292 /** 1293 * util_scan_entry_athcaps() - function to read ath caps vendor ie 1294 * @scan_entry: scan entry 1295 * 1296 * API, function to read ath caps vendor ie 1297 * 1298 * Return: ath caps vendorie or NULL if ie is not present 1299 */ 1300 static inline struct mlme_info* 1301 util_scan_entry_mlme_info(struct scan_cache_entry *scan_entry) 1302 { 1303 return &(scan_entry->mlme_info); 1304 } 1305 1306 /** 1307 * util_scan_entry_hecap() - function to read he caps vendor ie 1308 * @scan_entry: scan entry 1309 * 1310 * API, function to read he caps vendor ie 1311 * 1312 * Return: he caps vendorie or NULL if ie is not present 1313 */ 1314 static inline uint8_t* 1315 util_scan_entry_hecap(struct scan_cache_entry *scan_entry) 1316 { 1317 return scan_entry->ie_list.hecap; 1318 } 1319 1320 1321 /** 1322 * util_scan_entry_heop() - function to read heop vendor ie 1323 * @scan_entry: scan entry 1324 * 1325 * API, function to read heop vendor ie 1326 * 1327 * Return, heop vendorie or NULL if ie is not present 1328 */ 1329 static inline uint8_t* 1330 util_scan_entry_heop(struct scan_cache_entry *scan_entry) 1331 { 1332 return scan_entry->ie_list.heop; 1333 } 1334 1335 /** 1336 * util_scan_entry_muedca() - function to read MU-EDCA IE 1337 * @scan_entry: scan entry 1338 * 1339 * API, function to read MU-EDCA IE 1340 * 1341 * Return, MUEDCA IE or NULL if IE is not present 1342 */ 1343 static inline uint8_t* 1344 util_scan_entry_muedca(struct scan_cache_entry *scan_entry) 1345 { 1346 return scan_entry->ie_list.muedca; 1347 } 1348 1349 /** 1350 * util_scan_entry_spatial_reuse_parameter() - function to read spatial reuse 1351 * parameter ie 1352 * @scan_entry: scan entry 1353 * 1354 * API, function to read scan_entry reuse parameter ie 1355 * 1356 * Return, spatial reuse parameter ie or NULL if ie is not present 1357 */ 1358 static inline uint8_t* 1359 util_scan_entry_spatial_reuse_parameter(struct scan_cache_entry *scan_entry) 1360 { 1361 return scan_entry->ie_list.srp; 1362 } 1363 1364 /** 1365 * util_scan_entry_fils_indication() - function to read FILS indication ie 1366 * @scan_entry: scan entry 1367 * 1368 * API, function to read FILS indication ie 1369 * 1370 * Return, FILS indication ie or NULL if ie is not present 1371 */ 1372 static inline uint8_t* 1373 util_scan_entry_fils_indication(struct scan_cache_entry *scan_entry) 1374 { 1375 return scan_entry->ie_list.fils_indication; 1376 } 1377 1378 /** 1379 * util_get_last_scan_time() - function to get last scan time on this pdev 1380 * @vdev: vdev object 1381 * 1382 * API, function to read last scan time on this pdev 1383 * 1384 * Return: qdf_time_t 1385 */ 1386 qdf_time_t 1387 util_get_last_scan_time(struct wlan_objmgr_vdev *vdev); 1388 1389 /** 1390 * util_scan_entry_update_mlme_info() - function to update mlme info 1391 * @scan_entry: scan entry object 1392 * 1393 * API, function to update mlme info in scan DB 1394 * 1395 * Return: QDF_STATUS 1396 */ 1397 QDF_STATUS 1398 util_scan_entry_update_mlme_info(struct wlan_objmgr_pdev *pdev, 1399 struct scan_cache_entry *scan_entry); 1400 1401 /** 1402 * util_scan_is_hidden_ssid() - function to check if ssid is hidden 1403 * @ssid: struct ie_ssid object 1404 * 1405 * API, function to check if ssid is hidden 1406 * 1407 * Return: true if ap is hidden, false otherwise 1408 */ 1409 bool 1410 util_scan_is_hidden_ssid(struct ie_ssid *ssid); 1411 1412 /** 1413 * util_scan_entry_is_hidden_ap() - function to check if ap is hidden 1414 * @scan_entry: scan entry 1415 * 1416 * API, function to check if ap is hidden 1417 * 1418 * Return: true if ap is hidden, false otherwise 1419 */ 1420 static inline bool 1421 util_scan_entry_is_hidden_ap(struct scan_cache_entry *scan_entry) 1422 { 1423 return util_scan_is_hidden_ssid( 1424 (struct ie_ssid *)scan_entry->ie_list.ssid); 1425 } 1426 1427 /** 1428 * util_scan_entry_espinfo() - function to read ESP info 1429 * @scan_entry: scan entry 1430 * 1431 * API, function to read ESP info 1432 * 1433 * Return: erp info 1434 */ 1435 static inline uint8_t * 1436 util_scan_entry_esp_info(struct scan_cache_entry *scan_entry) 1437 { 1438 return scan_entry->ie_list.esp; 1439 } 1440 1441 /** 1442 * util_scan_entry_mbo_oce() - function to read MBO/OCE ie 1443 * @scan_entry: scan entry 1444 * 1445 * API, function to read MBO/OCE ie 1446 * 1447 * Return: MBO/OCE ie 1448 */ 1449 static inline uint8_t * 1450 util_scan_entry_mbo_oce(struct scan_cache_entry *scan_entry) 1451 { 1452 return scan_entry->ie_list.mbo_oce; 1453 } 1454 1455 /** 1456 * util_scan_scm_chan_to_band() - function to tell band for channel number 1457 * @chan: Channel number 1458 * 1459 * Return: Band information as per channel 1460 */ 1461 enum wlan_band util_scan_scm_chan_to_band(uint32_t chan); 1462 1463 /** 1464 * util_scan_scm_freq_to_band() - API to get band from frequency 1465 * @freq: Channel frequency 1466 * 1467 * Return: Band information as per frequency 1468 */ 1469 enum wlan_band util_scan_scm_freq_to_band(uint16_t freq); 1470 #endif 1471