* [PATCH 1/2] ide: add ide_dump_identify() debug helper
@ 2007-12-23 21:43 Bartlomiej Zolnierkiewicz
2007-12-25 10:26 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-12-23 21:43 UTC (permalink / raw)
To: linux-ide; +Cc: linux-kernel
* Add ide_dump_identify() debug helper for dumping raw identify data in
the hdparm friendly format (== the identify data can be extracted from
dmesg output and passed to hdparm --Istdin).
* Dump identify data in ide-probe.c::do_identify() if DEBUG is enabled.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-probe.c | 4 ++++
include/linux/ide.h | 5 +++++
2 files changed, 9 insertions(+)
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -129,6 +129,10 @@ static inline void do_identify (ide_driv
drive->id_read = 1;
local_irq_enable();
+#ifdef DEBUG
+ printk(KERN_INFO "%s: dumping identify data\n", drive->name);
+ ide_dump_identify((u8 *)id);
+#endif
ide_fix_driveid(id);
#if defined (CONFIG_SCSI_EATA_PIO) || defined (CONFIG_SCSI_EATA)
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1291,6 +1291,11 @@ extern struct bus_type ide_bus_type;
#define ide_id_has_flush_cache_ext(id) \
(((id)->cfs_enable_2 & 0x2400) == 0x2400)
+static inline void ide_dump_identify(u8 *id)
+{
+ print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0);
+}
+
static inline int hwif_to_node(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-25 10:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-23 21:43 [PATCH 1/2] ide: add ide_dump_identify() debug helper Bartlomiej Zolnierkiewicz
2007-12-25 10:26 ` Sergei Shtylyov
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).