Home | History | Annotate | Download | only in Sta_Management
      1 /*
      2  * qosMngr.h
      3  *
      4  * Copyright(c) 1998 - 2010 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 /** \file qosMngr.h
     36  *  \brief QOS manager module internal header file
     37  *
     38  *  \see qosMngr.c
     39  */
     40 
     41 /***************************************************************************/
     42 /*                                                                         */
     43 /*    MODULE:   qosMgr.h                                                   */
     44 /*    PURPOSE:  QOS manager module internal header file                    */
     45 /*                                                                         */
     46 /***************************************************************************/
     47 #ifndef __QOS_MNGR_H__
     48 #define __QOS_MNGR_H__
     49 
     50 #include "paramOut.h"
     51 #include "trafficAdmControl.h"
     52 
     53 /*
     54  *          Defines
     55  */
     56 
     57 #define QOS_MNGR_INIT_BIT_LOCAL_VECTOR     (0x01)
     58 #define QOS_MNGR_INIT_BIT_ADM_CTRL     (0x02)
     59 
     60 #define AC_PARAMS_AIFSN_MASK               (0x0f)
     61 #define AC_PARAMS_ACI_MASK                 (0x60)
     62 #define AC_PARAMS_CWMIN_MASK               (0x0f)
     63 #define AC_PARAMS_CWMAX_MASK               (0xf0)
     64 #define AC_PARAMS_ACM_MASK                 (0x10)
     65 
     66 #define MAX_ENABLED_PS_RX_STREAMS          4
     67 
     68 #if 0
     69 #define PS_PARAMETERS_LEGACY                    (0)
     70 #define PS_PARAMETERS_UPSD_TRIGGER_ENABLE_MASK  (0x01)
     71 #define PS_PARAMETERS_UPSD_DELIVERY_ENABLE_MASK (0x02)
     72 #define PS_UPSD_TRIGER_AND_DELIVERY (PS_PARAMETERS_UPSD_TRIGGER_ENABLE_MASK | PS_PARAMETERS_UPSD_DELIVERY_ENABLE_MASK)
     73 
     74 #define CONVERT_DRIVER_PS_MODE_TO_FW(PsMode_e)  ((PsMode_e == UPSD) ? PS_UPSD_TRIGER_AND_DELIVERY : PS_PARAMETERS_LEGACY)
     75 #endif
     76 
     77 
     78 /*
     79  *          Enumerations
     80  */
     81 #define RX_QUEUE_WIN_SIZE       8
     82 
     83 typedef enum
     84 {
     85     BA_POLICY_DISABLE                                   =   0,
     86     BA_POLICY_INITIATOR                                 =   1,
     87     BA_POLICY_RECEIVER                                  =   2,
     88     BA_POLICY_INITIATOR_AND_RECEIVER                    =   3
     89 } EqosMngrBaPolicy;
     90 
     91 
     92 /*
     93  *          Structures
     94  */
     95 
     96 typedef struct
     97 {
     98     tspecInfo_t     currentTspecInfo[MAX_NUM_OF_AC];
     99     tspecInfo_t     candidateTspecInfo[MAX_NUM_OF_AC];
    100     TI_UINT16       totalAllocatedMediumTime;
    101 }resourceMgmt_t;
    102 
    103 /*
    104  * per AC parameters
    105  */
    106 typedef struct
    107 {
    108     TQueueTrafficParams   QtrafficParams;    /* AC traffic confogiration params */
    109     TQueueTrafficParams   QTrafficInitParams;/* for disconnect - defaults traffic params */
    110     TAcQosParams          acQosParams;
    111     TAcQosParams          acQosInitParams;
    112     AckPolicy_e           wmeAcAckPolicy;     /* ack policy per AC               */
    113     PSScheme_e            currentWmeAcPsMode; /* current wme per ac power save mode */
    114     PSScheme_e            desiredWmeAcPsMode; /* desired wme per ac power save mode */
    115     EAdmissionState       apInitAdmissionState; /* AC admission state              */
    116     TI_UINT32             msduLifeTimeParam;
    117 }acParams_t;
    118 
    119 
    120 typedef TI_STATUS (*qosMngrCallb_t) (TI_HANDLE hApConn, trafficAdmRequestStatus_e result);
    121 
    122 /*
    123  *  qosMngr handle
    124  */
    125 
    126 typedef struct
    127 {
    128     TI_HANDLE           hSiteMgr;
    129     TI_HANDLE           hTWD;
    130     TI_HANDLE           hTxCtrl;
    131     TI_HANDLE           hTxMgmtQ;
    132     TI_HANDLE           hEvHandler;
    133     TI_HANDLE           hRoamMng;
    134 
    135     TI_HANDLE           hMeasurementMngr;
    136     TI_HANDLE           hSmeSm;
    137     TI_HANDLE           hCtrlData;
    138     TI_HANDLE           hXCCMgr;
    139 
    140     TI_HANDLE           hReport;
    141     TI_HANDLE           hOs;
    142     TI_HANDLE           hTimer;
    143     TI_HANDLE           hStaCap;
    144 
    145     TI_BOOL             WMEEnable;                           /* driver supports WME protocol       */
    146     TI_BOOL             WMESiteSupport;                      /* site support WME protocol          */
    147     EQosProtocol        activeProtocol;                      /* active protocol: XCC,WME or none.  */
    148     TI_BOOL             tagZeroConverHeader;                 /* converting tag zero headers        */
    149 
    150     TI_UINT8            qosPacketBurstEnable;                /* Packet Burst is Enable or NOT      */
    151     TI_UINT32           qosPacketBurstTxOpLimit;             /* TxOp limit in case of NON_QOS */
    152                                                              /* protocol and Packet Burst is Enable */
    153 
    154     acParams_t          acParams[MAX_NUM_OF_AC];             /* per ac parameters                  */
    155 
    156     TI_BOOL             isConnected;                         /* Connected or not ?                       */
    157     PSScheme_e          desiredPsMode;                       /* The desired PS mode of the station */
    158     PSScheme_e          currentPsMode;                       /* The current PS mode of the station */
    159     TI_UINT8            ApQosCapabilityParameters;
    160     TI_UINT8            desiredMaxSpLen;
    161 
    162     EHeaderConvertMode  headerConvetMode;
    163     TRxTimeOut          rxTimeOut;
    164 
    165     /* PS Rx streaming parameters */
    166     TPsRxStreaming      aTidPsRxStreaming[MAX_NUM_OF_802_1d_TAGS];/* Per TID PS-Rx-Streaming configured parameters */
    167     TI_UINT32           uNumEnabledPsRxStreams;             /* the number of enabled TID-PS-Rx-Streams */
    168 
    169     /* traffic admission control parameters */
    170     TI_BOOL             trafficAdmCtrlEnable;                /* driver supports Admission control  */
    171     trafficAdmCtrl_t    *pTrafficAdmCtrl;                    /* adm ctrl object */
    172     resourceMgmt_t      resourceMgmtTable;
    173     TI_UINT8            QosNullDataTemplateUserPriority;     /* Holds the last User Priority set into the firmware in the QOS Null data template */
    174 
    175     TI_BOOL             performTSPECRenegotiation;
    176     TI_BOOL             voiceTspecConfigured;
    177     TI_BOOL		        videoTspecConfigured;
    178     TI_HANDLE           TSPECNegotiationResultModule;
    179     qosMngrCallb_t      TSPECNegotiationResultCallb;
    180     OS_802_11_QOS_TSPEC_PARAMS  tspecRenegotiationParams[MAX_NUM_OF_AC];
    181 
    182     TI_BOOL             bCwFromUserEnable;
    183     TI_UINT8            uDesireCwMin;		/**< The contention window minimum size (in slots) from ini file */
    184     TI_UINT16           uDesireCwMax;		/**< The contention window maximum size (in slots) from ini file */
    185 
    186     /* 802.11n BA session */
    187     TI_UINT8               aBaPolicy[MAX_NUM_OF_802_1d_TAGS];
    188     TI_UINT16              aBaInactivityTimeout[MAX_NUM_OF_802_1d_TAGS];
    189 	TI_BOOL				bEnableBurstMode;
    190 } qosMngr_t;
    191 
    192 
    193 #endif /* QOS_MNGR_H */
    194