Deleted Added
full compact
cfi_var.h (233553) cfi_var.h (255207)
1/*-
2 * Copyright (c) 2007, Juniper Networks, Inc.
1/*-
2 * Copyright (c) 2007, Juniper Networks, Inc.
3 * Copyright (c) 2012-2013, SRI International
3 * All rights reserved.
4 *
4 * All rights reserved.
5 *
6 * Portions of this software were developed by SRI International and the
7 * University of Cambridge Computer Laboratory under DARPA/AFRL contract
8 * (FA8750-10-C-0237) ("CTSRD"), as part of the DARPA CRASH research
9 * programme.
10 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.

--- 8 unchanged lines hidden (view full) ---

21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.

--- 8 unchanged lines hidden (view full) ---

27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
29 * $FreeBSD: head/sys/dev/cfi/cfi_var.h 233553 2012-03-27 15:13:12Z jchandra $
35 * $FreeBSD: head/sys/dev/cfi/cfi_var.h 255207 2013-09-04 17:19:21Z brooks $
30 */
31
32#ifndef _DEV_CFI_VAR_H_
33#define _DEV_CFI_VAR_H_
34
36 */
37
38#ifndef _DEV_CFI_VAR_H_
39#define _DEV_CFI_VAR_H_
40
41enum cfi_wait_cmd {
42 CFI_TIMEOUT_ERASE,
43 CFI_TIMEOUT_WRITE,
44 CFI_TIMEOUT_BUFWRITE
45};
46
35struct cfi_region {
36 u_int r_blocks;
37 u_int r_blksz;
38};
39
40struct cfi_softc {
41 device_t sc_dev;
42
43 struct resource *sc_res;
44 bus_space_handle_t sc_handle;
45 bus_space_tag_t sc_tag;
46 int sc_rid;
47
48 u_int sc_size; /* Flash size. */
49 u_int sc_width; /* Interface width. */
50 u_int sc_regions; /* Erase regions. */
51 struct cfi_region *sc_region; /* Array of region info. */
52
53 u_int sc_cmdset;
47struct cfi_region {
48 u_int r_blocks;
49 u_int r_blksz;
50};
51
52struct cfi_softc {
53 device_t sc_dev;
54
55 struct resource *sc_res;
56 bus_space_handle_t sc_handle;
57 bus_space_tag_t sc_tag;
58 int sc_rid;
59
60 u_int sc_size; /* Flash size. */
61 u_int sc_width; /* Interface width. */
62 u_int sc_regions; /* Erase regions. */
63 struct cfi_region *sc_region; /* Array of region info. */
64
65 u_int sc_cmdset;
54 u_int sc_erase_timeout;
55 u_int sc_write_timeout;
66 sbintime_t sc_typical_timeouts[3];
67 sbintime_t sc_max_timeouts[3];
68 u_int sc_tto_counts[3];
69 u_int sc_mto_counts[3];
56
70
71 u_int sc_maxbuf;
72
57 struct cdev *sc_nod;
58 struct proc *sc_opened; /* Process that has us opened. */
59
60 u_char *sc_wrbuf;
73 struct cdev *sc_nod;
74 struct proc *sc_opened; /* Process that has us opened. */
75
76 u_char *sc_wrbuf;
77 u_char *sc_wrbufcpy;
61 u_int sc_wrbufsz;
62 u_int sc_wrofs;
63 u_int sc_writing;
64};
65
66extern char cfi_driver_name[];
67extern devclass_t cfi_devclass;
68extern devclass_t cfi_diskclass;

--- 20 unchanged lines hidden ---
78 u_int sc_wrbufsz;
79 u_int sc_wrofs;
80 u_int sc_writing;
81};
82
83extern char cfi_driver_name[];
84extern devclass_t cfi_devclass;
85extern devclass_t cfi_diskclass;

--- 20 unchanged lines hidden ---