diff options
| author | Michael Brown | 2006-05-31 16:34:17 +0200 |
|---|---|---|
| committer | Michael Brown | 2006-05-31 16:34:17 +0200 |
| commit | 68125bc44173893fb3af08085b0b6b823b60d030 (patch) | |
| tree | e93be1ff71e3b25a953947885a0c8379822694cf /src/drivers/block | |
| parent | Added drivers/ata directory (forgot to check this in previously). (diff) | |
| download | ipxe-68125bc44173893fb3af08085b0b6b823b60d030.tar.gz ipxe-68125bc44173893fb3af08085b0b6b823b60d030.tar.xz ipxe-68125bc44173893fb3af08085b0b6b823b60d030.zip | |
Added generic asynchronous operations code.
Removed data_in_len and data_out_len from ata_command structure; the
lengths are implied by the sector count and the presence of the data_in
or data_out pointers.
Changed AoE code to use subcommands by default, and made aoe_issue()
nonblocking (with completion via async_wait()).
Diffstat (limited to 'src/drivers/block')
| -rw-r--r-- | src/drivers/block/ata.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/drivers/block/ata.c b/src/drivers/block/ata.c index 3fcfa71c..e0df3673 100644 --- a/src/drivers/block/ata.c +++ b/src/drivers/block/ata.c @@ -18,6 +18,7 @@ #include <stddef.h> #include <string.h> +#include <assert.h> #include <byteswap.h> #include <gpxe/blockdev.h> #include <gpxe/ata.h> @@ -73,7 +74,6 @@ static int ata_read ( struct block_device *blockdev, uint64_t block, command.cb.device |= command.cb.lba.bytes.low_prev; command.cb.cmd_stat = ( ata->lba48 ? ATA_CMD_READ_EXT : ATA_CMD_READ ); command.data_in = buffer; - command.data_in_len = ( count * blockdev->blksize ); return ata_command ( ata, &command ); } @@ -101,7 +101,6 @@ static int ata_write ( struct block_device *blockdev, uint64_t block, command.cb.cmd_stat = ( ata->lba48 ? ATA_CMD_WRITE_EXT : ATA_CMD_WRITE ); command.data_out = buffer; - command.data_out_len = ( count * blockdev->blksize ); return ata_command ( ata, &command ); } @@ -119,12 +118,12 @@ static int ata_identify ( struct block_device *blockdev ) { /* Issue IDENTIFY */ memset ( &command, 0, sizeof ( command ) ); - command.cb.count.native = 1; /* n/a according to spec, but at least - * AoE vblade devices require it. */ + command.cb.count.native = 1; command.cb.device = ( ata->device | ATA_DEV_OBSOLETE | ATA_DEV_LBA ); command.cb.cmd_stat = ATA_CMD_IDENTIFY; command.data_in = virt_to_user ( &identity ); - command.data_in_len = sizeof ( identity ); + linker_assert ( sizeof ( identity ) == ATA_SECTOR_SIZE, + __ata_identity_bad_size__ ); if ( ( rc = ata_command ( ata, &command ) ) != 0 ) return rc; |
