Data Structures | Macros | Functions | Variables
driver.c File Reference
#include "simplelink.h"
#include "protocol.h"
#include "driver.h"
#include "flowcont.h"
+ Include dependency graph for driver.c:

Data Structures

union  _SlBasicCmdMsg_u
 
struct  _SlStatMem_t
 
struct  OpcodeKeyVal_t
 

Macros

#define _SL_PENDING_RX_MSG(pDriverCB)   (RxIrqCnt != (pDriverCB)->RxDoneCnt)
 
#define ACT_DATA_SIZE(_ptr)   (((_SocketAddrResponse_u *)(_ptr))->IpV4.statusOrLen)
 
#define BUF_SYNC_SPIM(pBuf)   ((*(_u32 *)(pBuf)) & N2H_SYNC_SPI_BUGS_MASK)
 
#define MATCH_WITH_SEQ_NUM(pBuf, TxSeqNum)   ( BUF_SYNC_SPIM(pBuf) == (N2H_SYNC_SPIM_WITH_SEQ(TxSeqNum)) )
 
#define MATCH_WOUT_SEQ_NUM(pBuf)   ( BUF_SYNC_SPIM(pBuf) == N2H_SYNC_SPIM )
 
#define N2H_SYNC_PATTERN_MASK   ((_u32)0xFFFFFFF8) /* Bits 3..31 - constant SYNC PATTERN */
 
#define N2H_SYNC_PATTERN_MATCH(pBuf, TxSeqNum)
 
#define N2H_SYNC_PATTERN_SEQ_NUM_BITS   ((_u32)0x00000003) /* Bits 0..1 - use the 2 LBS for seq num */
 
#define N2H_SYNC_PATTERN_SEQ_NUM_EXISTS   ((_u32)0x00000004) /* Bit 2 - sign that sequence number exists in the sync pattern */
 
#define N2H_SYNC_SPI_BUGS_MASK   ((_u32)0x7FFF7F7F) /* Bits 7,15,31 - ignore the SPI (8,16,32 bites bus) error bits */
 
#define N2H_SYNC_SPIM   (N2H_SYNC_PATTERN & N2H_SYNC_SPI_BUGS_MASK)
 
#define N2H_SYNC_SPIM_WITH_SEQ(TxSeqNum)   ((N2H_SYNC_SPIM & N2H_SYNC_PATTERN_MASK) | N2H_SYNC_PATTERN_SEQ_NUM_EXISTS | ((TxSeqNum) & (N2H_SYNC_PATTERN_SEQ_NUM_BITS)))
 
#define OPCODE(_ptr)   (((_SlResponseHeader_t *)(_ptr))->GenHeader.Opcode)
 
#define RSP_PAYLOAD_LEN(_ptr)   (((_SlResponseHeader_t *)(_ptr))->GenHeader.Len - _SL_RESP_SPEC_HDR_SIZE)
 
#define SD(_ptr)   (((_SocketAddrResponse_u *)(_ptr))->IpV4.sd)
 

Functions

static void _SlAsyncEventGenericHandler (_u8 bInCmdContext)
 
void _SlDriverHandleError (SlDeviceDriverError_e eError, _u32 info1, _u32 info2)
 
_i16 _SlDrvBasicCmd (_SlOpcode_t Opcode)
 
static _SlReturnVal_t _SlDrvClassifyRxMsg (_SlOpcode_t Opcode)
 
_SlReturnVal_t _SlDrvCmdOp (_SlCmdCtrl_t *pCmdCtrl, void *pTxRxDescBuff, _SlCmdExt_t *pCmdExt)
 
_SlReturnVal_t _SlDrvCmdSend (_SlCmdCtrl_t *pCmdCtrl, void *pTxRxDescBuff, _SlCmdExt_t *pCmdExt)
 
_SlReturnVal_t _SlDrvDataReadOp (_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl, void *pTxRxDescBuff, _SlCmdExt_t *pCmdExt)
 
_SlReturnVal_t _SlDrvDataWriteOp (_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl, void *pTxRxDescBuff, _SlCmdExt_t *pCmdExt)
 
_SlReturnVal_t _SlDrvDriverCBDeinit (void)
 
_SlReturnVal_t _SlDrvDriverCBInit (void)
 
_SlReturnVal_t _SlDrvGlobalObjUnLock (void)
 
void _SlDrvMemZero (void *Addr, _u16 size)
 
static _SlReturnVal_t _SlDrvMsgRead (void)
 
static _SlReturnVal_t _SlDrvMsgReadCmdCtx (_u16 cmdOpcode)
 
_SlReturnVal_t _SlDrvMsgReadSpawnCtx (void *pValue)
 
static _SlReturnVal_t _SlDrvMsgWrite (_SlCmdCtrl_t *pCmdCtrl, _SlCmdExt_t *pCmdExt, _u8 *pTxRxDescBuff)
 
static _SlReturnVal_t _SlDrvObjGlobalLockWaitForever (void)
 
_SlReturnVal_t _SlDrvObjLockWaitForever (_SlLockObj_t *pLockObj)
 
_SlReturnVal_t _SlDrvObjUnLock (_SlLockObj_t *pLockObj)
 
_u8 _SlDrvProtectAsyncRespSetting (_u8 *pAsyncRsp, _SlActionID_e ActionID, _u8 SocketID)
 
_SlReturnVal_t _SlDrvProtectionObjLockWaitForever (void)
 
_SlReturnVal_t _SlDrvProtectionObjUnLock (void)
 
void _SlDrvReleasePoolObj (_u8 ObjIdx)
 
void _SlDrvResetCmdExt (_SlCmdExt_t *pCmdExt)
 
static _SlReturnVal_t _SlDrvRxHdrRead (_u8 *pBuf, _u8 *pAlignSize)
 
_SlReturnVal_t _SlDrvRxIrqHandler (void *pValue)
 
_SlReturnVal_t _SlDrvSyncObjSignal (_SlSyncObj_t *pSyncObj)
 
_SlReturnVal_t _SlDrvSyncObjWaitForever (_SlSyncObj_t *pSyncObj)
 
_SlReturnVal_t _SlDrvSyncObjWaitTimeout (_SlSyncObj_t *pSyncObj, _u32 timeoutVal, SlDriverAPIWithTimeout_e apiIdx)
 
_u8 _SlDrvWaitForPoolObj (_u8 ActionID, _u8 SocketID)
 
static _SlReturnVal_t _SlFindAndSetActiveObj (_SlOpcode_t Opcode, _u8 Sd)
 
static void _SlRemoveFromList (_u8 *ListIndex, _u8 ItemIndex)
 

Variables

const _SlActionLookup_t _SlActionLookupTable []
 
_volatile _u8 g_bDeviceRestartIsRequired
 
static const _SlSyncPattern_t g_H2NCnysPattern = H2N_CNYS_PATTERN
 
static const _SlSyncPattern_t g_H2NSyncPattern = H2N_SYNC_PATTERN
 
_SlDriverCb_tg_pCB = NULL
 
_u16 g_SlDeviceStatus = 0
 
static _SlStatMem_t g_StatMem
 
static _u8 gFirstCmdMode = 0
 
const OpcodeKeyVal_t OpcodeTranslateTable []
 
P_SL_DEV_PING_CALLBACK pPingCallBackFunc = NULL
 
_volatile _u8 RxIrqCnt
 
static const _SlSpawnEntryFunc_t RxMsgClassLUT []
 

Macro Definition Documentation

#define _SL_PENDING_RX_MSG (   pDriverCB)    (RxIrqCnt != (pDriverCB)->RxDoneCnt)
#define ACT_DATA_SIZE (   _ptr)    (((_SocketAddrResponse_u *)(_ptr))->IpV4.statusOrLen)
#define BUF_SYNC_SPIM (   pBuf)    ((*(_u32 *)(pBuf)) & N2H_SYNC_SPI_BUGS_MASK)
#define MATCH_WITH_SEQ_NUM (   pBuf,
  TxSeqNum 
)    ( BUF_SYNC_SPIM(pBuf) == (N2H_SYNC_SPIM_WITH_SEQ(TxSeqNum)) )
#define MATCH_WOUT_SEQ_NUM (   pBuf)    ( BUF_SYNC_SPIM(pBuf) == N2H_SYNC_SPIM )
#define N2H_SYNC_PATTERN_MASK   ((_u32)0xFFFFFFF8) /* Bits 3..31 - constant SYNC PATTERN */
#define N2H_SYNC_PATTERN_MATCH (   pBuf,
  TxSeqNum 
)
Value:
( \
( (*((_u32 *)pBuf) & N2H_SYNC_PATTERN_SEQ_NUM_EXISTS) && ( MATCH_WITH_SEQ_NUM(pBuf, TxSeqNum) ) ) || \
( !(*((_u32 *)pBuf) & N2H_SYNC_PATTERN_SEQ_NUM_EXISTS) && ( MATCH_WOUT_SEQ_NUM(pBuf ) ) ) \
)
#define N2H_SYNC_PATTERN_SEQ_NUM_EXISTS
Definition: driver.c:55
#define MATCH_WITH_SEQ_NUM(pBuf, TxSeqNum)
Definition: driver.c:63
#define MATCH_WOUT_SEQ_NUM(pBuf)
Definition: driver.c:62
#define N2H_SYNC_PATTERN_SEQ_NUM_BITS   ((_u32)0x00000003) /* Bits 0..1 - use the 2 LBS for seq num */
#define N2H_SYNC_PATTERN_SEQ_NUM_EXISTS   ((_u32)0x00000004) /* Bit 2 - sign that sequence number exists in the sync pattern */
#define N2H_SYNC_SPI_BUGS_MASK   ((_u32)0x7FFF7F7F) /* Bits 7,15,31 - ignore the SPI (8,16,32 bites bus) error bits */
#define N2H_SYNC_SPIM   (N2H_SYNC_PATTERN & N2H_SYNC_SPI_BUGS_MASK)
#define N2H_SYNC_SPIM_WITH_SEQ (   TxSeqNum)    ((N2H_SYNC_SPIM & N2H_SYNC_PATTERN_MASK) | N2H_SYNC_PATTERN_SEQ_NUM_EXISTS | ((TxSeqNum) & (N2H_SYNC_PATTERN_SEQ_NUM_BITS)))
#define OPCODE (   _ptr)    (((_SlResponseHeader_t *)(_ptr))->GenHeader.Opcode)
#define RSP_PAYLOAD_LEN (   _ptr)    (((_SlResponseHeader_t *)(_ptr))->GenHeader.Len - _SL_RESP_SPEC_HDR_SIZE)
#define SD (   _ptr)    (((_SocketAddrResponse_u *)(_ptr))->IpV4.sd)

Function Documentation

static void _SlAsyncEventGenericHandler ( _u8  bInCmdContext)
static

+ Here is the caller graph for this function:

void _SlDriverHandleError ( SlDeviceDriverError_e  eError,
_u32  info1,
_u32  info2 
)

+ Here is the caller graph for this function:

_i16 _SlDrvBasicCmd ( _SlOpcode_t  Opcode)

+ Here is the call graph for this function:

static _SlReturnVal_t _SlDrvClassifyRxMsg ( _SlOpcode_t  Opcode)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

_SlReturnVal_t _SlDrvCmdOp ( _SlCmdCtrl_t pCmdCtrl,
void *  pTxRxDescBuff,
_SlCmdExt_t pCmdExt 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

_SlReturnVal_t _SlDrvCmdSend ( _SlCmdCtrl_t pCmdCtrl,
void *  pTxRxDescBuff,
_SlCmdExt_t pCmdExt 
)

+ Here is the call graph for this function:

_SlReturnVal_t _SlDrvDataReadOp ( _SlSd_t  Sd,
_SlCmdCtrl_t pCmdCtrl,
void *  pTxRxDescBuff,
_SlCmdExt_t pCmdExt 
)

+ Here is the call graph for this function:

_SlReturnVal_t _SlDrvDataWriteOp ( _SlSd_t  Sd,
_SlCmdCtrl_t pCmdCtrl,
void *  pTxRxDescBuff,
_SlCmdExt_t pCmdExt 
)

+ Here is the call graph for this function:

_SlReturnVal_t _SlDrvDriverCBDeinit ( void  )
_SlReturnVal_t _SlDrvDriverCBInit ( void  )

+ Here is the call graph for this function:

_SlReturnVal_t _SlDrvGlobalObjUnLock ( void  )
void _SlDrvMemZero ( void *  Addr,
_u16  size 
)

+ Here is the caller graph for this function:

static _SlReturnVal_t _SlDrvMsgRead ( void  )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static _SlReturnVal_t _SlDrvMsgReadCmdCtx ( _u16  cmdOpcode)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

_SlReturnVal_t _SlDrvMsgReadSpawnCtx ( void *  pValue)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static _SlReturnVal_t _SlDrvMsgWrite ( _SlCmdCtrl_t pCmdCtrl,
_SlCmdExt_t pCmdExt,
_u8 pTxRxDescBuff 
)
static

+ Here is the caller graph for this function:

static _SlReturnVal_t _SlDrvObjGlobalLockWaitForever ( void  )
static
_SlReturnVal_t _SlDrvObjLockWaitForever ( _SlLockObj_t pLockObj)
_SlReturnVal_t _SlDrvObjUnLock ( _SlLockObj_t pLockObj)
_u8 _SlDrvProtectAsyncRespSetting ( _u8 pAsyncRsp,
_SlActionID_e  ActionID,
_u8  SocketID 
)

+ Here is the call graph for this function:

_SlReturnVal_t _SlDrvProtectionObjLockWaitForever ( void  )
_SlReturnVal_t _SlDrvProtectionObjUnLock ( void  )
void _SlDrvReleasePoolObj ( _u8  ObjIdx)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void _SlDrvResetCmdExt ( _SlCmdExt_t pCmdExt)

+ Here is the call graph for this function:

static _SlReturnVal_t _SlDrvRxHdrRead ( _u8 pBuf,
_u8 pAlignSize 
)
static

+ Here is the caller graph for this function:

_SlReturnVal_t _SlDrvRxIrqHandler ( void *  pValue)

+ Here is the call graph for this function:

_SlReturnVal_t _SlDrvSyncObjSignal ( _SlSyncObj_t pSyncObj)
_SlReturnVal_t _SlDrvSyncObjWaitForever ( _SlSyncObj_t pSyncObj)

+ Here is the caller graph for this function:

_SlReturnVal_t _SlDrvSyncObjWaitTimeout ( _SlSyncObj_t pSyncObj,
_u32  timeoutVal,
SlDriverAPIWithTimeout_e  apiIdx 
)

+ Here is the call graph for this function:

_u8 _SlDrvWaitForPoolObj ( _u8  ActionID,
_u8  SocketID 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static _SlReturnVal_t _SlFindAndSetActiveObj ( _SlOpcode_t  Opcode,
_u8  Sd 
)
static

+ Here is the caller graph for this function:

static void _SlRemoveFromList ( _u8 ListIndex,
_u8  ItemIndex 
)
static

+ Here is the caller graph for this function:

Variable Documentation

const _SlActionLookup_t _SlActionLookupTable[]
Initial value:
=
{
}
#define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE
Definition: protocol.h:277
#define SL_OPCODE_SOCKET_CONNECTASYNCRESPONSE
Definition: protocol.h:240
_SlReturnVal_t _sl_HandleAsync_Accept(void *pVoidBuf)
Definition: socket.c:893
#define SL_OPCODE_NETAPP_PINGREPORTREQUESTRESPONSE
Definition: protocol.h:287
Definition: driver.h:197
#define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE
Definition: protocol.h:269
_SlReturnVal_t _sl_HandleAsync_Select(void *pVoidBuf)
Definition: socket.c:912
_SlReturnVal_t _sl_HandleAsync_DnsGetHostByService(void *pVoidBuf)
Definition: netapp.c:788
void _sl_HandleAsync_Stop(void *pVoidBuf)
Definition: device.c:207
_SlReturnVal_t _sl_HandleAsync_PingResponse(void *pVoidBuf)
Definition: netapp.c:990
_SlReturnVal_t _sl_HandleAsync_DnsGetHostByName(void *pVoidBuf)
Definition: netapp.c:950
#define SL_OPCODE_DEVICE_STOP_ASYNC_RESPONSE
Definition: protocol.h:156
_SlReturnVal_t _sl_HandleAsync_Connect(void *pVoidBuf)
Definition: socket.c:590
Definition: driver.h:200
short(* _SlSpawnEntryFunc_t)(void *pValue)
Definition: simplelink.h:726
Definition: driver.h:199
Definition: driver.h:189
#define SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE
Definition: protocol.h:230
#define SL_OPCODE_SOCKET_SELECTASYNCRESPONSE
Definition: protocol.h:243
Definition: driver.h:195
Definition: driver.h:202
Definition: driver.h:190
_volatile _u8 g_bDeviceRestartIsRequired
const _SlSyncPattern_t g_H2NCnysPattern = H2N_CNYS_PATTERN
static
const _SlSyncPattern_t g_H2NSyncPattern = H2N_SYNC_PATTERN
static
_SlDriverCb_t* g_pCB = NULL
_u16 g_SlDeviceStatus = 0
_SlStatMem_t g_StatMem
static
_u8 gFirstCmdMode = 0
static
const OpcodeKeyVal_t OpcodeTranslateTable[]
Initial value:
=
{
}
#define SL_OPCODE_WLAN_STA_DISCONNECTED
Definition: protocol.h:220
#define SL_WLAN_DISCONNECT_EVENT
Definition: device.h:185
#define SL_OPCODE_WLAN_P2P_NEG_REQ_RECEIVED
Definition: protocol.h:167
#define SL_OPCODE_NETAPP_IP_RELEASED
Definition: protocol.h:306
#define SL_OPCODE_WLAN_STA_CONNECTED
Definition: protocol.h:219
#define SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE
Definition: protocol.h:209
#define SL_OPCODE_WLAN_WLANASYNCDISCONNECTEDRESPONSE
Definition: protocol.h:171
#define SL_OPCODE_SOCKET_TXFAILEDASYNCRESPONSE
Definition: protocol.h:256
#define SL_OPCODE_WLAN_P2P_DEV_FOUND
Definition: protocol.h:165
#define SL_NETAPP_IPV6_IPACQUIRED_EVENT
Definition: device.h:214
#define SL_NETAPP_IP_LEASED_EVENT
Definition: device.h:215
#define SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT
Definition: device.h:194
#define SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE
Definition: protocol.h:212
#define SL_WLAN_SMART_CONFIG_STOP_EVENT
Definition: device.h:188
#define SL_OPCODE_NETAPP_IPACQUIRED_V6
Definition: protocol.h:295
#define SL_SOCKET_ASYNC_EVENT
Definition: device.h:211
#define SL_NETAPP_IP_RELEASED_EVENT
Definition: device.h:216
#define SL_WLAN_SMART_CONFIG_COMPLETE_EVENT
Definition: device.h:187
#define SL_WLAN_P2P_DEV_FOUND_EVENT
Definition: device.h:193
#define SL_NETAPP_IPV4_IPACQUIRED_EVENT
Definition: device.h:213
#define SL_OPCODE_NETAPP_IPACQUIRED
Definition: protocol.h:292
#define SL_WLAN_STA_DISCONNECTED_EVENT
Definition: device.h:191
#define SL_OPCODE_SOCKET_SOCKETASYNCEVENT
Definition: protocol.h:257
#define SL_OPCODE_WLAN_CONNECTION_FAILED
Definition: protocol.h:166
#define SL_WLAN_CONNECT_EVENT
Definition: device.h:184
#define SL_OPCODE_NETAPP_IP_LEASED
Definition: protocol.h:305
#define SL_WLAN_CONNECTION_FAILED_EVENT
Definition: device.h:195
#define SL_WLAN_STA_CONNECTED_EVENT
Definition: device.h:190
#define SL_SOCKET_TX_FAILED_EVENT
Definition: device.h:210
#define SL_OPCODE_WLAN_WLANASYNCCONNECTEDRESPONSE
Definition: protocol.h:164
P_SL_DEV_PING_CALLBACK pPingCallBackFunc = NULL
_volatile _u8 RxIrqCnt
const _SlSpawnEntryFunc_t RxMsgClassLUT[]
static
Initial value:
= {
NULL,
NULL,
NULL,
}
#define NULL
Definition: BCDS_Basics.h:80
_SlReturnVal_t _SlDrvDeviceEventHandler(void *pEventInfo)
Definition: device.c:509
short(* _SlSpawnEntryFunc_t)(void *pValue)
Definition: simplelink.h:726

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:24 by doxygen 1.8.8