| 1 | /* |
|---|
| 2 | * |
|---|
| 3 | * Derived from (and probably identical to): |
|---|
| 4 | * ftl.h 1.7 1999/10/25 20:23:17 |
|---|
| 5 | * |
|---|
| 6 | * The contents of this file are subject to the Mozilla Public License |
|---|
| 7 | * Version 1.1 (the "License"); you may not use this file except in |
|---|
| 8 | * compliance with the License. You may obtain a copy of the License |
|---|
| 9 | * at http://www.mozilla.org/MPL/ |
|---|
| 10 | * |
|---|
| 11 | * Software distributed under the License is distributed on an "AS IS" |
|---|
| 12 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See |
|---|
| 13 | * the License for the specific language governing rights and |
|---|
| 14 | * limitations under the License. |
|---|
| 15 | * |
|---|
| 16 | * The initial developer of the original code is David A. Hinds |
|---|
| 17 | * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds |
|---|
| 18 | * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. |
|---|
| 19 | * |
|---|
| 20 | * Alternatively, the contents of this file may be used under the |
|---|
| 21 | * terms of the GNU General Public License version 2 (the "GPL"), in |
|---|
| 22 | * which case the provisions of the GPL are applicable instead of the |
|---|
| 23 | * above. If you wish to allow the use of your version of this file |
|---|
| 24 | * only under the terms of the GPL and not to allow others to use |
|---|
| 25 | * your version of this file under the MPL, indicate your decision by |
|---|
| 26 | * deleting the provisions above and replace them with the notice and |
|---|
| 27 | * other provisions required by the GPL. If you do not delete the |
|---|
| 28 | * provisions above, a recipient may use your version of this file |
|---|
| 29 | * under either the MPL or the GPL. |
|---|
| 30 | */ |
|---|
| 31 | |
|---|
| 32 | #ifndef _LINUX_FTL_H |
|---|
| 33 | #define _LINUX_FTL_H |
|---|
| 34 | |
|---|
| 35 | typedef struct erase_unit_header_t { |
|---|
| 36 | u_int8_t LinkTargetTuple[5]; |
|---|
| 37 | u_int8_t DataOrgTuple[10]; |
|---|
| 38 | u_int8_t NumTransferUnits; |
|---|
| 39 | u_int32_t EraseCount; |
|---|
| 40 | u_int16_t LogicalEUN; |
|---|
| 41 | u_int8_t BlockSize; |
|---|
| 42 | u_int8_t EraseUnitSize; |
|---|
| 43 | u_int16_t FirstPhysicalEUN; |
|---|
| 44 | u_int16_t NumEraseUnits; |
|---|
| 45 | u_int32_t FormattedSize; |
|---|
| 46 | u_int32_t FirstVMAddress; |
|---|
| 47 | u_int16_t NumVMPages; |
|---|
| 48 | u_int8_t Flags; |
|---|
| 49 | u_int8_t Code; |
|---|
| 50 | u_int32_t SerialNumber; |
|---|
| 51 | u_int32_t AltEUHOffset; |
|---|
| 52 | u_int32_t BAMOffset; |
|---|
| 53 | u_int8_t Reserved[12]; |
|---|
| 54 | u_int8_t EndTuple[2]; |
|---|
| 55 | } erase_unit_header_t; |
|---|
| 56 | |
|---|
| 57 | /* Flags in erase_unit_header_t */ |
|---|
| 58 | #define HIDDEN_AREA 0x01 |
|---|
| 59 | #define REVERSE_POLARITY 0x02 |
|---|
| 60 | #define DOUBLE_BAI 0x04 |
|---|
| 61 | |
|---|
| 62 | /* Definitions for block allocation information */ |
|---|
| 63 | |
|---|
| 64 | #define BLOCK_FREE(b) ((b) == 0xffffffff) |
|---|
| 65 | #define BLOCK_DELETED(b) (((b) == 0) || ((b) == 0xfffffffe)) |
|---|
| 66 | |
|---|
| 67 | #define BLOCK_TYPE(b) ((b) & 0x7f) |
|---|
| 68 | #define BLOCK_ADDRESS(b) ((b) & ~0x7f) |
|---|
| 69 | #define BLOCK_NUMBER(b) ((b) >> 9) |
|---|
| 70 | #define BLOCK_CONTROL 0x30 |
|---|
| 71 | #define BLOCK_DATA 0x40 |
|---|
| 72 | #define BLOCK_REPLACEMENT 0x60 |
|---|
| 73 | #define BLOCK_BAD 0x70 |
|---|
| 74 | |
|---|
| 75 | #endif /* _LINUX_FTL_H */ |
|---|