blob: 25ea2f969059dcf060473f4b8797cc4f21ed2ba6 [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*/
Madan Mohan Koyyalamudi5aef2af2012-10-05 11:56:27 -070089
90#define SPACE_ASCII_VALUE 32
91
92typedef struct sSapChannelListInfo{
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -070093 v_U8_t numChannel;
94 v_U8_t *channelList;
Madan Mohan Koyyalamudi5aef2af2012-10-05 11:56:27 -070095} tSapChannelListInfo;
96
Jeff Johnson295189b2012-06-20 16:38:30 -070097typedef struct {
98 v_U16_t chNum; // Channel Number
99 v_U16_t bssCount; // bss found in scanresult for this channel
100 v_S31_t rssiAgr; // Max value of rssi among all BSS(es) from scanresult for this channel
101 v_U32_t weight; // Weightage of this channel
102 v_BOOL_t valid; // Is this a valid center frequency for regulatory domain
103} tSapSpectChInfo;//tDfsSpectChInfo;
104
105/**
106* Structure holding all the information required to make a
107* decision for the best operating channel based on dfs formula
108*/
Madan Mohan Koyyalamudi5aef2af2012-10-05 11:56:27 -0700109
Jeff Johnson295189b2012-06-20 16:38:30 -0700110typedef struct {
111 tSapSpectChInfo *pSpectCh;//tDfsSpectChInfo *pSpectCh; // Ptr to the channels in the entire spectrum band
112 v_U8_t numSpectChans; // Total num of channels in the spectrum
113} tSapChSelSpectInfo;//tDfsChSelParams;
114
115/**
116 * Structure for channel weight calculation parameters
117 */
118typedef struct sSapChSelParams {
119 void *pSpectInfoParams;//*pDfsParams; // Filled with tSapChSelSpectInfo
120 v_U16_t numChannels;
121} tSapChSelParams;
122
123#endif // if !defined __SAP_CH_SELECT_H
124