[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Technical Reference: Kernel and Subsystems, Volume 2
IDEIOREAD (Read) IDE Adapter Device Driver ioctl Operation
Purpose
Issues a single block Integrated Device Electronics
(IDE) read command to a selected IDE ATA device.
Description
The IDEIOREAD operation allows
the caller to issue an IDE device read command to a
selected device. System management routines use this command for configuring
IDE devices.
The arg parameter of the IDEIOREAD operation is the address of an ide_readblk structure. This structure is defined in the /usr/include/sys/ide.h header file.
This command results in the IDE adapter device driver
issuing an ATA READ SECTOR read command. The command
is set up to read only a single block. The caller supplies:
- Target device IDE device ID
- Logical block number or cylinder-head-sector
block number to be read
- Length (in bytes) of the block on the device
- Time-out value (in seconds) for the command
- Pointer to the application buffer where the
returned data is to be placed
- Flags parameter
The maximum block length for this command is 512 bytes.
The command will be rejected if the length is found to be larger than this
value.
Note
The IDE adapter device driver performs normal error-recovery
procedures during execution of this command.
Return Values
When completed successfully, this operation returns
a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to 1 of the following values:
Value |
Description |
EFAULT |
Indicates that a bad copy between kernel and user space occurred. |
EINVAL |
Indicates that an IDEIOSTART command was not
issued prior to this command. If the IDEIOSTART command
was issued, then this indicates the block length field value is too large. |
EIO |
Indicates that an I/O error has occurred. If
an EIO value is returned, the caller should retry the IDEIOREAD operation since the first command may have cleared
an error condition with the device. In the case of an adapter error, the system
error log records the adapter error status information. |
ENOCONNECT |
Indicates that a bus fault has occurred. Generally, the IDE adapter
device driver cannot determine which device caused the bus fault, so this
error is not logged. |
ENODEV |
Indicates that no IDE device responded to the requested IDE device
ID. This return value implies that no device exists at the specified IDE device
ID. This condition is not necessarily an error and is not logged. |
ENOMEM |
Indicates insufficient memory is available to complete the command. |
ETIMEDOUT |
Indicates the device did not respond with status before the internal
time-out value expired. The caller should retry this command at least once,
since the first command may have cleared an error condition with the device.
The system error log records this error. |
Files
/dev/ide0, /dev/ide1,..., /dev/iden |
Provide an interface to allow IDE device drivers to access IDE devices
or adapters. |
Related Information
idedisk IDE device driver or idecdrom IDE device driver.
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]