xref: /wlan-driver/qcacld-3.0/components/mlme/dispatcher/inc/cfg_sap_protection.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2019 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: This file contains centralized definitions of sap erp protection related
21  * converged configurations.
22  */
23 
24 #ifndef __CFG_MLME_SAP_PROTECTION_H
25 #define __CFG_MLME_SAP_PROTECTION_H
26 
27 #define CFG_PROTECTION_ENABLED CFG_UINT( \
28 		"protection_enabled", \
29 		0, \
30 		65535, \
31 		65535, \
32 		CFG_VALUE_OR_DEFAULT, \
33 		"sap protection enabled")
34 
35 #define CFG_FORCE_POLICY_PROTECTION CFG_UINT( \
36 		"protection_force_policy", \
37 		0, \
38 		5, \
39 		5, \
40 		CFG_VALUE_OR_DEFAULT, \
41 		"force policy protection")
42 
43 /*
44  * <ini>
45  * gignore_peer_ht_opmode
46  *
47  * @min 0
48  * @max 1
49  * @default 1
50  *
51  * Enabling gignore_peer_ht_opmode will enable 11g
52  * protection only when there is a 11g AP in vicinity.
53  *
54  * Related: None
55  *
56  * Supported Feature: SAP Protection
57  * </ini>
58  */
59 #define CFG_IGNORE_PEER_HT_MODE CFG_INI_BOOL( \
60 		"gignore_peer_ht_opmode", \
61 		false, \
62 		"ignore the peer ht mode")
63 
64 /*
65  * <ini>
66  * gEnableApProt - Enable/Disable AP protection
67  * @Min: 0
68  * @Max: 1
69  * @Default: 1
70  *
71  * This ini is used to enable/disable AP protection
72  *
73  * Related: None.
74  *
75  * Supported Feature: SAP
76  *
77  * Usage: Internal/External
78  *
79  * </ini>
80  */
81 #define CFG_AP_ENABLE_PROTECTION_MODE CFG_INI_BOOL( \
82 		"gEnableApProt", \
83 		true, \
84 		"enable protection on sap")
85 
86 /*
87  * <ini>
88  * gApProtection - Set AP protection parameter
89  * @Min: 0x0
90  * @Max: 0xFFFF
91  * @Default: 0xBFFF
92  *
93  * This ini is used to set AP protection parameter
94  * Bit map for CFG_AP_PROTECTION_MODE_DEFAULT
95  * LOWER byte for associated stations
96  * UPPER byte for overlapping stations
97  * each byte will have the following info
98  * bit15 bit14 bit13     bit12  bit11 bit10    bit9     bit8
99  * OBSS  RIFS  LSIG_TXOP NON_GF HT20  FROM_11G FROM_11B FROM_11A
100  * bit7  bit6  bit5      bit4   bit3  bit2     bit1     bit0
101  * OBSS  RIFS  LSIG_TXOP NON_GF HT_20 FROM_11G FROM_11B FROM_11A
102  *
103  * Related: None.
104  *
105  * Supported Feature: SAP
106  *
107  * Usage: Internal/External
108  *
109  * </ini>
110  */
111 #define CFG_AP_PROTECTION_MODE CFG_INI_UINT( \
112 				"gApProtection", \
113 				0x0, \
114 				0xFFFF, \
115 				0xBFFF, \
116 				CFG_VALUE_OR_DEFAULT, \
117 				"AP protection mode bitmap")
118 
119 /*
120  * <ini>
121  * gEnableApOBSSProt - Enable/Disable AP OBSS protection
122  * @Min: 0
123  * @Max: 1
124  * @Default: 0
125  *
126  * This ini is used to enable/disable AP OBSS protection
127  *
128  * Related: None.
129  *
130  * Supported Feature: SAP
131  *
132  * Usage: Internal/External
133  *
134  * </ini>
135  */
136 #define CFG_AP_OBSS_PROTECTION_ENABLE CFG_INI_BOOL( \
137 		"gEnableApOBSSProt", \
138 		false, \
139 		"Enable/Disable AP OBSS protection")
140 
141 #define CFG_SAP_PROTECTION_ALL \
142 	CFG(CFG_PROTECTION_ENABLED) \
143 	CFG(CFG_FORCE_POLICY_PROTECTION) \
144 	CFG(CFG_IGNORE_PEER_HT_MODE) \
145 	CFG(CFG_AP_ENABLE_PROTECTION_MODE) \
146 	CFG(CFG_AP_PROTECTION_MODE) \
147 	CFG(CFG_AP_OBSS_PROTECTION_ENABLE)
148 
149 #endif /* __CFG_MLME_SAP_PROTECTION_H */
150