3 * struct flchip definition
5 * Contains information about the location and state of a given flash device
7 * (C) 2000 Red Hat. GPLd.
10 #ifndef __MTD_FLASHCHIP_H__
11 #define __MTD_FLASHCHIP_H__
13 /* For spinlocks. sched.h includes spinlock.h from whichever directory it
14 * happens to be in - so we don't have to care whether we're on 2.2, which
15 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
17 #include <linux/sched.h>
46 /* NOTE: confusingly, this can be used to refer to more than one chip at a time,
47 if they're interleaved. This can even refer to individual partitions on
48 the same physical chip when present. */
51 unsigned long start
; /* Offset within the map */
53 /* We omit len for now, because when we group them together
54 we insist that they're all of the same size, and the chip size
55 is held in the next level up. If we get more versatile later,
56 it'll make it a damn sight harder to find which chip we want from
57 a given offset, and we'll want to add the per-chip length field
60 int ref_point_counter
;
64 unsigned int write_suspended
:1;
65 unsigned int erase_suspended
:1;
66 unsigned long in_progress_block_addr
;
69 spinlock_t _spinlock
; /* We do it like this because sometimes they'll be shared. */
70 wait_queue_head_t wq
; /* Wait on here when we're waiting for the chip
73 int buffer_write_time
;
76 int word_write_time_max
;
77 int buffer_write_time_max
;
83 /* This is used to handle contention on write/erase operations
84 between partitions of the same physical chip. */
85 struct flchip_shared
{
87 struct flchip
*writing
;
88 struct flchip
*erasing
;
92 #endif /* __MTD_FLASHCHIP_H__ */