diff options
| author | Michael Brown | 2006-05-31 20:57:11 +0200 |
|---|---|---|
| committer | Michael Brown | 2006-05-31 20:57:11 +0200 |
| commit | 99ef98d0bffdb9b8c67ad3892d533d33221529f0 (patch) | |
| tree | 2a7b65c59a856fc57031cf0a23881340b0d21ce5 /src | |
| parent | Missing from previous checkin. (diff) | |
| download | ipxe-99ef98d0bffdb9b8c67ad3892d533d33221529f0.tar.gz ipxe-99ef98d0bffdb9b8c67ad3892d533d33221529f0.tar.xz ipxe-99ef98d0bffdb9b8c67ad3892d533d33221529f0.zip | |
ATA devices are now asynchronous. The ATA layer itself now performs the
async_wait(), though we may wish to move this higher up the stack, and
consider making the block device model asynchronous. (There is only a
marginal cost for synchronous devices, since they can simply call
async_done() before returning; async_wait() will work seamlessly in this
situation).
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/ata/aoedev.c | 9 | ||||
| -rw-r--r-- | src/drivers/block/ata.c | 3 | ||||
| -rw-r--r-- | src/include/gpxe/aoe.h | 3 | ||||
| -rw-r--r-- | src/include/gpxe/ata.h | 8 | ||||
| -rw-r--r-- | src/net/aoe.c | 5 |
5 files changed, 17 insertions, 11 deletions
diff --git a/src/drivers/ata/aoedev.c b/src/drivers/ata/aoedev.c index 9679fc1bd..4b4541f66 100644 --- a/src/drivers/ata/aoedev.c +++ b/src/drivers/ata/aoedev.c @@ -30,15 +30,14 @@ * * @v ata ATA device * @v command ATA command - * @ret rc Return status code + * @ret aop Asynchronous operation */ -static int aoe_command ( struct ata_device *ata, - struct ata_command *command ) { +static struct async_operation * aoe_command ( struct ata_device *ata, + struct ata_command *command ) { struct aoe_device *aoedev = container_of ( ata, struct aoe_device, ata ); - aoe_issue ( &aoedev->aoe, command ); - return async_wait ( &aoedev->aoe.aop ); + return aoe_issue ( &aoedev->aoe, command ); } /** diff --git a/src/drivers/block/ata.c b/src/drivers/block/ata.c index e0df3673f..d2d77aeac 100644 --- a/src/drivers/block/ata.c +++ b/src/drivers/block/ata.c @@ -20,6 +20,7 @@ #include <string.h> #include <assert.h> #include <byteswap.h> +#include <gpxe/async.h> #include <gpxe/blockdev.h> #include <gpxe/ata.h> @@ -48,7 +49,7 @@ ata_command ( struct ata_device *ata, struct ata_command *command ) { ( unsigned long long ) command->cb.lba.native, command->cb.count.native ); - return ata->command ( ata, command ); + return async_wait ( ata->command ( ata, command ) ); } /** diff --git a/src/include/gpxe/aoe.h b/src/include/gpxe/aoe.h index fb692224b..07aec037d 100644 --- a/src/include/gpxe/aoe.h +++ b/src/include/gpxe/aoe.h @@ -115,7 +115,8 @@ struct aoe_session { extern void aoe_open ( struct aoe_session *aoe ); extern void aoe_close ( struct aoe_session *aoe ); -extern void aoe_issue ( struct aoe_session *aoe, struct ata_command *command ); +extern struct async_operation * aoe_issue ( struct aoe_session *aoe, + struct ata_command *command ); /** An AoE device */ struct aoe_device { diff --git a/src/include/gpxe/ata.h b/src/include/gpxe/ata.h index e0fca7afe..7b348d822 100644 --- a/src/include/gpxe/ata.h +++ b/src/include/gpxe/ata.h @@ -11,6 +11,8 @@ * */ +struct async_operation; + /** * An ATA Logical Block Address * @@ -191,10 +193,10 @@ struct ata_device { * * @v ata ATA device * @v command ATA command - * @ret rc Return status code + * @ret aop Asynchronous operation */ - int ( * command ) ( struct ata_device *ata, - struct ata_command *command ); + struct async_operation * ( * command ) ( struct ata_device *ata, + struct ata_command *command ); }; extern int init_atadev ( struct ata_device *ata ); diff --git a/src/net/aoe.c b/src/net/aoe.c index a91e00971..0d59a9778 100644 --- a/src/net/aoe.c +++ b/src/net/aoe.c @@ -274,14 +274,17 @@ void aoe_close ( struct aoe_session *aoe ) { * * @v aoe AoE session * @v command ATA command + * @ret aop Asynchronous operation * * Only one command may be issued concurrently per session. This call * is non-blocking; use async_wait() to wait for the command to * complete. */ -void aoe_issue ( struct aoe_session *aoe, struct ata_command *command ) { +struct async_operation * aoe_issue ( struct aoe_session *aoe, + struct ata_command *command ) { aoe->command = command; aoe->status = 0; aoe->command_offset = 0; aoe_send_command ( aoe ); + return &aoe->aop; } |
