linux/drivers/mxc/security/sahara2/km_adaptor.c File Reference

The Adaptor component provides an interface to the driver for a kernel user. More...

Functions

fsl_shw_return_t sah_register (fsl_shw_uco_t *user_ctx)
fsl_shw_return_t sah_deregister (fsl_shw_uco_t *user_ctx)
fsl_shw_return_t sah_get_results (sah_results *arg, fsl_shw_uco_t *uco)
fsl_shw_return_t adaptor_Exec_Descriptor_Chain (sah_Head_Desc *dar, fsl_shw_uco_t *uco)
void * fsl_shw_smalloc (fsl_shw_uco_t *user_ctx, uint32_t size, const uint8_t *UMID, uint32_t permissions)
fsl_shw_return_t fsl_shw_sfree (fsl_shw_uco_t *user_ctx, void *address)
fsl_shw_return_t fsl_shw_diminish_perms (fsl_shw_uco_t *user_ctx, void *address, uint32_t permissions)
fsl_shw_return_t do_scc_encrypt_region (fsl_shw_uco_t *user_ctx, void *partition_base, uint32_t offset_bytes, uint32_t byte_count, uint8_t *black_data, uint32_t *IV, fsl_shw_cypher_mode_t cypher_mode)
fsl_shw_return_t do_scc_decrypt_region (fsl_shw_uco_t *user_ctx, void *partition_base, uint32_t offset_bytes, uint32_t byte_count, const uint8_t *black_data, uint32_t *IV, fsl_shw_cypher_mode_t cypher_mode)

Variables

fsl_shw_pco_t sahara2_capabilities
static sah_Mem_Util std_kernelmode_mem_util

Detailed Description

The Adaptor component provides an interface to the driver for a kernel user.


Function Documentation

fsl_shw_return_t adaptor_Exec_Descriptor_Chain ( sah_Head_Desc dar,
fsl_shw_uco_t uco 
)

Writes the Descriptor Chain to the kernel driver.

This function writes the Descriptor Chain to the kernel driver.

Parameters:
dar A pointer to a Descriptor Chain of type sah_Head_Desc
uco The user context object
Returns:
A return code of type fsl_shw_return_t.

References sah_Head_Desc::desc, FSL_RETURN_ERROR_S, FSL_RETURN_NO_RESOURCE_S, FSL_RETURN_OK_S, FSL_UCO_BLOCKING_MODE, sah_Head_Desc::result, sah_blocking_mode(), sah_Physicalise_Descriptors(), sah_Queue_Manager_Append_Entry(), sah_Head_Desc::uco_flags, sah_Head_Desc::user_desc, and sah_Head_Desc::user_info.

fsl_shw_return_t sah_deregister ( fsl_shw_uco_t user_ctx  ) 

Sends a request to deregister this user.

Sends a request to deregister this user

Parameters:
[in,out] user_ctx Info on user being deregistered.
Returns:
A return code of type fsl_shw_return_t.

References FSL_RETURN_OK_S, sah_handle_deregistration(), and fsl_shw_uco_t::sahara_openfd.

Referenced by fsl_shw_deregister_user().

fsl_shw_return_t sah_get_results ( sah_results arg,
fsl_shw_uco_t uco 
)

Sends a request to get results for this user.

Sends a request to get results for this user

Parameters:
[in,out] arg Pointer to structure to collect results
uco User's context
Returns:
A return code of type fsl_shw_return_t.

References sah_results::actual, FSL_RETURN_OK_S, and sah_get_results_from_pool().

Referenced by fsl_shw_get_results().

Sends a request to register this user.

Sends a request to register this user

Parameters:
[in,out] user_ctx part of the structure contains input parameters and part is filled in by the driver
Returns:
A return code of type fsl_shw_return_t.

References FSL_RETURN_OK_S, fsl_shw_uco_t::mem_util, sah_handle_registration(), sah_validate_uco(), and fsl_shw_uco_t::sahara_openfd.

Referenced by fsl_shw_register_user().


Variable Documentation

Initial value:
 {
        1, 3,                   
        1, 6,                   
        {
         FSL_KEY_ALG_AES,
         FSL_KEY_ALG_DES,
         FSL_KEY_ALG_TDES,
         FSL_KEY_ALG_ARC4},
        {
         FSL_SYM_MODE_STREAM,
         FSL_SYM_MODE_ECB,
         FSL_SYM_MODE_CBC,
         FSL_SYM_MODE_CTR},
        {
         FSL_HASH_ALG_MD5,
         FSL_HASH_ALG_SHA1,
         FSL_HASH_ALG_SHA224,
         FSL_HASH_ALG_SHA256},
        
        {                       
         {0, 0, 0, 0},          
         {0, 1, 1, 1},          
         {0, 1, 1, 0},          
         {0, 1, 1, 0},          
         {1, 0, 0, 0}           
         },
        0, 0,
        0, 0, 0,
        {{0, 0}}
}

This matches Sahara2 capabilities...

Initial value:
 {
        .mu_ref = 0,
        .mu_malloc = my_malloc,
        .mu_alloc_head_desc = my_alloc_head_desc,
        .mu_alloc_desc = my_alloc_desc,
        .mu_alloc_link = my_alloc_link,
        .mu_free = my_free,
        .mu_free_head_desc = my_free_head_desc,
        .mu_free_desc = my_free_desc,
        .mu_free_link = my_free_link,
        .mu_memcpy = my_memcpy,
        .mu_memset = my_memset
}

Standard memory manipulation routines for kernel API.

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen