Index: uspace/drv/block/ata_bd/ata_bd.c
===================================================================
--- uspace/drv/block/ata_bd/ata_bd.c	(revision 88205440caa3e827197cd095139acca02b989d5e)
+++ uspace/drv/block/ata_bd/ata_bd.c	(revision 32e3cdfc8986d9f6c67d7e98cd10bf6ffa0720ef)
@@ -54,5 +54,7 @@
 #include <bd_srv.h>
 #include <fibril_synch.h>
+#include <scsi/mmc.h>
 #include <scsi/sbc.h>
+#include <scsi/spc.h>
 #include <stdint.h>
 #include <str.h>
@@ -343,5 +345,5 @@
 	identify_data_t idata;
 	uint8_t model[40];
-	ata_inquiry_data_t inq_data;
+	scsi_std_inquiry_data_t inq_data;
 	size_t isize;
 	uint16_t w;
@@ -472,5 +474,5 @@
 
 		/* Check device type. */
-		if (INQUIRY_PDEV_TYPE(inq_data.pdev_type) != PDEV_TYPE_CDROM)
+		if (INQUIRY_PDEV_TYPE(inq_data.pqual_devtype) != SCSI_DEV_CD_DVD)
 			ddf_msg(LVL_WARN, "Peripheral device type is not CD-ROM.");
 
@@ -831,13 +833,20 @@
     size_t *rcvd_size)
 {
-	ata_pcmd_inquiry_t cp;
+	uint8_t cpb[12];
+	scsi_cdb_inquiry_t *cp = (scsi_cdb_inquiry_t *)cpb;
 	int rc;
 
-	memset(&cp, 0, sizeof(cp));
-
-	cp.opcode = PCMD_INQUIRY;
-	cp.alloc_len = min(obuf_size, 0xff); /* Allocation length */
-
-	rc = ata_cmd_packet(disk, &cp, sizeof(cp), obuf, obuf_size, rcvd_size);
+	memset(cpb, 0, sizeof(cpb));
+
+	/*
+	 * For SFF 8020 compliance the inquiry must be padded to 12 bytes
+	 * and allocation length must fit in one byte.
+	 */
+	cp->op_code = SCSI_CMD_INQUIRY;
+
+	/* Allocation length */
+	cp->alloc_len = host2uint16_t_be(min(obuf_size, 0xff));
+
+	rc = ata_cmd_packet(disk, cpb, sizeof(cpb), obuf, obuf_size, rcvd_size);
 	if (rc != EOK)
 		return rc;
@@ -894,5 +903,5 @@
     void *obuf, size_t obuf_size)
 {
-	ata_pcmd_read_12_t cp;
+	scsi_cdb_read_12_t cp;
 	int rc;
 
@@ -902,7 +911,7 @@
 	memset(&cp, 0, sizeof(cp));
 
-	cp.opcode = PCMD_READ_12;
-	cp.ba = host2uint32_t_be(ba);
-	cp.nblocks = host2uint32_t_be(cnt);
+	cp.op_code = SCSI_CMD_READ_12;
+	cp.lba = host2uint32_t_be(ba);
+	cp.xfer_len = host2uint32_t_be(cnt);
 
 	rc = ata_cmd_packet(disk, &cp, sizeof(cp), obuf, obuf_size, NULL);
@@ -933,20 +942,21 @@
     size_t obuf_size)
 {
-	ata_pcmd_read_toc_t cp;
+	uint8_t cpb[12];
+	scsi_cdb_read_toc_t *cp = (scsi_cdb_read_toc_t *)cpb;
 	int rc;
 
-	memset(&cp, 0, sizeof(cp));
-
-	cp.opcode = PCMD_READ_TOC;
-	cp.msf = 0;
-	cp.format = 0x01; /* 0x01 = multi-session mode */
-	cp.start = session;
-	cp.size = host2uint16_t_be(obuf_size);
-	cp.oldformat = 0x40; /* 0x01 = multi-session mode (shifted to MSB) */
-	
-	rc = ata_cmd_packet(disk, &cp, sizeof(cp), obuf, obuf_size, NULL);
+	memset(cpb, 0, sizeof(cpb));
+
+	cp->op_code = SCSI_CMD_READ_TOC;
+	cp->msf = 0;
+	cp->format = 0x01; /* 0x01 = multi-session mode */
+	cp->track_sess_no = session;
+	cp->alloc_len = host2uint16_t_be(obuf_size);
+	cp->control = 0x40; /* 0x01 = multi-session mode (shifted to MSB) */
+
+	rc = ata_cmd_packet(disk, cpb, sizeof(cpb), obuf, obuf_size, NULL);
 	if (rc != EOK)
 		return rc;
-	
+
 	return EOK;
 }
Index: uspace/drv/block/ata_bd/ata_hw.h
===================================================================
--- uspace/drv/block/ata_bd/ata_hw.h	(revision 88205440caa3e827197cd095139acca02b989d5e)
+++ uspace/drv/block/ata_bd/ata_hw.h	(revision 32e3cdfc8986d9f6c67d7e98cd10bf6ffa0720ef)
@@ -241,71 +241,6 @@
 };
 
-/** ATA packet command codes. */
-enum ata_pkt_command {
-	PCMD_INQUIRY		= 0x12,
-	PCMD_READ_12		= 0xa8,
-	PCMD_READ_TOC		= 0x43
-};
-
-/** ATAPI Inquiry command */
-typedef struct {
-	uint8_t opcode;		/**< Operation code (PCMD_INQUIRY) */
-	uint8_t _res0;
-	uint8_t _res1;
-	uint8_t _res2;
-	uint8_t alloc_len;	/**< Allocation length */
-	uint8_t _res3;
-	uint8_t _res4;
-	uint8_t _res5;
-	uint32_t _res6;
-} __attribute__ ((packed)) ata_pcmd_inquiry_t;
-
-/** ATAPI Read(12) command */
-typedef struct {
-	uint8_t opcode;		/**< Operation code (PCMD_READ_12) */
-	uint8_t _res0;
-	uint32_t ba;		/**< Starting block address */
-	uint32_t nblocks;	/**< Number of blocks to transfer */
-	uint8_t _res1;
-	uint8_t _res2;
-} __attribute__ ((packed)) ata_pcmd_read_12_t;
-
-/** ATAPI Read TOC command */
-typedef struct {
-	uint8_t opcode;		/**< Operation code (PCMD_READ_TOC) */
-	uint8_t msf;            /**< 0x2 = MSF bit set */
-	uint8_t format;         /**< low 3 bits */
-	uint8_t _res0;
-	uint8_t _res1;
-	uint8_t _res2;
-	uint8_t start;          /**< starting track/session number */
-	uint16_t size;		/**< Allocation length */
-	uint8_t oldformat;         /**< high 2 bits */
-	uint8_t _res3;
-	uint8_t _res4;
-} __attribute__ ((packed)) ata_pcmd_read_toc_t;
-
-/** Data returned from Inquiry command (mandatory part) */
-typedef struct {
-	uint8_t pdev_type;	/** Reserved, Peripheral device type */
-	uint8_t rmb;		/** RMB, Reserved */
-	uint8_t std_version;	/** ISO version, ECMA version, ANSI version */
-	uint8_t atapi_ver_rdf;	/** ATAPI version, Response data format */
-	uint8_t additional_len;	/** Additional length */
-	uint8_t _res0;
-	uint8_t _res1;
-	uint8_t _res2;
-	uint8_t vendor_id[8];	/** Vendor ID */
-	uint8_t product_id[8];	/** Product ID */
-	uint8_t product_rev[4];	/** Product revision level */
-} ata_inquiry_data_t;
-
-/** Extract value of ata_inquiry_data_t.pdev_type */
+/** Extract value of device type from scsi_std_inquiry_data_t.pqual_devtype */
 #define INQUIRY_PDEV_TYPE(val) ((val) & 0x1f)
-
-/** Values for ata_inquiry_data_t.pdev_type */
-enum ata_pdev_type {
-	PDEV_TYPE_CDROM		= 0x05
-};
 
 enum ata_pdev_signature {
