xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/nxp/mlan/mlan_11ax.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /** @file mlan_11ax.h
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  *  @brief This file contains the functions for station ioctl.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  *  Copyright 2018-2022 NXP
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *  This software file (the File) is distributed by NXP
9*4882a593Smuzhiyun  *  under the terms of the GNU General Public License Version 2, June 1991
10*4882a593Smuzhiyun  *  (the License).  You may use, redistribute and/or modify the File in
11*4882a593Smuzhiyun  *  accordance with the terms and conditions of the License, a copy of which
12*4882a593Smuzhiyun  *  is available by writing to the Free Software Foundation, Inc.,
13*4882a593Smuzhiyun  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
14*4882a593Smuzhiyun  *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
17*4882a593Smuzhiyun  *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
18*4882a593Smuzhiyun  *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
19*4882a593Smuzhiyun  *  this warranty disclaimer.
20*4882a593Smuzhiyun  *
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun #ifndef _MLAN_11AX_H_
24*4882a593Smuzhiyun #define _MLAN_11AX_H_
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun /** device support 2.4G 40MHZ*/
27*4882a593Smuzhiyun #define AX_2G_40MHZ_SUPPORT MBIT(1)
28*4882a593Smuzhiyun /** device support 2.4G 242 tone RUs */
29*4882a593Smuzhiyun #define AX_2G_20MHZ_SUPPORT MBIT(5)
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun /*
32*4882a593Smuzhiyun  * 0 indicates support for HE-MCS 0-7 for n spatial streams
33*4882a593Smuzhiyun  * 1 indicates support for HE-MCS 0-9 for n spatial streams
34*4882a593Smuzhiyun  * 2 indicates support for HE-MCS 0-11 for n spatial streams
35*4882a593Smuzhiyun  * 3 indicates that n spatial streams is not supported for HE PPDUs
36*4882a593Smuzhiyun  */
37*4882a593Smuzhiyun #define GET_HE_NSSMCS(MCSMapSet, nss) ((MCSMapSet >> (2 * (nss - 1))) & 0x3)
38*4882a593Smuzhiyun #define SET_HE_NSSMCS(MCSMapSet, nss, value)                                   \
39*4882a593Smuzhiyun 	(MCSMapSet |= (value & 0x3) << (2 * (nss - 1)))
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv,
42*4882a593Smuzhiyun 				   BSSDescriptor_t *pbss_desc);
43*4882a593Smuzhiyun mlan_status wlan_11ax_ioctl_twtcfg(pmlan_adapter pmadapter,
44*4882a593Smuzhiyun 				   pmlan_ioctl_req pioctl_req);
45*4882a593Smuzhiyun mlan_status wlan_cmd_twt_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
46*4882a593Smuzhiyun 			     t_u16 cmd_action, t_void *pdata_buf);
47*4882a593Smuzhiyun t_u8 wlan_fill_he_cap_ie(mlan_private *pmpriv, IEEEtypes_HECap_t *hecap_ie,
48*4882a593Smuzhiyun 			 t_u16 band);
49*4882a593Smuzhiyun t_u8 wlan_fill_he_op_ie(mlan_private *pmpriv, IEEEtypes_HeOp_t *heop_ie);
50*4882a593Smuzhiyun t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
51*4882a593Smuzhiyun 			   MrvlIEtypes_Extension_t *phe_cap, t_u8 flag);
52*4882a593Smuzhiyun void wlan_update_11ax_cap(mlan_adapter *pmadapter,
53*4882a593Smuzhiyun 			  MrvlIEtypes_Extension_t *hw_he_cap);
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
56*4882a593Smuzhiyun 			     t_u8 **ppbuffer);
57*4882a593Smuzhiyun t_u16 wlan_11ax_bandconfig_allowed(mlan_private *pmpriv,
58*4882a593Smuzhiyun 				   BSSDescriptor_t *pbss_desc);
59*4882a593Smuzhiyun mlan_status wlan_11ax_cfg_ioctl(pmlan_adapter pmadapter,
60*4882a593Smuzhiyun 				pmlan_ioctl_req pioctl_req);
61*4882a593Smuzhiyun mlan_status wlan_11ax_ioctl_cmd(pmlan_adapter pmadapter,
62*4882a593Smuzhiyun 				pmlan_ioctl_req pioctl_req);
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun mlan_status wlan_cmd_11ax_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
65*4882a593Smuzhiyun 			      t_u16 cmd_action, t_void *pdata_buf);
66*4882a593Smuzhiyun mlan_status wlan_ret_11ax_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
67*4882a593Smuzhiyun 			      mlan_ioctl_req *pioctl_buf);
68*4882a593Smuzhiyun mlan_status wlan_cmd_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
69*4882a593Smuzhiyun 			      t_u16 cmd_action, t_void *pdata_buf);
70*4882a593Smuzhiyun mlan_status wlan_ret_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
71*4882a593Smuzhiyun 			      mlan_ioctl_req *pioctl_buf);
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun #endif /* _MLAN_11AX_H_ */
74