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