|
iPXE
|
ATA devices. More...
Go to the source code of this file.
Data Structures | |
| union | ata_lba |
| An ATA Logical Block Address. More... | |
| union | ata_fifo |
| An ATA 2-byte FIFO register. More... | |
| struct | ata_cb |
| ATA command block. More... | |
| struct | ata_identity |
| Structure returned by ATA IDENTIFY command. More... | |
| struct | ata_cmd |
| An ATA command information unit. More... | |
Macros | |
| #define | ATA_DEV_OBSOLETE 0xa0 |
| Obsolete bits in the ATA device register. | |
| #define | ATA_DEV_LBA 0x40 |
| LBA flag in the ATA device register. | |
| #define | ATA_DEV_SLAVE 0x10 |
| Slave ("device 1") flag in the ATA device register. | |
| #define | ATA_DEV_MASTER 0x00 |
| Master ("device 0") flag in the ATA device register. | |
| #define | ATA_DEV_MASK 0xf0 |
| Mask of non-LBA portion of device register. | |
| #define | ATA_CMD_READ 0x20 |
| "Read sectors" command | |
| #define | ATA_CMD_READ_EXT 0x24 |
| "Read sectors (ext)" command | |
| #define | ATA_CMD_WRITE 0x30 |
| "Write sectors" command | |
| #define | ATA_CMD_WRITE_EXT 0x34 |
| "Write sectors (ext)" command | |
| #define | ATA_CMD_IDENTIFY 0xec |
| "Identify" command | |
| #define | ATA_STAT_ERR 0x01 |
| Command completed in error. | |
| #define | ATA_SUPPORTS_LBA48 ( 1 << 10 ) |
| Supports LBA48 flag. | |
| #define | ATA_SECTOR_SIZE 512 |
| ATA sector size. | |
| #define | ata_command_TYPE(object_type) |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| int | ata_command (struct interface *control, struct interface *data, struct ata_cmd *command) |
| Issue ATA command. | |
| int | ata_open (struct interface *block, struct interface *ata, unsigned int device, unsigned int max_count) |
| Open ATA device. | |
ATA devices.
Definition in file ata.h.
| #define ATA_DEV_OBSOLETE 0xa0 |
Obsolete bits in the ATA device register.
Definition at line 111 of file ata.h.
Referenced by atadev_command().
| #define ATA_DEV_LBA 0x40 |
LBA flag in the ATA device register.
Definition at line 114 of file ata.h.
Referenced by atadev_command().
| #define ATA_DEV_SLAVE 0x10 |
Slave ("device 1") flag in the ATA device register.
Definition at line 117 of file ata.h.
Referenced by aoecmd_ata_cmd(), and atadev_edd_describe().
| #define ATA_DEV_MASTER 0x00 |
Master ("device 0") flag in the ATA device register.
Definition at line 120 of file ata.h.
Referenced by aoedev_open().
| #define ATA_DEV_MASK 0xf0 |
Mask of non-LBA portion of device register.
Definition at line 123 of file ata.h.
Referenced by aoecmd_ata_cmd().
| #define ATA_STAT_ERR 0x01 |
| #define ATA_SUPPORTS_LBA48 ( 1 << 10 ) |
| #define ATA_SECTOR_SIZE 512 |
ATA sector size.
Definition at line 165 of file ata.h.
Referenced by atacmd_identify_done(), atadev_command(), and atadev_read_capacity().
| #define ata_command_TYPE | ( | object_type | ) |
Definition at line 197 of file ata.h.
Referenced by ata_command().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Issue ATA command.
| control | ATA control interface |
| data | ATA data interface |
| command | ATA command |
| tag | Command tag, or negative error |
Definition at line 60 of file ata.c.
References ata_command_TYPE, control, data, dest, EOPNOTSUPP, intf_get_dest_op, intf_object(), intf_put(), op, and tag.
|
extern |
Open ATA device.
| block | Block control interface |
| ata | ATA control interface |
| device | ATA device number |
| max_count | Maximum number of blocks per single transfer |
| rc | Return status code |
Definition at line 663 of file ata.c.
References ata_device::ata, atadev_ata_desc, atadev_block_desc, ata_device::block, block, ata_device::device, ENOMEM, intf_init(), intf_plug_plug(), ata_device::max_count, NULL, ref_init, ref_put, ata_device::refcnt, and zalloc().
Referenced by aoedev_open().