/[linux-patches]/genpatches-2.6/trunk/2.6.12/4310_ahci-atapi.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.12/4310_ahci-atapi.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 38 - (show annotations) (download) (as text)
Sun Jun 19 11:22:50 2005 UTC (15 years, 1 month ago) by dsd
File MIME type: text/x-diff
File size: 1763 byte(s)
Add ATAPI support on AHCI
1 Author: Jeff Garzik <jgarzik@pobox.com>
2 Date: Sat, 4 Jun 2005 05:13:15 +0000 (-0400)
3 Source: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/jgarzik/libata-dev.git;a=commitdiff;h=a0ea7328e3f4971bbc2287c344650b08c2cec375
4
5 [libata] ahci: finish ATAPI support (hopefully)
6
7 --- a/drivers/scsi/ahci.c
8 +++ b/drivers/scsi/ahci.c
9 @@ -50,6 +50,7 @@ enum {
10 AHCI_CMD_SLOT_SZ = 32 * 32,
11 AHCI_RX_FIS_SZ = 256,
12 AHCI_CMD_TBL_HDR = 0x80,
13 + AHCI_CMD_TBL_CDB = 0x40,
14 AHCI_CMD_TBL_SZ = AHCI_CMD_TBL_HDR + (AHCI_MAX_SG * 16),
15 AHCI_PORT_PRIV_DMA_SZ = AHCI_CMD_SLOT_SZ + AHCI_CMD_TBL_SZ +
16 AHCI_RX_FIS_SZ,
17 @@ -510,7 +511,8 @@ static void ahci_fill_sg(struct ata_queu
18
19 static void ahci_qc_prep(struct ata_queued_cmd *qc)
20 {
21 - struct ahci_port_priv *pp = qc->ap->private_data;
22 + struct ata_port *ap = qc->ap;
23 + struct ahci_port_priv *pp = ap->private_data;
24 u32 opts;
25 const u32 cmd_fis_len = 5; /* five dwords */
26
27 @@ -522,18 +524,8 @@ static void ahci_qc_prep(struct ata_queu
28 opts = (qc->n_elem << 16) | cmd_fis_len;
29 if (qc->tf.flags & ATA_TFLAG_WRITE)
30 opts |= AHCI_CMD_WRITE;
31 -
32 - switch (qc->tf.protocol) {
33 - case ATA_PROT_ATAPI:
34 - case ATA_PROT_ATAPI_NODATA:
35 - case ATA_PROT_ATAPI_DMA:
36 + if (is_atapi_taskfile(&qc->tf))
37 opts |= AHCI_CMD_ATAPI;
38 - break;
39 -
40 - default:
41 - /* do nothing */
42 - break;
43 - }
44
45 pp->cmd_slot[0].opts = cpu_to_le32(opts);
46 pp->cmd_slot[0].status = 0;
47 @@ -545,6 +537,10 @@ static void ahci_qc_prep(struct ata_queu
48 * a SATA Register - Host to Device command FIS.
49 */
50 ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0);
51 + if (opts & AHCI_CMD_ATAPI) {
52 + memset(pp->cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32);
53 + memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, ap->cdb_len);
54 + }
55
56 if (!(qc->flags & ATA_QCFLAG_DMAMAP))
57 return;

  ViewVC Help
Powered by ViewVC 1.1.20