Commit 3f64f565 authored by Eric D. Mudama's avatar Eric D. Mudama Committed by Jeff Garzik

libata: rearrange dmesg info to add full ATA revision

Per Jeff's suggestion, this patch rearranges the info printed for ATA
drives into dmesg to add the full ATA firmware revision and model
information, while keeping the output to 2 lines.
Signed-off-by: default avatarEric D. Mudama <edmudama@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 24a01453
...@@ -1540,6 +1540,8 @@ int ata_dev_configure(struct ata_device *dev) ...@@ -1540,6 +1540,8 @@ int ata_dev_configure(struct ata_device *dev)
const u16 *id = dev->id; const u16 *id = dev->id;
unsigned int xfer_mask; unsigned int xfer_mask;
char revbuf[7]; /* XYZ-99\0 */ char revbuf[7]; /* XYZ-99\0 */
char fwrevbuf[ATA_ID_FW_REV_LEN+1];
char modelbuf[ATA_ID_PROD_LEN+1];
int rc; int rc;
if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { if (!ata_dev_enabled(dev) && ata_msg_info(ap)) {
...@@ -1594,6 +1596,16 @@ int ata_dev_configure(struct ata_device *dev) ...@@ -1594,6 +1596,16 @@ int ata_dev_configure(struct ata_device *dev)
dev->n_sectors = ata_id_n_sectors(id); dev->n_sectors = ata_id_n_sectors(id);
/* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV_OFS,
sizeof(fwrevbuf));
ata_id_c_string(dev->id, modelbuf, ATA_ID_PROD_OFS,
sizeof(modelbuf));
if (dev->id[59] & 0x100)
dev->multi_count = dev->id[59] & 0xff;
if (ata_id_has_lba(id)) { if (ata_id_has_lba(id)) {
const char *lba_desc; const char *lba_desc;
char ncq_desc[20]; char ncq_desc[20];
...@@ -1613,13 +1625,16 @@ int ata_dev_configure(struct ata_device *dev) ...@@ -1613,13 +1625,16 @@ int ata_dev_configure(struct ata_device *dev)
ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc)); ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc));
/* print device info to dmesg */ /* print device info to dmesg */
if (ata_msg_drv(ap) && print_info) if (ata_msg_drv(ap) && print_info) {
ata_dev_printk(dev, KERN_INFO, "%s, " ata_dev_printk(dev, KERN_INFO,
"max %s, %Lu sectors: %s %s\n", "%s: %s, %s, max %s\n",
revbuf, revbuf, modelbuf, fwrevbuf,
ata_mode_string(xfer_mask), ata_mode_string(xfer_mask));
ata_dev_printk(dev, KERN_INFO,
"%Lu sectors, multi %u: %s %s\n",
(unsigned long long)dev->n_sectors, (unsigned long long)dev->n_sectors,
lba_desc, ncq_desc); dev->multi_count, lba_desc, ncq_desc);
}
} else { } else {
/* CHS */ /* CHS */
...@@ -1636,22 +1651,17 @@ int ata_dev_configure(struct ata_device *dev) ...@@ -1636,22 +1651,17 @@ int ata_dev_configure(struct ata_device *dev)
} }
/* print device info to dmesg */ /* print device info to dmesg */
if (ata_msg_drv(ap) && print_info) if (ata_msg_drv(ap) && print_info) {
ata_dev_printk(dev, KERN_INFO, "%s, " ata_dev_printk(dev, KERN_INFO,
"max %s, %Lu sectors: CHS %u/%u/%u\n", "%s: %s, %s, max %s\n",
revbuf, revbuf, modelbuf, fwrevbuf,
ata_mode_string(xfer_mask), ata_mode_string(xfer_mask));
ata_dev_printk(dev, KERN_INFO,
"%Lu sectors, multi %u, CHS %u/%u/%u\n",
(unsigned long long)dev->n_sectors, (unsigned long long)dev->n_sectors,
dev->cylinders, dev->heads, dev->multi_count, dev->cylinders,
dev->sectors); dev->heads, dev->sectors);
} }
if (dev->id[59] & 0x100) {
dev->multi_count = dev->id[59] & 0xff;
if (ata_msg_drv(ap) && print_info)
ata_dev_printk(dev, KERN_INFO,
"ata%u: dev %u multi count %u\n",
ap->id, dev->devno, dev->multi_count);
} }
dev->cdb_len = 16; dev->cdb_len = 16;
......
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