Home | History | Annotate | Download | only in TrafficMonitor
      1 /****************************************************************************
      2 **+-----------------------------------------------------------------------+**
      3 **|                                                                       |**
      4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
      5 **| All rights reserved.                                                  |**
      6 **|                                                                       |**
      7 **| Redistribution and use in source and binary forms, with or without    |**
      8 **| modification, are permitted provided that the following conditions    |**
      9 **| are met:                                                              |**
     10 **|                                                                       |**
     11 **|  * Redistributions of source code must retain the above copyright     |**
     12 **|    notice, this list of conditions and the following disclaimer.      |**
     13 **|  * Redistributions in binary form must reproduce the above copyright  |**
     14 **|    notice, this list of conditions and the following disclaimer in    |**
     15 **|    the documentation and/or other materials provided with the         |**
     16 **|    distribution.                                                      |**
     17 **|  * Neither the name Texas Instruments nor the names of its            |**
     18 **|    contributors may be used to endorse or promote products derived    |**
     19 **|    from this software without specific prior written permission.      |**
     20 **|                                                                       |**
     21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
     22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
     23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
     24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
     25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
     26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
     27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
     28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
     29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
     30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
     31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
     32 **|                                                                       |**
     33 **+-----------------------------------------------------------------------+**
     34 ****************************************************************************/
     35 
     36 /***************************************************************************/
     37 /*                                                                         */
     38 /*    MODULE:   tx.h                                                       */
     39 /*    PURPOSE:  Tx module Header file                                      */
     40 /*                                                                         */
     41 /***************************************************************************/
     42 #ifndef _CTRL_H_
     43 #define _CTRL_H_
     44 
     45 #include "osTIType.h"
     46 #include "paramIn.h"
     47 #include "paramOut.h"
     48 #include "rxXfer_api.h"
     49 #include "RateAdaptation.h"
     50 #include "Clsfr.h"
     51 #include "fourX.h"
     52 
     53 #define     DEF_CURRENT_PREAMBLE                        PREAMBLE_LONG
     54 #define     DEF_CURRENT_MUDULATION_TYPE                 DRV_MODULATION_CCK
     55 #define     DEF_BASIC_RATE                              DRV_RATE_2M
     56 #define     DEF_BASIC_RATE_MASK                         0x0003
     57 #define     ALL_RATES_AVAILABLE                         0xFFFFFFFF
     58 
     59 #define     DEF_RATE_CONTROL_ENABLE                     FALSE
     60 #define     DEF_START_STOP_LINK_CTRL_ALG                FALSE
     61 
     62 typedef enum
     63 {
     64 CTRL_DATA_TRAFFIC_INTENSITY_HIGH_CROSSED_ABOVE,
     65 CTRL_DATA_TRAFFIC_INTENSITY_HIGH_CROSSED_BELOW,
     66 CTRL_DATA_TRAFFIC_INTENSITY_LOW_CROSSED_ABOVE,
     67 CTRL_DATA_TRAFFIC_INTENSITY_LOW_CROSSED_BELOW,
     68 CTRL_DATA_TRAFFIC_INTENSITY_MAX_EVENTS,
     69 } ctrlData_trafficIntensityEvents_e;
     70 
     71 
     72 #define TS_EXCEEDS(currTime,expTime) (currTime > expTime)
     73 #define TS_ADVANCE(currTime,expTime,delta) (expTime = currTime + (delta))
     74 
     75 typedef struct
     76 {
     77     UINT32 dbgNumOfMsduFreeInTxComplete[MAX_NUM_OF_TX_QUEUES];
     78 }ctrlDataDbgCounters_t;
     79 
     80 typedef struct
     81 {
     82     UINT32 supportedRatesMask[NUM_OF_RATE_CLASS_CLIENTS];
     83     UINT32 policyClassRateMask[NUM_OF_RATE_CLASS_CLIENTS];
     84     UINT32 fwPolicyID[NUM_OF_RATE_CLASS_CLIENTS];
     85 }tsrsParameters_t;
     86 
     87 typedef struct
     88 {
     89     TI_HANDLE           hSiteMgr;
     90     TI_HANDLE           hTxData;
     91     TI_HANDLE           hRxData;
     92     TI_HANDLE           hWhalCtrl;
     93     TI_HANDLE           hOs;
     94     TI_HANDLE           hReport;
     95     TI_HANDLE           hAPConn;
     96     TI_HANDLE           hEvHandler;
     97     TI_HANDLE           hTrafficMonitor;
     98     TI_HANDLE           hMemMngr;
     99 
    100 
    101     rateAdaptation_t*   pRateAdaptation;
    102 #ifdef SUPPORT_4X
    103     fourX_t*            pFourX;
    104 #endif
    105     classifier_t*       pClsfr;
    106 
    107     BOOL                ctrlDataRateControlEnable;
    108     BOOL                ctrlDataFourXEnable;
    109     BOOL                ctrlDataCerruentFourXstate;
    110     BOOL                ctrlDataStartStoplinkControlAlg;
    111 
    112     macAddress_t        ctrlDataCurrentBSSID;
    113     bssType_e           ctrlDataCurrentBssType;
    114     UINT32              ctrlDataBasicRateBitMask;
    115     UINT32              ctrlDataCurrentRateMask;
    116     modulationType_e    ctrlDataCurrentModulationType;
    117     rate_e              ctrlDataCurrentBasicRate;
    118     modulationType_e    ctrlDataCurrentBasicModulationType;
    119     preamble_e          ctrlDataCurrentPreambleType;
    120     macAddress_t        ctrlDataDeviceMacAddress;
    121 
    122     BOOL                ctrlDataProtectionEnabled;
    123     RtsCtsStatus_e      ctrlDataRtsCtsStatus;
    124     erpProtectionType_e ctrlDataIbssProtectionType;
    125 
    126     /* rate adaptation tables */
    127     rateTables_t        ctrlDataRateTables;
    128     ctrlData_rateAdapt_t* ctrlDataCurrentRateTable;
    129 
    130     /* Control module counters */
    131     ctrlDataCounters_t  ctrlDataCounters;
    132     /*
    133      * txRatePolicy section
    134      */
    135 
    136     /* txRatePolicies - here we store the policy and set it to the FW */
    137     txRatePolicy_t      ctrlDataTxRatePolicy;
    138 
    139     /* Client supported rates - currently User (all supported) or SG (configured) */
    140     UINT32              currClientRateMask[NUM_OF_RATE_CLASS_CLIENTS];
    141 
    142     /* changing supported rates is done in the next array. We use the change only
    143         on connection - we copy currClientRateMask = nextClientRateMask */
    144     UINT32              nextClientRateMask[NUM_OF_RATE_CLASS_CLIENTS];
    145 
    146     BOOL                bIsClassAvailable[NUM_OF_RATE_CLASS_CLIENTS];
    147 
    148     /* the class ID to use for Tx Data Packets */
    149     rateClassClients_e  currClientRateID;
    150     /* Saves the last wanted configuration of the Client ID, used when in a connection we get
    151         0 supported rates , but in the next connection we get supported rates, thus we use the last one configured */
    152     rateClassClients_e  configuredClientRateID;
    153 
    154     /* number of retries for each rate in each class in the policy that we set to the FW */
    155     policyClassRatesArray_t policyClassRatesArrayCck  [NUM_OF_RATE_CLASS_CLIENTS];
    156     policyClassRatesArray_t policyClassRatesArrayPbcc [NUM_OF_RATE_CLASS_CLIENTS];
    157     policyClassRatesArray_t policyClassRatesArrayOfdm [NUM_OF_RATE_CLASS_CLIENTS];
    158     policyClassRatesArray_t policyClassRatesArrayOfdmA[NUM_OF_RATE_CLASS_CLIENTS];
    159 
    160     /* holds the current used array */
    161     policyClassRatesArray_t *pCurrPolicyClassRatesArray;
    162     /* debug counter */
    163     ctrlDataDbgCounters_t ctrlDataDbgCounters;
    164 
    165     /* Callback for disassociation notification */
    166     disassocSentCB_t    disassocSentCBFunc;
    167     TI_HANDLE           disassocSentCBObj;
    168 
    169     /* Flag to indicate whether traffic intensity events should be sent or not */
    170     BOOL                ctrlDataTrafficIntensityEventsEnabled;
    171     OS_802_11_TRAFFIC_INTENSITY_THRESHOLD_PARAMS ctrlDataTrafficIntensityThresholds;
    172     TI_HANDLE ctrlDataTrafficThresholdEvents[CTRL_DATA_TRAFFIC_INTENSITY_MAX_EVENTS];
    173 
    174     tsrsParameters_t    tsrsParameters[MAX_NUM_OF_AC];
    175 
    176     /* holds last fragmentation threshold */
    177     UINT16              lastFragmentThreshold;
    178 
    179 } ctrlData_t;
    180 
    181 
    182 #endif
    183