1 /*
2  * Copyright (c) 2012-2015, 2017-2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 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 #if !defined(__SAP_CH_SELECT_H)
21 #define __SAP_CH_SELECT_H
22 
23 /*===========================================================================
24 
25 				sapChSelect.h
26 
27    OVERVIEW:
28 
29    This software unit holds the implementation of the WLAN SAP modules
30    functions for channel selection.
31 
32    DEPENDENCIES:
33 
34    Are listed for each API below.
35    ===========================================================================*/
36 
37 /*--------------------------------------------------------------------------
38    Include Files
39    ------------------------------------------------------------------------*/
40 #include "ani_global.h"
41 /*--------------------------------------------------------------------------
42    defines and enum
43    --------------------------------------------------------------------------*/
44 
45 #define SAPDFS_NORMALISE_1000      (1000/9)     /* Case of spec20 with channel diff = 0 */
46 #define SOFTAP_MIN_RSSI         (-100)
47 #define SOFTAP_MAX_RSSI         (0)
48 #define SOFTAP_MIN_COUNT        (0)
49 #define SOFTAP_MAX_COUNT        (60)
50 
51 #define SOFTAP_MIN_NF           (-120)
52 #define SOFTAP_MAX_NF           (-60)
53 #define SOFTAP_MIN_CHNFREE      (0)
54 #define SOFTAP_MAX_CHNFREE      (1)
55 #define SOFTAP_MIN_TXPWR        (0)
56 #define SOFTAP_MAX_TXPWR        (63)
57 
58 #define REG_MAX_EIRP_POWER 36
59 #define REG_MIN_EIRP_POWER 14
60 
61 #define SAP_NORMALISE_ACS_WEIGHT 5
62 
63 /* In HT40/VHT80, Effect of primary Channel RSSi on Subband1 */
64 #define SAP_SUBBAND1_RSSI_EFFECT_PRIMARY  (-20)
65 /* In VHT80, Effect of primary Channel RSSI on Subband2 */
66 #define SAP_SUBBAND2_RSSI_EFFECT_PRIMARY  (-30)
67 /* In VHT80, Effect of Primary Channel RSSI on Subband3 */
68 #define SAP_SUBBAND3_RSSI_EFFECT_PRIMARY  (-40)
69 /* In VHT80, Effect of Primary Channel RSSI on Subband4 */
70 #define SAP_SUBBAND4_RSSI_EFFECT_PRIMARY  (-50)
71 /* In VHT80, Effect of Primary Channel RSSI on Subband5 */
72 #define SAP_SUBBAND5_RSSI_EFFECT_PRIMARY  (-60)
73 /* In VHT80, Effect of Primary Channel RSSI on Subband6 */
74 #define SAP_SUBBAND6_RSSI_EFFECT_PRIMARY  (-70)
75 /* In VHT80, Effect of Primary Channel RSSI on Subband7 */
76 #define SAP_SUBBAND7_RSSI_EFFECT_PRIMARY  (-80)
77 
78 #define SAP_24GHZ_FIRST_OVERLAP_CHAN_RSSI_EFFECT_PRIMARY      (-10)     /* In 2.4GHZ, Effect of Primary  Channel RSSI on First Overlapping Channel */
79 #define SAP_24GHZ_SEC_OVERLAP_CHAN_RSSI_EFFECT_PRIMARY        (-20)     /* In 2.4GHZ, Effect of Primary  Channel RSSI on Second Overlapping Channel */
80 #define SAP_24GHZ_THIRD_OVERLAP_CHAN_RSSI_EFFECT_PRIMARY      (-30)     /* In 2.4GHZ, Effect of Primary  Channel RSSI on Third Overlapping Channel */
81 #define SAP_24GHZ_FOURTH_OVERLAP_CHAN_RSSI_EFFECT_PRIMARY     (-40)     /* In 2.4GHZ, Effect of Primary  Channel RSSI on Fourth Overlapping Channel */
82 
83 typedef enum {
84 	CHANNEL_1 = 1,
85 	CHANNEL_2,
86 	CHANNEL_3,
87 	CHANNEL_4,
88 	CHANNEL_5,
89 	CHANNEL_6,
90 	CHANNEL_7,
91 	CHANNEL_8,
92 	CHANNEL_9,
93 	CHANNEL_10,
94 	CHANNEL_11,
95 	CHANNEL_12,
96 	CHANNEL_13,
97 	CHANNEL_14
98 } tSapChannel;
99 #endif /* if !defined __SAP_CH_SELECT_H */
100