IO_Ctrl() - Device Driver
static void FSDev_####_IO_Ctrl (FS_DEV *p_dev,
FS_IO_CTRL_CMD cmd,
Void *p_buf,
FS_ERR *p_err);
File | Called from | Code enabled by |
---|---|---|
| various | N/A |
The device driver IO_Ctrl()
function performs an I/O control operation.
Arguments
p_dev
Pointer to device to query.
p_buf
Buffer which holds data to be used for operations
OR
Buffer in which data will be stored as a result of operation.
p_err
Pointer to variable that will receive the return error code from this function
FS_ERR_NONE
Control operation performed successfully.
FS_ERR_DEV_INVALID_IO_CTRL
I/O control operation unknown to driver.
FS_ERR_DEV_INVALID_UNIT_NBR
Device unit number is invalid.
FS_ERR_DEV_IO
Device I/O error.
FS_ERR_DEV_NOT_OPEN
Device is not open.
FS_ERR_DEV_NOT_PRESENT
Device is not present.
FS_ERR_DEV_TIMEOUT
Device timeout.
Returned Value
None.
Notes/Warnings
- Tracking whether a device is open is not necessary, because this should ONLY be called when a device is open.
Defined I/O control operations are
FS_DEV_IO_CTRL_REFRESH
Refresh device. FS_DEV_IO_CTRL_LOW_FMT
Low-level format device. FS_DEV_IO_CTRL_LOW_MOUNT
Low-level mount device. FS_DEV_IO_CTRL_LOW_UNMOUNT
Low-level unmount device. FS_DEV_IO_CTRL_LOW_COMPACT
Low-level compact device. FS_DEV_IO_CTRL_LOW_DEFRAH
Low-level defragment device. FS_DEV_IO_CTRL_SEC_RELEASE
Release data in sector FS_DEV_IO_CTRL_PHY_RD
Read physical device FS_DEV_IO_CTRL_PHY_WR
Write physical device FS_DEV_IO_CTRL_PHY_RD_PAGE
Read physical device page FS_DEV_IO_CTRL_PHY_WR_PAGE
Write physical device page FS_DEV_IO_CTRL_PHY_ERASE_BLK
Erase physical device block FS_DEV_IO_CTRL_PHY_ERASE_CHIP
Erase physical device
The device driver IO_Ctrl()
function is called while the caller holds the device lock.