mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
mtd: Implement BIOC_PARTINFO for all drivers
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Gustavo Henrique Nihei
parent
5a1de89370
commit
71269811ca
@@ -436,6 +436,23 @@ static int filemtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks *
|
||||
priv->erasesize / priv->blocksize;
|
||||
info->sectorsize = priv->blocksize;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
||||
Reference in New Issue
Block a user