From 0468cbf6d4847d20e53430190bb2b64f5259f021 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Mar 2009 21:10:03 +0100 Subject: dump access mode --- atasmart.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/atasmart.c b/atasmart.c index c66b088..b4ed846 100644 --- a/atasmart.c +++ b/atasmart.c @@ -103,6 +103,22 @@ typedef enum SkSmartCommand { SK_SMART_COMMAND_RETURN_STATUS = 0xDA } SkSmartCommand; +static const char *disk_type_to_string(SkDiskType type) { + + /* %STRINGPOOLSTART% */ + static const char* const map[_SK_DISK_TYPE_MAX] = { + [SK_DISK_TYPE_ATA_PASSTHROUGH_16] = "16 Byte SCSI ATA SAT Passthru", + [SK_DISK_TYPE_ATA_PASSTHROUGH_12] = "12 Byte SCSI ATA SAT Passthru", + [SK_DISK_TYPE_ATA] = "Native ATA", + }; + /* %STRINGPOOLSTOP% */ + + if (type >= _SK_DISK_TYPE_MAX) + return NULL; + + return _P(map[type]); +} + static SkBool disk_smart_is_available(SkDisk *d) { return d->identify_data_valid && !!(d->identify[164] & 1); } @@ -1446,9 +1462,11 @@ int sk_disk_dump(SkDisk *d) { SkBool awake = FALSE; printf("Device: %s\n" - "Size: %lu MiB\n", + "Size: %lu MiB\n" + "Type: %s\n", d->name, - (unsigned long) (d->size/1024/1024)); + (unsigned long) (d->size/1024/1024), + disk_type_to_string(d->type)); if (d->identify_data_valid) { const SkIdentifyParsedData *ipd; -- cgit