函数 | |
INT32 | los_disk_init (const CHAR *diskName, const struct block_operations *bops, VOID *priv, INT32 diskID, VOID *info) |
Disk driver initialization. 更多... | |
INT32 | los_disk_deinit (INT32 diskID) |
Destroy a disk driver. 更多... | |
INT32 | los_disk_read (INT32 drvID, VOID *buf, UINT64 sector, UINT32 count, BOOL useRead) |
Read data from disk driver. 更多... | |
INT32 | los_disk_write (INT32 drvID, const VOID *buf, UINT64 sector, UINT32 count) |
Write data to a disk driver. 更多... | |
INT32 | los_disk_ioctl (INT32 drvID, INT32 cmd, VOID *buf) |
Get information of disk driver. 更多... | |
INT32 | los_disk_sync (INT32 drvID) |
Sync blib cache. 更多... | |
INT32 | los_disk_set_bcache (INT32 drvID, UINT32 sectorPerBlock, UINT32 blockNum) |
Set blib cache for the disk driver. 更多... | |
INT32 | los_part_read (INT32 pt, VOID *buf, UINT64 sector, UINT32 count, BOOL useRead) |
Read data from chosen partition. 更多... | |
INT32 | los_part_write (INT32 pt, const VOID *buf, UINT64 sector, UINT32 count) |
Write data to chosen partition. 更多... | |
INT32 | los_disk_cache_clear (INT32 drvID) |
Clear the bcache data 更多... | |
INT32 | los_part_ioctl (INT32 pt, INT32 cmd, VOID *buf) |
Get information of chosen partition. 更多... | |
INT32 | los_part_access (const CHAR *dev, mode_t mode) |
Decide the chosen partition is exist or not. 更多... | |
los_part * | los_part_find (struct Vnode *blkDriver) |
Find disk partition. 更多... | |
los_disk * | get_disk (INT32 id) |
Find disk driver. 更多... | |
los_part * | get_part (INT32 id) |
Find disk partition. 更多... | |
VOID | show_part (los_part *part) |
Print partition information. 更多... | |
INT32 | add_mmc_partition (struct disk_divide_info *info, size_t sectorStart, size_t sectorCount) |
Add a new mmc partition. 更多... | |
INT32 | los_alloc_diskid_byname (const CHAR *diskName) |
alloc a new UNUSED disk id. 更多... | |
INT32 | los_get_diskid_byname (const CHAR *diskName) |
get the INUSED disk id. 更多... | |
VOID | OsSetUsbStatus (UINT32 diskId) |
Set usb mode. 更多... | |
VOID | OsClearUsbStatus (UINT32 diskId) |
Set usb mode. 更多... | |
INT32 add_mmc_partition | ( | struct disk_divide_info * | info, |
size_t | sectorStart, | ||
size_t | sectorCount | ||
) |
Add a new mmc partition.
info | [IN] Type #struct disk_divide_info * Disk driver information structure pointer. |
sectorStart | [IN] Type size_t Start sector number of the new partition. |
sectorCount | [IN] Type size_t Sector count of the new partition. |
#0 | Add partition success. |
#-1 | Add partition failed. |
Add a new mmc partition.
info | |
sectorStart | |
sectorCount |
Find disk partition.
id | [IN] Type INT32 partition id number,less than the value defined by SYS_MAX_PART. |
#NULL | Can't find chosen disk partition. |
los_part | * This is partition structure pointer of chosen disk partition. |
Find disk partition.
alloc a new UNUSED disk id.
diskName | [IN] Type #const CHAR * device name. |
INT32 | available disk id |
#-1 | alloc disk id failed |
alloc a new UNUSED disk id.
Clear the bcache data
drvID | [IN] Type INT32 disk id |
#0 | Write success. |
#-1 | Write failed. |
Destroy a disk driver.
diskID | [IN] Type INT32 disk driver id number, less than the value defined by SYS_MAX_DISK. |
#0 | Destroy success. |
#-1 | Destroy failed. |
Destroy a disk driver.
INT32 los_disk_init | ( | const CHAR * | diskName, |
const struct block_operations * | bops, | ||
VOID * | priv, | ||
INT32 | diskID, | ||
VOID * | info | ||
) |
Disk driver initialization.
diskName | [IN] Type #const CHAR * disk driver name. |
bops | [IN] Type #const struct block_operations * block driver control structure. |
priv | [IN] Type #VOID * private data of vnode. |
diskID | [IN] Type INT32 disk id number, less than SYS_MAX_DISK. |
info | [IN] Type #VOID * disk driver partition information. |
#0 | Initialization success. |
#-1 | Initialization failed. |
Disk driver initialization.
Get information of disk driver.
drvID | [IN] Type INT32 disk driver id number, less than the value defined by SYS_MAX_DISK. |
cmd | [IN] Type INT32 command to issu, currently support GET_SECTOR_COUNT, GET_SECTOR_SIZE, GET_BLOCK_SIZE, CTRL_SYNC. |
buf | [OUT] Type #VOID * memory to storage the information, the size must enough for data type(UINT64) when cmd type is DISK_GET_SECTOR_COUNT, others is size_t. |
#0 | Get information success. |
#-1 | Get information failed. |
Read data from disk driver.
drvID | [IN] Type INT32 disk driver id number, less than the value defined by SYS_MAX_DISK. |
buf | [OUT] Type #VOID * memory which used to store read data. |
sector | [IN] Type UINT64 expected start sector number to read. |
count | [IN] Type UINT32 expected sector count to read. |
useRead | [IN] Type BOOL set FALSE to use the write block for optimization |
#0 | Read success. |
#-1 | Read failed. |
Read data from disk driver.
Set blib cache for the disk driver.
drvID | [IN] Type INT32 disk driver id number, less than the value defined by SYS_MAX_DISK. |
sectorPerBlock | [IN] Type UINT32 sector number of per block, only can be 32 * (1, 2, ..., 8). |
blockNum | [IN] Type UINT32 block number of cache. |
#0 | Set success. |
INT32 | Set failed. |
Set blib cache for the disk driver.
Write data to a disk driver.
drvID | [IN] Type INT32 disk driver id number, less than the value defined by SYS_MAX_DISK. |
buf | [IN] Type #const VOID * memory which used to storage write data. |
sector | [IN] Type UINT64 expected start sector number to read. |
count | [IN] Type UINT32 experted sector count of write. |
#0 | Write success. |
#-1 | Write failed. |
Write data to a disk driver.
get the INUSED disk id.
diskName | [IN] Type #const CHAR * device name. |
INT32 | available disk id |
#-1 | get disk id failed |
get the INUSED disk id.
Decide the chosen partition is exist or not.
dev | [IN] Type #const CHAR * partition driver name. |
mode | [IN] Type mode_t access modd. |
#0 | The chosen partition is exist. |
#-1 | The chosen partition is not exist. |
Decide the chosen partition is exist or not.
Find disk partition.
blkDriver | [IN] Type #struct Vnode * partition driver vnode. |
#NULL | Can't find chosen disk partition. |
los_part | * This is partition structure pointer of chosen disk partition. |
Find disk partition.
Get information of chosen partition.
pt | [IN] Type INT32 partition number,less than the value defined by SYS_MAX_PART. |
cmd | [IN] Type INT32 command to issu, currently support GET_SECTOR_COUNT, GET_SECTOR_SIZE, GET_BLOCK_SIZE, CTRL_SYNC. |
buf | [OUT] Type #VOID * memory to store the information, the size must enough for data type (UINT64) when cmd type is DISK_GET_SECTOR_COUNT, others is size_t. |
#0 | Get information success. |
#-1 | Get information failed. |
Read data from chosen partition.
pt | [IN] Type INT32 partition number, less than the value defined by SYS_MAX_PART. |
buf | [OUT] Type #VOID * memory which used to store the data to be read. |
sector | [IN] Type UINT64 start sector number of chosen partition. |
count | [IN] Type UINT32 the expected sector count for reading. |
useRead | [IN] Type BOOL FALSE when reading large contiguous data, TRUE for other situations |
#0 | Read success. |
#-1 | Read failed. |
Read data from chosen partition.
Write data to chosen partition.
pt | [IN] Type INT32 partition number,less than the value defined by SYS_MAX_PART. |
buf | [IN] Type #VOID * memory which used to storage the written data. |
sector | [IN] Type UINT64 start sector number of chosen partition. |
count | [IN] Type UINT32 the expected sector count for write. |
#0 | Write success. |
#-1 | Write failed. |
Write data to chosen partition.
VOID OsClearUsbStatus | ( | UINT32 | diskId | ) |
Set usb mode.
diskId | [IN] Type # unsigned int disk id. |
VOID OsSetUsbStatus | ( | UINT32 | diskId | ) |
Set usb mode.
diskId | [IN] Type # unsigned int disk id. |