*
* @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 );
}
/**
#include <string.h>
#include <assert.h>
#include <byteswap.h>
+#include <gpxe/async.h>
#include <gpxe/blockdev.h>
#include <gpxe/ata.h>
( unsigned long long ) command->cb.lba.native,
command->cb.count.native );
- return ata->command ( ata, command );
+ return async_wait ( ata->command ( ata, command ) );
}
/**
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 {
*
*/
+struct async_operation;
+
/**
* An ATA Logical Block Address
*
*
* @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 );
*
* @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;
}