1  /*
2   * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
3   * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4   *
5   * Permission to use, copy, modify, and/or distribute this software for
6   * any purpose with or without fee is hereby granted, provided that the
7   * above copyright notice and this permission notice appear in all
8   * copies.
9   *
10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11   * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12   * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13   * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14   * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15   * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17   * PERFORMANCE OF THIS SOFTWARE.
18   */
19  
20  /**
21   * \file csr_support.h
22   *
23   * Exports and types for the Common Scan and Roaming supporting interfaces.
24   */
25  #ifndef CSR_SUPPORT_H__
26  #define CSR_SUPPORT_H__
27  
28  #include "csr_link_list.h"
29  #include "csr_api.h"
30  #include "cds_reg_service.h"
31  
32  #ifdef FEATURE_WLAN_WAPI
33  #define CSR_WAPI_OUI_SIZE              (4)
34  #endif /* FEATURE_WLAN_WAPI */
35  
36  #define CSR_RSN_OUI_SIZE              (4)
37  #define CSR_WPA_OUI_SIZE              (4)
38  
39  #define CSR_DOT11_SUPPORTED_RATES_MAX (12)
40  #define CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX (8)
41  
42  #define CSR_DOT11_BASIC_RATE_MASK    WLAN_DOT11_BASIC_RATE_MASK
43  
44  /**
45   * struct csr_timer_info - CSR-specific timer context
46   * @mac: Global MAC context associated with the timer
47   * @vdev_id: Session associated with the timer
48   */
49  struct csr_timer_info {
50  	struct mac_context *mac;
51  	uint8_t vdev_id;
52  };
53  
54  #define CSR_IS_QOS_BSS(pIes)  \
55  		((pIes)->WMMParams.present || (pIes)->WMMInfoAp.present)
56  
57  uint32_t csr_get_frag_thresh(struct mac_context *mac_ctx);
58  uint32_t csr_get_rts_thresh(struct mac_context *mac_ctx);
59  
60  bool csr_is_bssid_match(struct qdf_mac_addr *pProfBssid,
61  			struct qdf_mac_addr *BssBssid);
62  /*
63   * This function will allocate memory for the parsed IEs to the caller.
64   * Caller must free the memory. after it is done with the data only if
65   * this function succeeds
66   */
67  QDF_STATUS csr_get_parsed_bss_description_ies(struct mac_context *mac_ctx,
68  					      struct bss_description *bss_desc,
69  					      tDot11fBeaconIEs **ppIEStruct);
70  
71  /**
72   * csr_is_auth_type_ese() - Checks whether Auth type is ESE or not
73   * @AuthType: Authentication type
74   *
75   * Return: true, if auth type is ese, false otherwise
76   */
77  bool csr_is_auth_type_ese(enum csr_akm_type AuthType);
78  
79  #endif
80