summaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-14 14:14:16 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-14 14:14:16 -0500
commit2c13b7cee045af689b36349c2bc6a9ed6e3d73fa (patch)
tree594a061fa9b9c1fa03bfe01c9177cc016e1bb1a4 /include/linux/libata.h
parente1410f2d951d45aee3bdbcc05ecedaaa9db276e5 (diff)
downloadop-kernel-dev-2c13b7cee045af689b36349c2bc6a9ed6e3d73fa.zip
op-kernel-dev-2c13b7cee045af689b36349c2bc6a9ed6e3d73fa.tar.gz
[libata] minor fixes, new helpers
- in ata_dev_identify(), don't assume that all devices are either ATA or ATAPI. In the future, this code will see port multipliers and other devices. - make a debugging printk less verbose - add new helper ata_qc_reinit() - add new helper BPRINTK() and port flag ATA_FLAG_DEBUGMSG, for fine-grained debugging use.
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ad59961..f2dbb68 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -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
@@ -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? */
@@ -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.
OpenPOWER on IntegriCloud