blob: 79f4e8ca046c047742fe378dabd9e17ed5da598a [file] [log] [blame]
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -07001/*
Jeff Johnsone4c11db2018-05-05 23:22:32 -07002 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -07003 *
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 Johnson82797b62017-08-11 15:31:27 -070029struct hdd_context;
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -070030struct wma_tgt_cfg;
Jeff Johnsonc5d76502017-08-15 13:58:43 -070031struct hdd_beacon_data;
Jeff Johnsone4c11db2018-05-05 23:22:32 -070032struct sap_config;
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -080033
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -070034#ifdef WLAN_FEATURE_11AX
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -080035/**
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 */
53enum 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 Natarajanf30de902017-03-23 11:43:20 -070069/**
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 Johnson82797b62017-08-11 15:31:27 -070080void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx,
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -070081 struct wma_tgt_cfg *cfg);
Krishna Kumaar Natarajanf30de902017-03-23 11:43:20 -070082
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 Johnsonc5d76502017-08-15 13:58:43 -070093void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon,
Jeff Johnsone4c11db2018-05-05 23:22:32 -070094 struct sap_config *config);
Krishna Kumaar Natarajanf30de902017-03-23 11:43:20 -070095
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 Johnson56acf432017-08-28 12:00:20 -0700102void hdd_he_print_ini_config(struct hdd_context *hdd_ctx);
Krishna Kumaar Natarajanf30de902017-03-23 11:43:20 -0700103
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 Johnson56acf432017-08-28 12:00:20 -0700113int hdd_update_he_cap_in_cfg(struct hdd_context *hdd_ctx);
Krishna Kumaar Natarajanf30de902017-03-23 11:43:20 -0700114
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 Natarajan90bb6f12017-03-03 21:05:52 -0800122void hdd_he_set_sme_config(tSmeConfigParams *sme_config,
123 struct hdd_config *config);
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -0800124
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 */
134int 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 Natarajaned1efd92016-09-24 18:05:47 -0700146#else
Jeff Johnson82797b62017-08-11 15:31:27 -0700147static inline void hdd_update_tgt_he_cap(struct hdd_context *hdd_ctx,
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -0700148 struct wma_tgt_cfg *cfg)
149{
150}
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800151
Jeff Johnsonc5d76502017-08-15 13:58:43 -0700152static inline void wlan_hdd_check_11ax_support(struct hdd_beacon_data *beacon,
Jeff Johnsone4c11db2018-05-05 23:22:32 -0700153 struct sap_config *config)
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800154{
155}
Krishna Kumaar Natarajan90bb6f12017-03-03 21:05:52 -0800156
Jeff Johnson56acf432017-08-28 12:00:20 -0700157static inline void hdd_he_print_ini_config(struct hdd_context *hdd_ctx)
Krishna Kumaar Natarajan90bb6f12017-03-03 21:05:52 -0800158{
159}
160
Jeff Johnson56acf432017-08-28 12:00:20 -0700161static inline int hdd_update_he_cap_in_cfg(struct hdd_context *hdd_ctx)
Krishna Kumaar Natarajan90bb6f12017-03-03 21:05:52 -0800162{
163 return 0;
164}
165
166static inline void hdd_he_set_sme_config(tSmeConfigParams *sme_config,
167 struct hdd_config *config)
168{
169}
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -0800170
171/* dummy definition */
172#define FEATURE_11AX_VENDOR_COMMANDS
173
Krishna Kumaar Natarajaned1efd92016-09-24 18:05:47 -0700174#endif
175#endif /* if !defined(WLAN_HDD_HE_H)*/