10_libata_ahci-atapi.patch

        This patch adds ATAPI support to ahci driver.  This currently
        doesn't work.  I'll write a reply to this thread to tell more
        about this.  However, it at least shows that NCQ ATAPI error
        handling works.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>

 ahci.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

Index: work/drivers/scsi/ahci.c
===================================================================
--- work.orig/drivers/scsi/ahci.c       2005-07-07 22:08:37.000000000 +0900
+++ work/drivers/scsi/ahci.c    2005-07-07 22:08:37.000000000 +0900
@@ -543,14 +543,22 @@ static void ahci_qc_prep(struct ata_queu
 {
        struct ahci_port_priv *pp = qc->ap->private_data;
        const u32 cmd_fis_len = 5; /* five dwords */
+       void *cmd_tbl;
        dma_addr_t cmd_tbl_dma;
        u32 opts;
        int offset;
 
        /*
-        * Fill in command slot information
+        * the tag determines the offset into the allocated cmd table
         */
+       offset = qc->tag * AHCI_CMD_TOTAL;
+
+       cmd_tbl = pp->cmd_tbl + offset;
+       cmd_tbl_dma = pp->cmd_tbl_dma + offset;
 
+       /*
+        * Fill in command slot information
+        */
        opts = (qc->n_elem << 16) | cmd_fis_len;
        if (qc->tf.flags & ATA_TFLAG_WRITE)
                opts |= AHCI_CMD_WRITE;
@@ -559,6 +567,7 @@ static void ahci_qc_prep(struct ata_queu
        case ATA_PROT_ATAPI:
        case ATA_PROT_ATAPI_NODATA:
        case ATA_PROT_ATAPI_DMA:
+               memcpy(cmd_tbl + 0x40, qc->cdb, qc->ap->cdb_len);
                opts |= AHCI_CMD_ATAPI;
                break;
 
@@ -567,13 +576,6 @@ static void ahci_qc_prep(struct ata_queu
                break;
        }
 
-       /*
-        * the tag determines the offset into the allocated cmd table
-        */
-       offset = qc->tag * AHCI_CMD_TOTAL;
-
-       cmd_tbl_dma = pp->cmd_tbl_dma + offset;
-
        pp->cmd_slot[qc->tag].opts = cpu_to_le32(opts);
        pp->cmd_slot[qc->tag].status = 0;
        pp->cmd_slot[qc->tag].tbl_addr = cpu_to_le32(cmd_tbl_dma & 0xffffffff);

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to