diff options
author | Tejun Heo <htejun@gmail.com> | 2006-04-02 05:51:53 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-02 10:09:20 -0400 |
commit | d69cf37d5387801914bbf5297f070c7d2ee0206f (patch) | |
tree | de9f081b20302e394936d23a3f983407d87dafd3 | |
parent | 74e6c8c394ca2126a60e97bc1142ec2d91761e9a (diff) |
[PATCH] libata: add @cdb to ata_exec_internal()
Add @cdb to ata_exec_internal(). It will be used by new EH.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/scsi/libata-core.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index e9002a4174d0..66b48b11fa0e 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -964,6 +964,7 @@ void ata_qc_complete_internal(struct ata_queued_cmd *qc) | |||
964 | * @ap: Port to which the command is sent | 964 | * @ap: Port to which the command is sent |
965 | * @dev: Device to which the command is sent | 965 | * @dev: Device to which the command is sent |
966 | * @tf: Taskfile registers for the command and the result | 966 | * @tf: Taskfile registers for the command and the result |
967 | * @cdb: CDB for packet command | ||
967 | * @dma_dir: Data tranfer direction of the command | 968 | * @dma_dir: Data tranfer direction of the command |
968 | * @buf: Data buffer of the command | 969 | * @buf: Data buffer of the command |
969 | * @buflen: Length of data buffer | 970 | * @buflen: Length of data buffer |
@@ -980,7 +981,7 @@ void ata_qc_complete_internal(struct ata_queued_cmd *qc) | |||
980 | 981 | ||
981 | static unsigned | 982 | static unsigned |
982 | ata_exec_internal(struct ata_port *ap, struct ata_device *dev, | 983 | ata_exec_internal(struct ata_port *ap, struct ata_device *dev, |
983 | struct ata_taskfile *tf, | 984 | struct ata_taskfile *tf, const u8 *cdb, |
984 | int dma_dir, void *buf, unsigned int buflen) | 985 | int dma_dir, void *buf, unsigned int buflen) |
985 | { | 986 | { |
986 | u8 command = tf->command; | 987 | u8 command = tf->command; |
@@ -995,6 +996,8 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev, | |||
995 | BUG_ON(qc == NULL); | 996 | BUG_ON(qc == NULL); |
996 | 997 | ||
997 | qc->tf = *tf; | 998 | qc->tf = *tf; |
999 | if (cdb) | ||
1000 | memcpy(qc->cdb, cdb, ATAPI_CDB_LEN); | ||
998 | qc->dma_dir = dma_dir; | 1001 | qc->dma_dir = dma_dir; |
999 | if (dma_dir != DMA_NONE) { | 1002 | if (dma_dir != DMA_NONE) { |
1000 | ata_sg_init_one(qc, buf, buflen); | 1003 | ata_sg_init_one(qc, buf, buflen); |
@@ -1144,7 +1147,7 @@ static int ata_dev_read_id(struct ata_port *ap, struct ata_device *dev, | |||
1144 | 1147 | ||
1145 | tf.protocol = ATA_PROT_PIO; | 1148 | tf.protocol = ATA_PROT_PIO; |
1146 | 1149 | ||
1147 | err_mask = ata_exec_internal(ap, dev, &tf, DMA_FROM_DEVICE, | 1150 | err_mask = ata_exec_internal(ap, dev, &tf, NULL, DMA_FROM_DEVICE, |
1148 | id, sizeof(id[0]) * ATA_ID_WORDS); | 1151 | id, sizeof(id[0]) * ATA_ID_WORDS); |
1149 | if (err_mask) { | 1152 | if (err_mask) { |
1150 | rc = -EIO; | 1153 | rc = -EIO; |
@@ -2988,7 +2991,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_port *ap, | |||
2988 | tf.protocol = ATA_PROT_NODATA; | 2991 | tf.protocol = ATA_PROT_NODATA; |
2989 | tf.nsect = dev->xfer_mode; | 2992 | tf.nsect = dev->xfer_mode; |
2990 | 2993 | ||
2991 | err_mask = ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0); | 2994 | err_mask = ata_exec_internal(ap, dev, &tf, NULL, DMA_NONE, NULL, 0); |
2992 | 2995 | ||
2993 | DPRINTK("EXIT, err_mask=%x\n", err_mask); | 2996 | DPRINTK("EXIT, err_mask=%x\n", err_mask); |
2994 | return err_mask; | 2997 | return err_mask; |
@@ -3028,7 +3031,7 @@ static unsigned int ata_dev_init_params(struct ata_port *ap, | |||
3028 | tf.nsect = sectors; | 3031 | tf.nsect = sectors; |
3029 | tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */ | 3032 | tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */ |
3030 | 3033 | ||
3031 | err_mask = ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0); | 3034 | err_mask = ata_exec_internal(ap, dev, &tf, NULL, DMA_NONE, NULL, 0); |
3032 | 3035 | ||
3033 | DPRINTK("EXIT, err_mask=%x\n", err_mask); | 3036 | DPRINTK("EXIT, err_mask=%x\n", err_mask); |
3034 | return err_mask; | 3037 | return err_mask; |
@@ -4482,7 +4485,7 @@ static int ata_do_simple_cmd(struct ata_port *ap, struct ata_device *dev, | |||
4482 | tf.flags |= ATA_TFLAG_DEVICE; | 4485 | tf.flags |= ATA_TFLAG_DEVICE; |
4483 | tf.protocol = ATA_PROT_NODATA; | 4486 | tf.protocol = ATA_PROT_NODATA; |
4484 | 4487 | ||
4485 | err = ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0); | 4488 | err = ata_exec_internal(ap, dev, &tf, NULL, DMA_NONE, NULL, 0); |
4486 | if (err) | 4489 | if (err) |
4487 | printk(KERN_ERR "%s: ata command failed: %d\n", | 4490 | printk(KERN_ERR "%s: ata command failed: %d\n", |
4488 | __FUNCTION__, err); | 4491 | __FUNCTION__, err); |