Browse Source

Backing out last change; no immediate plans to make the whole block-device

layer asynchronous, so keeping the sync/async boundary within aoedev.c
seems cleanest for now.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
1f394c2f7c
3 changed files with 9 additions and 11 deletions
  1. 5
    4
      src/drivers/ata/aoedev.c
  2. 1
    2
      src/drivers/block/ata.c
  3. 3
    5
      src/include/gpxe/ata.h

+ 5
- 4
src/drivers/ata/aoedev.c View File

30
  *
30
  *
31
  * @v ata		ATA device
31
  * @v ata		ATA device
32
  * @v command		ATA command
32
  * @v command		ATA command
33
- * @ret aop		Asynchronous operation
33
+ * @ret rc		Return status code
34
  */
34
  */
35
-static struct async_operation * aoe_command ( struct ata_device *ata,
36
-					      struct ata_command *command ) {
35
+static int aoe_command ( struct ata_device *ata,
36
+			 struct ata_command *command ) {
37
 	struct aoe_device *aoedev
37
 	struct aoe_device *aoedev
38
 		= container_of ( ata, struct aoe_device, ata );
38
 		= container_of ( ata, struct aoe_device, ata );
39
 
39
 
40
-	return aoe_issue ( &aoedev->aoe, command );
40
+	aoe_issue ( &aoedev->aoe, command );
41
+	return async_wait ( &aoedev->aoe.aop );
41
 }
42
 }
42
 
43
 
43
 /**
44
 /**

+ 1
- 2
src/drivers/block/ata.c View File

20
 #include <string.h>
20
 #include <string.h>
21
 #include <assert.h>
21
 #include <assert.h>
22
 #include <byteswap.h>
22
 #include <byteswap.h>
23
-#include <gpxe/async.h>
24
 #include <gpxe/blockdev.h>
23
 #include <gpxe/blockdev.h>
25
 #include <gpxe/ata.h>
24
 #include <gpxe/ata.h>
26
 
25
 
49
 	      ( unsigned long long ) command->cb.lba.native,
48
 	      ( unsigned long long ) command->cb.lba.native,
50
 	      command->cb.count.native );
49
 	      command->cb.count.native );
51
 
50
 
52
-	return async_wait ( ata->command ( ata, command ) );
51
+	return ata->command ( ata, command );	
53
 }
52
 }
54
 
53
 
55
 /**
54
 /**

+ 3
- 5
src/include/gpxe/ata.h View File

11
  *
11
  *
12
  */
12
  */
13
 
13
 
14
-struct async_operation;
15
-
16
 /**
14
 /**
17
  * An ATA Logical Block Address
15
  * An ATA Logical Block Address
18
  *
16
  *
193
 	 *
191
 	 *
194
 	 * @v ata		ATA device
192
 	 * @v ata		ATA device
195
 	 * @v command		ATA command
193
 	 * @v command		ATA command
196
-	 * @ret aop		Asynchronous operation
194
+	 * @ret rc		Return status code
197
 	 */
195
 	 */
198
-	struct async_operation * ( * command ) ( struct ata_device *ata,
199
-						 struct ata_command *command );
196
+	int ( * command ) ( struct ata_device *ata,
197
+			    struct ata_command *command );
200
 };
198
 };
201
 
199
 
202
 extern int init_atadev ( struct ata_device *ata );
200
 extern int init_atadev ( struct ata_device *ata );

Loading…
Cancel
Save