staging:iio:trigger handle name attr in core, remove old alloc and register any contr...
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / sep / sep_driver_api.h
blobc3aacfcc8ac6812fcf5c3a0ea52b08d03e02f282
1 /*
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
15 * more details.
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.
21 * CONTACTS:
23 * Mark Allyn mark.a.allyn@intel.com
24 * Jayant Mangalampalli jayant.mangalampalli@intel.com
26 * CHANGES:
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 /*-------------------------------------------
42 TYPEDEFS
43 ----------------------------------------------*/
45 struct alloc_struct {
46 /* offset from start of shared pool area */
47 u32 offset;
48 /* number of bytes to allocate */
49 u32 num_bytes;
52 /* command struct for getting caller id value and address */
53 struct caller_id_struct {
54 /* pid of the process */
55 u32 pid;
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
65 struct sep_dcblock {
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 */
81 u32 tail_data_size;
82 /* input tail data array */
83 u8 tail_data[68];
86 struct sep_caller_id_entry {
87 int pid;
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;
97 /* size of data in */
98 u32 data_in_size;
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 */
103 u32 block_size;
104 /* the size of the block of the operation - if needed,
105 every table will be modulo this parameter */
106 u32 tail_block_size;
110 * @struct sep_dma_map
112 * Structure that contains all information needed for mapping the user pages
113 * or kernel buffers for dma operations
117 struct sep_dma_map {
118 /* mapped dma address */
119 dma_addr_t dma_addr;
120 /* size of the mapped data */
121 size_t size;
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 */
134 u32 in_num_pages;
136 /* number of pages in the sep_out_page_array */
137 u32 out_num_pages;
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 {
157 /* rar handle */
158 aligned_u64 rar_handle;
162 structure that represent one entry in the DMA LLI table
164 struct sep_lli_entry {
165 /* physical address */
166 u32 bus_address;
168 /* block size */
169 u32 block_size;
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)
215 #endif