3 * sep_driver_api.h - Security Processor Driver api definitions
5 * Copyright(c) 2009,2010 Intel Corporation. All rights reserved.
6 * Contributions(c) 2009,2010 Discretix. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; version 2 of the License.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc., 59
19 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Mark Allyn mark.a.allyn@intel.com
24 * Jayant Mangalampalli jayant.mangalampalli@intel.com
28 * 2010.09.14 Upgrade to Medfield
32 #ifndef __SEP_DRIVER_API_H__
33 #define __SEP_DRIVER_API_H__
35 /* Type of request from device */
36 #define SEP_DRIVER_SRC_REPLY 1
37 #define SEP_DRIVER_SRC_REQ 2
38 #define SEP_DRIVER_SRC_PRINTF 3
41 /*-------------------------------------------
43 ----------------------------------------------*/
46 /* offset from start of shared pool area */
48 /* number of bytes to allocate */
52 /* command struct for getting caller id value and address */
53 struct caller_id_struct {
54 /* pid of the process */
56 /* virtual address of the caller id hash */
57 aligned_u64 callerIdAddress;
58 /* caller id hash size in bytes */
59 u32 callerIdSizeInBytes;
63 structure that represents DCB
66 /* physical address of the first input mlli */
67 u32 input_mlli_address;
68 /* num of entries in the first input mlli */
69 u32 input_mlli_num_entries;
70 /* size of data in the first input mlli */
71 u32 input_mlli_data_size;
72 /* physical address of the first output mlli */
73 u32 output_mlli_address;
74 /* num of entries in the first output mlli */
75 u32 output_mlli_num_entries;
76 /* size of data in the first output mlli */
77 u32 output_mlli_data_size;
78 /* pointer to the output virtual tail */
79 aligned_u64 out_vr_tail_pt;
80 /* size of tail data */
82 /* input tail data array */
86 struct sep_caller_id_entry {
88 unsigned char callerIdHash[SEP_CALLER_ID_HASH_SIZE_IN_BYTES];
92 command structure for building dcb block (currently for ext app only
94 struct build_dcb_struct {
95 /* address value of the data in */
96 aligned_u64 app_in_address;
99 /* address of the data out */
100 aligned_u64 app_out_address;
101 /* the size of the block of the operation - if needed,
102 every table will be modulo this parameter */
104 /* the size of the block of the operation - if needed,
105 every table will be modulo this parameter */
110 * @struct sep_dma_map
112 * Structure that contains all information needed for mapping the user pages
113 * or kernel buffers for dma operations
118 /* mapped dma address */
120 /* size of the mapped data */
124 struct sep_dma_resource {
125 /* array of pointers to the pages that represent
126 input data for the synchronic DMA action */
127 struct page **in_page_array;
129 /* array of pointers to the pages that represent out
130 data for the synchronic DMA action */
131 struct page **out_page_array;
133 /* number of pages in the sep_in_page_array */
136 /* number of pages in the sep_out_page_array */
139 /* map array of the input data */
140 struct sep_dma_map *in_map_array;
142 /* map array of the output data */
143 struct sep_dma_map *out_map_array;
145 /* number of entries of the input mapp array */
146 u32 in_map_num_entries;
148 /* number of entries of the output mapp array */
149 u32 out_map_num_entries;
153 /* command struct for translating rar handle to bus address
154 and setting it at predefined location */
155 struct rar_hndl_to_bus_struct {
158 aligned_u64 rar_handle;
162 structure that represent one entry in the DMA LLI table
164 struct sep_lli_entry {
165 /* physical address */
172 /*----------------------------------------------------------------
173 IOCTL command defines
174 -----------------------------------------------------------------*/
176 /* magic number 1 of the sep IOCTL command */
177 #define SEP_IOC_MAGIC_NUMBER 's'
179 /* sends interrupt to sep that message is ready */
180 #define SEP_IOCSENDSEPCOMMAND \
181 _IO(SEP_IOC_MAGIC_NUMBER, 0)
183 /* sends interrupt to sep that message is ready */
184 #define SEP_IOCSENDSEPRPLYCOMMAND \
185 _IO(SEP_IOC_MAGIC_NUMBER, 1)
187 /* allocate memory in data pool */
188 #define SEP_IOCALLOCDATAPOLL \
189 _IOW(SEP_IOC_MAGIC_NUMBER, 2, struct alloc_struct)
191 /* free dynamic data aalocated during table creation */
192 #define SEP_IOCFREEDMATABLEDATA \
193 _IO(SEP_IOC_MAGIC_NUMBER, 7)
195 /* get the static pool area addersses (physical and virtual) */
196 #define SEP_IOCGETSTATICPOOLADDR \
197 _IO(SEP_IOC_MAGIC_NUMBER, 8)
199 /* end transaction command */
200 #define SEP_IOCENDTRANSACTION \
201 _IO(SEP_IOC_MAGIC_NUMBER, 15)
203 #define SEP_IOCRARPREPAREMESSAGE \
204 _IOW(SEP_IOC_MAGIC_NUMBER, 20, struct rar_hndl_to_bus_struct)
206 #define SEP_IOCTLSETCALLERID \
207 _IOW(SEP_IOC_MAGIC_NUMBER, 34, struct caller_id_struct)
209 #define SEP_IOCPREPAREDCB \
210 _IOW(SEP_IOC_MAGIC_NUMBER, 35, struct build_dcb_struct)
212 #define SEP_IOCFREEDCB \
213 _IO(SEP_IOC_MAGIC_NUMBER, 36)