diff options
author | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2002-06-15 10:59:07 +0000 |
---|---|---|
committer | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2002-06-15 10:59:07 +0000 |
commit | cf4f693dd15fde77963d7aead249fc514251b2ee (patch) | |
tree | 65a92afef6aee61a79717e65b99918d6cc1f207a /sbin | |
parent | b0134880aace06cfbbee085b056a93391a6da9af (diff) |
Move ATA SMART defines to atactl.
No kernel parts use this constants.
From Alexander Yurchenko <grange@rt.mipt.ru>
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/atactl/atactl.c | 22 | ||||
-rw-r--r-- | sbin/atactl/atasmart.h | 18 |
2 files changed, 25 insertions, 15 deletions
diff --git a/sbin/atactl/atactl.c b/sbin/atactl/atactl.c index a1ba6f6ff97..ba89873d7b4 100644 --- a/sbin/atactl/atactl.c +++ b/sbin/atactl/atactl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atactl.c,v 1.16 2002/06/09 08:13:05 todd Exp $ */ +/* $OpenBSD: atactl.c,v 1.17 2002/06/15 10:59:06 gluk Exp $ */ /* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */ /*- @@ -654,7 +654,7 @@ device_smart_enable(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_EN; + req.features = ATA_SMART_EN; ata_command(&req); @@ -682,7 +682,7 @@ device_smart_disable(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_DS; + req.features = ATA_SMART_DS; ata_command(&req); @@ -710,7 +710,7 @@ device_smart_status(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_STATUS; + req.features = ATA_SMART_STATUS; ata_command(&req); @@ -749,7 +749,7 @@ device_smart_autosave(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_AUTOSAVE; + req.features = ATA_SMART_AUTOSAVE; if ((val = strtoval(argv[1], smart_autosave)) == -1) goto usage; req.sec_num = val; @@ -782,7 +782,7 @@ device_smart_offline(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_OFFLINE; + req.features = ATA_SMART_OFFLINE; if ((val = strtoval(argv[1], smart_offline)) == -1) goto usage; req.sec_num = val; @@ -816,7 +816,7 @@ device_smart_read(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_READ; + req.features = ATA_SMART_READ; req.flags = ATACMD_READ; req.databuf = (caddr_t)&data; req.datalen = sizeof(data); @@ -879,7 +879,7 @@ device_smart_readlog(argc, argv) req.command = ATAPI_SMART; req.cylinder = 0xc24f; req.timeout = 1000; - req.features = ATAPI_SMART_READLOG; + req.features = ATA_SMART_READLOG; req.flags = ATACMD_READ; req.sec_count = 1; req.databuf = (caddr_t)inbuf; @@ -964,7 +964,7 @@ device_smart_readlog(argc, argv) memset(&req, 0, sizeof(req)); req.flags = ATACMD_READ; req.command = ATAPI_SMART; - req.features = ATAPI_SMART_READLOG; + req.features = ATA_SMART_READLOG; req.sec_count = nsect; req.sec_num = SMART_READLOG_COMP; req.cylinder = 0xc24f; @@ -1118,13 +1118,13 @@ device_attr(argc, argv) req.cylinder = 0xc24f; /* LBA High = C2h, LBA Mid = 4Fh */ req.timeout = 1000; - req.features = ATAPI_SMART_READ; + req.features = ATA_SMART_READ; req.flags = ATACMD_READ; req.databuf = (caddr_t)&attr_val; req.datalen = sizeof(attr_val); ata_command(&req); - req.features = SMART_THRESHOLD; + req.features = ATA_SMART_THRESHOLD; req.flags = ATACMD_READ; req.databuf = (caddr_t)&attr_thr; req.datalen = sizeof(attr_thr); diff --git a/sbin/atactl/atasmart.h b/sbin/atactl/atasmart.h index a8207e7747c..40a1e4fc123 100644 --- a/sbin/atactl/atasmart.h +++ b/sbin/atactl/atasmart.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atasmart.h,v 1.1 2002/06/08 12:50:42 gluk Exp $ */ +/* $OpenBSD: atasmart.h,v 1.2 2002/06/15 10:59:06 gluk Exp $ */ /* * Copyright (c) 2002 Alexander Yurchenko <grange@rt.mipt.ru> @@ -30,7 +30,17 @@ * */ -#define SMART_THRESHOLD 0xd1 /* SMART read threshold */ +/* ATA SMART subcommands */ +#define ATA_SMART_READ 0xd0 /* SMART read data */ +#define ATA_SMART_THRESHOLD 0xd1 /* SMART read threshold */ +#define ATA_SMART_AUTOSAVE 0xd2 /* SMART en-/disable attr. autosave */ +#define ATA_SMART_SAVE 0xd3 /* SMART save attributes */ +#define ATA_SMART_OFFLINE 0xd4 /* SMART execute offline immediately */ +#define ATA_SMART_READLOG 0xd5 /* SMART read log */ +#define ATA_SMART_WRITELOG 0xd6 /* SMART write log */ +#define ATA_SMART_EN 0xd8 /* SMART enable operations */ +#define ATA_SMART_DS 0xd9 /* SMART disable operations */ +#define ATA_SMART_STATUS 0xda /* SMART return status */ /* device attribute */ struct attribute { @@ -204,8 +214,8 @@ struct smart_log_self { #define SMART_OFFLINE_SHORTCAP 129 #define SMART_OFFLINE_EXTENCAP 130 -#define SMART_AUTOSAVE_EN 0xf1 #define SMART_AUTOSAVE_DS 0x00 +#define SMART_AUTOSAVE_EN 0xf1 #define SMART_READLOG_DIR 0x00 #define SMART_READLOG_SUM 0x01 @@ -214,4 +224,4 @@ struct smart_log_self { #define SMART_READLOG_SELF 0x06 #define SMART_READLOG_ESELF 0x07 -#define SMART_LOG_MSECT 0x01 +#define SMART_LOG_MSECT 0x01 |