Commit 8962c315 authored by Jeff Garzik's avatar Jeff Garzik Committed by Linus Torvalds

[libata] preparation for writeback caching support

* bug fix: make sure 'nsect' member of struct ata_queued_cmd is
initialized each time a cmd is re-used.  Only affects PIO data xfers,
which nobody uses.
* slightly change the way a device's flags are printed out.  currently
the only flag is 'lba48', but soon 'wcache' will appear also.
* add WB-cache-related constants and macros to linux/ata.h
parent 7fb76946
...@@ -1156,11 +1156,11 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device) ...@@ -1156,11 +1156,11 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
ap->host->max_cmd_len = 16; ap->host->max_cmd_len = 16;
/* print device info to dmesg */ /* print device info to dmesg */
printk(KERN_INFO "ata%u: dev %u ATA, max %s, %Lu sectors%s\n", printk(KERN_INFO "ata%u: dev %u ATA, max %s, %Lu sectors: %s\n",
ap->id, device, ap->id, device,
ata_udma_string(udma_modes), ata_udma_string(udma_modes),
(unsigned long long)dev->n_sectors, (unsigned long long)dev->n_sectors,
dev->flags & ATA_DFLAG_LBA48 ? " (lba48)" : ""); dev->flags & ATA_DFLAG_LBA48 ? " lba48" : "");
} }
/* ATAPI-specific feature tests */ /* ATAPI-specific feature tests */
...@@ -2311,6 +2311,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, ...@@ -2311,6 +2311,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
qc->ap = ap; qc->ap = ap;
qc->dev = dev; qc->dev = dev;
qc->cursect = qc->cursg = qc->cursg_ofs = 0; qc->cursect = qc->cursg = qc->cursg_ofs = 0;
qc->nsect = 0;
ata_tf_init(ap, &qc->tf, dev->devno); ata_tf_init(ap, &qc->tf, dev->devno);
......
...@@ -104,6 +104,8 @@ enum { ...@@ -104,6 +104,8 @@ enum {
/* ATA device commands */ /* ATA device commands */
ATA_CMD_EDD = 0x90, /* execute device diagnostic */ ATA_CMD_EDD = 0x90, /* execute device diagnostic */
ATA_CMD_FLUSH = 0xE7,
ATA_CMD_FLUSH_EXT = 0xEA,
ATA_CMD_ID_ATA = 0xEC, ATA_CMD_ID_ATA = 0xEC,
ATA_CMD_ID_ATAPI = 0xA1, ATA_CMD_ID_ATAPI = 0xA1,
ATA_CMD_READ = 0xC8, ATA_CMD_READ = 0xC8,
...@@ -196,7 +198,9 @@ struct ata_taskfile { ...@@ -196,7 +198,9 @@ struct ata_taskfile {
}; };
#define ata_id_is_ata(dev) (((dev)->id[0] & (1 << 15)) == 0) #define ata_id_is_ata(dev) (((dev)->id[0] & (1 << 15)) == 0)
#define ata_id_wcache_enabled(dev) ((dev)->id[85] & (1 << 5))
#define ata_id_has_lba48(dev) ((dev)->id[83] & (1 << 10)) #define ata_id_has_lba48(dev) ((dev)->id[83] & (1 << 10))
#define ata_id_has_wcache(dev) ((dev)->id[82] & (1 << 5))
#define ata_id_has_lba(dev) ((dev)->id[49] & (1 << 8)) #define ata_id_has_lba(dev) ((dev)->id[49] & (1 << 8))
#define ata_id_has_dma(dev) ((dev)->id[49] & (1 << 9)) #define ata_id_has_dma(dev) ((dev)->id[49] & (1 << 9))
#define ata_id_u32(dev,n) \ #define ata_id_u32(dev,n) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment