From 68125bc44173893fb3af08085b0b6b823b60d030 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 31 May 2006 14:34:17 +0000 Subject: 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()). --- src/drivers/ata/aoedev.c | 3 ++- src/drivers/block/ata.c | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/ata/aoedev.c b/src/drivers/ata/aoedev.c index 0350bc097..9679fc1bd 100644 --- a/src/drivers/ata/aoedev.c +++ b/src/drivers/ata/aoedev.c @@ -37,7 +37,8 @@ static int aoe_command ( struct ata_device *ata, struct aoe_device *aoedev = container_of ( ata, struct aoe_device, ata ); - return aoe_issue_split ( &aoedev->aoe, command ); + aoe_issue ( &aoedev->aoe, command ); + return async_wait ( &aoedev->aoe.aop ); } /** diff --git a/src/drivers/block/ata.c b/src/drivers/block/ata.c index 3fcfa71c2..e0df3673f 100644 --- a/src/drivers/block/ata.c +++ b/src/drivers/block/ata.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -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; -- cgit v1.2.3-55-g7522