54#if __BYTE_ORDER == __LITTLE_ENDIAN
62#elif __BYTE_ORDER == __BIG_ENDIAN
71#error "I need a byte order"
82#if __BYTE_ORDER == __LITTLE_ENDIAN
85#elif __BYTE_ORDER == __BIG_ENDIAN
89#error "I need a byte order"
111#define ATA_DEV_OBSOLETE 0xa0
114#define ATA_DEV_LBA 0x40
117#define ATA_DEV_SLAVE 0x10
120#define ATA_DEV_MASTER 0x00
123#define ATA_DEV_MASK 0xf0
126#define ATA_CMD_READ 0x20
129#define ATA_CMD_READ_EXT 0x24
132#define ATA_CMD_WRITE 0x30
135#define ATA_CMD_WRITE_EXT 0x34
138#define ATA_CMD_IDENTIFY 0xec
141#define ATA_STAT_ERR 0x01
162#define ATA_SUPPORTS_LBA48 ( 1 << 10 )
165#define ATA_SECTOR_SIZE 512
197#define ata_command_TYPE( object_type ) \
198 typeof ( int ( object_type, struct interface *data, \
199 struct ata_cmd *command ) )
202 unsigned int device,
unsigned int max_count );
unsigned long long uint64_t
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.
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
uint8_t block[3][8]
DES-encrypted blocks.
uint8_t device
Device register.
union ata_lba lba
Logical block address.
uint8_t cmd_stat
Command/status register.
int lba48
Use LBA48 extended addressing.
union ata_fifo count
Sector count.
union ata_fifo err_feat
Error/feature register.
An ATA command information unit.
struct ata_cb cb
ATA command block.
size_t data_out_len
Data-out buffer length.
void * data_out
Data-out buffer (may be NULL)
size_t data_in_len
Data-in buffer length.
void * data_in
Data-in buffer (may be NULL)
Structure returned by ATA IDENTIFY command.
An ATA 2-byte FIFO register.
uint16_t native
Value in native-endian order.
An ATA Logical Block Address.
uint64_t native
LBA as a 64-bit integer in native-endian order.