Browse Source

[ata] Add support for describing an ATA device using EDD

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
f8fa23b183
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      src/drivers/block/ata.c

+ 19
- 0
src/drivers/block/ata.c View File

@@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
27 27
 #include <ipxe/list.h>
28 28
 #include <ipxe/interface.h>
29 29
 #include <ipxe/blockdev.h>
30
+#include <ipxe/edd.h>
30 31
 #include <ipxe/ata.h>
31 32
 
32 33
 /** @file
@@ -602,6 +603,23 @@ static void atadev_close ( struct ata_device *atadev, int rc ) {
602 603
 	}
603 604
 }
604 605
 
606
+/**
607
+ * Describe ATA device using EDD
608
+ *
609
+ * @v atadev		ATA device
610
+ * @v type		EDD interface type
611
+ * @v path		EDD device path
612
+ * @ret rc		Return status code
613
+ */
614
+static int atadev_edd_describe ( struct ata_device *atadev,
615
+				 struct edd_interface_type *type,
616
+				 union edd_device_path *path ) {
617
+
618
+	type->type = cpu_to_le64 ( EDD_INTF_TYPE_ATA );
619
+	path->ata.slave = ( ( atadev->device == ATA_DEV_SLAVE ) ? 0x01 : 0x00 );
620
+	return 0;
621
+}
622
+
605 623
 /** ATA device block interface operations */
606 624
 static struct interface_operation atadev_block_op[] = {
607 625
 	INTF_OP ( block_read, struct ata_device *, atadev_read ),
@@ -609,6 +627,7 @@ static struct interface_operation atadev_block_op[] = {
609 627
 	INTF_OP ( block_read_capacity, struct ata_device *,
610 628
 		  atadev_read_capacity ),
611 629
 	INTF_OP ( intf_close, struct ata_device *, atadev_close ),
630
+	INTF_OP ( edd_describe, struct ata_device *, atadev_edd_describe ),
612 631
 };
613 632
 
614 633
 /** ATA device block interface descriptor */

Loading…
Cancel
Save