blob: 0721d3947d0030aa1f809cc0500e2ed76fe8ba79 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22#if !defined( __SAP_CH_SELECT_H )
23#define __SAP_CH_SELECT_H
24/*===========================================================================
25
26 s a p C h S e l e c t . h
27
28 OVERVIEW:
29
30 This software unit holds the implementation of the WLAN SAP modules
31 functions for channel selection.
32
33 DEPENDENCIES:
34
35
36 Are listed for each API below.
37
38
39 Copyright (c) 2010 QUALCOMM Incorporated.
40 All Rights Reserved.
41 Qualcomm Confidential and Proprietary
42===========================================================================*/
43
44/*===========================================================================
45
46 EDIT HISTORY FOR FILE
47
48
49 This section contains comments describing changes made to the module.
50 Notice that changes are listed in reverse chronological order.
51
52
53
54 when who what, where, why
55---------- ----- --------------------------------------------------------
562010-03-15 SoftAP Created module
57
58===========================================================================*/
59
60
61/*--------------------------------------------------------------------------
62 Include Files
63------------------------------------------------------------------------*/
64#include "aniGlobal.h"
65/*--------------------------------------------------------------------------
66 defines and enum
67--------------------------------------------------------------------------*/
68
69#define SPECT_24GHZ_CH_COUNT (11) // USA regulatory domain
70#define SAPDFS_NORMALISE_1000 (1000/9) // Case of spec20 with channel diff = 0
71/* Gen 5 values
72#define SOFTAP_MIN_RSSI (-85)
73#define SOFTAP_MAX_RSSI (-45)
74*/
75#define SOFTAP_MIN_RSSI (-100)
76#define SOFTAP_MAX_RSSI (0)
77#define SOFTAP_MIN_COUNT (0)
78#define SOFTAP_MAX_COUNT (60)
79#define SOFTAP_RSSI_WEIGHT (20)
80#define SOFTAP_COUNT_WEIGHT (20)
81
82#define SAP_DEFAULT_CHANNEL (6)
83#define SAP_DEFAULT_5GHZ_CHANNEL (40)
84#define SAP_CHANNEL_NOT_SELECTED (0)
85/**
86* Structure holding information of each channel in the spectrum,
87* it contains the channel number, the computed weight
88*/
89typedef struct {
90 v_U16_t chNum; // Channel Number
91 v_U16_t bssCount; // bss found in scanresult for this channel
92 v_S31_t rssiAgr; // Max value of rssi among all BSS(es) from scanresult for this channel
93 v_U32_t weight; // Weightage of this channel
94 v_BOOL_t valid; // Is this a valid center frequency for regulatory domain
95} tSapSpectChInfo;//tDfsSpectChInfo;
96
97/**
98* Structure holding all the information required to make a
99* decision for the best operating channel based on dfs formula
100*/
101typedef struct {
102 tSapSpectChInfo *pSpectCh;//tDfsSpectChInfo *pSpectCh; // Ptr to the channels in the entire spectrum band
103 v_U8_t numSpectChans; // Total num of channels in the spectrum
104} tSapChSelSpectInfo;//tDfsChSelParams;
105
106/**
107 * Structure for channel weight calculation parameters
108 */
109typedef struct sSapChSelParams {
110 void *pSpectInfoParams;//*pDfsParams; // Filled with tSapChSelSpectInfo
111 v_U16_t numChannels;
112} tSapChSelParams;
113
114#endif // if !defined __SAP_CH_SELECT_H
115