Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | e4c11db | 2018-05-05 23:22:32 -0700 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 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 : wlan_hdd_he.h |
| 21 | * |
| 22 | * WLAN Host Device Driver file for 802.11ax (High Efficiency) support. |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #if !defined(WLAN_HDD_HE_H) |
| 27 | #define WLAN_HDD_HE_H |
| 28 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 29 | struct hdd_context; |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 30 | struct wma_tgt_cfg; |
Jeff Johnson | c5d7650 | 2017-08-15 13:58:43 -0700 | [diff] [blame] | 31 | struct hdd_beacon_data; |
Jeff Johnson | e4c11db | 2018-05-05 23:22:32 -0700 | [diff] [blame] | 32 | struct sap_config; |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 33 | |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 34 | #ifdef WLAN_FEATURE_11AX |
Krishna Kumaar Natarajan | f567650 | 2017-03-06 10:28:44 -0800 | [diff] [blame] | 35 | /** |
| 36 | * enum qca_wlan_vendor_attr_get_he_capabilities - attributes for HE caps. |
| 37 | * vendor command. |
| 38 | * @QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_INVALID - invalid |
| 39 | * @QCA_WLAN_VENDOR_ATTR_HE_SUPPORTED - to check if HE capabilities is supported |
| 40 | * @QCA_WLAN_VENDOR_ATTR_PHY_CAPAB - to get HE PHY capabilities |
| 41 | * @QCA_WLAN_VENDOR_ATTR_MAC_CAPAB - to get HE MAC capabilities |
| 42 | * @QCA_WLAN_VENDOR_ATTR_HE_MCS - to get HE MCS |
| 43 | * @QCA_WLAN_VENDOR_ATTR_NUM_SS - to get NUM SS |
| 44 | * @QCA_WLAN_VENDOR_ATTR_RU_IDX_MASK - to get RU index mask |
| 45 | * @QCA_WLAN_VENDOR_ATTR_RU_COUNT - to get RU count, |
| 46 | * @QCA_WLAN_VENDOR_ATTR_PPE_THRESHOLD - to get PPE Threshold, |
| 47 | * @QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_AFTER_LAST - next to last valid enum |
| 48 | * @QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_MAX - max value supported |
| 49 | * |
| 50 | * enum values are used for NL attributes for data used by |
| 51 | * QCA_NL80211_VENDOR_SUBCMD_GET_HE_CAPABILITIES sub command. |
| 52 | */ |
| 53 | enum qca_wlan_vendor_attr_get_he_capabilities { |
| 54 | QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_INVALID = 0, |
| 55 | QCA_WLAN_VENDOR_ATTR_HE_SUPPORTED, |
| 56 | QCA_WLAN_VENDOR_ATTR_PHY_CAPAB, |
| 57 | QCA_WLAN_VENDOR_ATTR_MAC_CAPAB, |
| 58 | QCA_WLAN_VENDOR_ATTR_HE_MCS, |
| 59 | QCA_WLAN_VENDOR_ATTR_NUM_SS = 5, |
| 60 | QCA_WLAN_VENDOR_ATTR_RU_IDX_MASK, |
| 61 | QCA_WLAN_VENDOR_ATTR_PPE_THRESHOLD, |
| 62 | |
| 63 | /* keep last */ |
| 64 | QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_AFTER_LAST, |
| 65 | QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_MAX = |
| 66 | QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_AFTER_LAST - 1, |
| 67 | }; |
| 68 | |
Krishna Kumaar Natarajan | f30de90 | 2017-03-23 11:43:20 -0700 | [diff] [blame] | 69 | /** |
| 70 | * hdd_update_tgt_he_cap() - Update HE related capabilities |
| 71 | * @hdd_ctx: HDD context |
| 72 | * @he_cap: Target HE capabilities |
| 73 | * |
| 74 | * This function updaates WNI CFG with Target capabilities received as part of |
| 75 | * Default values present in WNI CFG are the values supported by FW/HW. |
| 76 | * INI should be introduced if user control is required to control the value. |
| 77 | * |
| 78 | * Return: None |
| 79 | */ |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 80 | void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx, |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 81 | struct wma_tgt_cfg *cfg); |
Krishna Kumaar Natarajan | f30de90 | 2017-03-23 11:43:20 -0700 | [diff] [blame] | 82 | |
| 83 | /** |
| 84 | * wlan_hdd_check_11ax_support() - check if beacon IE and update hw mode |
| 85 | * @beacon: beacon IE buffer |
| 86 | * @config: pointer to sap config |
| 87 | * |
| 88 | * Check if HE cap IE is present in beacon IE, if present update hw mode |
| 89 | * to 11ax. |
| 90 | * |
| 91 | * Return: None |
| 92 | */ |
Jeff Johnson | c5d7650 | 2017-08-15 13:58:43 -0700 | [diff] [blame] | 93 | void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon, |
Jeff Johnson | e4c11db | 2018-05-05 23:22:32 -0700 | [diff] [blame] | 94 | struct sap_config *config); |
Krishna Kumaar Natarajan | f30de90 | 2017-03-23 11:43:20 -0700 | [diff] [blame] | 95 | |
| 96 | /** |
| 97 | * hdd_he_print_ini_config()- Print 11AX(HE) specific INI configuration |
| 98 | * @hdd_ctx: handle to hdd context |
| 99 | * |
| 100 | * Return: None |
| 101 | */ |
Jeff Johnson | 56acf43 | 2017-08-28 12:00:20 -0700 | [diff] [blame] | 102 | void hdd_he_print_ini_config(struct hdd_context *hdd_ctx); |
Krishna Kumaar Natarajan | f30de90 | 2017-03-23 11:43:20 -0700 | [diff] [blame] | 103 | |
| 104 | /** |
| 105 | * hdd_update_he_cap_in_cfg() - update HE cap in global CFG |
| 106 | * @hdd_ctx: pointer to hdd context |
| 107 | * |
| 108 | * This API will update the HE config in CFG after taking intersection |
| 109 | * of INI and firmware capabilities provided reading CFG |
| 110 | * |
| 111 | * Return: 0 on success and errno on failure |
| 112 | */ |
Jeff Johnson | 56acf43 | 2017-08-28 12:00:20 -0700 | [diff] [blame] | 113 | int hdd_update_he_cap_in_cfg(struct hdd_context *hdd_ctx); |
Krishna Kumaar Natarajan | f30de90 | 2017-03-23 11:43:20 -0700 | [diff] [blame] | 114 | |
| 115 | /** |
| 116 | * hdd_he_set_sme_config() - set HE related SME config param |
| 117 | * @sme_config: pointer to SME config |
| 118 | * @config: pointer to INI config |
| 119 | * |
| 120 | * Return: None |
| 121 | */ |
Krishna Kumaar Natarajan | 90bb6f1 | 2017-03-03 21:05:52 -0800 | [diff] [blame] | 122 | void hdd_he_set_sme_config(tSmeConfigParams *sme_config, |
| 123 | struct hdd_config *config); |
Krishna Kumaar Natarajan | f567650 | 2017-03-06 10:28:44 -0800 | [diff] [blame] | 124 | |
| 125 | /** |
| 126 | * wlan_hdd_cfg80211_get_he_cap() - get HE Capabilities |
| 127 | * @wiphy: Pointer to wiphy |
| 128 | * @wdev: Pointer to wdev |
| 129 | * @data: Pointer to data |
| 130 | * @data_len: Data length |
| 131 | * |
| 132 | * Return: 0 if success, non-zero for failure |
| 133 | */ |
| 134 | int wlan_hdd_cfg80211_get_he_cap(struct wiphy *wiphy, |
| 135 | struct wireless_dev *wdev, const void *data, |
| 136 | int data_len); |
| 137 | #define FEATURE_11AX_VENDOR_COMMANDS \ |
| 138 | { \ |
| 139 | .info.vendor_id = QCA_NL80211_VENDOR_ID, \ |
| 140 | .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_HE_CAPABILITIES, \ |
| 141 | .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ |
| 142 | WIPHY_VENDOR_CMD_NEED_NETDEV, \ |
| 143 | .doit = wlan_hdd_cfg80211_get_he_cap \ |
| 144 | }, |
| 145 | |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 146 | #else |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 147 | static inline void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx, |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 148 | struct wma_tgt_cfg *cfg) |
| 149 | { |
| 150 | } |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 151 | |
Jeff Johnson | c5d7650 | 2017-08-15 13:58:43 -0700 | [diff] [blame] | 152 | static inline void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon, |
Jeff Johnson | e4c11db | 2018-05-05 23:22:32 -0700 | [diff] [blame] | 153 | struct sap_config *config) |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 154 | { |
| 155 | } |
Krishna Kumaar Natarajan | 90bb6f1 | 2017-03-03 21:05:52 -0800 | [diff] [blame] | 156 | |
Jeff Johnson | 56acf43 | 2017-08-28 12:00:20 -0700 | [diff] [blame] | 157 | static inline void hdd_he_print_ini_config(struct hdd_context *hdd_ctx) |
Krishna Kumaar Natarajan | 90bb6f1 | 2017-03-03 21:05:52 -0800 | [diff] [blame] | 158 | { |
| 159 | } |
| 160 | |
Jeff Johnson | 56acf43 | 2017-08-28 12:00:20 -0700 | [diff] [blame] | 161 | static inline int hdd_update_he_cap_in_cfg(struct hdd_context *hdd_ctx) |
Krishna Kumaar Natarajan | 90bb6f1 | 2017-03-03 21:05:52 -0800 | [diff] [blame] | 162 | { |
| 163 | return 0; |
| 164 | } |
| 165 | |
| 166 | static inline void hdd_he_set_sme_config(tSmeConfigParams *sme_config, |
| 167 | struct hdd_config *config) |
| 168 | { |
| 169 | } |
Krishna Kumaar Natarajan | f567650 | 2017-03-06 10:28:44 -0800 | [diff] [blame] | 170 | |
| 171 | /* dummy definition */ |
| 172 | #define FEATURE_11AX_VENDOR_COMMANDS |
| 173 | |
Krishna Kumaar Natarajan | ed1efd9 | 2016-09-24 18:05:47 -0700 | [diff] [blame] | 174 | #endif |
| 175 | #endif /* if !defined(WLAN_HDD_HE_H)*/ |