Merge commit 'upstream/0.15'
Martin Pitt
14 years ago
15 | 15 | # License along with libatasmart. If not, If not, see |
16 | 16 | # <http://www.gnu.org/licenses/>. |
17 | 17 | |
18 | dist_doc_DATA = README | |
19 | ||
18 | 20 | EXTRA_DIST = \ |
19 | 21 | bootstrap.sh \ |
20 | 22 | LGPL \ |
21 | 23 | README \ |
22 | atasmart.vapi \ | |
23 | 24 | atasmart.c \ |
24 | 25 | blob-examples/README \ |
25 | 26 | blob-examples/FUJITSU_MHY2120BH--0084000D \ |
26 | 27 | blob-examples/FUJITSU_MHY2120BH--0085000B \ |
28 | blob-examples/FUJITSU_MHY2120BH--0085000B \ | |
27 | 29 | blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \ |
30 | blob-examples/INTEL_SSDSA2MH080G1GC--045C8820 \ | |
28 | 31 | blob-examples/Maxtor_96147H8--BAC51KJ0 \ |
32 | blob-examples/Maxtor_96147H8--BAC51KJ0--2 \ | |
29 | 33 | blob-examples/SAMSUNG_HD501LJ--CR100-12 \ |
30 | 34 | blob-examples/ST320410A--3.39 \ |
31 | 35 | blob-examples/ST9160821AS--3.CLH \ |
36 | blob-examples/TOSHIBA_MK1651GSY--38IGT0G5T \ | |
32 | 37 | blob-examples/WDC_WD2500JB--00REA0-20.00K20 \ |
33 | 38 | 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 | |
35 | 41 | |
36 | 42 | SUBDIRS = |
37 | 43 | |
42 | 48 | |
43 | 49 | pkgconfigdir = $(libdir)/pkgconfig |
44 | 50 | pkgconfig_DATA = libatasmart.pc |
51 | ||
52 | vapidir = $(datadir)/vala/vapi | |
53 | vapi_DATA = vala/atasmart.vapi | |
45 | 54 | |
46 | 55 | include_HEADERS = \ |
47 | 56 | atasmart.h |
57 | 57 | sbin_PROGRAMS = skdump$(EXEEXT) sktest$(EXEEXT) |
58 | 58 | noinst_PROGRAMS = strpool$(EXEEXT) |
59 | 59 | 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 \ | |
62 | 62 | $(srcdir)/config.h.in $(srcdir)/libatasmart.pc.in \ |
63 | 63 | $(top_srcdir)/configure compile config.guess config.rpath \ |
64 | 64 | config.sub depcomp install-sh ltmain.sh missing |
94 | 94 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ |
95 | 95 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' |
96 | 96 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" \ |
97 | "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" | |
97 | "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \ | |
98 | "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(includedir)" | |
98 | 99 | LTLIBRARIES = $(lib_LTLIBRARIES) |
99 | 100 | am__DEPENDENCIES_1 = |
100 | 101 | libatasmart_la_DEPENDENCIES = $(am__DEPENDENCIES_1) |
154 | 155 | install-pdf-recursive install-ps-recursive install-recursive \ |
155 | 156 | installcheck-recursive installdirs-recursive pdf-recursive \ |
156 | 157 | ps-recursive uninstall-recursive |
157 | DATA = $(noinst_DATA) $(pkgconfig_DATA) | |
158 | DATA = $(dist_doc_DATA) $(noinst_DATA) $(pkgconfig_DATA) $(vapi_DATA) | |
158 | 159 | HEADERS = $(include_HEADERS) |
159 | 160 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ |
160 | 161 | distclean-recursive maintainer-clean-recursive |
321 | 322 | top_build_prefix = @top_build_prefix@ |
322 | 323 | top_builddir = @top_builddir@ |
323 | 324 | top_srcdir = @top_srcdir@ |
325 | dist_doc_DATA = README | |
324 | 326 | EXTRA_DIST = \ |
325 | 327 | bootstrap.sh \ |
326 | 328 | LGPL \ |
327 | 329 | README \ |
328 | atasmart.vapi \ | |
329 | 330 | atasmart.c \ |
330 | 331 | blob-examples/README \ |
331 | 332 | blob-examples/FUJITSU_MHY2120BH--0084000D \ |
332 | 333 | blob-examples/FUJITSU_MHY2120BH--0085000B \ |
334 | blob-examples/FUJITSU_MHY2120BH--0085000B \ | |
333 | 335 | blob-examples/FUJITSU_MHZ2160BH_G1--0084000A \ |
336 | blob-examples/INTEL_SSDSA2MH080G1GC--045C8820 \ | |
334 | 337 | blob-examples/Maxtor_96147H8--BAC51KJ0 \ |
338 | blob-examples/Maxtor_96147H8--BAC51KJ0--2 \ | |
335 | 339 | blob-examples/SAMSUNG_HD501LJ--CR100-12 \ |
336 | 340 | blob-examples/ST320410A--3.39 \ |
337 | 341 | blob-examples/ST9160821AS--3.CLH \ |
342 | blob-examples/TOSHIBA_MK1651GSY--38IGT0G5T \ | |
338 | 343 | blob-examples/WDC_WD2500JB--00REA0-20.00K20 \ |
339 | 344 | 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 | |
341 | 347 | |
342 | 348 | SUBDIRS = |
343 | 349 | CLEANFILES = atasmart.strpool.c |
345 | 351 | noinst_DATA = |
346 | 352 | pkgconfigdir = $(libdir)/pkgconfig |
347 | 353 | pkgconfig_DATA = libatasmart.pc |
354 | vapidir = $(datadir)/vala/vapi | |
355 | vapi_DATA = vala/atasmart.vapi | |
348 | 356 | include_HEADERS = \ |
349 | 357 | atasmart.h |
350 | 358 | |
586 | 594 | |
587 | 595 | distclean-libtool: |
588 | 596 | -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 | |
589 | 617 | install-pkgconfigDATA: $(pkgconfig_DATA) |
590 | 618 | @$(NORMAL_INSTALL) |
591 | 619 | test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" |
606 | 634 | test -n "$$files" || exit 0; \ |
607 | 635 | echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ |
608 | 636 | 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 | |
609 | 657 | install-includeHEADERS: $(include_HEADERS) |
610 | 658 | @$(NORMAL_INSTALL) |
611 | 659 | test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" |
943 | 991 | config.h |
944 | 992 | installdirs: installdirs-recursive |
945 | 993 | 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 \ | |
947 | 995 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ |
948 | 996 | done |
949 | 997 | install: $(BUILT_SOURCES) |
999 | 1047 | |
1000 | 1048 | info-am: |
1001 | 1049 | |
1002 | install-data-am: install-includeHEADERS install-pkgconfigDATA | |
1050 | install-data-am: install-dist_docDATA install-includeHEADERS \ | |
1051 | install-pkgconfigDATA install-vapiDATA | |
1003 | 1052 | |
1004 | 1053 | install-dvi: install-dvi-recursive |
1005 | 1054 | |
1047 | 1096 | |
1048 | 1097 | ps-am: |
1049 | 1098 | |
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 | |
1052 | 1102 | |
1053 | 1103 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ |
1054 | 1104 | ctags-recursive install install-am install-strip \ |
1063 | 1113 | distclean-generic distclean-hdr distclean-libtool \ |
1064 | 1114 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ |
1065 | 1115 | 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 | |
1078 | 1129 | |
1079 | 1130 | |
1080 | 1131 | atasmart.strpool.c: atasmart.c strpool |
3464 | 3464 | eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' |
3465 | 3465 | |
3466 | 3466 | cat <<_LT_EOF >> conftest.$ac_ext |
3467 | ||
3468 | 3467 | /* The mapping between symbol names and symbols. */ |
3469 | 3468 | const struct { |
3470 | 3469 | const char *name; |
1182 | 1182 | a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150; |
1183 | 1183 | else if (!strcmp(a->name, "power-on-minutes")) |
1184 | 1184 | 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")) | |
1186 | 1187 | a->pretty_value = fourtyeight * 1000; |
1187 | 1188 | else if (!strcmp(a->name, "power-on-half-minutes")) |
1188 | 1189 | a->pretty_value = fourtyeight * 30 * 1000; |
1308 | 1309 | [228] = { "power-off-retract-count-2", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }, |
1309 | 1310 | [230] = { "head-amplitude", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL }, |
1310 | 1311 | [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 | ||
1311 | 1319 | [240] = { "head-flying-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time }, |
1312 | 1320 | [250] = { "read-error-retry-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL } |
1313 | 1321 | }; |
1910 | 1918 | |
1911 | 1919 | if (!strcmp(a->name, "power-on-minutes") || |
1912 | 1920 | !strcmp(a->name, "power-on-seconds") || |
1921 | !strcmp(a->name, "power-on-seconds-2") || | |
1913 | 1922 | !strcmp(a->name, "power-on-half-minutes") || |
1914 | 1923 | !strcmp(a->name, "power-on-hours")) { |
1915 | 1924 | |
2464 | 2473 | goto finish; |
2465 | 2474 | } |
2466 | 2475 | |
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) || | |
2468 | 2484 | (vid == 0x04fc && pid == 0x0c25) || |
2469 | 2485 | (vid == 0x04fc && pid == 0x0c15)) |
2470 | 2486 | 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) || | |
2473 | 2488 | (vid == 0x152d && pid == 0x2338) || |
2474 | 2489 | (vid == 0x152d && pid == 0x2339)) |
2475 | 2490 | 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. */ | |
1 | 1 | static const char _strpool_[] = |
2 | 2 | "16 Byte SCSI ATA SAT Passthru\0" |
3 | 3 | "12 Byte SCSI ATA SAT Passthru\0" |
78 | 78 | "head-amplitude\0" |
79 | 79 | /*** Suppressed due to suffix: |
80 | 80 | "temperature-celsius\0" ***/ |
81 | "endurance-remaining\0" | |
82 | "power-on-seconds-2\0" | |
83 | "uncorrectable-ecc-count\0" | |
84 | "good-block-rate\0" | |
81 | 85 | "head-flying-hours\0" |
82 | 86 | "read-error-retry-rate\0" |
83 | 87 | "9_POWERONMINUTES\0" |
1304 | 1308 | a->pretty_value = (fourtyeight & 0xFFFF)*100 + 273150; |
1305 | 1309 | else if (!strcmp(a->name, "power-on-minutes")) |
1306 | 1310 | 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")) | |
1308 | 1313 | a->pretty_value = fourtyeight * 1000; |
1309 | 1314 | else if (!strcmp(a->name, "power-on-half-minutes")) |
1310 | 1315 | a->pretty_value = fourtyeight * 30 * 1000; |
1430 | 1435 | [228] = { ((const char*) 2321), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }, |
1431 | 1436 | [230] = { ((const char*) 2347), SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL }, |
1432 | 1437 | [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 } | |
1435 | 1447 | }; |
1436 | 1448 | /* %STRINGPOOLSTOP% */ |
1437 | 1449 | |
1453 | 1465 | |
1454 | 1466 | /* %STRINGPOOLSTART% */ |
1455 | 1467 | 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), | |
1462 | 1470 | ((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), | |
1469 | 1481 | NULL |
1470 | 1482 | }; |
1471 | 1483 | /* %STRINGPOOLSTOP% */ |
1702 | 1714 | /* %STRINGPOOLSTART% */ |
1703 | 1715 | if (quirk & SK_SMART_QUIRK_9_POWERONMINUTES) { |
1704 | 1716 | 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 | |
1706 | 1718 | }; |
1707 | 1719 | return &a; |
1708 | 1720 | |
1709 | 1721 | } else if (quirk & SK_SMART_QUIRK_9_POWERONSECONDS) { |
1710 | 1722 | 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 | |
1712 | 1724 | }; |
1713 | 1725 | return &a; |
1714 | 1726 | |
1715 | 1727 | } else if (quirk & SK_SMART_QUIRK_9_POWERONHALFMINUTES) { |
1716 | 1728 | 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 | |
1718 | 1730 | }; |
1719 | 1731 | return &a; |
1720 | 1732 | } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN) |
1727 | 1739 | /* %STRINGPOOLSTART% */ |
1728 | 1740 | if (quirk & SK_SMART_QUIRK_192_EMERGENCYRETRACTCYCLECT) { |
1729 | 1741 | static const SkSmartAttributeInfo a = { |
1730 | ((const char*) 2667), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL | |
1742 | ((const char*) 2746), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL | |
1731 | 1743 | }; |
1732 | 1744 | return &a; |
1733 | 1745 | } |
1739 | 1751 | /* %STRINGPOOLSTART% */ |
1740 | 1752 | if (quirk & SK_SMART_QUIRK_194_10XCELSIUS) { |
1741 | 1753 | 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 | |
1743 | 1755 | }; |
1744 | 1756 | return &a; |
1745 | 1757 | } else if (quirk & SK_SMART_QUIRK_194_UNKNOWN) |
1764 | 1776 | /* %STRINGPOOLSTART% */ |
1765 | 1777 | if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) { |
1766 | 1778 | static const SkSmartAttributeInfo a = { |
1767 | ((const char*) 2723), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL | |
1779 | ((const char*) 2802), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL | |
1768 | 1780 | }; |
1769 | 1781 | return &a; |
1770 | 1782 | } |
1776 | 1788 | /* %STRINGPOOLSTART% */ |
1777 | 1789 | if (quirk & SK_SMART_QUIRK_201_DETECTEDTACOUNT) { |
1778 | 1790 | static const SkSmartAttributeInfo a = { |
1779 | ((const char*) 2741), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL | |
1791 | ((const char*) 2820), SK_SMART_ATTRIBUTE_UNIT_NONE, NULL | |
1780 | 1792 | }; |
1781 | 1793 | return &a; |
1782 | 1794 | } |
1971 | 1983 | const char * const map[] = { |
1972 | 1984 | [SK_SMART_ATTRIBUTE_UNIT_UNKNOWN] = NULL, |
1973 | 1985 | [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) | |
1977 | 1989 | }; |
1978 | 1990 | /* %STRINGPOOLSTOP% */ |
1979 | 1991 | |
2032 | 2044 | |
2033 | 2045 | if (!strcmp(a->name, "power-on-minutes") || |
2034 | 2046 | !strcmp(a->name, "power-on-seconds") || |
2047 | !strcmp(a->name, "power-on-seconds-2") || | |
2035 | 2048 | !strcmp(a->name, "power-on-half-minutes") || |
2036 | 2049 | !strcmp(a->name, "power-on-hours")) { |
2037 | 2050 | |
2162 | 2175 | |
2163 | 2176 | /* %STRINGPOOLSTART% */ |
2164 | 2177 | 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), | |
2171 | 2184 | }; |
2172 | 2185 | /* %STRINGPOOLSTOP% */ |
2173 | 2186 | |
2586 | 2599 | goto finish; |
2587 | 2600 | } |
2588 | 2601 | |
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) || | |
2590 | 2610 | (vid == 0x04fc && pid == 0x0c25) || |
2591 | 2611 | (vid == 0x04fc && pid == 0x0c15)) |
2592 | 2612 | 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) || | |
2595 | 2614 | (vid == 0x152d && pid == 0x2338) || |
2596 | 2615 | (vid == 0x152d && pid == 0x2339)) |
2597 | 2616 | d->type = SK_DISK_TYPE_JMICRON; |
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 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | 0 | #! /bin/sh |
1 | 1 | # 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. | |
3 | 3 | # |
4 | 4 | # Report bugs to <mzyvongnfzneg (at) 0pointer (dot) net>. |
5 | 5 | # |
744 | 744 | # Identity of this package. |
745 | 745 | PACKAGE_NAME='libatasmart' |
746 | 746 | 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' | |
749 | 749 | PACKAGE_BUGREPORT='mzyvongnfzneg (at) 0pointer (dot) net' |
750 | 750 | |
751 | 751 | ac_unique_file="atasmart.c" |
1488 | 1488 | # Omit some internal or obsolete options to make the list less imposing. |
1489 | 1489 | # This message is too long to be a string in the A/UX 3.1 sh. |
1490 | 1490 | 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. | |
1492 | 1492 | |
1493 | 1493 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1494 | 1494 | |
1558 | 1558 | |
1559 | 1559 | if test -n "$ac_init_help"; then |
1560 | 1560 | case $ac_init_help in |
1561 | short | recursive ) echo "Configuration of libatasmart 0.14:";; | |
1561 | short | recursive ) echo "Configuration of libatasmart 0.15:";; | |
1562 | 1562 | esac |
1563 | 1563 | cat <<\_ACEOF |
1564 | 1564 | |
1668 | 1668 | test -n "$ac_init_help" && exit $ac_status |
1669 | 1669 | if $ac_init_version; then |
1670 | 1670 | cat <<\_ACEOF |
1671 | libatasmart configure 0.14 | |
1671 | libatasmart configure 0.15 | |
1672 | 1672 | generated by GNU Autoconf 2.63 |
1673 | 1673 | |
1674 | 1674 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1682 | 1682 | This file contains any messages produced by compilers while |
1683 | 1683 | running configure, to aid debugging if configure makes a mistake. |
1684 | 1684 | |
1685 | It was created by libatasmart $as_me 0.14, which was | |
1685 | It was created by libatasmart $as_me 0.15, which was | |
1686 | 1686 | generated by GNU Autoconf 2.63. Invocation command line was |
1687 | 1687 | |
1688 | 1688 | $ $0 $@ |
2548 | 2548 | |
2549 | 2549 | # Define the identity of the package. |
2550 | 2550 | PACKAGE='libatasmart' |
2551 | VERSION='0.14' | |
2551 | VERSION='0.15' | |
2552 | 2552 | |
2553 | 2553 | |
2554 | 2554 | cat >>confdefs.h <<_ACEOF |
2673 | 2673 | PACKAGE_URL=http://git.0pointer.de/?p=libatasmart.git |
2674 | 2674 | |
2675 | 2675 | |
2676 | LIBATASMART_VERSION_INFO=4:0:0 | |
2676 | LIBATASMART_VERSION_INFO=4:1:0 | |
2677 | 2677 | |
2678 | 2678 | |
2679 | 2679 | # Make sure we can run config.sub. |
2758 | 2758 | IFS=$ac_save_IFS |
2759 | 2759 | case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac |
2760 | 2760 | |
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='\' | |
2761 | 2774 | |
2762 | 2775 | |
2763 | 2776 | if type -p stow > /dev/null && test -d /usr/local/stow ; then |
5955 | 5968 | else |
5956 | 5969 | lt_cv_nm_interface="BSD nm" |
5957 | 5970 | 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) | |
5959 | 5972 | (eval "$ac_compile" 2>conftest.err) |
5960 | 5973 | 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) | |
5962 | 5975 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) |
5963 | 5976 | cat conftest.err >&5 |
5964 | (eval echo "\"\$as_me:5965: output\"" >&5) | |
5977 | (eval echo "\"\$as_me:5978: output\"" >&5) | |
5965 | 5978 | cat conftest.out >&5 |
5966 | 5979 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then |
5967 | 5980 | lt_cv_nm_interface="MS dumpbin" |
7037 | 7050 | eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' |
7038 | 7051 | |
7039 | 7052 | cat <<_LT_EOF >> conftest.$ac_ext |
7040 | ||
7041 | 7053 | /* The mapping between symbol names and symbols. */ |
7042 | 7054 | const struct { |
7043 | 7055 | const char *name; |
7166 | 7178 | ;; |
7167 | 7179 | *-*-irix6*) |
7168 | 7180 | # Find out which ABI we are using. |
7169 | echo '#line 7170 "configure"' > conftest.$ac_ext | |
7181 | echo '#line 7182 "configure"' > conftest.$ac_ext | |
7170 | 7182 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
7171 | 7183 | (eval $ac_compile) 2>&5 |
7172 | 7184 | ac_status=$? |
9269 | 9281 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9270 | 9282 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9271 | 9283 | -e 's:$: $lt_compiler_flag:'` |
9272 | (eval echo "\"\$as_me:9273: $lt_compile\"" >&5) | |
9284 | (eval echo "\"\$as_me:9285: $lt_compile\"" >&5) | |
9273 | 9285 | (eval "$lt_compile" 2>conftest.err) |
9274 | 9286 | ac_status=$? |
9275 | 9287 | cat conftest.err >&5 |
9276 | echo "$as_me:9277: \$? = $ac_status" >&5 | |
9288 | echo "$as_me:9289: \$? = $ac_status" >&5 | |
9277 | 9289 | if (exit $ac_status) && test -s "$ac_outfile"; then |
9278 | 9290 | # The compiler can only warn and ignore the option if not recognized |
9279 | 9291 | # So say no if there are warnings other than the usual output. |
9608 | 9620 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9609 | 9621 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9610 | 9622 | -e 's:$: $lt_compiler_flag:'` |
9611 | (eval echo "\"\$as_me:9612: $lt_compile\"" >&5) | |
9623 | (eval echo "\"\$as_me:9624: $lt_compile\"" >&5) | |
9612 | 9624 | (eval "$lt_compile" 2>conftest.err) |
9613 | 9625 | ac_status=$? |
9614 | 9626 | cat conftest.err >&5 |
9615 | echo "$as_me:9616: \$? = $ac_status" >&5 | |
9627 | echo "$as_me:9628: \$? = $ac_status" >&5 | |
9616 | 9628 | if (exit $ac_status) && test -s "$ac_outfile"; then |
9617 | 9629 | # The compiler can only warn and ignore the option if not recognized |
9618 | 9630 | # So say no if there are warnings other than the usual output. |
9713 | 9725 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9714 | 9726 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9715 | 9727 | -e 's:$: $lt_compiler_flag:'` |
9716 | (eval echo "\"\$as_me:9717: $lt_compile\"" >&5) | |
9728 | (eval echo "\"\$as_me:9729: $lt_compile\"" >&5) | |
9717 | 9729 | (eval "$lt_compile" 2>out/conftest.err) |
9718 | 9730 | ac_status=$? |
9719 | 9731 | cat out/conftest.err >&5 |
9720 | echo "$as_me:9721: \$? = $ac_status" >&5 | |
9732 | echo "$as_me:9733: \$? = $ac_status" >&5 | |
9721 | 9733 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
9722 | 9734 | then |
9723 | 9735 | # The compiler can only warn and ignore the option if not recognized |
9768 | 9780 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9769 | 9781 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9770 | 9782 | -e 's:$: $lt_compiler_flag:'` |
9771 | (eval echo "\"\$as_me:9772: $lt_compile\"" >&5) | |
9783 | (eval echo "\"\$as_me:9784: $lt_compile\"" >&5) | |
9772 | 9784 | (eval "$lt_compile" 2>out/conftest.err) |
9773 | 9785 | ac_status=$? |
9774 | 9786 | cat out/conftest.err >&5 |
9775 | echo "$as_me:9776: \$? = $ac_status" >&5 | |
9787 | echo "$as_me:9788: \$? = $ac_status" >&5 | |
9776 | 9788 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
9777 | 9789 | then |
9778 | 9790 | # The compiler can only warn and ignore the option if not recognized |
12571 | 12583 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
12572 | 12584 | lt_status=$lt_dlunknown |
12573 | 12585 | cat > conftest.$ac_ext <<_LT_EOF |
12574 | #line 12575 "configure" | |
12586 | #line 12587 "configure" | |
12575 | 12587 | #include "confdefs.h" |
12576 | 12588 | |
12577 | 12589 | #if HAVE_DLFCN_H |
12667 | 12679 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
12668 | 12680 | lt_status=$lt_dlunknown |
12669 | 12681 | cat > conftest.$ac_ext <<_LT_EOF |
12670 | #line 12671 "configure" | |
12682 | #line 12683 "configure" | |
12671 | 12683 | #include "confdefs.h" |
12672 | 12684 | |
12673 | 12685 | #if HAVE_DLFCN_H |
14687 | 14699 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14688 | 14700 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14689 | 14701 | -e 's:$: $lt_compiler_flag:'` |
14690 | (eval echo "\"\$as_me:14691: $lt_compile\"" >&5) | |
14702 | (eval echo "\"\$as_me:14703: $lt_compile\"" >&5) | |
14691 | 14703 | (eval "$lt_compile" 2>conftest.err) |
14692 | 14704 | ac_status=$? |
14693 | 14705 | cat conftest.err >&5 |
14694 | echo "$as_me:14695: \$? = $ac_status" >&5 | |
14706 | echo "$as_me:14707: \$? = $ac_status" >&5 | |
14695 | 14707 | if (exit $ac_status) && test -s "$ac_outfile"; then |
14696 | 14708 | # The compiler can only warn and ignore the option if not recognized |
14697 | 14709 | # So say no if there are warnings other than the usual output. |
14786 | 14798 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14787 | 14799 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14788 | 14800 | -e 's:$: $lt_compiler_flag:'` |
14789 | (eval echo "\"\$as_me:14790: $lt_compile\"" >&5) | |
14801 | (eval echo "\"\$as_me:14802: $lt_compile\"" >&5) | |
14790 | 14802 | (eval "$lt_compile" 2>out/conftest.err) |
14791 | 14803 | ac_status=$? |
14792 | 14804 | cat out/conftest.err >&5 |
14793 | echo "$as_me:14794: \$? = $ac_status" >&5 | |
14805 | echo "$as_me:14806: \$? = $ac_status" >&5 | |
14794 | 14806 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
14795 | 14807 | then |
14796 | 14808 | # The compiler can only warn and ignore the option if not recognized |
14838 | 14850 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14839 | 14851 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14840 | 14852 | -e 's:$: $lt_compiler_flag:'` |
14841 | (eval echo "\"\$as_me:14842: $lt_compile\"" >&5) | |
14853 | (eval echo "\"\$as_me:14854: $lt_compile\"" >&5) | |
14842 | 14854 | (eval "$lt_compile" 2>out/conftest.err) |
14843 | 14855 | ac_status=$? |
14844 | 14856 | cat out/conftest.err >&5 |
14845 | echo "$as_me:14846: \$? = $ac_status" >&5 | |
14857 | echo "$as_me:14858: \$? = $ac_status" >&5 | |
14846 | 14858 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
14847 | 14859 | then |
14848 | 14860 | # The compiler can only warn and ignore the option if not recognized |
18550 | 18562 | # report actual input values of CONFIG_FILES etc. instead of their |
18551 | 18563 | # values after options handling. |
18552 | 18564 | 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 | |
18554 | 18566 | generated by GNU Autoconf 2.63. Invocation command line was |
18555 | 18567 | |
18556 | 18568 | CONFIG_FILES = $CONFIG_FILES |
18613 | 18625 | _ACEOF |
18614 | 18626 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
18615 | 18627 | ac_cs_version="\\ |
18616 | libatasmart config.status 0.14 | |
18628 | libatasmart config.status 0.15 | |
18617 | 18629 | configured by $0, generated by GNU Autoconf 2.63, |
18618 | 18630 | with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
18619 | 18631 |
20 | 20 | |
21 | 21 | AC_PREREQ(2.63) |
22 | 22 | |
23 | AC_INIT([libatasmart], 0.14, [mzyvongnfzneg (at) 0pointer (dot) net]) | |
23 | AC_INIT([libatasmart], 0.15, [mzyvongnfzneg (at) 0pointer (dot) net]) | |
24 | 24 | AC_CONFIG_SRCDIR([atasmart.c]) |
25 | 25 | AC_CONFIG_HEADERS([config.h]) |
26 | 26 | AC_CONFIG_MACRO_DIR(m4) |
29 | 29 | |
30 | 30 | AC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=libatasmart.git]) |
31 | 31 | |
32 | AC_SUBST(LIBATASMART_VERSION_INFO, [4:0:0]) | |
32 | AC_SUBST(LIBATASMART_VERSION_INFO, [4:1:0]) | |
33 | 33 | |
34 | 34 | AC_CANONICAL_HOST |
35 | ||
36 | AM_SILENT_RULES([yes]) | |
35 | 37 | |
36 | 38 | if type -p stow > /dev/null && test -d /usr/local/stow ; then |
37 | 39 | AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***]) |
2320 | 2320 | |
2321 | 2321 | #ifdef __cplusplus |
2322 | 2322 | extern \"C\" { |
2323 | #endif | |
2324 | ||
2325 | #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) | |
2326 | #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" | |
2323 | 2327 | #endif |
2324 | 2328 | |
2325 | 2329 | /* 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 | } |