mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
drivers/mtd: add MTDIOC_ISBAD ioctl
add an ioctl item MTDIOC_ISBAD used for flashtool command to check bad blocks Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
This commit is contained in:
@@ -85,6 +85,9 @@
|
||||
* OUT: None
|
||||
* Resets the device to the power-on
|
||||
* default condition */
|
||||
#define MTDIOC_ISBAD _MTDIOC(0x000e) /* IN: Erase block number
|
||||
* OUT: 0=A good block
|
||||
* 1=A bad block */
|
||||
|
||||
/* Macros to hide implementation */
|
||||
|
||||
@@ -158,6 +161,14 @@ struct mtd_erase_s
|
||||
uint32_t nblocks; /* Number of blocks to be erased */
|
||||
};
|
||||
|
||||
/* This structure store the bad block information of a block */
|
||||
|
||||
struct mtd_bad_block_s
|
||||
{
|
||||
off_t block_num;
|
||||
int bad_flag;
|
||||
};
|
||||
|
||||
/* This structure defines the interface to a simple memory technology device.
|
||||
* It will likely need to be extended in the future to support more complex
|
||||
* devices.
|
||||
|
||||
Reference in New Issue
Block a user