|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|

函数 | |
| 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) |
| 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) |
| 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_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 (const struct inode *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 (const 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 disk id in used. | |
| 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. |
Find disk driver.
| id | [IN] Type INT32 disk id number,less than the value defined by SYS_MAX_DISK. |
| NULL | Can't find chosen disk driver. |
| los_disk | * This is disk structure pointer of chosen disk driver. |
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. |
alloc a new UNUSED disk id.
| diskName | [IN] Type #const CHAR * device name. |
| INT32 | available disk id |
| #-1 | alloc disk id 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. |
| 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 inode. |
| 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. |
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 DISK_GET_SECTOR_COUNT, DISK_GET_SECTOR_SIZE, DISK_GET_BLOCK_SIZE, DISK_CTRL_SYNC. |
| buf | [OUT] Type VOID * memory to storage the information, different cmd require different buf sizes: DISK_CTRL_SYNC(NULL) DISK_GET_SECTOR_COUNT(UINT64) DISK_GET_SECTOR_SIZE(size_t) DISK_GET_BLOCK_SIZE(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. |
| #0 | Read success. |
| #-1 | Read failed. |
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. |
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. |
get the disk id in used.
| diskName | [IN] Type #const CHAR * device name. |
| INT32 | available disk id |
| #-1 | get disk id failed |
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. |
| los_part * los_part_find | ( | const struct inode * | blkDriver | ) |
Find disk partition.
| blkDriver | [IN] Type #struct inode * partition driver inode. |
| NULL | Can't find chosen disk partition. |
| los_part | * This is partition structure pointer of chosen 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, TRIM_CMD. |
| buf | [OUT] Type VOID * memory to store the information, different cmd require different buf size: CTRL_SYNC(NULL) GET_SECTOR_COUNT(UINT64) GET_SECTOR_SIZE(size_t) GET_BLOCK_SIZE(size_t) TRIM_CMD(UINT64 * 2). |
| #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. |
| #0 | Read success. |
| #-1 | Read failed. |
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. |
Set usb mode.
| diskId | [IN] Type # unsigned int disk id. |
Set usb mode.
| diskId | [IN] Type # unsigned int disk id. |