diff options
author | Alan Cox <alan@linux.intel.com> | 2009-08-06 15:45:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 15:02:12 -0400 |
commit | f5e3980f9b28b703bc009af9dfa33ae2236503da (patch) | |
tree | 8d63e5b932f32b5a9c38b733c6928206346f159f /drivers/staging/sep/sep_dev.h | |
parent | 6a107539899803c1f8f36bcd3cc5a3c68660bd13 (diff) |
Staging: sep: Create a structure to hold all the current crap spewed about as globals
For now keep the field names matching the variable names
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sep/sep_dev.h')
-rw-r--r-- | drivers/staging/sep/sep_dev.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/drivers/staging/sep/sep_dev.h b/drivers/staging/sep/sep_dev.h new file mode 100644 index 00000000000..b3d48e16dc6 --- /dev/null +++ b/drivers/staging/sep/sep_dev.h | |||
@@ -0,0 +1,119 @@ | |||
1 | #ifndef __SEP_DEV_H__ | ||
2 | #define __SEP_DEV_H__ | ||
3 | |||
4 | /* | ||
5 | * | ||
6 | * sep_dev.h - Security Processor Device Structures | ||
7 | * | ||
8 | * Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
9 | * Copyright(c) 2009 Discretix. All rights reserved. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the Free | ||
13 | * Software Foundation; either version 2 of the License, or (at your option) | ||
14 | * any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
19 | * more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License along with | ||
22 | * this program; if not, write to the Free Software Foundation, Inc., 59 | ||
23 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
24 | * | ||
25 | * CONTACTS: | ||
26 | * | ||
27 | * Alan Cox alan@linux.intel.com | ||
28 | * | ||
29 | */ | ||
30 | |||
31 | struct sep_device { | ||
32 | /* pointer to pci dev */ | ||
33 | struct pci_dev *sep_pci_dev_ptr; | ||
34 | |||
35 | unsigned long io_memory_start_physical_address; | ||
36 | unsigned long io_memory_end_physical_address; | ||
37 | unsigned long io_memory_size; | ||
38 | void *io_memory_start_virtual_address; | ||
39 | |||
40 | /* restricted access region */ | ||
41 | unsigned long rar_physical_address; | ||
42 | void *rar_virtual_address; | ||
43 | |||
44 | /* shared memory region */ | ||
45 | unsigned long shared_physical_address; | ||
46 | void *shared_virtual_address; | ||
47 | |||
48 | /* firmware regions */ | ||
49 | unsigned long cache_physical_address; | ||
50 | unsigned long cache_size; | ||
51 | void *cache_virtual_address; | ||
52 | |||
53 | unsigned long resident_physical_address; | ||
54 | unsigned long resident_size; | ||
55 | void *resident_virtual_address; | ||
56 | |||
57 | /* device interrupt (as retrieved from PCI) */ | ||
58 | int sep_irq; | ||
59 | |||
60 | unsigned long rar_region_addr; | ||
61 | |||
62 | /* start address of the access to the SEP registers from driver */ | ||
63 | unsigned long reg_base_address; | ||
64 | /* transaction counter that coordinates the transactions between SEP and HOST */ | ||
65 | unsigned long host_to_sep_send_counter; | ||
66 | /* counter for the messages from sep */ | ||
67 | unsigned long sep_to_host_reply_counter; | ||
68 | /* counter for the number of bytes allocated in the pool for the current | ||
69 | transaction */ | ||
70 | unsigned long data_pool_bytes_allocated; | ||
71 | |||
72 | /* array of pointers to the pages that represent input data for the synchronic | ||
73 | DMA action */ | ||
74 | struct page **in_page_array; | ||
75 | |||
76 | /* array of pointers to the pages that represent out data for the synchronic | ||
77 | DMA action */ | ||
78 | struct page **out_page_array; | ||
79 | |||
80 | /* number of pages in the sep_in_page_array */ | ||
81 | unsigned long in_num_pages; | ||
82 | |||
83 | /* number of pages in the sep_out_page_array */ | ||
84 | unsigned long out_num_pages; | ||
85 | |||
86 | /* global data for every flow */ | ||
87 | struct sep_flow_context_t flows_data_array[SEP_DRIVER_NUM_FLOWS]; | ||
88 | |||
89 | /* flag for API mode - 1 -is blocking, 0 is non-blocking */ | ||
90 | unsigned long block_mode_flag; | ||
91 | |||
92 | /* pointer to the workqueue that handles the flow done interrupts */ | ||
93 | struct workqueue_struct *flow_wq_ptr; | ||
94 | |||
95 | /* address of the shared memory allocated during init for SEP driver */ | ||
96 | unsigned long shared_area_addr; | ||
97 | /* the physical address of the shared area */ | ||
98 | unsigned long phys_shared_area_addr; | ||
99 | |||
100 | /* Message Shared Area start address - will be allocated during init */ | ||
101 | unsigned long message_shared_area_addr; | ||
102 | }; | ||
103 | |||
104 | extern struct sep_device *sep_dev; | ||
105 | |||
106 | extern inline void sep_write_reg(struct sep_device *dev, int reg, u32 value) | ||
107 | { | ||
108 | void __iomem *addr = dev->reg_base_address + reg; | ||
109 | writel(value, reg); | ||
110 | } | ||
111 | |||
112 | extern inline u32 sep_read_reg(struct sep_device *dev, int reg) | ||
113 | { | ||
114 | void __iomem *addr = dev->reg_base_address + reg; | ||
115 | return readl(reg); | ||
116 | } | ||
117 | |||
118 | #endif | ||
119 | |||