Home | History | Annotate | Download | only in Data_link
      1 /*
      2  * DataCtrl_Api.h
      3  *
      4  * Copyright(c) 1998 - 2009 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 /*      PURPOSE:    DataCtrl module api functions header file              */
     39 /*                                                                         */
     40 /***************************************************************************/
     41 
     42 #ifndef _DATA_CTRL_API_H_
     43 #define _DATA_CTRL_API_H_
     44 
     45 #include "paramOut.h"
     46 #include "rxXfer_api.h"
     47 #include "802_11Defs.h"
     48 #include "GeneralUtilApi.h"
     49 #include "DrvMainModules.h"
     50 
     51 /* Include all core Tx modules APIs */
     52 #include "txCtrl_Api.h"
     53 #include "txPort_Api.h"
     54 #include "txDataQueue_Api.h"
     55 #include "txMgmtQueue_Api.h"
     56 
     57 
     58 typedef enum
     59 {
     60     RX_DATA_EAPOL_DESTINATION_PARAM = 0x01,
     61     RX_DATA_PORT_STATUS_PARAM       = 0x02
     62 
     63 } ERxDataParam;
     64 
     65 
     66 /*  RX MODULE   */
     67 /*--------------*/
     68 
     69 /* Rx module interface functions */
     70 
     71 #define RECV_OK                  0x1
     72 #define DIRECTED_BYTES_RECV      0x2
     73 #define DIRECTED_FRAMES_RECV     0x4
     74 #define MULTICAST_BYTES_RECV     0x8
     75 #define MULTICAST_FRAMES_RECV    0x10
     76 #define BROADCAST_BYTES_RECV     0x20
     77 #define BROADCAST_FRAMES_RECV    0x40
     78 
     79 #define NO_RX_NOTIFICATION  0x0
     80 
     81 #define ALL_RCV_FRAME (DIRECTED_FRAMES_RECV|MULTICAST_FRAMES_RECV|BROADCAST_FRAMES_RECV)
     82 
     83 #define  MAX_RX_NOTIF_REQ_ELMENTS 8
     84 
     85 
     86 /*TI_HANDLE rxData_create (msduReceiveCB_t* msduReceiveCB, TI_HANDLE hOs);  */
     87 TI_HANDLE rxData_create (TI_HANDLE hOs);
     88 
     89 void      rxData_init (TStadHandlesList *pStadHandles);
     90 
     91 TI_STATUS rxData_SetDefaults (TI_HANDLE hRxData, rxDataInitParams_t * rxDataInitParams);
     92 
     93 void      rxData_receivePacketFromWlan (TI_HANDLE hRxData, void *pBuffer, TRxAttr* pRxAttr);
     94 
     95 TI_STATUS rxData_stop(TI_HANDLE hRxData);
     96 
     97 TI_STATUS rxData_unLoad(TI_HANDLE hRxData);
     98 
     99 TI_STATUS ctrlData_getParamProtType(TI_HANDLE hCtrlData, erpProtectionType_e *protType);
    100 
    101 TI_STATUS ctrlData_getParamPreamble(TI_HANDLE hCtrlData, EPreamble *preamble);
    102 
    103 TI_STATUS ctrlData_getParamBssid(TI_HANDLE hCtrlData, EInternalParam paramVal, TMacAddr bssid);
    104 
    105 TI_STATUS rxData_getParam(TI_HANDLE hRxData, paramInfo_t *pParamInfo);
    106 
    107 TI_STATUS rxData_setParam(TI_HANDLE hRxData, paramInfo_t *pParamInfo);
    108 
    109 TI_STATUS rxData_getTiwlnCounters(TI_HANDLE hRxData, TIWLN_COUNTERS *pTiwlnCounters);
    110 
    111 void      rxData_resetCounters(TI_HANDLE hRxData);
    112 
    113 TI_HANDLE rxData_RegNotif(TI_HANDLE hRxData,TI_UINT16 EventMask,GeneralEventCall_t CallBack,TI_HANDLE context,TI_UINT32 Cookie);
    114 
    115 TI_STATUS rxData_UnRegNotif(TI_HANDLE hRxData,TI_HANDLE RegEventHandle);
    116 
    117 TI_STATUS rxData_AddToNotifMask(TI_HANDLE hRxData,TI_HANDLE Notifh,TI_UINT16 EventMask);
    118 
    119 void rxData_SetReAuthInProgress(TI_HANDLE hRxData, TI_BOOL	value);
    120 
    121 TI_BOOL rxData_IsReAuthInProgress(TI_HANDLE hRxData);
    122 
    123 void rxData_StopReAuthActiveTimer(TI_HANDLE hRxData);
    124 void rxData_ReauthDisablePriority(TI_HANDLE hRxData);
    125 
    126 /* debug functions */
    127 void rxData_resetDbgCounters(TI_HANDLE hRxData);
    128 void rxData_printRxBlock(TI_HANDLE hRxData);
    129 void rxData_printRxCounters(TI_HANDLE hRxData);
    130 void rxData_startRxThroughputTimer(TI_HANDLE hRxData);
    131 void rxData_stopRxThroughputTimer(TI_HANDLE hRxData);
    132 void rxData_printRxDataFilter(TI_HANDLE hRxData);
    133 
    134 
    135 
    136 /* CONTROL MODULE */
    137 /*----------------*/
    138 
    139 #define XFER_OK                 0x1
    140 #define DIRECTED_BYTES_XFER     0x2
    141 #define DIRECTED_FRAMES_XFER    0x4
    142 #define MULTICAST_BYTES_XFER    0x8
    143 #define MULTICAST_FRAMES_XFER   0x10
    144 #define BROADCAST_BYTES_XFER    0x20
    145 #define BROADCAST_FRAMES_XFER   0x40
    146 
    147 #define  MAX_TX_NOTIF_REQ_ELMENTS 8
    148 
    149 
    150 typedef struct
    151 {
    152     TMacAddr    ctrlDataDeviceMacAddress;
    153 } ctrlDataConfig_t;
    154 
    155 /* retries for the next link test packet Callback */
    156 typedef void (*retriesCB_t)(TI_HANDLE handle, TI_UINT8 ackFailures);
    157 
    158 /*******************************/
    159 /* Control module interface functions */
    160 TI_HANDLE ctrlData_create(TI_HANDLE hOs);
    161 
    162 void      ctrlData_init (TStadHandlesList *pStadHandles,
    163                          retriesCB_t       retriesUpdateCBFunc,
    164                          TI_HANDLE         retriesUpdateCBObj);
    165 
    166 TI_STATUS ctrlData_SetDefaults (TI_HANDLE hCtrlData, ctrlDataInitParams_t *ctrlDataInitParams);
    167 
    168 TI_STATUS ctrlData_unLoad(TI_HANDLE hCtrlData);
    169 
    170 TI_STATUS ctrlData_getParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo);
    171 
    172 TI_STATUS ctrlData_setParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo);
    173 
    174 TI_STATUS ctrlData_stop(TI_HANDLE hCtrlData);
    175 
    176 TI_STATUS ctrlData_getTiwlnCounters(TI_HANDLE hCtrlData, TIWLN_COUNTERS *pTiwlnCounters);
    177 
    178 void ctrlData_updateTxRateAttributes(TI_HANDLE hCtrlData);
    179 
    180 void ctrlData_getCurrBssTypeAndCurrBssId(TI_HANDLE hCtrlData, TMacAddr *pCurrBssid,
    181                                          ScanBssType_e *pCurrBssType);
    182 
    183 void ctrlData_txCompleteStatus(TI_HANDLE hCtrlData, TxResultDescriptor_t *pTxResultInfo,
    184 							   EHwRateBitFiled HwTxRequestRate, TI_UINT8 txPktFlags);
    185 
    186 void ctrlData_ToggleTrafficIntensityNotification (TI_HANDLE hCtrlData, TI_BOOL enabledFlag);
    187 
    188 
    189 /* dbg functions */
    190 /*---------------*/
    191 #ifdef TI_DBG
    192 void ctrlData_printTxParameters(TI_HANDLE hCtrlData);
    193 void ctrlData_printCtrlBlock(TI_HANDLE hCtrlData);
    194 #endif /* TI_DBG */
    195 
    196 
    197 #endif  /* _DATA_CTRL_API_H_ */
    198 
    199