1981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/*
2981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * regulatoryDomain.h
3981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *
4981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * All rights reserved.
6981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *
7981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * Redistribution and use in source and binary forms, with or without
8981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * modification, are permitted provided that the following conditions
9981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * are met:
10981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *
11981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *  * Redistributions of source code must retain the above copyright
12981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *    notice, this list of conditions and the following disclaimer.
13981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *  * Redistributions in binary form must reproduce the above copyright
14981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *    notice, this list of conditions and the following disclaimer in
15981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *    the documentation and/or other materials provided with the
16981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *    distribution.
17981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *  * Neither the name Texas Instruments nor the names of its
18981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *    contributors may be used to endorse or promote products derived
19981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *    from this software without specific prior written permission.
20981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *
21981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt */
33981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
34981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/** \file regulatoryDomain.h
35981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *  \brief regulatoryDomain module internal header file
36981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *
37981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt *  \see regulatoryDomain.c
38981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt */
39981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
40981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/***************************************************************************/
41981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/*                                                                          */
42981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/*    MODULE:   regulatoryDomain.h                                          */
43981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/*    PURPOSE:  regulatoryDomain module internal header file                */
44981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/*                                                                          */
45981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt/***************************************************************************/
46981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#ifndef __REGULATORY_DOMAIN_H__
47981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define __REGULATORY_DOMAIN_H__
48981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
49981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "paramOut.h"
50981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "fsm.h"
51981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#include "802_11Defs.h"
52981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
53981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define BG_24G_BAND_CHANNEL_HOPS    1
54981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define BG_24G_BAND_MIN_CHANNEL     1
55981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
56981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define A_5G_BAND_CHANNEL_HOPS      4
57981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
58981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define A_5G_BAND_MIN_MIDDLE_BAND_DFS_CHANNEL   52
59981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define A_5G_BAND_MAX_MIDDLE_BAND_DFS_CHANNEL   64
60981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define A_5G_BAND_MIN_UPPER_BAND_DFS_CHANNEL    100
61981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#define A_5G_BAND_MAX_UPPER_BAND_DFS_CHANNEL    140
62981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
63981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
64981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidttypedef struct
65981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt{
66981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL    channelValidityPassive; /*TI_TRUE-valid, TI_FALSE-invalid */
67981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL    channelValidityActive; /*TI_TRUE-valid, TI_FALSE-invalid */
68981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL    bChanneInCountryIe;
69981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
70981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8   uMaxTxPowerDomain;     /*
71981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt									  * Holds ONLY the default limitation (Application)
72981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt									  * or according to 11d country code IE
73981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt									  * Updated on init phase or upon receiving new country code IE
74981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt									  */
75981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT32  timestamp;
76981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt}   channelCapability_t;
77981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
78981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
79981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidttypedef struct
80981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt{
81981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Variables read from registry */
82981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /********************************/
83981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* 802.11h enabled or disabled */
84981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL                            	spectrumManagementEnabled;
85981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* 802.11d enabled or disabled */
86981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL                            	regulatoryDomainEnabled;
87981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* scan availability channels from registry */
88981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    scanControlTable_t              	scanControlTable;
89981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Desired Temp Tx Power */
90981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	uDesiredTemporaryTxPower;
91981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Actual Temp Tx Power */
92981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	uTemporaryTxPower;
93981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* User configuration for max Tx power */
94981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	uUserMaxTxPower;
95981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Tx Power Control adjustment flag on=TI_TRUE\off=TI_FALSE */
96981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL                             bTemporaryTxPowerEnable;
97981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
98981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Internal reg domain variables */
99981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /*********************************/
100981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
101981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Power Constraint IE 32 in DBM/10, valid only when 802.11h is enabled  */
102981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	uPowerConstraint;
103981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* External TX Power Control in DBM/10, valid only when 802.11h is disabled */
104981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	uExternTxPowerPreferred;
105981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
106981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	minDFS_channelNum;
107981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT8                           	maxDFS_channelNum;
108981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
109981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TCountry                       		country24;   /* Detected County IE for 2.4 Ghz */
110981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TCountry                       		country5;    /* Detected County IE for 5 Ghz */
111981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL                            	country_2_4_WasFound;
112981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_BOOL                            	country_5_WasFound;
113981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT32                          	uLastCountryReceivedTS;
114981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_UINT32                          	uTimeOutToResetCountryMs;
115981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    channelCapability_t             	supportedChannels_band_5[A_5G_BAND_NUM_CHANNELS];
116981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    channelCapability_t             	supportedChannels_band_2_4[NUM_OF_CHANNELS_24];
117981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
118981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt	/* set the size of the array to max of B_G & A, so that the array doesnt overflow. +3 for word alignment */
119981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt	TI_UINT8                        	pDefaultChannels[A_5G_BAND_NUM_CHANNELS+3];
120981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* merge 4.02/4.03 evaluate the +3 above and adjust or hSiteMgr and below will be
121981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt       will be unaligned accesses.  Expect it might now be +1 since 2 UINT8 variable
122981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt       have been added in 4.03 (max and min DFS_channelNum above) */
123981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
124981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
125981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    /* Handles to other objects */
126981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_HANDLE                       	hSiteMgr;
127981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_HANDLE                       	hTWD;
128981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_HANDLE                       	hSwitchChannel;
129981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_HANDLE                       	hReport;
130981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt    TI_HANDLE                       	hOs;
131981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
132981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
133981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt} regulatoryDomain_t;
134981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
135981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
136981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
137981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
138981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt
139981801b95b81e6d1c7a2085967406e86af0f08fcDmitry Shmidt#endif /* __REGULATORY_DOMAIN_H__*/
140