salld.h File Reference

SA LLD Interface Unit API and Data Definitions. More...

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <ti/drv/sa/saver.h>

Go to the source code of this file.

Data Structures

struct  Sa_ChanSizeCfg_t
 SALLD channel size configuration structure. More...
struct  Sa_ChanConfig_t
 SALLD Channel Configuration structure. More...
struct  Sa_SrtpConfigParams_t
 SRTP Configuration Parameters structure. More...
struct  Sa_IpsecConfigParams_t
 IPSEC Configuration Parameters structure. More...
struct  Sa_AcConfigParams_t
 AC (Air Ciphering) Configuration Parameters structure. More...
struct  Sa_DataModeConfigParams_t
 Data Mode Configuration Parameters structure. More...
union  Sa_ProtocolConfigParams_t
 SALLD Protocol-specfic Configuration Parameters structure. More...
struct  Sa_DestInfo_t
 SALLD Destination Info structure. More...
struct  Sa_GenConfigParams_t
 SALLD General Configuration Parameters structure. More...
struct  Sa_GenCtrlInfo_t
 SALLD General Control Information structure. More...
struct  Sa_SrtpKeyParams_t
 SRTP Key Information structure. More...
struct  Sa_IpsecKeyParams_t
 IPSEC Key Information structure. More...
struct  Sa_AcKeyParams_t
 Air Ciphering Key Information structure. More...
struct  Sa_DataModeKeyParams_t
 Data Mode Key Information structure. More...
union  Sa_ProtocolKeyParams_t
 Protocol-Specific Key Information structure. More...
struct  Sa_KeyCtrlInfo_t
 SALLD Key Control Information structure. More...
struct  Sa_ChanCtrlInfo_t
 Channel Control Information structure. More...
struct  Sa_SWInfo_t
 SA Software Information structure. More...
struct  Sa_CmdLbParamInfo_t
 SA Command Label Parameter Information structure. More...
struct  Sa_CmdLbUpdateInfo_t
 SA Command Label Updating Information structure. More...
struct  Sa_CmdLabelInfo_t
 SA Command Label Information structure. More...
struct  Sa_PayloadInfo_t
 SA Payload Information structure. More...
struct  Sa_ipsecNatTInfo_t
 SA IPSEC NAT-T structure. More...
struct  Sa_PktDesc_t
 Packet Descriptor structure. More...
struct  Sa_PktInfo_t
 Packet Information structure. More...
struct  Sa_SrtpKeyRequest_t
 SRTP Key Request structure. More...
struct  Sa_KeyRequest_t
 Key Request structure. More...
struct  Sa_ScReqInfo_t
 Security Context Request Information structure. More...
struct  Sa_Replay_Cxt_tag
 SALLD Replay Window Context. More...
struct  Sa_SrtpStats_t
 SALLD SRTP Statistics Structure. More...
struct  Sa_SrtcpStats_t
 SALLD SRTCP Statistics Structure. More...
struct  Sa_IpsecStats_t
 SALLD IPSEC Statistics Structure. More...
struct  Sa_AcStats_t
 SALLD Air Ciphering Statistics Structure. More...
struct  Sa_DataModeStats_t
 SALLD Data Mode Statistics Structure. More...
union  Sa_Stats_t
 SALLD Statistics Structure. More...
struct  Sa_CallOutFuns_s
 The SALLD Call-out function table. More...
struct  Sa_SizeCfg_t
 SA Size Configuration Structure. More...
struct  Sa_Config_t
 SALLD Configuration structure. More...
struct  Sa_SrtpSysStats_t
 SALLD SRTP System Statistics Structure. More...
struct  Sa_IpsecSysStats_t
 SALLD IPSEC System Statistics Structure. More...
struct  Sa_AcSysStats_t
 SALLD Air Ciphering System Statistics Structure. More...
struct  Sa_ErrorSysStats_t
 SALLD Error System Statistics Structure. More...
struct  Sa_SysStats_s
 SALLD Statistics Structure. More...
struct  Sa_PkaReqInfo_t
 SALLD PKA Operation Request Structure. More...
struct  Sa_RngConfigParams_t
 SALLD RNG Configuration Structure. More...
struct  Sa_RngData_t
 SALLD RNG Output Structure. More...
struct  Sa_psInfo_t
 Sa_psInfo_t defines the PS Info data used by SASS. More...

Defines

#define SALLD_MAX_KEY_SIZE   32
 Define the maximum key size supported by SASS.
#define sa_MAX_SW_INFO_SIZE   3
 Define the maxmium number of software info parameters at Sa_SWInfo_t.
#define sa_SWINFO_UPDATE_DEST_INFO(info, queueID, flowIndex)
 sa_SWINFO_UPDATE_DEST_INFO is used to update the destination information within swInfo[2] at Sa_SWInfo_t
#define sa_MAX_CMDLB_SIZE   96
 Define the maxmium size of the command label stored at cmdLbBuf of Sa_CmdLabelInfo_t.
#define sa_SC_ID_MASK   0x7FFF
#define sa_SC_IND_PERMANENT   0x8000
#define sa_MAX_REPLAY_WINDOW_SIZE   128
 Define the maxmium replay window size supported by SASS.
#define sa_MAX_PKA_OPERAND_SIZE   128
#define sa_MAX_PKA_OPERAND_SIZE_EXP4   64
#define sa_N_BUFS   1
 Define the maximum number of buffers the module (SALLD) can request.
#define sa_CHAN_N_BUFS   1
 Define the maximum number of buffers each SA LLD channel can request.
#define sa_RESET_SUBSYSTEM()
 sa_RESET_SUBSYSTEM is used to reset the SA Sub-System (PDSPs)
#define sa_ENABLE_SUBSYSTEM()
 sa_ENABLE_SUBSYSTEM enables the SA subsystem.
#define sa_DOWNLOAD_MODULE(id, img, size)   SYSTEM_COPY(pSaRegs->PDSP_IRAM[id].DATA, img, size)
 sa_DOWNLOAD_MODULE downloads an image
#define sa_GET_SYSTEM_STATE(x)
 sa_GET_SYSETM_STATE returns the state of the SA subsystem
SALLD Debug message types

Debug message types used by debugInfo().

#define sa_DBG_INFORMATIONAL   0
#define sa_DBG_WARNING   1
#define sa_DBG_FATAL_ERROR   2
SALLD Debug message codes

Debug message codes used by debugInfo().

#define sa_MSG_NO_MKI_LEN_CHANGE_ON_FLY   1
#define sa_MSG_MKI_LEN_IS_ZERO   2
SALLD Sub-System Queries and States

SA Sub-System reset state and query arguments used by API function Sa_resetControl

#define sa_STATE_RESET   0
#define sa_STATE_ENABLE   1
#define sa_STATE_QUERY   2
#define sa_STATE_INCONSISTENT   3
#define sa_STATE_INVALID_REQUEST   4
#define sa_STATE_ENABLE_FAILED   5
#define sa_STATE_INVALID   6
SALLD Function Return Codes

Error codes returned by SALLD API functions.

#define sa_ERR_OK   0
#define sa_ERR_GEN   -1
#define sa_ERR_PARAMS   -2
#define sa_ERR_NOMEM   -3
#define sa_ERR_INV_BUF   -4
#define sa_ERR_INV_PROTO_TYPE   -5
#define sa_ERR_NO_CTX_BUF   -6
#define sa_ERR_KEY_EXPIRED   -7
#define sa_ERR_REPLAY_OLD   -8
#define sa_ERR_REPLAY_DUP   -9
#define sa_ERR_AUTH_FAIL   -10
#define sa_ERR_PADDING_FAIL   -11
#define sa_ERR_CLOSE_PENDING   -12
#define sa_ERR_UNSUPPORTED   -13
#define sa_ERR_STATS_UNAVAIL   -14
#define sa_ERR_MODULE_BUSY   -15
#define sa_ERR_MODULE_UNAVAIL   -16
#define sa_ERR_PKA_TIMEOUT   -17
#define sa_ERR_SWINFO_UNAVAIL   -18
#define sa_ERR_INV_HANDLE   -19
#define sa_ERR_INV_ENDIAN_MODE   -20
#define sa_ERR_SCRATCH_MEMORY_FULL   -21
#define sa_ERR_INV_INT_MEM   -22
SA Size Configuration Control Bit Definitions

Bitmap definition of the ctrlBitMap in Sa_ChanSizeCfg_t and Sa_SizeCfg_t.

#define sa_SIZE_CONFIG_CREATE_SHADOW_INST   0x0001
IPSEC Configuration Control Bit Definitions

Bitmap definition of the ctrlBitMap in salldInpsecConfigParams_t.

#define sa_IPSEC_CONFIG_ESN   0x0001
#define sa_IPSEC_CONFIG_PERMANENT_SC   0x0002
AC Configuration Control Bit Definitions

Bitmap definition of the ctrlBitMap in Sa_AcConfigParams_t.

#define sa_AC_CONFIG_BEARER_MASK   0x00FF
#define sa_AC_CONFIG_DIR   0x0100
#define sa_AC_CONFIG_COPY_COUNTC   0x0200
#define sa_AC_CONFIG_KEY_IN_SCRATCH   0x0400
SALLD General Control Info Valid Bit Definitions

Bitmap definition of the validBitfield in Sa_GenCtrlInfo_t. It allows selective control parameters

#define sa_CONTROLINFO_VALID_CTRL_BITMAP   0x0001
#define sa_CONTROLINFO_VALID_TX_CTRL   0x0002
#define sa_CONTROLINFO_VALID_RX_CTRL   0x0004
#define sa_CONTROLINFO_VALID_REPLAY_WIN   0x0008
SALLD General Control Info Control Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_GenCtrlInfo_t. It allows selective enabling/disabling of specific SALLD operations

#define sa_CONTROLINFO_CTRL_TX_ON   0x0001
#define sa_CONTROLINFO_CTRL_RX_ON   0x0002
#define sa_CONTROLINFO_CTRL_TX_RX_MASK   0x0003
#define sa_CONTROLINFO_CTRL_SW_ONLY   0x0008
#define sa_CONTROLINFO_CTRL_OP_MASK   0x000b
SRTP Key Control Info Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_SrtpKeyParams_t.

#define sa_SRTP_KEY_CTRL_MASTER_KEY   0x0001
#define sa_SRTP_KEY_CTRL_MASTER_SALT   0x0002
#define sa_SRTP_KEY_CTRL_KEY_DERIVE_RATE   0x0004
#define sa_SRTP_KEY_CTRL_KEY_LIFETIME   0x0008
#define sa_SRTP_KEY_CTRL_ROC   0x0010
#define sa_SRTP_KEY_CTRL_MKI   0x0020
#define sa_SRTP_KEY_CTRL_KEY_TYPE_FROM_TO   0x0040
IPSEC Key Control Info Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_IpsecKeyParams_t.

#define sa_IPSEC_KEY_CTRL_ENC_KEY   0x0001
#define sa_IPSEC_KEY_CTRL_MAC_KEY   0x0002
#define sa_IPSEC_KEY_CTRL_SALT   0x0004
Air Ciphering Key Control Info Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_AcKeyParams_t.

#define sa_AC_KEY_CTRL_ENC_KEY   0x0001
#define sa_AC_KEY_CTRL_MAC_KEY   0x0002
Data Mode Key Control Info Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_DataModeKeyParams_t.

#define sa_DATA_MODE_KEY_CTRL_ENC_KEY   0x0001
#define sa_DATA_MODE_KEY_CTRL_MAC_KEY   0x0002
#define sa_DATA_MODE_KEY_CTRL_SALT   0x0004
SALLD Key Control Info Control Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_KeyCtrlInfo_t.

#define sa_KEY_CONTROL_TX_KEY_VALID   0x0001
#define sa_KEY_CONTROL_RX_KEY_VALID   0x0002
SALLD PKT Error Codes

Definitions of the error codes for the packets received from SA

#define sa_PKT_ERR_OK   0
#define sa_PKT_ERR_REPLAY_OLD   1
#define sa_PKT_ERR_REPLAY_DUP   2
#define sa_PKT_ERR_INVALID_KEY   3
#define sa_PKT_ERR_INVALID_MKI   4
#define sa_PKT_ERR_AUTH_FAIL   5
Command Label Update Valid Bit Definitions

Bitmap definition of the validBitfield in Sa_CmdLbUpdateInfo_t.

#define sa_CMDL_UPDATE_VALID_ENC   0x0001
#define sa_CMDL_UPDATE_VALID_AUTH   0x0002
#define sa_CMDL_UPDATE_VALID_ENC_IV   0x0004
#define sa_CMDL_UPDATE_VALID_AUTH_IV   0x0008
#define sa_CMDL_UPDATE_VALID_AAD   0x0010
#define sa_CMDL_UPDATE_VALID_AUX_KEY   0x0020
#define sa_CMDL_UPDATE_VALID_PAYLOAD   0x0040
#define sa_CMDL_UPDATE_VALID_ENC_SIZE   0x0080
#define sa_CMDL_UPDATE_VALID_ENC_IV2   0x0100
#define sa_CMDL_UPDATE_VALID_AUTH_SIZE   0x0200
SALLD Packet Info Valid Bit Definitions

Bitmap definition of the validBitMap in Sa_PktInfo_t.

#define sa_PKT_INFO_VALID_PKT_ERR_CODE   0x0001
#define sa_PKT_INFO_VALID_SW_INFO   0x0002
#define sa_PKT_INFO_VALID_CMDLB_INFO   0x0004
#define sa_PKT_INFO_VALID_PAYLOAD_INFO   0x0008
#define sa_PKT_INFO_VALID_IPSEC_NAT_T_INFO   0x0010
SRTP Key Request Info Control Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_SrtpKeyRequest_t.

#define sa_SRTP_KEY_REQUEST_KEY_TYPE_MKI   0x0001
#define sa_SRTP_KEY_REQUEST_TX_KEY   0x0002
#define sa_SRTP_KEY_REQUEST_RX_KEY   0x0004
#define sa_SRTP_KEY_REQUEST_MKI_VALID   0x0008
Security Context maximum size

Define Security Context maximum size requirements.

#define sa_IPSEC_TX_MAX_SC_SIZE   288
#define sa_IPSEC_RX_MAX_SC_SIZE   320
#define sa_SRTP_TX_MAX_SC_SIZE   224
#define sa_SRTP_RX_MAX_SC_SIZE   288
#define sa_AC_MAX_SC_SIZE   288
#define sa_DATA_MODE_MAX_SC_SIZE   256
#define sa_MAX_SC_SIZE   320
SALLD Statistics Query Control Bit Definitions

Bitmap definition of the control flags in Sa_chanGetStats() API.

#define sa_STATS_QUERY_FLAG_CLEAR   0x0001
#define sa_STATS_QUERY_FLAG_TRIG   0x0002
#define sa_STATS_QUERY_FLAG_NOW   0x0004
RNG Configuration Control Info Bit Definitions

Bitmap definition of the ctrlBitfield in Sa_RngConfigParams_t.

#define sa_RNG_CTRL_REINIT   0x0001
#define sa_RNG_CTRL_ENABLE_INT   0x0002
#define sa_RNG_CTRL_RESET   0x0004
SA System Memory Buffer Index

Define the buffer index of the SA system memory blocks.

#define sa_SYS_BUF_INST   0
SA Channel Memory Buffer Index

Define the buffer index of the SA channel memory blocks.

#define sa_CHAN_BUF_INST   0

Typedefs

typedef int Sa_State_t
 Sa_State_t defines the operating state of the security accelerator sub-system.
typedef void * Sa_ChanHandle
 Specification of Sa_ChanHandle The Sa_ChanHandle is used to identify a SALLD channel instance.
typedef uint16_t Sa_PktErr_t
 SA Packet Error data type.
typedef struct Sa_Replay_Cxt_tag Sa_Replay_Cxt_t
 SALLD Replay Window Context.
typedef void * Sa_Handle
 Specification of Sa_Handle The Sa_Handle is used to identify a SALLD system instance.
typedef struct Sa_CallOutFuns_s Sa_CallOutFuncs_t
 The SALLD Call-out function table.
typedef struct Sa_SysStats_s Sa_SysStats_t
 SALLD Statistics Structure.

Enumerations

Security Protocol Types

Definition of Security Protocol Types of the packets to be processed in the SALLD channel

enum  Sa_SecProto_e {
  sa_PT_NULL = 0, sa_PT_SRTP, sa_PT_SRTCP, sa_PT_IPSEC_AH,
  sa_PT_IPSEC_ESP, sa_PT_3GPP_AC
}
Cipher Modes

Definition of Cipher Modes used by the SA sub-engines

enum  Sa_CipherMode_e {
  sa_CipherMode_NULL = 0, sa_CipherMode_AES_CTR, sa_CipherMode_AES_F8, sa_CipherMode_AES_CBC,
  sa_CipherMode_DES_CBC, sa_CipherMode_3DES_CBC, sa_CipherMode_CCM, sa_CipherMode_GCM,
  sa_CipherMode_GSM_A53, sa_CipherMode_ECSD_A53, sa_CipherMode_GEA3, sa_CipherMode_KASUMI_F8,
  sa_CipherMode_SNOW3G_F8
}
Authentication Modes

Definition of Authentication Modes used by the SA sub-engines

enum  Sa_AuthMode_e {
  sa_AuthMode_NULL = 0, sa_AuthMode_MD5 = sa_CipherMode_LAST, sa_AuthMode_SHA1, sa_AuthMode_SHA2_224,
  sa_AuthMode_SHA2_256, sa_AuthMode_HMAC_MD5, sa_AuthMode_HMAC_SHA1, sa_AuthMode_HMAC_SHA2_224,
  sa_AuthMode_HMAC_SHA2_256, sa_AuthMode_GMAC, sa_AuthMode_GMAC_AH, sa_AuthMode_CMAC,
  sa_AuthMode_CBC_MAC, sa_AuthMode_AES_XCBC, sa_AuthMode_KASUMI_F9
}
IPSEC Transport Types

Parameter transportType of Sa_IpsecConfigParams_t should be set to one of these transport types.

enum  Sa_IpsecTransportType_e { sa_IPSEC_TRANSPORT_TRANSPORT = 0, sa_IPSEC_TRANSPORT_TUNNEL }
Air Ciphering PDU Types

Definition of Air Ciphering PDU Types supported in SA Parameter pduType of Sa_AcConfigParams_t should be set to one of these types. Refer to 3GPP Opeartion and PDU formats for detailed description

enum  Sa_AcPduType_e {
  sa_AcPduType_GSM = 0, sa_AcPduType_WCDMA_TMD, sa_AcPduType_WCDMA_UMD, sa_AcPduType_WCDMA_AMD,
  sa_AcPduType_LTE, sa_AcPduType_LTE_CP
}
Channel Control Type

Definition of channel control types supported by SA LLD Parameter ctrlType of Sa_ChanCtrlInfo_t should be set to one of these types.

enum  Sa_ChanControlCode_e { sa_CHAN_CTRL_GEN_CONFIG = 1, sa_CHAN_CTRL_KEY_CONFIG = 2 }
SA Packet Directions

Definition of SA Packet Directions used at API Sa_chanGetSwInfo

enum  Sa_PktDir_t { sa_PKT_DIR_FROM_NETWORK = 0, sa_PKT_DIR_TO_NETWORK }
Data Sub Operation Modes

Definition of the sub operation modes in Data mode.

enum  Sa_DM_subMode_e {
  sa_DM_GEN = 0, sa_DM_CCM, sa_DM_GCM, sa_DM_GMAC,
  sa_DM_GMAC_AH
}
PKA Arithmetic Operation Types

Definition of PKA Arithmetic Operation Types Parameter operation of Sa_PkaReqInfo_t should be set to one of these types.

enum  Sa_PkaOpTypes_t {
  sa_PKA_OP_ADD = 0, sa_PKA_OP_SUB, sa_PKA_OP_MUL, sa_PKA_OP_DIV,
  sa_PKA_OP_RSHIFT, sa_PKA_OP_LSHIFT, sa_PKA_OP_COMP, sa_PKA_OP_COPY,
  sa_PKA_OP_EXP2, sa_PKA_OP_EXP4
}
PKA Comparison Results

Definition of PKA Comparsion Result from SALLD API Sa_pkaOperation

enum  Sa_PkaCompResults_t { sa_PKA_COMP_AEQB = 1, sa_PKA_COMP_AINFB = 2, sa_PKA_COMP_ASUPB = 4 }

Functions

COMMON (Common Interface) APIs

int16_t Sa_getBufferReq (Sa_SizeCfg_t *sizeCfg, int sizes[], int aligns[])
 Sa_getBufferReq returns the memory requirements for the SALLD instance.
int16_t Sa_create (Sa_Config_t *cfg, void *bases[], Sa_Handle *pHandle)
 Sa_create creates the SA LLD instance. It initializes the SALLD instance and its corresponding instance structure based on channel configuration data such as the call-out table, and etc.
int16_t Sa_start (Sa_Handle handle, Sa_Config_t *cfg)
 Sa_start activates the SA LLD instance.
int16_t Sa_getShadowHandle (Sa_Handle handle, Sa_Handle *shandle)
 Sa_getShadowHandle queries the shadow system handle.
int16_t Sa_close (Sa_Handle handle, void *bases[])
 Sa_close deactivates the SA LLD instance.
int16_t Sa_getSysStats (Sa_Handle handle, Sa_SysStats_t *stats)
 This function obtains SALLD system statistics.
Sa_State_t Sa_resetControl (Sa_Handle handle, Sa_State_t newState)
 This function controls the reset state of the SA Sub-System.
int16_t Sa_downloadImage (Sa_Handle handle, int modId, void *image, int sizeBytes)
 This function downloads a PDSP image to a PDSP core within the SA sub-system.
int16_t Sa_rngInit (Sa_Handle handle, Sa_RngConfigParams_t *cfg)
 The function is called to initialize and configure the RNG (Random Number Generator) module inside SA.
int16_t Sa_getRandomNum (Sa_Handle handle, uint16_t f_isr, Sa_RngData_t *rnd)
 This function returns a 64-bit true random number.
int16_t Sa_rngClose (Sa_Handle handle)
 Sa_rngClose decativates the SA RNG module.
int16_t Sa_pkaInit (Sa_Handle handle)
 This function initializes the PKA (Public Key Accelerator) module inside SA.
int16_t Sa_pkaOperation (Sa_Handle handle, Sa_PkaReqInfo_t *pkaReqInfo)
 This function triggers a large vector arithmetic operation through the PKA module.
int16_t Sa_pkaClose (Sa_Handle handle)
 Sa_pkaClose decativates the SA PKA module.
uint32_t Sa_getID (Sa_Handle handle)
 This function returns the SA system ID associated with the specified handle.
uint32_t Sa_getVersion (void)
 Sa_getVersion returns the SA LLD version information.
const char * Sa_getVersionStr (void)
 Sa_getVersionStr returns the SA LLD version string.
int16_t Sa_getPDSPVersion (Sa_Handle handle, int modId, uint32_t *pVersion)
 Sa_getPDSPVersion returns the SA PDSP version information.
CHANNEL (Channel-Specific) APIs

int16_t Sa_chanGetBufferReq (Sa_ChanSizeCfg_t *sizeCfg, int sizes[], int aligns[])
 Sa_chanGetBufferReq returns the memory requirements for an SALLD channel.
int16_t Sa_chanCreate (Sa_Handle handle, Sa_ChanConfig_t *cfg, void *bases[], Sa_ChanHandle *pChanHdl)
 Sa_chanCreate creates the SALLD channel. It initializes an instance of SALLD channel and its corresponding instance structure based on channel configuration data such as the security protocol, and etc.
int16_t Sa_chanClose (Sa_ChanHandle handle, void *bases[])
 Sa_chanClose decativates the SALLD channel. It clears the SALLD channel instance. All the associated memory buffers can be freed after this call.
int16_t Sa_chanControl (Sa_ChanHandle handle, Sa_ChanCtrlInfo_t *chanCtrlInfo)
 This function controls the operations of a channel instance of SALLD. It is used to configure and/or re-configure the SALLD channel with various control information. This function should be called multiple times to configure and activate the SALLD channel during the call setup period. Then it is typically called to perform re-key operation subsequently.
int16_t Sa_chanStart (Sa_ChanHandle handle)
 This function activates the local channel instance at other DSP cores. It should be called once at any other DSP cores which invoke the same SALLD channel that is created and configured at the master core. It is up to the master core to make the channel handle public and accessible by other DSP cores after channel creation and configuration. The following APIs are supported at slave cores.

  • Sa_chanReceiveData
  • Sa_chanSendData
  • Sa_chanGetStats
  • Sa_chanGetID.

int16_t Sa_chanGetShadowHandle (Sa_ChanHandle handle, Sa_ChanHandle *shandle)
 Sa_chanGetShadowHandle queries the shadow channel handle.
int16_t Sa_chanReceiveData (Sa_ChanHandle handle, Sa_PktInfo_t *pktInfo)
 This function processes packets received from the network. It performs protocol-specific post-SA operations on the decrypted and/or integrity-verified data packet. It also performs the actual decryption/authentication operation in SW-only mode.
int16_t Sa_chanSendData (Sa_ChanHandle handle, Sa_PktInfo_t *pktInfo, uint16_t clear)
 This function processes the data packet to the networks. It performs protocol-specific operations to prepare the data packets to be encrypted and/or authenticated by the SA. It also performs the actual encryption and/or authentication in the SW-only mode.
int16_t Sa_chanGetStats (Sa_ChanHandle handle, uint16_t flags, Sa_Stats_t *stats)
 This function obtains SALLD channel protocol-specific statistics.
uint32_t Sa_chanGetID (Sa_ChanHandle handle)
 Sa_chanGetID returns the SA channel ID associated with the specified handle.
int16_t Sa_chanGetSwInfo (Sa_ChanHandle handle, uint16_t dir, Sa_SWInfo_t *pChanSwInfo)
 Sa_chanGetSwInfo returns the SA-specific software information required for all packets to be delivered to SA.
Utility APIs

uint16_t Sa_isScBufFree (uint8_t *scBuf)
 This function verifies whether the security context buffer has been freed by SA.

SA LLD Macros



#define sa_MK_UINT32(a, b, c, d)   (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
 sa_MK_UINT32 is a simple utility macro which constructs a 32-bit word from 4 input bytes
static void sa_mDmResetCmdLb (Sa_CmdLbUpdateInfo_t *updateInfo, uint32_t *cmdLb)
 sa_mDmResetCmdLb: Reset the Command Label for Data Mode
static void sa_mDmUpdateCmdLb (uint8_t encOffset, uint16_t encSize, uint8_t *pEncIV, uint8_t authOffset, uint16_t authSize, uint8_t *pAuthIV, uint8_t aadSize, uint8_t *aad, uint8_t *pDataBuf, Sa_CmdLbUpdateInfo_t *updateInfo, uint32_t *cmdLb)
 sa_mDmUpdateCmdLb: Update the command label for Data Mode

SA PS Info Constructing Macros

Macros used by the SA PS Info Command



#define sa_PSINFO_FORMAT_CMD(x, offset, len)   ((x)->word[0] = (0x20000000UL | ((offset) << 16) | (len)))
#define sa_PSINFO_SET_COUNTC(x, countC)   ((x)->word[1] = (countC))
static void sa_PSINFO_SET_IV (Sa_psInfo_t *x, uint32_t *iv, int ivSize)

Detailed Description

SA LLD Interface Unit API and Data Definitions.

path ti/drv/sa/salld.h

============================================================================ Copyright (c) Texas Instruments Incorporated 2009-2012

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file salld.h.


Define Documentation

#define sa_MAX_PKA_OPERAND_SIZE   128

4k-bits or 128 32-bit words

Definition at line 2159 of file salld.h.

#define sa_MAX_PKA_OPERAND_SIZE_EXP4   64

2k-bits or 64 32-bit words

Definition at line 2160 of file salld.h.

#define sa_PSINFO_FORMAT_CMD ( x,
offset,
len   )     ((x)->word[0] = (0x20000000UL | ((offset) << 16) | (len)))

Format the PS Info header

Definition at line 3080 of file salld.h.

#define sa_PSINFO_SET_COUNTC ( x,
countC   )     ((x)->word[1] = (countC))

Constructing Count-C

Definition at line 3081 of file salld.h.

#define sa_SC_ID_MASK   0x7FFF

Define security context ID mask.

Definition at line 1655 of file salld.h.

#define sa_SC_IND_PERMANENT   0x8000

Indicate that the corresponding security context is permanent

Definition at line 1661 of file salld.h.


Function Documentation

static void sa_PSINFO_SET_IV ( Sa_psInfo_t x,
uint32_t *  iv,
int  ivSize 
) [inline, static]
Parameters:
ivSize Constructing IV

Definition at line 3082 of file salld.h.


Copyright 2014, Texas Instruments Incorporated