Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * sep_driver_api.h - Security Processor Driver api definitions |
| 4 | * |
| 5 | * Copyright(c) 2009 Intel Corporation. All rights reserved. |
| 6 | * Copyright(c) 2009 Discretix. All rights reserved. |
| 7 | * |
| 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; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 16 | * more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License along with |
| 19 | * this program; if not, write to the Free Software Foundation, Inc., 59 |
| 20 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | * |
| 22 | * CONTACTS: |
| 23 | * |
| 24 | * Mark Allyn mark.a.allyn@intel.com |
| 25 | * |
| 26 | * CHANGES: |
| 27 | * |
| 28 | * 2009.06.26 Initial publish |
| 29 | * |
| 30 | */ |
| 31 | |
| 32 | #ifndef __SEP_DRIVER_API_H__ |
| 33 | #define __SEP_DRIVER_API_H__ |
| 34 | |
| 35 | |
| 36 | |
| 37 | /*---------------------------------------------------------------- |
| 38 | IOCTL command defines |
| 39 | -----------------------------------------------------------------*/ |
| 40 | |
| 41 | /* magic number 1 of the sep IOCTL command */ |
| 42 | #define SEP_IOC_MAGIC_NUMBER 's' |
| 43 | |
| 44 | /* sends interrupt to sep that message is ready */ |
| 45 | #define SEP_IOCSENDSEPCOMMAND _IO(SEP_IOC_MAGIC_NUMBER , 0) |
| 46 | |
| 47 | /* sends interrupt to sep that message is ready */ |
| 48 | #define SEP_IOCSENDSEPRPLYCOMMAND _IO(SEP_IOC_MAGIC_NUMBER , 1) |
| 49 | |
| 50 | /* allocate memory in data pool */ |
| 51 | #define SEP_IOCALLOCDATAPOLL _IO(SEP_IOC_MAGIC_NUMBER , 2) |
| 52 | |
| 53 | /* write to pre-allocated memory in data pool */ |
| 54 | #define SEP_IOCWRITEDATAPOLL _IO(SEP_IOC_MAGIC_NUMBER , 3) |
| 55 | |
| 56 | /* read from pre-allocated memory in data pool */ |
| 57 | #define SEP_IOCREADDATAPOLL _IO(SEP_IOC_MAGIC_NUMBER , 4) |
| 58 | |
| 59 | /* create sym dma lli tables */ |
| 60 | #define SEP_IOCCREATESYMDMATABLE _IO(SEP_IOC_MAGIC_NUMBER , 5) |
| 61 | |
| 62 | /* create flow dma lli tables */ |
| 63 | #define SEP_IOCCREATEFLOWDMATABLE _IO(SEP_IOC_MAGIC_NUMBER , 6) |
| 64 | |
| 65 | /* free dynamic data aalocated during table creation */ |
| 66 | #define SEP_IOCFREEDMATABLEDATA _IO(SEP_IOC_MAGIC_NUMBER , 7) |
| 67 | |
| 68 | /* get the static pool area addersses (physical and virtual) */ |
| 69 | #define SEP_IOCGETSTATICPOOLADDR _IO(SEP_IOC_MAGIC_NUMBER , 8) |
| 70 | |
| 71 | /* set flow id command */ |
| 72 | #define SEP_IOCSETFLOWID _IO(SEP_IOC_MAGIC_NUMBER , 9) |
| 73 | |
| 74 | /* add tables to the dynamic flow */ |
| 75 | #define SEP_IOCADDFLOWTABLE _IO(SEP_IOC_MAGIC_NUMBER , 10) |
| 76 | |
| 77 | /* add flow add tables message */ |
| 78 | #define SEP_IOCADDFLOWMESSAGE _IO(SEP_IOC_MAGIC_NUMBER , 11) |
| 79 | |
| 80 | /* start sep command */ |
| 81 | #define SEP_IOCSEPSTART _IO(SEP_IOC_MAGIC_NUMBER , 12) |
| 82 | |
| 83 | /* init sep command */ |
| 84 | #define SEP_IOCSEPINIT _IO(SEP_IOC_MAGIC_NUMBER , 13) |
| 85 | |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 86 | /* end transaction command */ |
| 87 | #define SEP_IOCENDTRANSACTION _IO(SEP_IOC_MAGIC_NUMBER , 15) |
| 88 | |
| 89 | /* reallocate cache and resident */ |
| 90 | #define SEP_IOCREALLOCCACHERES _IO(SEP_IOC_MAGIC_NUMBER , 16) |
| 91 | |
| 92 | /* get the offset of the address starting from the beginnnig of the map area */ |
| 93 | #define SEP_IOCGETMAPPEDADDROFFSET _IO(SEP_IOC_MAGIC_NUMBER , 17) |
| 94 | |
| 95 | /* get time address and value */ |
| 96 | #define SEP_IOCGETIME _IO(SEP_IOC_MAGIC_NUMBER , 19) |
| 97 | |
| 98 | /*------------------------------------------- |
| 99 | TYPEDEFS |
| 100 | ----------------------------------------------*/ |
| 101 | |
| 102 | /* |
| 103 | init command struct |
| 104 | */ |
| 105 | struct sep_driver_init_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 106 | /* start of the 1G of the host memory address that SEP can access */ |
| 107 | unsigned long message_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 108 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 109 | /* start address of resident */ |
| 110 | unsigned long message_size_in_words; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 111 | |
| 112 | }; |
| 113 | |
| 114 | |
| 115 | /* |
| 116 | realloc cache resident command |
| 117 | */ |
| 118 | struct sep_driver_realloc_cache_resident_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 119 | /* base address */ |
| 120 | unsigned long base_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 121 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 122 | /* current cache address */ |
| 123 | unsigned long cache_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 124 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 125 | /* cache size in bytes */ |
| 126 | unsigned long cache_size_in_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 127 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 128 | /* current resident address */ |
| 129 | unsigned long resident_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 130 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 131 | /* resident size in bytes */ |
| 132 | unsigned long resident_size_in_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 133 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 134 | /* new cache address */ |
| 135 | unsigned long new_cache_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 136 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 137 | /* new resident address */ |
| 138 | unsigned long new_resident_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 139 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 140 | /* new resident address */ |
| 141 | unsigned long new_shared_area_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 142 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 143 | /* new base address */ |
| 144 | unsigned long new_base_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 145 | }; |
| 146 | |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 147 | struct sep_driver_alloc_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 148 | /* virtual address of allocated space */ |
| 149 | unsigned long offset; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 150 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 151 | /* physical address of allocated space */ |
| 152 | unsigned long phys_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 153 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 154 | /* number of bytes to allocate */ |
| 155 | unsigned long num_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | /* |
| 159 | */ |
| 160 | struct sep_driver_write_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 161 | /* application space address */ |
| 162 | unsigned long app_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 163 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 164 | /* address of the data pool */ |
| 165 | unsigned long datapool_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 166 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 167 | /* number of bytes to write */ |
| 168 | unsigned long num_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 169 | }; |
| 170 | |
| 171 | /* |
| 172 | */ |
| 173 | struct sep_driver_read_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 174 | /* application space address */ |
| 175 | unsigned long app_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 176 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 177 | /* address of the data pool */ |
| 178 | unsigned long datapool_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 179 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 180 | /* number of bytes to read */ |
| 181 | unsigned long num_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 182 | }; |
| 183 | |
| 184 | /* |
| 185 | */ |
| 186 | struct sep_driver_build_sync_table_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 187 | /* address value of the data in */ |
| 188 | unsigned long app_in_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 189 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 190 | /* size of data in */ |
| 191 | unsigned long data_in_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 192 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 193 | /* address of the data out */ |
| 194 | unsigned long app_out_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 195 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 196 | /* the size of the block of the operation - if needed, |
| 197 | every table will be modulo this parameter */ |
| 198 | unsigned long block_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 199 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 200 | /* the physical address of the first input DMA table */ |
| 201 | unsigned long in_table_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 202 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 203 | /* number of entries in the first input DMA table */ |
| 204 | unsigned long in_table_num_entries; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 205 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 206 | /* the physical address of the first output DMA table */ |
| 207 | unsigned long out_table_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 208 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 209 | /* number of entries in the first output DMA table */ |
| 210 | unsigned long out_table_num_entries; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 211 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 212 | /* data in the first input table */ |
| 213 | unsigned long table_data_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 214 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 215 | /* distinct user/kernel layout */ |
| 216 | bool isKernelVirtualAddress; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 217 | |
| 218 | }; |
| 219 | |
| 220 | /* |
| 221 | */ |
| 222 | struct sep_driver_build_flow_table_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 223 | /* flow type */ |
| 224 | unsigned long flow_type; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 225 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 226 | /* flag for input output */ |
| 227 | unsigned long input_output_flag; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 228 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 229 | /* address value of the data in */ |
| 230 | unsigned long virt_buff_data_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 231 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 232 | /* size of data in */ |
| 233 | unsigned long num_virtual_buffers; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 234 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 235 | /* the physical address of the first input DMA table */ |
| 236 | unsigned long first_table_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 237 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 238 | /* number of entries in the first input DMA table */ |
| 239 | unsigned long first_table_num_entries; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 240 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 241 | /* data in the first input table */ |
| 242 | unsigned long first_table_data_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 243 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 244 | /* distinct user/kernel layout */ |
| 245 | bool isKernelVirtualAddress; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 246 | }; |
| 247 | |
| 248 | |
| 249 | struct sep_driver_add_flow_table_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 250 | /* flow id */ |
| 251 | unsigned long flow_id; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 252 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 253 | /* flag for input output */ |
| 254 | unsigned long inputOutputFlag; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 255 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 256 | /* address value of the data in */ |
| 257 | unsigned long virt_buff_data_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 258 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 259 | /* size of data in */ |
| 260 | unsigned long num_virtual_buffers; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 261 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 262 | /* address of the first table */ |
| 263 | unsigned long first_table_addr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 264 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 265 | /* number of entries in the first table */ |
| 266 | unsigned long first_table_num_entries; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 267 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 268 | /* data size of the first table */ |
| 269 | unsigned long first_table_data_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 270 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 271 | /* distinct user/kernel layout */ |
| 272 | bool isKernelVirtualAddress; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 273 | |
| 274 | }; |
| 275 | |
| 276 | /* |
| 277 | command struct for set flow id |
| 278 | */ |
| 279 | struct sep_driver_set_flow_id_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 280 | /* flow id to set */ |
| 281 | unsigned long flow_id; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 282 | }; |
| 283 | |
| 284 | |
| 285 | /* command struct for add tables message */ |
| 286 | struct sep_driver_add_message_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 287 | /* flow id to set */ |
| 288 | unsigned long flow_id; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 289 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 290 | /* message size in bytes */ |
| 291 | unsigned long message_size_in_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 292 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 293 | /* address of the message */ |
| 294 | unsigned long message_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 295 | }; |
| 296 | |
| 297 | /* command struct for static pool addresses */ |
| 298 | struct sep_driver_static_pool_addr_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 299 | /* physical address of the static pool */ |
| 300 | unsigned long physical_static_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 301 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 302 | /* virtual address of the static pool */ |
| 303 | unsigned long virtual_static_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 304 | }; |
| 305 | |
| 306 | /* command struct for getiing offset of the physical address from |
| 307 | the start of the mapped area */ |
| 308 | struct sep_driver_get_mapped_offset_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 309 | /* physical address of the static pool */ |
| 310 | unsigned long physical_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 311 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 312 | /* virtual address of the static pool */ |
| 313 | unsigned long offset; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 314 | }; |
| 315 | |
| 316 | /* command struct for getting time value and address */ |
| 317 | struct sep_driver_get_time_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 318 | /* physical address of stored time */ |
| 319 | unsigned long time_physical_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 320 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 321 | /* value of the stored time */ |
| 322 | unsigned long time_value; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 323 | }; |
| 324 | |
| 325 | |
| 326 | /* |
| 327 | structure that represent one entry in the DMA LLI table |
| 328 | */ |
| 329 | struct sep_lli_entry_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 330 | /* physical address */ |
| 331 | unsigned long physical_address; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 332 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 333 | /* block size */ |
| 334 | unsigned long block_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 335 | }; |
| 336 | |
| 337 | /* |
| 338 | structure that reperesents data needed for lli table construction |
| 339 | */ |
| 340 | struct sep_lli_prepare_table_data_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 341 | /* pointer to the memory where the first lli entry to be built */ |
| 342 | struct sep_lli_entry_t *lli_entry_ptr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 343 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 344 | /* pointer to the array of lli entries from which the table is to be built */ |
| 345 | struct sep_lli_entry_t *lli_array_ptr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 346 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 347 | /* number of elements in lli array */ |
| 348 | int lli_array_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 349 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 350 | /* number of entries in the created table */ |
| 351 | int num_table_entries; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 352 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 353 | /* number of array entries processed during table creation */ |
| 354 | int num_array_entries_processed; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 355 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 356 | /* the totatl data size in the created table */ |
| 357 | int lli_table_total_data_size; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 358 | }; |
| 359 | |
| 360 | /* |
| 361 | structure that represent tone table - it is not used in code, jkust |
| 362 | to show what table looks like |
| 363 | */ |
| 364 | struct sep_lli_table_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 365 | /* number of pages mapped in this tables. If 0 - means that the table |
| 366 | is not defined (used as a valid flag) */ |
| 367 | unsigned long num_pages; |
| 368 | /* |
| 369 | pointer to array of page pointers that represent the mapping of the |
| 370 | virtual buffer defined by the table to the physical memory. If this |
| 371 | pointer is NULL, it means that the table is not defined |
| 372 | (used as a valid flag) |
| 373 | */ |
| 374 | struct page **table_page_array_ptr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 375 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 376 | /* maximum flow entries in table */ |
| 377 | struct sep_lli_entry_t lli_entries[SEP_DRIVER_MAX_FLOW_NUM_ENTRIES_IN_TABLE]; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 378 | }; |
| 379 | |
| 380 | |
| 381 | /* |
| 382 | structure for keeping the mapping of the virtual buffer into physical pages |
| 383 | */ |
| 384 | struct sep_flow_buffer_data { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 385 | /* pointer to the array of page structs pointers to the pages of the |
| 386 | virtual buffer */ |
| 387 | struct page **page_array_ptr; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 388 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 389 | /* number of pages taken by the virtual buffer */ |
| 390 | unsigned long num_pages; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 391 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 392 | /* this flag signals if this page_array is the last one among many that were |
| 393 | sent in one setting to SEP */ |
| 394 | unsigned long last_page_array_flag; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 395 | }; |
| 396 | |
| 397 | /* |
| 398 | struct that keeps all the data for one flow |
| 399 | */ |
| 400 | struct sep_flow_context_t { |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 401 | /* |
| 402 | work struct for handling the flow done interrupt in the workqueue |
| 403 | this structure must be in the first place, since it will be used |
| 404 | forcasting to the containing flow context |
| 405 | */ |
| 406 | struct work_struct flow_wq; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 407 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 408 | /* flow id */ |
| 409 | unsigned long flow_id; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 410 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 411 | /* additional input tables exists */ |
| 412 | unsigned long input_tables_flag; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 413 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 414 | /* additional output tables exists */ |
| 415 | unsigned long output_tables_flag; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 416 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 417 | /* data of the first input file */ |
| 418 | struct sep_lli_entry_t first_input_table; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 419 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 420 | /* data of the first output table */ |
| 421 | struct sep_lli_entry_t first_output_table; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 422 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 423 | /* last input table data */ |
| 424 | struct sep_lli_entry_t last_input_table; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 425 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 426 | /* last output table data */ |
| 427 | struct sep_lli_entry_t last_output_table; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 428 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 429 | /* first list of table */ |
| 430 | struct sep_lli_entry_t input_tables_in_process; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 431 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 432 | /* output table in process (in sep) */ |
| 433 | struct sep_lli_entry_t output_tables_in_process; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 434 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 435 | /* size of messages in bytes */ |
| 436 | unsigned long message_size_in_bytes; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 437 | |
Alan Cox | d19cf32 | 2009-08-06 20:45:57 +0100 | [diff] [blame] | 438 | /* message */ |
| 439 | unsigned char message[SEP_MAX_ADD_MESSAGE_LENGTH_IN_BYTES]; |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 440 | }; |
| 441 | |
| 442 | |
Mark Allyn | cd1bb43 | 2009-08-06 20:43:59 +0100 | [diff] [blame] | 443 | #endif |