Home | History | Annotate | Download | only in siteMgr
      1 /** \file siteHash.h
      2  *  \brief Hash & site table internal header file
      3  *
      4  *  \see siteHash.c
      5  */
      6 /****************************************************************************
      7 **+-----------------------------------------------------------------------+**
      8 **|                                                                       |**
      9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
     10 **| All rights reserved.                                                  |**
     11 **|                                                                       |**
     12 **| Redistribution and use in source and binary forms, with or without    |**
     13 **| modification, are permitted provided that the following conditions    |**
     14 **| are met:                                                              |**
     15 **|                                                                       |**
     16 **|  * Redistributions of source code must retain the above copyright     |**
     17 **|    notice, this list of conditions and the following disclaimer.      |**
     18 **|  * Redistributions in binary form must reproduce the above copyright  |**
     19 **|    notice, this list of conditions and the following disclaimer in    |**
     20 **|    the documentation and/or other materials provided with the         |**
     21 **|    distribution.                                                      |**
     22 **|  * Neither the name Texas Instruments nor the names of its            |**
     23 **|    contributors may be used to endorse or promote products derived    |**
     24 **|    from this software without specific prior written permission.      |**
     25 **|                                                                       |**
     26 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
     27 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
     28 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
     29 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
     30 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
     31 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
     32 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
     33 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
     34 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
     35 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
     36 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
     37 **|                                                                       |**
     38 **+-----------------------------------------------------------------------+**
     39 ****************************************************************************/
     40 
     41 /***************************************************************************/
     42 /*                                                                          */
     43 /*    MODULE:   siteHash.h                                                  */
     44 /*    PURPOSE:  Hash & site table internal header file                      */
     45 /*                                                                          */
     46 /***************************************************************************/
     47 #ifndef __SITE_MGR_H__
     48 #define __SITE_MGR_H__
     49 
     50 #include "osTIType.h"
     51 #include "paramOut.h"
     52 #include "paramIn.h"
     53 #include "802_11Defs.h"
     54 #include "DataCtrl_Api.h"
     55 #include "whalCtrl_api.h"
     56 
     57 #define MAX_RSN_IE          3
     58 
     59 /* site types */
     60 typedef enum
     61 {
     62     SITE_PRIMARY        = 0,
     63     SITE_SELF           = 1,
     64     SITE_REGULAR        = 2,
     65     SITE_NULL           = 3,
     66 } siteType_e;
     67 
     68 typedef struct
     69 {
     70     UINT8   hopPattern;
     71     UINT8   hopSet;
     72     UINT16  dwellTime;
     73 } FHParams_t;
     74 
     75 /* A site entry contains all the site attribute received in beacon and probes
     76     and data used to manage the site table and hash table */
     77 typedef struct siteEntry_t siteEntry_t;
     78 struct siteEntry_t
     79 {
     80     /* The following fields, in addition with the BSSID is used for entry management */
     81     UINT8                   index;
     82     siteType_e              siteType;
     83     UINT32                  localTimeStamp;
     84     UINT32                  dtimTimeStamp;
     85     UINT8                   tsfTimeStamp[TIME_STAMP_LEN];
     86     UINT32                  osTimeStamp;
     87 
     88 
     89 
     90     /* The following fields are used for the selection */
     91     BOOL                    probeRecv;
     92     BOOL                    beaconRecv;
     93     BOOL                    beaconReceiveAfterJoin;
     94     macAddress_t            bssid;
     95     ssid_t                  ssid;
     96     bssType_e               bssType;
     97     rateMask_t              rateMask;
     98     rate_e                  maxBasicRate;
     99     rate_e                  maxActiveRate;
    100     modulationType_e        beaconModulation;
    101     modulationType_e        probeModulation;
    102     preamble_e              currentPreambleType;
    103     preamble_e              preambleAssRspCap;
    104     preamble_e              barkerPreambleType;
    105     slotTime_e              currentSlotTime;
    106     slotTime_e              newSlotTime;
    107     BOOL                    useProtection;
    108     BOOL                    NonErpPresent;
    109     UINT8                   channel;
    110     UINT8                   attemptsNumber;
    111     UINT8                   Not_Received;
    112     UINT32                  matchingLevel;
    113 
    114     BOOL                    privacy;
    115     BOOL                    agility;
    116     UINT16                  capabilities;
    117     UINT16                  beaconInterval;
    118     UINT8                   dtimPeriod;
    119     UINT8                   snr;
    120     rate_e                  rxRate;
    121     INT32                   rssi;
    122     dot11_4X_t              fourXParams;
    123     BOOL                    fourXsupported;
    124 
    125     /* Power Constraint */
    126     UINT8                   powerConstraint;
    127 
    128     /* AP Tx Power obtained from TPC Report */
    129     UINT8                   APTxPower;
    130 
    131     /* QOS */
    132     BOOL                    WMESupported;
    133     ACParameters_t          WMEParameters;
    134     UINT8                   lastWMEParameterCnt;
    135 
    136     /* UPSD */
    137     BOOL                    APSDSupport;
    138 
    139     /* The following fields are never updated */
    140     UINT16                  atimWindow;
    141     FHParams_t              FHParams;
    142     dot11_RSN_t             pRsnIe[MAX_RSN_IE];
    143     UINT8                   rsnIeLen;
    144 
    145     mgmtStatus_e            failStatus;
    146     BOOL                    prioritySite;
    147     UINT8                   probeRespBuffer[MAX_BEACON_BODY_LENGTH];
    148     UINT16                  probeRespLength;
    149     UINT8                   beaconBuffer[MAX_BEACON_BODY_LENGTH];
    150     UINT16                  beaconLength;
    151 
    152     BOOL                    detectedWhileMeasuring;
    153 };
    154 
    155 typedef struct
    156 {
    157     UINT8           numOfSites;
    158     UINT8           maxNumOfSites;
    159     siteEntry_t     siteTable[MAX_SITES_BG_BAND];
    160 }siteTablesParams_t;
    161 
    162 /* This struct is seperated from the above struct (siteTablesParams_t) for memory optimizations */
    163 typedef struct
    164 {
    165     UINT8           numOfSites;
    166     UINT8           maxNumOfSites;
    167     siteEntry_t     siteTable[MAX_SITES_A_BAND];
    168 }siteTablesParamsBandA_t;
    169 
    170 /* Ths following structure is used to manage the sites */
    171 typedef struct
    172 {
    173     siteTablesParamsBandA_t  dot11A_sitesTables;
    174     siteTablesParams_t        dot11BG_sitesTables;
    175     siteTablesParams_t        *pCurrentSiteTable;
    176     siteEntry_t               *pPrimarySite;
    177     siteEntry_t               *pPrevPrimarySite;
    178 } sitesMgmtParams_t;
    179 
    180 
    181 /* Site manager handle */
    182 typedef struct
    183 {
    184     siteMgrInitParams_t *pDesiredParams;
    185     sitesMgmtParams_t   *pSitesMgmtParams;
    186 
    187     TI_HANDLE           hConn;
    188     TI_HANDLE           hSmeSm;
    189     TI_HANDLE           hCtrlData;
    190     TI_HANDLE           hRxData;
    191     TI_HANDLE           hTxData;
    192     TI_HANDLE           hRsn;
    193     TI_HANDLE           hAuth;
    194     TI_HANDLE           hAssoc;
    195     TI_HANDLE           hRegulatoryDomain;
    196     TI_HANDLE           hMeasurementMgr;
    197     TI_HANDLE           hHalCtrl;
    198     TI_HANDLE           hMlmeSm;
    199     TI_HANDLE           hMemMgr;
    200     TI_HANDLE           hReport;
    201     TI_HANDLE           hOs;
    202     TI_HANDLE           hExcMngr;
    203     TI_HANDLE           hApConn;
    204     TI_HANDLE           hCurrBss;
    205     TI_HANDLE           hQosMngr;
    206     TI_HANDLE           hPowerMgr;
    207     TI_HANDLE           hEvHandler;
    208     TI_HANDLE           hMacServices;
    209     TI_HANDLE           hScr;
    210 
    211     UINT32              beaconSentCount;
    212     UINT32              rxPacketsCount;
    213     UINT32              txPacketsCount;
    214 
    215     modulationType_e    chosenModulation;
    216     modulationType_e    currentDataModulation;
    217     dot11mode_e         siteMgrOperationalMode;
    218     radioBand_e         radioBand;
    219     radioBand_e         prevRadioBand;
    220 
    221     macAddress_t        ibssBssid;
    222     BOOLEAN             bPostponedDisconnectInProgress;
    223     BOOL                isAgingEnable;
    224 
    225     /* TX Power Adjust */
    226     UINT32              siteMgrTxPowerCheckTime;
    227     BOOL                bTempTxPowerEnabled;
    228 
    229     /* Scans procedures */
    230     UINT8               numOfBeaconFiltering;
    231     BOOL                keepAliveEnable;
    232     /*UINT8             siteMgrDesiredBeaconFilterState;*/
    233     beaconFilterParams_t    beaconFilterParams; /*contains the desired state*/
    234 
    235 
    236     /*HW Request from Power Ctrl */
    237     UINT32              DriverTestId;
    238 
    239     BOOL                powerSaveLdMode;
    240 } siteMgr_t;
    241 
    242 
    243 
    244 siteEntry_t *findAndInsertSiteEntry(siteMgr_t       *pSiteMgr,
    245                                     macAddress_t    *bssid,
    246                                     radioBand_e     band);
    247 
    248 siteEntry_t *findSiteEntry(siteMgr_t        *pSiteMgr,
    249                            macAddress_t     *bssid);
    250 
    251 void removeSiteEntry(siteMgr_t *pSiteMgr, siteTablesParams_t *pCurrSiteTblParams,
    252                      siteEntry_t  *hashPtr);
    253 
    254 TI_STATUS removeEldestSite(siteMgr_t *pSiteMgr);
    255 
    256 TI_STATUS buildProbeReqTemplate(siteMgr_t *pSiteMgr, whalCtrl_setTemplate_t *pTemplate, ssid_t *pSsid,
    257 								radioBand_e radioBand);
    258 
    259 TI_STATUS buildProbeRspTemplate(siteMgr_t *pSiteMgr, whalCtrl_setTemplate_t *pTemplate);
    260 
    261 TI_STATUS buildNullTemplate(siteMgr_t *pSiteMgr, whalCtrl_setTemplate_t *pTemplate);
    262 
    263 TI_STATUS buildPsPollTemplate(siteMgr_t *pSiteMgr, whalCtrl_setTemplate_t *pTemplate);
    264 
    265 TI_STATUS buildQosNullDataTemplate(siteMgr_t *pSiteMgr, whalCtrl_setTemplate_t *pTemplate, UINT8 userPriority);
    266 
    267 #endif /* __SITE_MGR_H__ */
    268