Home | History | Annotate | Download | only in block

Lines Matching defs:ata

28 #include <gpxe/ata.h>
32 * ATA block device
42 * Issue ATA command
44 * @v ata ATA device
45 * @v command ATA command
49 ata_command ( struct ata_device *ata, struct ata_command *command ) {
52 DBG ( "ATA cmd %02x dev %02x LBA%s %llx count %04x\n",
61 /* Issue ATA command */
62 if ( ( rc = ata->command ( ata, command ) ) != 0 ) {
64 DBG ( "ATA could not issue command: %s\n", strerror ( rc ) );
73 DBG ( "ATA command failed: %s\n", strerror ( rc ) );
81 * Read block from ATA device
91 struct ata_device *ata = block_to_ata ( blockdev );
97 command.cb.device = ( ata->device | ATA_DEV_OBSOLETE | ATA_DEV_LBA );
98 command.cb.lba48 = ata->lba48;
99 if ( ! ata->lba48 )
101 command.cb.cmd_stat = ( ata->lba48 ? ATA_CMD_READ_EXT : ATA_CMD_READ );
103 return ata_command ( ata, &command );
107 * Write block to ATA device
117 struct ata_device *ata = block_to_ata ( blockdev );
123 command.cb.device = ( ata->device | ATA_DEV_OBSOLETE | ATA_DEV_LBA );
124 command.cb.lba48 = ata->lba48;
125 if ( ! ata->lba48 )
127 command.cb.cmd_stat = ( ata->lba48 ?
130 return ata_command ( ata, &command );
134 * Identify ATA device
140 struct ata_device *ata = block_to_ata ( blockdev );
148 command.cb.device = ( ata->device | ATA_DEV_OBSOLETE | ATA_DEV_LBA );
153 if ( ( rc = ata_command ( ata, &command ) ) != 0 )
159 ata->lba48 = 1;
173 * Initialise ATA device
175 * @v ata ATA device
178 * Initialises an ATA device. The ata_device::command field and the
184 int init_atadev ( struct ata_device *ata ) {
186 ata->blockdev.op = &ata_operations;
187 return ata_identify ( &ata->blockdev );