summaryrefslogtreecommitdiffstats
path: root/atasmart.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-03-18 21:10:03 +0100
committerLennart Poettering <lennart@poettering.net>2009-03-18 21:10:03 +0100
commit0468cbf6d4847d20e53430190bb2b64f5259f021 (patch)
treef0a4f596b0f37f78d471c371514ea7916fb55712 /atasmart.c
parent8e07ffd3047362423a3ba4e5b240031996a26aac (diff)
dump access mode
Diffstat (limited to 'atasmart.c')
-rw-r--r--atasmart.c22
1 files 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;