Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
sep_driver_api.h File Reference

Go to the source code of this file.

Data Structures

struct  sep_dcblock
 
struct  build_dcb_struct
 
struct  build_dcb_struct_kernel
 
struct  sep_dma_map
 
struct  sep_dma_resource
 
struct  rar_hndl_to_bus_struct
 
struct  sep_lli_entry
 
struct  sep_fastcall_hdr
 
struct  sep_call_status
 
struct  sep_dma_context
 
struct  sep_private_data
 

Macros

#define SEP_DRIVER_SRC_REPLY   1
 
#define SEP_DRIVER_SRC_REQ   2
 
#define SEP_DRIVER_SRC_PRINTF   3
 
#define SEP_DRIVER_POWERON   1
 
#define SEP_DRIVER_POWEROFF   2
 

Enumerations

enum  type_of_request {
  NO_REQUEST, AES_CBC, AES_ECB, DES_CBC,
  DES_ECB, DES3_ECB, DES3_CBC, SHA1,
  MD5, SHA224, SHA256
}
 
enum  hash_stage {
  HASH_INIT, HASH_UPDATE, HASH_FINISH, HASH_DIGEST,
  HASH_FINUP_DATA, HASH_FINUP_FINISH
}
 

Functions

void sep_queue_status_remove (struct sep_device *sep, struct sep_queue_info **queue_elem)
 

: current process name

sep_queue_status_add - Adds transaction to status queue : SEP device : transaction opcode : input data size : pid of current process

: length of name (current process)

This function adds information about about transaction started to the status queue.

#define SEP_IOC_MAGIC_NUMBER   's'
 
#define SEP_IOCSENDSEPCOMMAND   _IO(SEP_IOC_MAGIC_NUMBER, 0)
 
#define SEP_IOCENDTRANSACTION   _IO(SEP_IOC_MAGIC_NUMBER, 15)
 
#define SEP_IOCPREPAREDCB   _IOW(SEP_IOC_MAGIC_NUMBER, 35, struct build_dcb_struct)
 
#define SEP_IOCFREEDCB   _IO(SEP_IOC_MAGIC_NUMBER, 36)
 
#define SEP_IOCPREPAREDCB_SECURE_DMA   _IOW(SEP_IOC_MAGIC_NUMBER, 38, struct build_dcb_struct)
 
#define SEP_IOCFREEDCB_SECURE_DMA   _IO(SEP_IOC_MAGIC_NUMBER, 39)
 
struct sep_queue_infosep_queue_status_add (struct sep_device *sep, u32 opcode, u32 size, u32 pid, u8 *name, size_t name_len)
 
int sep_create_dcb_dmatables_context_kernel (struct sep_device *sep, struct sep_dcblock **dcb_region, void **dmatables_region, struct sep_dma_context **dma_ctx, const struct build_dcb_struct_kernel *dcb_data, const u32 num_dcbs)
 
ssize_t sep_activate_dcb_dmatables_context (struct sep_device *sep, struct sep_dcblock **dcb_region, void **dmatables_region, struct sep_dma_context *dma_ctx)
 
int sep_prepare_input_output_dma_table_in_dcb (struct sep_device *sep, unsigned long app_in_address, unsigned long app_out_address, u32 data_in_size, u32 block_size, u32 tail_block_size, bool isapplet, bool is_kva, bool secure_dma, struct sep_dcblock *dcb_region, void **dmatables_region, struct sep_dma_context **dma_ctx, struct scatterlist *src_sg, struct scatterlist *dst_sg)
 
int sep_free_dma_table_data_handler (struct sep_device *sep, struct sep_dma_context **dma_ctx)
 
int sep_send_command_handler (struct sep_device *sep)
 
int sep_wait_transaction (struct sep_device *sep)
 

Macro Definition Documentation

#define SEP_DRIVER_POWEROFF   2

Definition at line 43 of file sep_driver_api.h.

#define SEP_DRIVER_POWERON   1

Definition at line 42 of file sep_driver_api.h.

#define SEP_DRIVER_SRC_PRINTF   3

Definition at line 39 of file sep_driver_api.h.

#define SEP_DRIVER_SRC_REPLY   1

Definition at line 37 of file sep_driver_api.h.

#define SEP_DRIVER_SRC_REQ   2

Definition at line 38 of file sep_driver_api.h.

#define SEP_IOC_MAGIC_NUMBER   's'

IOCTL command defines

Definition at line 378 of file sep_driver_api.h.

#define SEP_IOCENDTRANSACTION   _IO(SEP_IOC_MAGIC_NUMBER, 15)

Definition at line 385 of file sep_driver_api.h.

#define SEP_IOCFREEDCB   _IO(SEP_IOC_MAGIC_NUMBER, 36)

Definition at line 391 of file sep_driver_api.h.

#define SEP_IOCFREEDCB_SECURE_DMA   _IO(SEP_IOC_MAGIC_NUMBER, 39)

Definition at line 399 of file sep_driver_api.h.

#define SEP_IOCPREPAREDCB   _IOW(SEP_IOC_MAGIC_NUMBER, 35, struct build_dcb_struct)

Definition at line 388 of file sep_driver_api.h.

#define SEP_IOCPREPAREDCB_SECURE_DMA   _IOW(SEP_IOC_MAGIC_NUMBER, 38, struct build_dcb_struct)

Definition at line 396 of file sep_driver_api.h.

#define SEP_IOCSENDSEPCOMMAND   _IO(SEP_IOC_MAGIC_NUMBER, 0)

Definition at line 381 of file sep_driver_api.h.

Enumeration Type Documentation

enum hash_stage
Enumerator:
HASH_INIT 
HASH_UPDATE 
HASH_FINISH 
HASH_DIGEST 
HASH_FINUP_DATA 
HASH_FINUP_FINISH 

Definition at line 60 of file sep_driver_api.h.

Enumerator:
NO_REQUEST 
AES_CBC 
AES_ECB 
DES_CBC 
DES_ECB 
DES3_ECB 
DES3_CBC 
SHA1 
MD5 
SHA224 
SHA256 

Definition at line 46 of file sep_driver_api.h.

Function Documentation

ssize_t sep_activate_dcb_dmatables_context ( struct sep_device sep,
struct sep_dcblock **  dcb_region,
void **  dmatables_region,
struct sep_dma_context dma_ctx 
)

sep_activate_dcb_dmatables_context - Takes DCB & DMA tables contexts into use : SEP device : DCB region copy : MLLI/DMA tables copy : DMA context for current transaction

Definition at line 3300 of file sep_main.c.

int sep_create_dcb_dmatables_context_kernel ( struct sep_device sep,
struct sep_dcblock **  dcb_region,
void **  dmatables_region,
struct sep_dma_context **  dma_ctx,
const struct build_dcb_struct_kernel dcb_data,
const u32  num_dcbs 
)

sep_create_dcb_dmatables_context_kernel - Creates DCB & MLLI/DMA table context for kernel crypto : SEP device : DCB region buf to create for current transaction : MLLI/DMA tables buf to create for current transaction : DMA context buf to create for current transaction : User arguments for DCB/MLLI creation : Number of DCBs to create

sep_create_dcb_dmatables_context_kernel - Creates DCB & MLLI/DMA table context for kernel crypto : SEP device : DCB region buf to create for current transaction : MLLI/DMA tables buf to create for current transaction : DMA context buf to create for current transaction : User arguments for DCB/MLLI creation : Number of DCBs to create This does that same thing as sep_create_dcb_dmatables_context except that it is used only for the kernel crypto operation. It is separate because there is no user data involved; the dcb data structure is specific for kernel crypto (build_dcb_struct_kernel)

Definition at line 3491 of file sep_main.c.

int sep_free_dma_table_data_handler ( struct sep_device sep,
struct sep_dma_context **  dma_ctx 
)

sep_free_dma_table_data_handler - free DMA table : pointer to struct sep_device : dma context

Handles the request to free DMA table for synchronic actions

Output is handled different. If this was a secure dma into restricted memory, then we skip this step altogether as restricted memory is not available to the o/s at all.

Note that here we use in_map_num_entries because we don't have a page array; the page array is generated only in the lock_user_pages, which is not called for kernel crypto, which is what the sg (scatter gather is used for exclusively)

Definition at line 454 of file sep_main.c.

int sep_prepare_input_output_dma_table_in_dcb ( struct sep_device sep,
unsigned long  app_in_address,
unsigned long  app_out_address,
u32  data_in_size,
u32  block_size,
u32  tail_block_size,
bool  isapplet,
bool  is_kva,
bool  secure_dma,
struct sep_dcblock dcb_region,
void **  dmatables_region,
struct sep_dma_context **  dma_ctx,
struct scatterlist src_sg,
struct scatterlist dst_sg 
)

sep_prepare_input_output_dma_table_in_dcb - prepare control blocks : unsigned long; for data buffer in (user space) : unsigned long; for data buffer out (user space) : u32; for size of data : u32; for block size : u32; for size of tail block : bool; to indicate external app : bool; kernel buffer; only used for kernel crypto module ; indicates whether this is secure_dma using IMR

This function prepares the linked DMA tables and puts the address for the linked list of tables inta a DCB (data control block) the address of which is known by the SEP hardware Note that all bus addresses that are passed to the SEP are in 32 bit format; the SEP is a 32 bit device

Definition at line 2626 of file sep_main.c.

struct sep_queue_info* sep_queue_status_add ( struct sep_device sep,
u32  opcode,
u32  size,
u32  pid,
u8 name,
size_t  name_len 
)
read

Definition at line 149 of file sep_main.c.

void sep_queue_status_remove ( struct sep_device sep,
struct sep_queue_info **  queue_elem 
)

sep_queue_status_remove - Removes transaction from status queue : SEP device : pointer to status queue

This function will removes information about transaction from the queue.

sep_queue_status_remove - Removes transaction from status queue : SEP device : pointer to status queue

This function will remove information about transaction from the queue.

Definition at line 110 of file sep_main.c.

int sep_send_command_handler ( struct sep_device sep)

sep_send_command_handler - kick off a command : SEP being signalled

This function raises interrupt to SEP that signals that is has a new command from the host

Note that this function does fall under the ioctl lock

Definition at line 895 of file sep_main.c.

int sep_wait_transaction ( struct sep_device sep)

sep_wait_transaction - Used for synchronizing transactions : SEP device

Definition at line 247 of file sep_main.c.