From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, albertcc@tw.ibm.com,
linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 12/15] libata: add @cdb to ata_exec_internal()
Date: Sun, 2 Apr 2006 18:51:53 +0900 [thread overview]
Message-ID: <11439715131615-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11439715124131-git-send-email-htejun@gmail.com>
Add @cdb to ata_exec_internal(). It will be used by new EH.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/scsi/libata-core.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
d73daad1db8fa577219cdcf734046018d9ad45a9
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 551f078..999fe08 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -964,6 +964,7 @@ void ata_qc_complete_internal(struct ata
* @ap: Port to which the command is sent
* @dev: Device to which the command is sent
* @tf: Taskfile registers for the command and the result
+ * @cdb: CDB for packet command
* @dma_dir: Data tranfer direction of the command
* @buf: Data buffer of the command
* @buflen: Length of data buffer
@@ -980,7 +981,7 @@ void ata_qc_complete_internal(struct ata
static unsigned
ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
- struct ata_taskfile *tf,
+ struct ata_taskfile *tf, const u8 *cdb,
int dma_dir, void *buf, unsigned int buflen)
{
u8 command = tf->command;
@@ -995,6 +996,8 @@ ata_exec_internal(struct ata_port *ap, s
BUG_ON(qc == NULL);
qc->tf = *tf;
+ if (cdb)
+ memcpy(qc->cdb, cdb, ATAPI_CDB_LEN);
qc->dma_dir = dma_dir;
if (dma_dir != DMA_NONE) {
ata_sg_init_one(qc, buf, buflen);
@@ -1144,7 +1147,7 @@ static int ata_dev_read_id(struct ata_po
tf.protocol = ATA_PROT_PIO;
- err_mask = ata_exec_internal(ap, dev, &tf, DMA_FROM_DEVICE,
+ err_mask = ata_exec_internal(ap, dev, &tf, NULL, DMA_FROM_DEVICE,
id, sizeof(id[0]) * ATA_ID_WORDS);
if (err_mask) {
rc = -EIO;
@@ -2983,7 +2986,7 @@ static unsigned int ata_dev_set_xfermode
tf.protocol = ATA_PROT_NODATA;
tf.nsect = dev->xfer_mode;
- err_mask = ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0);
+ err_mask = ata_exec_internal(ap, dev, &tf, NULL, DMA_NONE, NULL, 0);
DPRINTK("EXIT, err_mask=%x\n", err_mask);
return err_mask;
@@ -3023,7 +3026,7 @@ static unsigned int ata_dev_init_params(
tf.nsect = sectors;
tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */
- err_mask = ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0);
+ err_mask = ata_exec_internal(ap, dev, &tf, NULL, DMA_NONE, NULL, 0);
DPRINTK("EXIT, err_mask=%x\n", err_mask);
return err_mask;
@@ -4477,7 +4480,7 @@ static int ata_do_simple_cmd(struct ata_
tf.flags |= ATA_TFLAG_DEVICE;
tf.protocol = ATA_PROT_NODATA;
- err = ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0);
+ err = ata_exec_internal(ap, dev, &tf, NULL, DMA_NONE, NULL, 0);
if (err)
printk(KERN_ERR "%s: ata command failed: %d\n",
__FUNCTION__, err);
--
1.2.4
next prev parent reply other threads:[~2006-04-02 9:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-02 9:51 [PATCHSET] libata: prep for new EH, take 2 Tejun Heo
2006-04-02 9:51 ` [PATCH 04/15] libata: clean up constants Tejun Heo
2006-04-02 9:51 ` [PATCH 01/15] libata: report device number when PIO fails Tejun Heo
2006-04-02 9:51 ` [PATCH 05/15] libata: rename ATA_FLAG_PORT_DISABLED to ATA_FLAG_DISABLED Tejun Heo
2006-04-02 9:51 ` [PATCH 02/15] libata: ata_dev_revalidate() printk update Tejun Heo
2006-04-02 9:51 ` [PATCH 03/15] libata: ATA_FLAG_IN_EH is not used, kill it Tejun Heo
2006-04-02 9:51 ` [PATCH 14/15] libata: separate out libata-eh.c Tejun Heo
2006-04-02 9:51 ` [PATCH 09/15] libata: pass qc around intead of ap during PIO Tejun Heo
2006-04-02 9:51 ` [PATCH 08/15] libata: add ATA_QCFLAG_IO Tejun Heo
2006-04-02 9:51 ` [PATCH 10/15] libata: always generate sense if qc->err_mask is non-zero Tejun Heo
2006-04-02 9:51 ` [PATCH 13/15] libata: dec scmd->retries for qcs with zero err_mask Tejun Heo
2006-04-02 9:51 ` [PATCH 11/15] libata: don't read TF directly from sense generation functions Tejun Heo
2006-04-02 9:51 ` [PATCH 07/15] libata: clear ATA_DFLAG_PIO before setting it Tejun Heo
2006-04-02 9:51 ` Tejun Heo [this message]
2006-04-02 9:51 ` [PATCH 06/15] libata: clear only affected flags during ata_dev_configure() Tejun Heo
2006-04-02 9:51 ` [PATCH 15/15] libata: make some libata-core routines extern Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11439715131615-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).