Codebase list libatasmart / 6db8ebb
Imported Upstream version 0.15 Martin Pitt 14 years ago
13 changed file(s) with 365 addition(s) and 238 deletion(s). Raw diff Collapse all Expand all
1515 # License along with libatasmart. If not, If not, see
1616 # <http://www.gnu.org/licenses/>.
1717
18 dist_doc_DATA = README
19
1820 EXTRA_DIST = \
1921 bootstrap.sh \
2022 LGPL \
2123 README \
22 atasmart.vapi \
2324 atasmart.c \
2425 blob-examples/README \
2526 blob-examples/FUJITSU_MHY2120BH--0084000D \
2627 blob-examples/FUJITSU_MHY2120BH--0085000B \
28 blob-examples/FUJITSU_MHY2120BH--0085000B \
2729 blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \
30 blob-examples/INTEL_SSDSA2MH080G1GC--045C8820 \
2831 blob-examples/Maxtor_96147H8--BAC51KJ0 \
32 blob-examples/Maxtor_96147H8--BAC51KJ0--2 \
2933 blob-examples/SAMSUNG_HD501LJ--CR100-12 \
3034 blob-examples/ST320410A--3.39 \
3135 blob-examples/ST9160821AS--3.CLH \
36 blob-examples/TOSHIBA_MK1651GSY--38IGT0G5T \
3237 blob-examples/WDC_WD2500JB--00REA0-20.00K20 \
3338 blob-examples/WDC_WD2500JS-75NCB3--10.02E04 \
34 blob-examples/WDC_WD5000AAKS--00TMA0-12.01C01
39 blob-examples/WDC_WD5000AAKS--00TMA0-12.01C01 \
40 vala/atasmart.vapi
3541
3642 SUBDIRS =
3743
4248
4349 pkgconfigdir = $(libdir)/pkgconfig
4450 pkgconfig_DATA = libatasmart.pc
51
52 vapidir = $(datadir)/vala/vapi
53 vapi_DATA = vala/atasmart.vapi
4554
4655 include_HEADERS = \
4756 atasmart.h
5757 sbin_PROGRAMS = skdump$(EXEEXT) sktest$(EXEEXT)
5858 noinst_PROGRAMS = strpool$(EXEEXT)
5959 subdir = .
60 DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
61 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
60 DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
61 $(include_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
6262 $(srcdir)/config.h.in $(srcdir)/libatasmart.pc.in \
6363 $(top_srcdir)/configure compile config.guess config.rpath \
6464 config.sub depcomp install-sh ltmain.sh missing
9494 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
9595 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
9696 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" \
97 "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"
97 "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \
98 "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(includedir)"
9899 LTLIBRARIES = $(lib_LTLIBRARIES)
99100 am__DEPENDENCIES_1 =
100101 libatasmart_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
154155 install-pdf-recursive install-ps-recursive install-recursive \
155156 installcheck-recursive installdirs-recursive pdf-recursive \
156157 ps-recursive uninstall-recursive
157 DATA = $(noinst_DATA) $(pkgconfig_DATA)
158 DATA = $(dist_doc_DATA) $(noinst_DATA) $(pkgconfig_DATA) $(vapi_DATA)
158159 HEADERS = $(include_HEADERS)
159160 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
160161 distclean-recursive maintainer-clean-recursive
321322 top_build_prefix = @top_build_prefix@
322323 top_builddir = @top_builddir@
323324 top_srcdir = @top_srcdir@
325 dist_doc_DATA = README
324326 EXTRA_DIST = \
325327 bootstrap.sh \
326328 LGPL \
327329 README \
328 atasmart.vapi \
329330 atasmart.c \
330331 blob-examples/README \
331332 blob-examples/FUJITSU_MHY2120BH--0084000D \
332333 blob-examples/FUJITSU_MHY2120BH--0085000B \
334 blob-examples/FUJITSU_MHY2120BH--0085000B \
333335 blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \
336 blob-examples/INTEL_SSDSA2MH080G1GC--045C8820 \
334337 blob-examples/Maxtor_96147H8--BAC51KJ0 \
338 blob-examples/Maxtor_96147H8--BAC51KJ0--2 \
335339 blob-examples/SAMSUNG_HD501LJ--CR100-12 \
336340 blob-examples/ST320410A--3.39 \
337341 blob-examples/ST9160821AS--3.CLH \
342 blob-examples/TOSHIBA_MK1651GSY--38IGT0G5T \
338343 blob-examples/WDC_WD2500JB--00REA0-20.00K20 \
339344 blob-examples/WDC_WD2500JS-75NCB3--10.02E04 \
340 blob-examples/WDC_WD5000AAKS--00TMA0-12.01C01
345 blob-examples/WDC_WD5000AAKS--00TMA0-12.01C01 \
346 vala/atasmart.vapi
341347
342348 SUBDIRS =
343349 CLEANFILES = atasmart.strpool.c
345351 noinst_DATA =
346352 pkgconfigdir = $(libdir)/pkgconfig
347353 pkgconfig_DATA = libatasmart.pc
354 vapidir = $(datadir)/vala/vapi
355 vapi_DATA = vala/atasmart.vapi
348356 include_HEADERS = \
349357 atasmart.h
350358
586594
587595 distclean-libtool:
588596 -rm -f libtool config.lt
597 install-dist_docDATA: $(dist_doc_DATA)
598 @$(NORMAL_INSTALL)
599 test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
600 @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
601 for p in $$list; do \
602 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
603 echo "$$d$$p"; \
604 done | $(am__base_list) | \
605 while read files; do \
606 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
607 $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
608 done
609
610 uninstall-dist_docDATA:
611 @$(NORMAL_UNINSTALL)
612 @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
613 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
614 test -n "$$files" || exit 0; \
615 echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
616 cd "$(DESTDIR)$(docdir)" && rm -f $$files
589617 install-pkgconfigDATA: $(pkgconfig_DATA)
590618 @$(NORMAL_INSTALL)
591619 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
606634 test -n "$$files" || exit 0; \
607635 echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
608636 cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
637 install-vapiDATA: $(vapi_DATA)
638 @$(NORMAL_INSTALL)
639 test -z "$(vapidir)" || $(MKDIR_P) "$(DESTDIR)$(vapidir)"
640 @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \
641 for p in $$list; do \
642 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
643 echo "$$d$$p"; \
644 done | $(am__base_list) | \
645 while read files; do \
646 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(vapidir)'"; \
647 $(INSTALL_DATA) $$files "$(DESTDIR)$(vapidir)" || exit $$?; \
648 done
649
650 uninstall-vapiDATA:
651 @$(NORMAL_UNINSTALL)
652 @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \
653 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
654 test -n "$$files" || exit 0; \
655 echo " ( cd '$(DESTDIR)$(vapidir)' && rm -f" $$files ")"; \
656 cd "$(DESTDIR)$(vapidir)" && rm -f $$files
609657 install-includeHEADERS: $(include_HEADERS)
610658 @$(NORMAL_INSTALL)
611659 test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
943991 config.h
944992 installdirs: installdirs-recursive
945993 installdirs-am:
946 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
994 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(includedir)"; do \
947995 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
948996 done
949997 install: $(BUILT_SOURCES)
9991047
10001048 info-am:
10011049
1002 install-data-am: install-includeHEADERS install-pkgconfigDATA
1050 install-data-am: install-dist_docDATA install-includeHEADERS \
1051 install-pkgconfigDATA install-vapiDATA
10031052
10041053 install-dvi: install-dvi-recursive
10051054
10471096
10481097 ps-am:
10491098
1050 uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
1051 uninstall-pkgconfigDATA uninstall-sbinPROGRAMS
1099 uninstall-am: uninstall-dist_docDATA uninstall-includeHEADERS \
1100 uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \
1101 uninstall-sbinPROGRAMS uninstall-vapiDATA
10521102
10531103 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
10541104 ctags-recursive install install-am install-strip \
10631113 distclean-generic distclean-hdr distclean-libtool \
10641114 distclean-tags distcleancheck distdir distuninstallcheck dvi \
10651115 dvi-am html html-am info info-am install install-am \
1066 install-data install-data-am install-dvi install-dvi-am \
1067 install-exec install-exec-am install-html install-html-am \
1068 install-includeHEADERS install-info install-info-am \
1069 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
1070 install-pkgconfigDATA install-ps install-ps-am \
1071 install-sbinPROGRAMS install-strip installcheck \
1072 installcheck-am installdirs installdirs-am maintainer-clean \
1073 maintainer-clean-generic mostlyclean mostlyclean-compile \
1074 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
1075 tags tags-recursive uninstall uninstall-am \
1076 uninstall-includeHEADERS uninstall-libLTLIBRARIES \
1077 uninstall-pkgconfigDATA uninstall-sbinPROGRAMS
1116 install-data install-data-am install-dist_docDATA install-dvi \
1117 install-dvi-am install-exec install-exec-am install-html \
1118 install-html-am install-includeHEADERS install-info \
1119 install-info-am install-libLTLIBRARIES install-man install-pdf \
1120 install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
1121 install-sbinPROGRAMS install-strip install-vapiDATA \
1122 installcheck installcheck-am installdirs installdirs-am \
1123 maintainer-clean maintainer-clean-generic mostlyclean \
1124 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
1125 pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
1126 uninstall-dist_docDATA uninstall-includeHEADERS \
1127 uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \
1128 uninstall-sbinPROGRAMS uninstall-vapiDATA
10781129
10791130
10801131 atasmart.strpool.c: atasmart.c strpool
34643464 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
34653465
34663466 cat <<_LT_EOF >> conftest.$ac_ext
3467
34683467 /* The mapping between symbol names and symbols. */
34693468 const struct {
34703469 const char *name;
11821182 a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150;
11831183 else if (!strcmp(a->name, "power-on-minutes"))
11841184 a->pretty_value = fourtyeight * 60 * 1000;
1185 else if (!strcmp(a->name, "power-on-seconds"))
1185 else if (!strcmp(a->name, "power-on-seconds") ||
1186 !strcmp(a->name, "power-on-seconds-2"))
11861187 a->pretty_value = fourtyeight * 1000;
11871188 else if (!strcmp(a->name, "power-on-half-minutes"))
11881189 a->pretty_value = fourtyeight * 30 * 1000;
13081309 [228] = { "power-off-retract-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
13091310 [230] = { "head-amplitude", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
13101311 [231] = { "temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1312
1313 /* http://www.adtron.com/pdf/SMART_for_XceedLite_SATA_RevA.pdf */
1314 [232] = { "endurance-remaining", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1315 [233] = { "power-on-seconds-2", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1316 [234] = { "uncorrectable-ecc-count", SK_SMART_ATTRIBUTE_UNIT_SECTORS, NULL },
1317 [235] = { "good-block-rate", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1318
13111319 [240] = { "head-flying-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
13121320 [250] = { "read-error-retry-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
13131321 };
19101918
19111919 if (!strcmp(a->name, "power-on-minutes") ||
19121920 !strcmp(a->name, "power-on-seconds") ||
1921 !strcmp(a->name, "power-on-seconds-2") ||
19131922 !strcmp(a->name, "power-on-half-minutes") ||
19141923 !strcmp(a->name, "power-on-hours")) {
19151924
24642473 goto finish;
24652474 }
24662475
2467 if ((vid == 0x0c0b && pid == 0xb159) ||
2476 if ((vid == 0x152d && pid == 0x2329)) {
2477 /* Some JMicron bridges seem to choke on SMART
2478 * commands, so let's explicitly black list
2479 * them here.
2480 *
2481 * https://bugzilla.redhat.com/show_bug.cgi?id=515881 */
2482 d->type = SK_DISK_TYPE_NONE;
2483 } else if ((vid == 0x0c0b && pid == 0xb159) ||
24682484 (vid == 0x04fc && pid == 0x0c25) ||
24692485 (vid == 0x04fc && pid == 0x0c15))
24702486 d->type = SK_DISK_TYPE_SUNPLUS;
2471 else if ((vid == 0x152d && pid == 0x2329) ||
2472 (vid == 0x152d && pid == 0x2336) ||
2487 else if ((vid == 0x152d && pid == 0x2336) ||
24732488 (vid == 0x152d && pid == 0x2338) ||
24742489 (vid == 0x152d && pid == 0x2339))
24752490 d->type = SK_DISK_TYPE_JMICRON;
0 /* Saved 109 relocations, saved 2 strings (19 b) due to suffix compression. */
0 /* Saved 113 relocations, saved 2 strings (19 b) due to suffix compression. */
11 static const char _strpool_[] =
22 "16 Byte SCSI ATA SAT Passthru\0"
33 "12 Byte SCSI ATA SAT Passthru\0"
7878 "head-amplitude\0"
7979 /*** Suppressed due to suffix:
8080 "temperature-celsius\0" ***/
81 "endurance-remaining\0"
82 "power-on-seconds-2\0"
83 "uncorrectable-ecc-count\0"
84 "good-block-rate\0"
8185 "head-flying-hours\0"
8286 "read-error-retry-rate\0"
8387 "9_POWERONMINUTES\0"
13041308 a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150;
13051309 else if (!strcmp(a->name, "power-on-minutes"))
13061310 a->pretty_value = fourtyeight * 60 * 1000;
1307 else if (!strcmp(a->name, "power-on-seconds"))
1311 else if (!strcmp(a->name, "power-on-seconds") ||
1312 !strcmp(a->name, "power-on-seconds-2"))
13081313 a->pretty_value = fourtyeight * 1000;
13091314 else if (!strcmp(a->name, "power-on-half-minutes"))
13101315 a->pretty_value = fourtyeight * 30 * 1000;
14301435 [228] = { ((const char*) 2321), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL },
14311436 [230] = { ((const char*) 2347), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
14321437 [231] = { ((const char*) 1795), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature },
1433 [240] = { ((const char*) 2362), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
1434 [250] = { ((const char*) 2380), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
1438
1439 /* http://www.adtron.com/pdf/SMART_for_XceedLite_SATA_RevA.pdf */
1440 [232] = { ((const char*) 2362), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1441 [233] = { ((const char*) 2382), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1442 [234] = { ((const char*) 2401), SK_SMART_ATTRIBUTE_UNIT_SECTORS, NULL },
1443 [235] = { ((const char*) 2425), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
1444
1445 [240] = { ((const char*) 2441), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
1446 [250] = { ((const char*) 2459), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
14351447 };
14361448 /* %STRINGPOOLSTOP% */
14371449
14531465
14541466 /* %STRINGPOOLSTART% */
14551467 static const char *quirk_name[] = {
1456 ((const char*) 2402),
1457 ((const char*) 2419),
1458 ((const char*) 2436),
1459 ((const char*) 2457),
1460 ((const char*) 2485),
1461 ((const char*) 2500),
1468 ((const char*) 2481),
1469 ((const char*) 2498),
14621470 ((const char*) 2515),
1463 ((const char*) 2527),
1464 ((const char*) 2547),
1465 ((const char*) 2567),
1466 ((const char*) 2577),
1467 ((const char*) 2587),
1468 ((const char*) 2599),
1471 ((const char*) 2536),
1472 ((const char*) 2564),
1473 ((const char*) 2579),
1474 ((const char*) 2594),
1475 ((const char*) 2606),
1476 ((const char*) 2626),
1477 ((const char*) 2646),
1478 ((const char*) 2656),
1479 ((const char*) 2666),
1480 ((const char*) 2678),
14691481 NULL
14701482 };
14711483 /* %STRINGPOOLSTOP% */
17021714 /* %STRINGPOOLSTART% */
17031715 if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) {
17041716 static const SkSmartAttributeInfo a = {
1705 ((const char*) 2611), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
1717 ((const char*) 2690), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
17061718 };
17071719 return &a;
17081720
17091721 } else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) {
17101722 static const SkSmartAttributeInfo a = {
1711 ((const char*) 2628), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
1723 ((const char*) 2707), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
17121724 };
17131725 return &a;
17141726
17151727 } else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) {
17161728 static const SkSmartAttributeInfo a = {
1717 ((const char*) 2645), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
1729 ((const char*) 2724), SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time
17181730 };
17191731 return &a;
17201732 } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
17271739 /* %STRINGPOOLSTART% */
17281740 if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) {
17291741 static const SkSmartAttributeInfo a = {
1730 ((const char*) 2667), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
1742 ((const char*) 2746), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
17311743 };
17321744 return &a;
17331745 }
17391751 /* %STRINGPOOLSTART% */
17401752 if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) {
17411753 static const SkSmartAttributeInfo a = {
1742 ((const char*) 2697), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature
1754 ((const char*) 2776), SK_SMART_ATTRIBUTE_UNIT_MKELVIN, verify_temperature
17431755 };
17441756 return &a;
17451757 } else if (quirk & SK_SMART_QUIRK_194_UNKNOWN)
17641776 /* %STRINGPOOLSTART% */
17651777 if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
17661778 static const SkSmartAttributeInfo a = {
1767 ((const char*) 2723), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
1779 ((const char*) 2802), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
17681780 };
17691781 return &a;
17701782 }
17761788 /* %STRINGPOOLSTART% */
17771789 if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) {
17781790 static const SkSmartAttributeInfo a = {
1779 ((const char*) 2741), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
1791 ((const char*) 2820), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL
17801792 };
17811793 return &a;
17821794 }
19711983 const char * const map[] = {
19721984 [SK_SMART_ATTRIBUTE_UNIT_UNKNOWN] = NULL,
19731985 [SK_SMART_ATTRIBUTE_UNIT_NONE] = ((const char*) 30),
1974 [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 2759),
1975 [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 2762),
1976 [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 2770)
1986 [SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = ((const char*) 2838),
1987 [SK_SMART_ATTRIBUTE_UNIT_SECTORS] = ((const char*) 2841),
1988 [SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = ((const char*) 2849)
19771989 };
19781990 /* %STRINGPOOLSTOP% */
19791991
20322044
20332045 if (!strcmp(a->name, "power-on-minutes") ||
20342046 !strcmp(a->name, "power-on-seconds") ||
2047 !strcmp(a->name, "power-on-seconds-2") ||
20352048 !strcmp(a->name, "power-on-half-minutes") ||
20362049 !strcmp(a->name, "power-on-hours")) {
20372050
21622175
21632176 /* %STRINGPOOLSTART% */
21642177 const char * const map[] = {
2165 [SK_SMART_OVERALL_GOOD] = ((const char*) 2773),
2166 [SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST] = ((const char*) 2778),
2167 [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 2804),
2168 [SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW] = ((const char*) 2815),
2169 [SK_SMART_OVERALL_BAD_SECTOR_MANY] = ((const char*) 2833),
2170 [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 2849),
2178 [SK_SMART_OVERALL_GOOD] = ((const char*) 2852),
2179 [SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST] = ((const char*) 2857),
2180 [SK_SMART_OVERALL_BAD_SECTOR] = ((const char*) 2883),
2181 [SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW] = ((const char*) 2894),
2182 [SK_SMART_OVERALL_BAD_SECTOR_MANY] = ((const char*) 2912),
2183 [SK_SMART_OVERALL_BAD_STATUS] = ((const char*) 2928),
21712184 };
21722185 /* %STRINGPOOLSTOP% */
21732186
25862599 goto finish;
25872600 }
25882601
2589 if ((vid == 0x0c0b && pid == 0xb159) ||
2602 if ((vid == 0x152d && pid == 0x2329)) {
2603 /* Some JMicron bridges seem to choke on SMART
2604 * commands, so let's explicitly black list
2605 * them here.
2606 *
2607 * https://bugzilla.redhat.com/show_bug.cgi?id=515881 */
2608 d->type = SK_DISK_TYPE_NONE;
2609 } else if ((vid == 0x0c0b && pid == 0xb159) ||
25902610 (vid == 0x04fc && pid == 0x0c25) ||
25912611 (vid == 0x04fc && pid == 0x0c15))
25922612 d->type = SK_DISK_TYPE_SUNPLUS;
2593 else if ((vid == 0x152d && pid == 0x2329) ||
2594 (vid == 0x152d && pid == 0x2336) ||
2613 else if ((vid == 0x152d && pid == 0x2336) ||
25952614 (vid == 0x152d && pid == 0x2338) ||
25962615 (vid == 0x152d && pid == 0x2339))
25972616 d->type = SK_DISK_TYPE_JMICRON;
+0
-140
atasmart.vapi less more
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 using GLib;
23
24 [CCode (cheader_filename="atasmart.h")]
25 namespace Smart {
26
27 [CCode (cname="SkSmartSelfTest", cprefix="SK_SMART_SELF_TEST_")]
28 public enum SmartSelfTest {
29 SHORT, EXTENDED, CONVEYANCE, ABORT
30 }
31
32 [Immutable]
33 [CCode (cname="SkIdentifyParsedData")]
34 public struct IdentifyParsedData {
35 public string serial;
36 public string firmware;
37 public string model;
38 }
39
40 [CCode (cname="SkSmartOfflineDataCollectionStatus", cprefix="SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_")]
41 public enum SmartOfflineDataCollectionStatus {
42 NEVER, SUCCESS, INPROGRESS, SUSPENDED, ABORTED, FATAL, UNKNOWN
43 }
44
45 [CCode (cname="sk_smart_offline_data_collection_status_to_string")]
46 public weak string smart_offline_data_collection_status_to_string(SmartOfflineDataCollectionStatus status);
47
48
49 [CCode (cname="SkSmartSelfTestExecutionStatus", cprefix="SK_SMART_SELF_TEST_EXECUTION_STATUS_")]
50 public enum SmartSelfTestExecutionStatus {
51 SUCCESS_OR_NEVER, ABORTED, INTERRUPTED, FATAL, ERROR_UNKNOWN, ERROR_ELECTRICAL, ERROR_SERVO, ERROR_READ, ERROR_HANDLING, INPROGRESS
52 }
53
54 [CCode (cname="sk_smart_self_test_execution_status_to_string")]
55 public weak string smart_self_test_execution_status_to_string(SmartSelfTestExecutionStatus status);
56
57 [Immutable]
58 [CCode (cname="SkSmartParsedData")]
59 public struct SmartParsedData {
60 public SmartOfflineDataCollectionStatus offline_data_collection_status;
61 public uint total_offline_data_collection_seconds;
62 public SmartSelfTestExecutionStatus self_test_execution_status;
63 public uint self_test_execution_percent_remaining;
64
65 public bool conveyance_test_available;
66 public bool short_and_extended_test_available;
67 public bool start_test_available;
68 public bool abort_test_available;
69
70 public uint short_test_polling_minutes;
71 public uint extended_test_polling_minutes;
72 public uint conveyance_test_polling_minutes;
73
74 [CCode (cname="sk_smart_self_test_available")]
75 public bool self_test_available(SmartSelfTest test);
76
77 [CCode (cname="sk_smart_self_test_polling_minutes")]
78 public uint self_test_polling_minutes(SmartSelfTest test);
79 }
80
81 [CCode (cname="SkSmartAttributeUnit", cprefix="SK_SMART_ATTRIBUTE_UNIT_")]
82 public enum SmartAttributeUnit {
83 UNKNOWN, NONE, MSECONDS, SECTORS, MKELVIN
84 }
85
86 [CCode (cname="sk_smart_attribute_unit_to_string")]
87 public weak string smart_attribute_unit_to_string(SmartAttributeUnit unit);
88
89 [Immutable]
90 [CCode (cname="SkSmartAttributeParsedData")]
91 public struct SmartAttributeParsedData {
92 public uint8 id;
93 public string name;
94 public SmartAttributeUnit pretty_unit;
95 public uint16 flags;
96 public uint8 threshold;
97 public bool threshold_valid;
98 public bool online;
99 public bool prefailure;
100 public bool good;
101 public uint8 current_value;
102 public uint8 worst_value;
103 public uint64 pretty_value;
104 public uint8[6] raw;
105 }
106
107 [CCode (cname="SkSmartAttributeParseCallback")]
108 public delegate void SmartAttributeParseCallback(void* disk, SmartAttributeParsedData a);
109
110 [Compact]
111 [CCode (free_function="sk_disk_free", cname="SkDisk", cprefix="sk_disk_")]
112 public class Disk {
113
114 public static int open(string name, out Disk disk);
115
116 public int get_size(out uint64 bytes);
117
118 public int check_sleep_mode(out bool awake);
119
120 public int identify_is_available(out bool available);
121 public int identify_parse(out weak IdentifyParsedData* data);
122
123 public int smart_is_available(out bool available);
124 public int smart_status(out bool good);
125 public int smart_read_data();
126 public int smart_parse_attributes(SmartAttributeParseCallback cb);
127 public int smart_parse(out weak SmartParsedData* data);
128 public int smart_self_test(SmartSelfTest test);
129
130 public int dump();
131 }
132
133 /* These two should move to an official vala package */
134 [CCode (cname="errno", cheader_filename="errno.h")]
135 public int errno;
136
137 [CCode (cname="g_strerror", cheader_filename="glib.h")]
138 public weak string strerror(int err);
139 }
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.63 for libatasmart 0.14.
2 # Generated by GNU Autoconf 2.63 for libatasmart 0.15.
33 #
44 # Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>.
55 #
744744 # Identity of this package.
745745 PACKAGE_NAME='libatasmart'
746746 PACKAGE_TARNAME='libatasmart'
747 PACKAGE_VERSION='0.14'
748 PACKAGE_STRING='libatasmart 0.14'
747 PACKAGE_VERSION='0.15'
748 PACKAGE_STRING='libatasmart 0.15'
749749 PACKAGE_BUGREPORT='mzyvongnfzneg (at) 0pointer (dot) net'
750750
751751 ac_unique_file="atasmart.c"
14881488 # Omit some internal or obsolete options to make the list less imposing.
14891489 # This message is too long to be a string in the A/UX 3.1 sh.
14901490 cat <<_ACEOF
1491 \`configure' configures libatasmart 0.14 to adapt to many kinds of systems.
1491 \`configure' configures libatasmart 0.15 to adapt to many kinds of systems.
14921492
14931493 Usage: $0 [OPTION]... [VAR=VALUE]...
14941494
15581558
15591559 if test -n "$ac_init_help"; then
15601560 case $ac_init_help in
1561 short | recursive ) echo "Configuration of libatasmart 0.14:";;
1561 short | recursive ) echo "Configuration of libatasmart 0.15:";;
15621562 esac
15631563 cat <<\_ACEOF
15641564
16681668 test -n "$ac_init_help" && exit $ac_status
16691669 if $ac_init_version; then
16701670 cat <<\_ACEOF
1671 libatasmart configure 0.14
1671 libatasmart configure 0.15
16721672 generated by GNU Autoconf 2.63
16731673
16741674 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
16821682 This file contains any messages produced by compilers while
16831683 running configure, to aid debugging if configure makes a mistake.
16841684
1685 It was created by libatasmart $as_me 0.14, which was
1685 It was created by libatasmart $as_me 0.15, which was
16861686 generated by GNU Autoconf 2.63. Invocation command line was
16871687
16881688 $ $0 $@
25482548
25492549 # Define the identity of the package.
25502550 PACKAGE='libatasmart'
2551 VERSION='0.14'
2551 VERSION='0.15'
25522552
25532553
25542554 cat >>confdefs.h <<_ACEOF
26732673 PACKAGE_URL=http://git.0pointer.de/?p=libatasmart.git
26742674
26752675
2676 LIBATASMART_VERSION_INFO=4:0:0
2676 LIBATASMART_VERSION_INFO=4:1:0
26772677
26782678
26792679 # Make sure we can run config.sub.
27582758 IFS=$ac_save_IFS
27592759 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
27602760
2761
2762
2763 # Check whether --enable-silent-rules was given.
2764 if test "${enable_silent_rules+set}" = set; then
2765 enableval=$enable_silent_rules;
2766 fi
2767
2768 case $enable_silent_rules in
2769 yes) AM_DEFAULT_VERBOSITY=0;;
2770 no) AM_DEFAULT_VERBOSITY=1;;
2771 *) AM_DEFAULT_VERBOSITY=0;;
2772 esac
2773 AM_BACKSLASH='\'
27612774
27622775
27632776 if type -p stow > /dev/null && test -d /usr/local/stow ; then
59555968 else
59565969 lt_cv_nm_interface="BSD nm"
59575970 echo "int some_variable = 0;" > conftest.$ac_ext
5958 (eval echo "\"\$as_me:5959: $ac_compile\"" >&5)
5971 (eval echo "\"\$as_me:5972: $ac_compile\"" >&5)
59595972 (eval "$ac_compile" 2>conftest.err)
59605973 cat conftest.err >&5
5961 (eval echo "\"\$as_me:5962: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
5974 (eval echo "\"\$as_me:5975: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
59625975 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
59635976 cat conftest.err >&5
5964 (eval echo "\"\$as_me:5965: output\"" >&5)
5977 (eval echo "\"\$as_me:5978: output\"" >&5)
59655978 cat conftest.out >&5
59665979 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
59675980 lt_cv_nm_interface="MS dumpbin"
70377050 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
70387051
70397052 cat <<_LT_EOF >> conftest.$ac_ext
7040
70417053 /* The mapping between symbol names and symbols. */
70427054 const struct {
70437055 const char *name;
71667178 ;;
71677179 *-*-irix6*)
71687180 # Find out which ABI we are using.
7169 echo '#line 7170 "configure"' > conftest.$ac_ext
7181 echo '#line 7182 "configure"' > conftest.$ac_ext
71707182 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
71717183 (eval $ac_compile) 2>&5
71727184 ac_status=$?
92699281 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
92709282 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
92719283 -e 's:$: $lt_compiler_flag:'`
9272 (eval echo "\"\$as_me:9273: $lt_compile\"" >&5)
9284 (eval echo "\"\$as_me:9285: $lt_compile\"" >&5)
92739285 (eval "$lt_compile" 2>conftest.err)
92749286 ac_status=$?
92759287 cat conftest.err >&5
9276 echo "$as_me:9277: \$? = $ac_status" >&5
9288 echo "$as_me:9289: \$? = $ac_status" >&5
92779289 if (exit $ac_status) && test -s "$ac_outfile"; then
92789290 # The compiler can only warn and ignore the option if not recognized
92799291 # So say no if there are warnings other than the usual output.
96089620 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
96099621 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
96109622 -e 's:$: $lt_compiler_flag:'`
9611 (eval echo "\"\$as_me:9612: $lt_compile\"" >&5)
9623 (eval echo "\"\$as_me:9624: $lt_compile\"" >&5)
96129624 (eval "$lt_compile" 2>conftest.err)
96139625 ac_status=$?
96149626 cat conftest.err >&5
9615 echo "$as_me:9616: \$? = $ac_status" >&5
9627 echo "$as_me:9628: \$? = $ac_status" >&5
96169628 if (exit $ac_status) && test -s "$ac_outfile"; then
96179629 # The compiler can only warn and ignore the option if not recognized
96189630 # So say no if there are warnings other than the usual output.
97139725 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
97149726 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
97159727 -e 's:$: $lt_compiler_flag:'`
9716 (eval echo "\"\$as_me:9717: $lt_compile\"" >&5)
9728 (eval echo "\"\$as_me:9729: $lt_compile\"" >&5)
97179729 (eval "$lt_compile" 2>out/conftest.err)
97189730 ac_status=$?
97199731 cat out/conftest.err >&5
9720 echo "$as_me:9721: \$? = $ac_status" >&5
9732 echo "$as_me:9733: \$? = $ac_status" >&5
97219733 if (exit $ac_status) && test -s out/conftest2.$ac_objext
97229734 then
97239735 # The compiler can only warn and ignore the option if not recognized
97689780 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
97699781 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
97709782 -e 's:$: $lt_compiler_flag:'`
9771 (eval echo "\"\$as_me:9772: $lt_compile\"" >&5)
9783 (eval echo "\"\$as_me:9784: $lt_compile\"" >&5)
97729784 (eval "$lt_compile" 2>out/conftest.err)
97739785 ac_status=$?
97749786 cat out/conftest.err >&5
9775 echo "$as_me:9776: \$? = $ac_status" >&5
9787 echo "$as_me:9788: \$? = $ac_status" >&5
97769788 if (exit $ac_status) && test -s out/conftest2.$ac_objext
97779789 then
97789790 # The compiler can only warn and ignore the option if not recognized
1257112583 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1257212584 lt_status=$lt_dlunknown
1257312585 cat > conftest.$ac_ext <<_LT_EOF
12574 #line 12575 "configure"
12586 #line 12587 "configure"
1257512587 #include "confdefs.h"
1257612588
1257712589 #if HAVE_DLFCN_H
1266712679 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1266812680 lt_status=$lt_dlunknown
1266912681 cat > conftest.$ac_ext <<_LT_EOF
12670 #line 12671 "configure"
12682 #line 12683 "configure"
1267112683 #include "confdefs.h"
1267212684
1267312685 #if HAVE_DLFCN_H
1468714699 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1468814700 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1468914701 -e 's:$: $lt_compiler_flag:'`
14690 (eval echo "\"\$as_me:14691: $lt_compile\"" >&5)
14702 (eval echo "\"\$as_me:14703: $lt_compile\"" >&5)
1469114703 (eval "$lt_compile" 2>conftest.err)
1469214704 ac_status=$?
1469314705 cat conftest.err >&5
14694 echo "$as_me:14695: \$? = $ac_status" >&5
14706 echo "$as_me:14707: \$? = $ac_status" >&5
1469514707 if (exit $ac_status) && test -s "$ac_outfile"; then
1469614708 # The compiler can only warn and ignore the option if not recognized
1469714709 # So say no if there are warnings other than the usual output.
1478614798 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1478714799 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1478814800 -e 's:$: $lt_compiler_flag:'`
14789 (eval echo "\"\$as_me:14790: $lt_compile\"" >&5)
14801 (eval echo "\"\$as_me:14802: $lt_compile\"" >&5)
1479014802 (eval "$lt_compile" 2>out/conftest.err)
1479114803 ac_status=$?
1479214804 cat out/conftest.err >&5
14793 echo "$as_me:14794: \$? = $ac_status" >&5
14805 echo "$as_me:14806: \$? = $ac_status" >&5
1479414806 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1479514807 then
1479614808 # The compiler can only warn and ignore the option if not recognized
1483814850 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1483914851 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1484014852 -e 's:$: $lt_compiler_flag:'`
14841 (eval echo "\"\$as_me:14842: $lt_compile\"" >&5)
14853 (eval echo "\"\$as_me:14854: $lt_compile\"" >&5)
1484214854 (eval "$lt_compile" 2>out/conftest.err)
1484314855 ac_status=$?
1484414856 cat out/conftest.err >&5
14845 echo "$as_me:14846: \$? = $ac_status" >&5
14857 echo "$as_me:14858: \$? = $ac_status" >&5
1484614858 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1484714859 then
1484814860 # The compiler can only warn and ignore the option if not recognized
1855018562 # report actual input values of CONFIG_FILES etc. instead of their
1855118563 # values after options handling.
1855218564 ac_log="
18553 This file was extended by libatasmart $as_me 0.14, which was
18565 This file was extended by libatasmart $as_me 0.15, which was
1855418566 generated by GNU Autoconf 2.63. Invocation command line was
1855518567
1855618568 CONFIG_FILES = $CONFIG_FILES
1861318625 _ACEOF
1861418626 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1861518627 ac_cs_version="\\
18616 libatasmart config.status 0.14
18628 libatasmart config.status 0.15
1861718629 configured by $0, generated by GNU Autoconf 2.63,
1861818630 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
1861918631
2020
2121 AC_PREREQ(2.63)
2222
23 AC_INIT([libatasmart], 0.14, [mzyvongnfzneg (at) 0pointer (dot) net])
23 AC_INIT([libatasmart], 0.15, [mzyvongnfzneg (at) 0pointer (dot) net])
2424 AC_CONFIG_SRCDIR([atasmart.c])
2525 AC_CONFIG_HEADERS([config.h])
2626 AC_CONFIG_MACRO_DIR(m4)
2929
3030 AC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=libatasmart.git])
3131
32 AC_SUBST(LIBATASMART_VERSION_INFO, [4:0:0])
32 AC_SUBST(LIBATASMART_VERSION_INFO, [4:1:0])
3333
3434 AC_CANONICAL_HOST
35
36 AM_SILENT_RULES([yes])
3537
3638 if type -p stow > /dev/null && test -d /usr/local/stow ; then
3739 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
23202320
23212321 #ifdef __cplusplus
23222322 extern \"C\" {
2323 #endif
2324
2325 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
2326 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
23232327 #endif
23242328
23252329 /* External symbol declarations for the compiler. */\
0 /*-*- Mode: C; c-basic-offset: 8 -*-*/
1
2 /***
3 This file is part of libatasmart.
4
5 Copyright 2008 Lennart Poettering
6
7 libatasmart is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation, either version 2.1 of the
10 License, or (at your option) any later version.
11
12 libatasmart is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with libatasmart. If not, If not, see
19 <http://www.gnu.org/licenses/>.
20 ***/
21
22 using GLib;
23
24 [CCode (cheader_filename="atasmart.h")]
25 namespace AtaSmart {
26
27 [CCode (cname="SkSmartSelfTest", cprefix="SK_SMART_SELF_TEST_")]
28 public enum SmartSelfTest {
29 SHORT, EXTENDED, CONVEYANCE, ABORT;
30
31 [CCode (cname="sk_smart_self_test_to_string")]
32 public unowned string? to_string();
33 }
34
35 [Immutable]
36 [CCode (cname="SkIdentifyParsedData")]
37 public struct IdentifyParsedData {
38 public string serial;
39 public string firmware;
40 public string model;
41 }
42
43 [CCode (cname="SkSmartOfflineDataCollectionStatus", cprefix="SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_")]
44 public enum SmartOfflineDataCollectionStatus {
45 NEVER, SUCCESS, INPROGRESS, SUSPENDED, ABORTED, FATAL, UNKNOWN;
46
47 [CCode (cname="sk_smart_offline_data_collection_status_to_string")]
48 public unowned string? to_string();
49 }
50
51 [CCode (cname="SkSmartSelfTestExecutionStatus", cprefix="SK_SMART_SELF_TEST_EXECUTION_STATUS_")]
52 public enum SmartSelfTestExecutionStatus {
53 SUCCESS_OR_NEVER, ABORTED, INTERRUPTED, FATAL, ERROR_UNKNOWN, ERROR_ELECTRICAL, ERROR_SERVO, ERROR_READ, ERROR_HANDLING, INPROGRESS;
54
55 [CCode (cname="sk_smart_self_test_execution_status_to_string")]
56 public unowned string? to_string();
57 }
58
59 [Immutable]
60 [CCode (cname="SkSmartParsedData")]
61 public struct SmartParsedData {
62 public SmartOfflineDataCollectionStatus offline_data_collection_status;
63 public uint total_offline_data_collection_seconds;
64 public SmartSelfTestExecutionStatus self_test_execution_status;
65 public uint self_test_execution_percent_remaining;
66
67 public bool conveyance_test_available;
68 public bool short_and_extended_test_available;
69 public bool start_test_available;
70 public bool abort_test_available;
71
72 public uint short_test_polling_minutes;
73 public uint extended_test_polling_minutes;
74 public uint conveyance_test_polling_minutes;
75
76 [CCode (cname="sk_smart_self_test_available")]
77 public bool self_test_available(SmartSelfTest test);
78
79 [CCode (cname="sk_smart_self_test_polling_minutes")]
80 public uint self_test_polling_minutes(SmartSelfTest test);
81 }
82
83 [CCode (cname="SkSmartAttributeUnit", cprefix="SK_SMART_ATTRIBUTE_UNIT_")]
84 public enum SmartAttributeUnit {
85 UNKNOWN, NONE, MSECONDS, SECTORS, MKELVIN;
86
87 [CCode (cname="sk_smart_attribute_unit_to_string")]
88 public unowned string? to_string();
89 }
90
91 [Immutable]
92 [CCode (cname="SkSmartAttributeParsedData")]
93 public struct SmartAttributeParsedData {
94 public uint8 id;
95 public string name;
96 public SmartAttributeUnit pretty_unit;
97 public uint16 flags;
98 public uint8 threshold;
99 public bool threshold_valid;
100 public bool online;
101 public bool prefailure;
102 public bool good_now;
103 public bool good_now_valid;
104 public bool good_in_the_past;
105 public bool good_in_the_past_valid;
106 public bool current_value_valid;
107 public bool worst_value_valid;
108 public bool warn;
109 public uint8 current_value;
110 public uint8 worst_value;
111 public uint64 pretty_value;
112 public uint8[] raw;
113 }
114
115 [CCode (cname="SkSmartOverall", cprefix="SK_SMART_OVERALL_")]
116 public enum SmartOverall {
117 GOOD, BAD_ATTRIBUTE_IN_THE_PAST, BAD_SECTOR, BAD_ATTRIBUTE_NOW, BAD_SECTOR_MANY, BAD_STATUS;
118
119 [CCode (cname="sk_smart_overall_to_string")]
120 public unowned string? to_string();
121 }
122
123 [CCode (cname="SkSmartAttributeParseCallback")]
124 public delegate void SmartAttributeParseCallback(Disk disk, SmartAttributeParsedData a);
125
126 [Compact]
127 [CCode (free_function="sk_disk_free", cname="SkDisk", cprefix="sk_disk_")]
128 public class Disk {
129
130 public static int open(string name, out Disk? disk);
131
132 public int get_size(out uint64 bytes);
133
134 public int check_sleep_mode(out bool awake);
135
136 public int identify_is_available(out bool available);
137 public int identify_parse(out unowned IdentifyParsedData* data);
138
139 public int smart_is_available(out bool available);
140 public int smart_status(out bool good);
141 public int smart_read_data();
142 public int smart_get_blob(out unowned void* blob, out size_t size);
143 public int smart_set_blob(void* blob, size_t size);
144 public int smart_parse_attributes(SmartAttributeParseCallback cb);
145 public int smart_parse(out unowned SmartParsedData* data);
146 public int smart_self_test(SmartSelfTest test);
147 public int smart_get_power_on(out uint64 mseconds);
148 public int smart_get_power_cycle(out uint64 count);
149 public int smart_get_bad(out uint64 sectors);
150 public int smart_get_temperature(out uint64 mkelvin);
151 public int smart_get_overall(out SmartOverall overall);
152
153 public int dump();
154 }
155 }