Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14243
b: refs/heads/master
c: 2c13b7c
h: refs/heads/master
i:
  14241: 389fd81
  14239: 701a886
v: v3
  • Loading branch information
Jeff Garzik committed Nov 14, 2005
1 parent 7d04fdf commit fb3aea5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1410f2d951d45aee3bdbcc05ecedaaa9db276e5
refs/heads/master: 2c13b7cee045af689b36349c2bc6a9ed6e3d73fa
11 changes: 3 additions & 8 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
}

/* ATAPI-specific feature tests */
else {
else if (dev->class == ATA_DEV_ATAPI) {
if (ata_id_is_ata(dev->id)) /* sanity check */
goto err_out_nosup;

Expand Down Expand Up @@ -2399,7 +2399,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
if (qc->flags & ATA_QCFLAG_SINGLE)
assert(qc->n_elem == 1);

DPRINTK("unmapping %u sg elements\n", qc->n_elem);
VPRINTK("unmapping %u sg elements\n", qc->n_elem);

/* if we padded the buffer out to 32-bit bound, and data
* xfer direction is from-device, we must copy from the
Expand Down Expand Up @@ -3432,16 +3432,11 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,

qc = ata_qc_new(ap);
if (qc) {
qc->__sg = NULL;
qc->flags = 0;
qc->scsicmd = NULL;
qc->ap = ap;
qc->dev = dev;
qc->cursect = qc->cursg = qc->cursg_ofs = 0;
qc->nsect = 0;
qc->nbytes = qc->curbytes = 0;

ata_tf_init(ap, &qc->tf, dev->devno);
ata_qc_reinit(qc);
}

return qc;
Expand Down
14 changes: 14 additions & 0 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
#define VPRINTK(fmt, args...)
#endif /* ATA_DEBUG */

#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)

#ifdef ATA_NDEBUG
#define assert(expr)
#else
Expand Down Expand Up @@ -119,6 +121,7 @@ enum {
ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */
ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once
* proper HSM is in place. */
ATA_FLAG_DEBUGMSG = (1 << 10),

ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */
ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
Expand Down Expand Up @@ -659,6 +662,17 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns
tf->device = ATA_DEVICE_OBS | ATA_DEV1;
}

static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
{
qc->__sg = NULL;
qc->flags = 0;
qc->cursect = qc->cursg = qc->cursg_ofs = 0;
qc->nsect = 0;
qc->nbytes = qc->curbytes = 0;

ata_tf_init(qc->ap, &qc->tf, qc->dev->devno);
}


/**
* ata_irq_on - Enable interrupts on a port.
Expand Down

0 comments on commit fb3aea5

Please sign in to comment.