persistent_ram: Remove prz->node
[deliverable/linux.git] / drivers / staging / android / persistent_ram.h
1 /*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15 #ifndef __LINUX_PERSISTENT_RAM_H__
16 #define __LINUX_PERSISTENT_RAM_H__
17
18 #include <linux/device.h>
19 #include <linux/kernel.h>
20 #include <linux/list.h>
21 #include <linux/types.h>
22
23 struct persistent_ram_buffer;
24
25 struct persistent_ram_descriptor {
26 const char *name;
27 phys_addr_t size;
28 };
29
30 struct persistent_ram {
31 phys_addr_t start;
32 phys_addr_t size;
33
34 int num_descs;
35 struct persistent_ram_descriptor *descs;
36
37 struct list_head node;
38 };
39
40 struct persistent_ram_zone {
41 void *vaddr;
42 struct persistent_ram_buffer *buffer;
43 size_t buffer_size;
44
45 /* ECC correction */
46 bool ecc;
47 char *par_buffer;
48 char *par_header;
49 struct rs_control *rs_decoder;
50 int corrected_bytes;
51 int bad_blocks;
52 int ecc_block_size;
53 int ecc_size;
54 int ecc_symsize;
55 int ecc_poly;
56
57 char *old_log;
58 size_t old_log_size;
59 size_t old_log_footer_size;
60 bool early;
61 };
62
63 int persistent_ram_early_init(struct persistent_ram *ram);
64
65 struct persistent_ram_zone *persistent_ram_init_ringbuffer(struct device *dev,
66 bool ecc);
67
68 int persistent_ram_write(struct persistent_ram_zone *prz, const void *s,
69 unsigned int count);
70
71 size_t persistent_ram_old_size(struct persistent_ram_zone *prz);
72 void *persistent_ram_old(struct persistent_ram_zone *prz);
73 void persistent_ram_free_old(struct persistent_ram_zone *prz);
74 ssize_t persistent_ram_ecc_string(struct persistent_ram_zone *prz,
75 char *str, size_t len);
76
77 #endif
This page took 0.049378 seconds and 5 git commands to generate.