mirror of
https://git.proxmox.com/git/mirror_smartmontools-debian
synced 2025-07-14 16:10:39 +00:00
Imported Upstream version 6.1+svn3812
This commit is contained in:
parent
f4e463df43
commit
ee38a438aa
53
AUTHORS
53
AUTHORS
@ -1,4 +1,4 @@
|
||||
$Id: AUTHORS 3096 2010-04-30 14:32:49Z chrfranke $
|
||||
$Id: AUTHORS 3751 2013-01-18 21:19:43Z chrfranke $
|
||||
|
||||
This code was originally developed as a Senior Thesis by Michael
|
||||
Cornwell at the Concurrent Systems Laboratory (now part of the Storage
|
||||
@ -10,29 +10,30 @@ ucsc-smartsuite and smartsuite packages, and is derived from that code.
|
||||
|
||||
Maintainers / Developers:
|
||||
|
||||
Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
Erik Inge Bolsø <knan@mo.himolde.no>
|
||||
Stanislav Brabec <sbrabec@suse.cz>
|
||||
Peter Cassidy <pcassidy@mac.com>
|
||||
Casper Dik <casper@holland.sun.com>
|
||||
Christian Franke <franke@computer.org>
|
||||
Guilhem Frézou <guilhem.frezou@catii.fr>
|
||||
Douglas Gilbert <dgilbert@interlog.com>
|
||||
Guido Guenther <agx@sigxcpu.org>
|
||||
Geoff Keating <geoffk@geoffk.org>
|
||||
Dr. David Kirkby <drkirkby@ntlworld.com>
|
||||
Kai Mäkisara <kai.makisara@kolumbus.fi>
|
||||
Eduard Martinescu <martines@rochester.rr.com>
|
||||
Frédéric L. W. Meunier <http://www.pervalidus.net/contact.html>
|
||||
Keiji Sawada <card_captor@users.sourceforge.net>
|
||||
Manfred Schwarb <manfred99@gmx.ch>
|
||||
David Snyder <dasnyderx@yahoo.com>
|
||||
Sergey Svishchev <svs@ropnet.ru>
|
||||
Phil Williams <phil@subbacultcha.demon.co.uk>
|
||||
Richard Zybert <richard.zybert@zybert.co.uk>
|
||||
Yuri Dario <mc6530@mclink.it>
|
||||
Shengfeng Zhou <linux@highpoint-tech.com>
|
||||
Praveen Chidambaram <bunchofmails@gmail.com>
|
||||
Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
Erik Inge Bolsø <knan@mo.himolde.no>
|
||||
Stanislav Brabec <sbrabec@suse.cz>
|
||||
Peter Cassidy <pcassidy@mac.com>
|
||||
Praveen Chidambaram <bunchofmails@gmail.com>
|
||||
Yuri Dario <mc6530@mclink.it>
|
||||
Casper Dik <casper@holland.sun.com>
|
||||
Christian Franke <franke@computer.org>
|
||||
Guilhem Frézou <guilhem.frezou@catii.fr>
|
||||
Douglas Gilbert <dgilbert@interlog.com>
|
||||
Guido Guenther <agx@sigxcpu.org>
|
||||
Jordan Hargrave <jordan_hargrave@dell.com>
|
||||
Joerg Hering <hering.ruegen@gmx.de>
|
||||
Tomas Smetana <tsmetana@redhat.com>
|
||||
Jordan Hargrave <jordan_hargrave@dell.com>
|
||||
Geoff Keating <geoffk@geoffk.org>
|
||||
Dr. David Kirkby <drkirkby@ntlworld.com>
|
||||
Kai Mäkisara <kai.makisara@kolumbus.fi>
|
||||
Eduard Martinescu <martines@rochester.rr.com>
|
||||
Frédéric L. W. Meunier <http://www.pervalidus.net/contact.html>
|
||||
Alex Samorukov <samm@os2.kiev.ua>
|
||||
Keiji Sawada <card_captor@users.sourceforge.net>
|
||||
Manfred Schwarb <manfred99@gmx.ch>
|
||||
Tomas Smetana <tsmetana@redhat.com>
|
||||
David Snyder <dasnyderx@yahoo.com>
|
||||
Sergey Svishchev <svs@ropnet.ru>
|
||||
Phil Williams <phil@subbacultcha.demon.co.uk>
|
||||
Shengfeng Zhou <linux@highpoint-tech.com>
|
||||
Richard Zybert <richard.zybert@zybert.co.uk>
|
||||
|
507
ChangeLog
Normal file
507
ChangeLog
Normal file
@ -0,0 +1,507 @@
|
||||
$Id: ChangeLog 3812 2013-04-20 18:59:19Z chrfranke $
|
||||
|
||||
2013-04-20 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- InnoDisk InnoLite SATADOM D150QV-L SSDs
|
||||
- Intel 313 Series SSDs
|
||||
- Intel 330 Series SSDs: 240GB
|
||||
- JMicron based SSDs: Kingston V200 (ticket #267)
|
||||
- Samsung based SSDs: SM843T Series
|
||||
|
||||
2013-04-20 Christian Franke <franke@computer.org>
|
||||
|
||||
configure.ac: Linux: Try 'hostname -y' if 'nishostname' is missing.
|
||||
|
||||
2013-04-18 Christian Franke <franke@computer.org>
|
||||
|
||||
configure.ac, smartd_warning.sh.in: Add platform specific commands for
|
||||
host and domain names.
|
||||
os_win32/smartd_warning.cmd: Use WMI for DNS domain name.
|
||||
|
||||
2013-04-18 Christian Franke <franke@computer.org>
|
||||
|
||||
scsicmds.cpp, scsiprint.cpp: Silence -Wmaybe-uninitialized warning
|
||||
(g++ 4.8.0 with -flto).
|
||||
|
||||
2013-03-29 Christian Franke <franke@computer.org>
|
||||
|
||||
os_darwin.cpp: Silence -Wself-assign warning (ticket #266).
|
||||
os_darwin.cpp, os_netbsd.cpp, os_os2.cpp, os_qnxnto.cpp, os_solaris.cpp:
|
||||
Remove dummy functions no longer called since r3192.
|
||||
|
||||
2013-03-27 Christian Franke <franke@computer.org>
|
||||
|
||||
os_win32.cpp: Silence -Wunused-local-typedefs warning.
|
||||
|
||||
2013-03-24 Christian Franke <franke@computer.org>
|
||||
|
||||
dev_areca.cpp: Add casts to silence C++11 -Wnarrowing warning
|
||||
from g++ 4.8.
|
||||
|
||||
2013-03-24 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows: Compile fixes for 64-bit Cygwin.
|
||||
It uses LP64 model instead of LLP64 (64-bit MSVC, MinGW).
|
||||
|
||||
2013-03-16 Christian Franke <franke@computer.org>
|
||||
|
||||
smartmontools 6.1
|
||||
|
||||
2013-03-15 Christian Franke <franke@computer.org>
|
||||
|
||||
os_win32.cpp: Support device names /dev/sd[a-z][a-z] (ticket #240).
|
||||
Enhance DEVICESCAN to 128 drives. Add '-d [TYPE,]pd' option.
|
||||
smartctl.8.in, smartd.8.in: Document these enhancements.
|
||||
|
||||
2013-03-14 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- Seagate Barracuda 7200.14: Fix regex for new firmware version.
|
||||
|
||||
2013-03-13 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- USB: Prolific PL3507 (0x067b:0x3507): works with '-d usbjmicron,p'
|
||||
|
||||
2013-03-13 Christian Franke <franke@computer.org>
|
||||
|
||||
Create branch RELEASE_6_0_DRIVEDB with last drivedb.h file
|
||||
compatible with smartmontools 6.0.
|
||||
|
||||
2013-03-13 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- SandForce Driven SSDs: Fix format of attribute 198 (ticket #258).
|
||||
- SandForce Driven SSDs: Corsair Force GS
|
||||
- Indilinx Barefoot_2/Everest/Martini based SSDs: OCZ VERTEX PLUS R2
|
||||
- Samsung/Seagate SpinPoint M8: 320GB, 640GB
|
||||
- Seagate Momentus Thin
|
||||
- Quantum Fireball EX: 10.2GB
|
||||
|
||||
2013-03-07 Christian Franke <franke@computer.org>
|
||||
|
||||
ataidentify.cpp, ataprint.cpp: ACS-3 updates.
|
||||
ataprint.cpp: Improve device statistics error messages.
|
||||
|
||||
2013-03-06 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd_warning.sh.in: Support BSD variant of 'hostname' command
|
||||
which prints FQDN. Add Windows domain name (Cygwin).
|
||||
|
||||
2013-03-01 Douglas Gilbert <dgilbert@interlog.com>
|
||||
|
||||
scsicmds.h, scsicmds.cpp, scsiprint.cpp:
|
||||
- for SCSI disks prefer READ DEFECT(12) for finding the
|
||||
grown defect list length (previously used READ DEFECT(10)
|
||||
only)
|
||||
|
||||
2013-03-01 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- SandForce Driven SSDs: Transcend SSD320
|
||||
- Intel 520 Series SSDs: OEM variant
|
||||
- JMicron based SSDs: Transcend SSD25 IDE
|
||||
- HGST Travelstar 7K1000
|
||||
- Seagate Desktop HDD.15
|
||||
- Seagate LD25.2
|
||||
- Western Digital RE4 (SATA 6Gb/s)
|
||||
- USB: Fujitsu/Zalman ZM-VE300 (0x04c5:0x2028)
|
||||
|
||||
2013-02-23 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h: Crucial/Micron RealSSD C300: Remove bogus trailing '|' from
|
||||
regex (Regression from r3772).
|
||||
|
||||
2013-02-16 Douglas Gilbert <dgilbert@interlog.com>
|
||||
|
||||
scsicmds.h, scsicmds.cpp, scsiprint.h, scsiprint.cpp:
|
||||
- for SCSI disks, in 'smartctl --info' report physical
|
||||
block size and lowest LBA alignement (if PB size
|
||||
different from LB size); logical block provisioning
|
||||
status (if any); and disk protection (a.k.a. DIF) type
|
||||
|
||||
2013-02-19 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
atacmds.cpp: fixed scttemphist on LE machines, including PPC. Patch
|
||||
and report provided by Roger Roehrig.
|
||||
|
||||
2013-02-16 Douglas Gilbert <dgilbert@interlog.com>
|
||||
|
||||
scsicmds.h, scsicmds.cpp, scsiprint.h, scsiprint.cpp:
|
||||
- SCSI VPD work; improve rotation rate reporting and add form factor
|
||||
|
||||
2013-02-14 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- SandForce Driven SSDs: Kingston V+ 200, Mushkin Chronos deluxe,
|
||||
OCZ Talos 2
|
||||
- Plextor M3 (Pro) Series SSDs
|
||||
|
||||
2013-02-13 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- Crucial/Micron RealSSD C300: new separate entry
|
||||
- Crucial/Micron RealSSD m4/C400: firmware bug warning
|
||||
|
||||
2013-02-10 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
os_freebsd.cpp: adding device type fix for devices on MPT controllers.
|
||||
|
||||
2013-02-06 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- Seagate Samsung SpinPoint M8U (USB)
|
||||
- Hitachi/HGST Travelstar Z5K500
|
||||
- Hitachi/HGST Travelstar 5K750
|
||||
- Hitachi/HGST Deskstar 7K4000
|
||||
- Toshiba 2.5" HDD MK..37GSX
|
||||
- Toshiba 2.5" HDD MK..65GSX: GSXN variant
|
||||
- Toshiba 2.5" HDD MQ01ABD...
|
||||
- Seagate Momentus 7200.5
|
||||
- Western Digital Caviar Green (AF, SATA 6Gb/s): 2TB
|
||||
- USB: Samsung M3 Portable USB 3.0 (0x04e8:0x61b6)
|
||||
- USB: LaCie Rugged Mini USB 3.0 (0x059f:0x1051)
|
||||
- Change short attribute names required before r3343.
|
||||
|
||||
2013-02-05 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd.cpp: Fix allocation of buffer passed to putenv().
|
||||
Using putenv("NAME") to unset NAME is not portable.
|
||||
|
||||
2013-02-05 Christian Franke <franke@computer.org>
|
||||
|
||||
do_release: New Signing Key.
|
||||
|
||||
2013-01-31 Christian Franke <franke@computer.org>
|
||||
|
||||
dev_areca.h: Use the C++ way to specify unused arguments.
|
||||
This silences -Wself-assign warning from clang++.
|
||||
|
||||
2013-01-30 Christian Franke <franke@computer.org>
|
||||
|
||||
configure.ac: Use AC_CHECK_TOOL for winmc and windres.
|
||||
|
||||
2013-01-30 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows smartd: Install service with delayed auto start enabled.
|
||||
|
||||
2013-01-26 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows smartd: Add eventlog MESSAGETABLE resource.
|
||||
Install/remove smartd.exe as event message file.
|
||||
Remove syslogevt.exe tool.
|
||||
|
||||
2013-01-26 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows: Add required string CompanyName to VERSIONINFO.
|
||||
|
||||
2013-01-23 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows: Add VERSIONINFO resource to exe files.
|
||||
|
||||
2013-01-23 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- Crucial/Micron RealSSD C300/C400/m4: m4 mSATA variant
|
||||
- Indilinx Barefoot 3 based SSDs
|
||||
- Intel DC S3700 Series SSDs
|
||||
- Samsung based SSD: Samsung SSD 840 Series
|
||||
|
||||
2013-01-18 Christian Franke <franke@computer.org>
|
||||
|
||||
AUTHORS: Convert to UTF-8. Sort names. Replace tabs.
|
||||
|
||||
2013-01-18 Christian Franke <franke@computer.org>
|
||||
|
||||
Rename configure.in to configure.ac to silence warning from
|
||||
new automake.
|
||||
autogen.sh: automake 1.12.5 is OK.
|
||||
|
||||
2013-01-16 Christian Franke <franke@computer.org>
|
||||
|
||||
atacmds.cpp: Fix assignment of BYTEORDER from -v option
|
||||
(Regression from r3719).
|
||||
|
||||
2013-01-13 Ole Jørgen Legård <ole@smartautomation.no>
|
||||
|
||||
os_qnxnto.cpp: Fix include of errno.h.
|
||||
|
||||
2013-01-12 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- SandForce Driven SSDs: Mushkin Callisto deluxe, SuperSSpeed S301
|
||||
- Intel 320 Series SSDs: 'B' (7mm) variant (ticket #257)
|
||||
- SAMSUNG SpinPoint F1 EG
|
||||
- SAMSUNG SpinPoint P80: SP0401N/TJ100-30
|
||||
- Western Digital Caviar Black: 4TB
|
||||
- Western Digital Caviar Black (AF): Remove non-AF models
|
||||
- Western Digital My Passport (USB, AF): 5000L, 10J variants
|
||||
- USB: WD My Passport USB 3.0 (0x1058:0x07a8)
|
||||
- USB: WD My Book Studio II (0x1058:0x1105)
|
||||
|
||||
2013-01-02 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- SandForce Driven SSDs: ADATA S396, Kingston 3K, V+
|
||||
- Indilinx Everest/Martini based SSDs: OCZ VERTEX PLUS
|
||||
- Samsung based SSD: Samsung SSD 840 PRO Series
|
||||
|
||||
2013-01-02 Christian Franke <franke@computer.org>
|
||||
|
||||
Add '-d usbjmicron,p' device type for Prolific USB bridges.
|
||||
Based on patch provided by Edward Sheldrake.
|
||||
|
||||
2013-01-01 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd: Use Attribute 190 for temperature (-W) if 194 is not present.
|
||||
|
||||
2013-01-01 Christian Franke <franke@computer.org>
|
||||
|
||||
Happy New Year! Update copyright year in version info.
|
||||
|
||||
2012-12-16 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
os_freebsd.cpp: WRITE LOG on LSI/Megaraid should work fine, disable
|
||||
check, problem was linux related.
|
||||
os_linux.cpp: Implemented autoscan for the megaraid SAS controolers.
|
||||
os_linux.cpp: fix WRITE LOG command in SAT layer for -d megaraid.
|
||||
Reason was direction flag always set to READ.
|
||||
os_linux.cpp: unblock autodetection for the SAT drives in -d megaraid.
|
||||
|
||||
2012-12-14 Christian Franke <franke@computer.org>
|
||||
|
||||
man pages: Fix usage of Hyphen (-) and Minus sign (\-).
|
||||
|
||||
2012-12-13 Christian Franke <franke@computer.org>
|
||||
|
||||
man pages: Update EXPERIMENTAL notes.
|
||||
Fix spelling (Red Hat Bugzilla 665028).
|
||||
|
||||
2012-12-13 Christian Franke <franke@computer.org>
|
||||
|
||||
ataprint.cpp: Print Additional Product Identifier (OEM Id).
|
||||
|
||||
2012-12-13 Stanislav Brabec <sbrabec@suse.cz>
|
||||
|
||||
Update FSF postal address in all files.
|
||||
|
||||
2012-12-12 Christian Franke <franke@computer.org>
|
||||
|
||||
smartctl.cpp: Remove include <new> for QNXNTO.
|
||||
Should only be needed if placement new is used.
|
||||
smartd.cpp: Remove very old _GNU_SOURCE define.
|
||||
It was added 10 years ago in r147. It is not (or no longer) needed
|
||||
and has an unwanted side effect (__USE_MINGW_ANSI_STDIO) on MinGW.
|
||||
|
||||
2012-12-11 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd.cpp: Add '-w PATH, --warnexec=PATH' option.
|
||||
smartd.8.in: Document this option.
|
||||
|
||||
2012-12-11 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd.cpp: Add '-d ignore' directive.
|
||||
smartd.conf.5.in: Document '-d ignore'. Add DEVICESCAN example.
|
||||
Remove duplicate and outdated info about device scanning.
|
||||
smartd.8.in: Add notes about RAID controllers to device scanning info.
|
||||
|
||||
2012-12-11 Stanislav Brabec <sbrabec@suse.cz>
|
||||
|
||||
* smartd.initd.in: SUSE: Added sysconfig options to disable
|
||||
persistent state writes, attribute log and set arbitrary smartd
|
||||
options.
|
||||
|
||||
2012-12-03 Christian Franke <franke@computer.org>
|
||||
|
||||
Avoid usage of strcpy(), strcat(), sprintf().
|
||||
Use snprintf() instead or change type to std::string.
|
||||
Use array references instead of char pointers for parameters.
|
||||
|
||||
2012-12-03 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd.cpp: Ignore a device from DEVICESCAN if a preceding smartd.conf
|
||||
entry for the same device exists.
|
||||
|
||||
2012-11-28 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd.conf.5.in: Document smartd_warning.sh/cmd scripts and
|
||||
the new environment variables.
|
||||
Makefile.am: Replace smartd_warning.* paths on man pages.
|
||||
Reformat long sed commands.
|
||||
|
||||
2012-11-27 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd.cpp: Remove trailing newlines from some MailWarning() strings.
|
||||
os_win32/smartd_warning.cmd: Fix SMARTD_MESSAGE with parentheses.
|
||||
|
||||
2012-11-25 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
OpenBSD: remove dummy functions
|
||||
|
||||
2012-11-24 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows: Add tool wtssendmsg.exe based on no longer
|
||||
used module os_win32/wtssendmsg.cpp.
|
||||
os_win32/smartd_warning.cmd: Fix wtssendmsg call.
|
||||
os_win32/installer.nsi: Install smartd_warning.cmd
|
||||
and wtssendmsg.exe. Fix uninstall of old ChangeLog.
|
||||
|
||||
2012-11-23 Christian Franke <franke@computer.org>
|
||||
|
||||
Move MSVC10 project files to new directory os_win32/vc10.
|
||||
|
||||
2012-11-22 Christian Franke <franke@computer.org>
|
||||
|
||||
smartd: Move warning message formatting and mailer/command
|
||||
startup to new script SYSCONFDIR/smartd_warning.sh
|
||||
(Windows: smartd_warning.cmd).
|
||||
Add environment variables SMARTD_PREVCNT and SMARTD_NEXTDAYS.
|
||||
Remove host/domainname related code from smartd.cpp
|
||||
and configure.in
|
||||
|
||||
2012-11-22 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
smartctl: implemeted support for -g/-s rcache and -g/-s wcache for SCSI
|
||||
devices to control read/write device cache.
|
||||
|
||||
2012-11-19 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
smartctl: supports progress indicator on selftests
|
||||
smartctl: prints rotation speed for SCSI drives, if supported
|
||||
smartctl: add headers to SCSI output, fix data blocks formatting,
|
||||
trim identification data
|
||||
os_linux.cpp: add autodetection for PERC H700 array
|
||||
smartd: trim SCSI vendor/model/serial before creating state files
|
||||
|
||||
2012-11-18 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
smartd.cpp: implement error counters and temperature saving to the
|
||||
attrlog file for SCSI devices.
|
||||
smartd.cpp: added reset_warning_mail() if device is working for SCSI
|
||||
|
||||
2012-11-18 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h: Western Digital Caviar Green: Add -F xerrorlba
|
||||
|
||||
2012-11-17 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
smartd.cpp: print lu_id for SPC devices, it is supported by standard
|
||||
smartd.cpp: added initial state file support for the SCSI devices
|
||||
smartd.cpp: add S/N to SCSI device identifier, lu_id is not available
|
||||
on some drives.
|
||||
smartd.cpp: fix warning for SCSI drives with self test in progress (#249)
|
||||
drivedb.h: added -F xerrorlba flag Seagate Barracuda LP/CC32
|
||||
|
||||
2012-11-09 Christian Franke <franke@computer.org>
|
||||
|
||||
Windows smartd: Allow quoting of '-M exec' argument
|
||||
to support path names with spaces.
|
||||
|
||||
2012-11-09 Christian Franke <franke@computer.org>
|
||||
|
||||
ataprint.cpp: Rework smartctl -l directory output.
|
||||
Add R/W, R/O info. Report identical logs in one line.
|
||||
|
||||
2012-11-09 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
os_freebsd.cpp: adding handling of SCSI devices exported with mfip
|
||||
driver. FreeBSD changing PDT code to 0x1f and we are changing it back
|
||||
to 0x00 (direct-access block device).
|
||||
os_freebsd.cpp: improved error handling for the ATA devices
|
||||
|
||||
2012-11-04 Christian Franke <franke@computer.org>
|
||||
|
||||
drivedb.h:
|
||||
- SandForce Driven SSDs: Mushkin Chronos
|
||||
- Indilinx Everest/Martini based SSDs: OCZ AGILITY4
|
||||
- Intel 710 Series SSDs: Add attribute 174
|
||||
- JMicron based SSDs: KINGSTON SSDNOW 30GB
|
||||
- Hitachi Deskstar 7K1000.C: *CLA330
|
||||
- Seagate DiamondMax 23, Barracuda 7200.12, 7200.14 (AF),
|
||||
LP, Green (AF): no warnings for newer firmware versions
|
||||
- Western Digital Caviar Green (AF, SATA 6Gb/s): rename, add 1TB
|
||||
- USB: Toshiba Stor.E (0x0930:0x0b1[9a])
|
||||
- USB: Verbatim Store'n'Go (0x18a5:0x022b)
|
||||
|
||||
2012-11-02 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
os_freebsd.cpp: disabling 48bit commands on legacy ATA controllers
|
||||
in ATACAM mode because of kernel bug.
|
||||
|
||||
2012-10-31 Christian Franke <franke@computer.org>
|
||||
|
||||
atacmdnames.cpp: Update for ATA-8-ACS, ACS-2, ACS-3.
|
||||
ataidentify.cpp: Mark retired/obsolete values.
|
||||
ataprint.cpp: Add new ACS-3 logs, mark obsolete logs.
|
||||
|
||||
2012-10-27 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
os_freebsd.cpp: Have smartd prefer real device names over passN.
|
||||
Patch provided by dnelson, see ticket #21
|
||||
os_freebsd.cpp: fix 48-bit support for ATA legacy controllers in
|
||||
ATACAM mode, patch provided by Alexander Motin
|
||||
|
||||
2012-10-25 Christian Franke <franke@computer.org>
|
||||
|
||||
atacmds.cpp: Return error for get SCT ERC if ATA registers are
|
||||
unchanged after SMART_WRITE_LOG command (see ticket #245).
|
||||
|
||||
2012-10-24 Christian Franke <franke@computer.org>
|
||||
|
||||
dev_areca.cpp: Add missing parameter check to ata_pass_through().
|
||||
Update Areca info on man pages.
|
||||
|
||||
2012-10-24 Christian Franke <franke@computer.org>
|
||||
|
||||
dev_interface: Rework ATA parameter checks, use new flags
|
||||
ata_device::supports_* for new ata_cmd_is_supported().
|
||||
Replace ata_cmd_is_ok() by ata_cmd_is_supported() in scsiata.cpp
|
||||
and os_win32.cpp.
|
||||
|
||||
2012-10-19 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
os_freebsd.cpp - fixed 3ware twe controller support broken
|
||||
by inerface migration.
|
||||
|
||||
2012-10-18 Christian Franke <franke@computer.org>
|
||||
|
||||
utility.cpp: Add missing errno clear in split_selective_arg()
|
||||
(Debian bug 690108).
|
||||
Remove unused function split_report_arg2().
|
||||
|
||||
2012-10-18 Christian Franke <franke@computer.org>
|
||||
|
||||
os_win32.cpp: define _WIN32. This fixes build on
|
||||
Cygwin with new w32api-headers.
|
||||
|
||||
2012-10-18 Alex Samorukov <samm@os2.kiev.ua>
|
||||
|
||||
Compile fixes for Areca patch on FreeBSD.
|
||||
Added support for the /dev/twsX (3ware 9750) controller on FreeBSD.
|
||||
Manual pages updated with /dev/twsX device
|
||||
FreeBSD: Migrate 3ware interface to ata_pass_through()
|
||||
FreeBSD: fix missing drives detection on -d 3ware
|
||||
FreeBSD: 3ware - do not pass buffers direcly, use memcpy() instead
|
||||
FreeBSD: improved detection of 3ware/LSI controllers
|
||||
|
||||
2012-10-16 Christian Franke <franke@computer.org>
|
||||
|
||||
Compile fixes for Areca patch:
|
||||
Add missing includes. Add GPL header.
|
||||
Add dev_areca.* to configure.in and Makefile.am.
|
||||
|
||||
2012-10-16 Hank Wu <hank@areca.com.tw>
|
||||
|
||||
Move common Areca code from os_freebsd.cpp, os_linux.cpp, os_win32.cpp
|
||||
to new files dev_areca.h, dev_areca.cpp.
|
||||
Add SAS support for FreeBSD and Linux.
|
||||
|
||||
2012-10-10 Christian Franke <franke@computer.org>
|
||||
|
||||
Rename old CHANGELOG to ChangeLog-5.0-6.0.
|
||||
Start new ChangeLog.
|
||||
|
||||
2012-10-10 Christian Franke <franke@computer.org>
|
||||
|
||||
smartmontools 6.0
|
@ -1,9 +1,6 @@
|
||||
CHANGELOG for smartmontools
|
||||
CHANGELOG for smartmontools 5.0 to 6.0
|
||||
|
||||
$Id: CHANGELOG 3561 2012-06-05 19:49:31Z chrfranke $
|
||||
|
||||
The most recent version of this file is:
|
||||
http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/CHANGELOG?view=markup
|
||||
$Id: ChangeLog-5.0-6.0 3645 2012-10-10 16:15:26Z chrfranke $
|
||||
|
||||
Maintainers / Developers Key (alphabetic order):
|
||||
[AS] Alex Samorukov
|
||||
@ -41,6 +38,224 @@ Maintainers / Developers Key (alphabetic order):
|
||||
|
||||
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
|
||||
|
||||
smartmontools 6.0 2012-10-10
|
||||
|
||||
[CF] do_release: Fix for minor rev number 0.
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- SandForce Driven SSDs: Corsair Force 115GB
|
||||
- Hitachi Ultrastar 7K4000
|
||||
- Seagate Barracuda 7200.7 and 7200.7 Plus: IBM OEM variants
|
||||
- Western Digital Caviar Black (AF)
|
||||
|
||||
[CF] man pages: Update introduction. Update ATA standards.
|
||||
Remove some outdated info.
|
||||
|
||||
[CF] man pages: Unify license headers.
|
||||
|
||||
[CF] smartctl: Do not abort SCT status output on unknown temperature
|
||||
history format version.
|
||||
|
||||
[CF] smartctl: Remove duplicate note about selective self-test log
|
||||
version.
|
||||
|
||||
[CF] smartctl: Add '-l devstat' to '-x, --xall' output.
|
||||
|
||||
[CF] smartctl: Rework ATA error messages and 'not supported' messages.
|
||||
Avoid misleading warnings on unsupported features (ticket #182).
|
||||
Avoid duplicate error messages.
|
||||
|
||||
[CF] atacmds.h: Remove nonexistent functions.
|
||||
|
||||
[CF] Windows installer: Add support for /S(ilent) install/uninstall.
|
||||
|
||||
[CF] Windows installer: Update examples. Remove some doc shortcuts.
|
||||
|
||||
[CF] Prepare release 6.0. Change Copyright output line.
|
||||
Change AUTHORS sections on man pages.
|
||||
|
||||
[CF] smartctl: Rework "ATA Version" output. Print major and minor
|
||||
revision in one output line. Remove "ATA Standard" line.
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- Add firmware warnings for various Seagate series (ticket #239):
|
||||
DiamondMax 23, Barracuda 7200.12, 7200.14 (AF), LP, Green (AF)
|
||||
- Seagate Barracuda 7200.14 (AF): 2.5TB
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- SandForce Driven SSDs: SanDisk Extreme
|
||||
- Indilinx Everest/Martini based SSDs: OCZ-VERTEX4,
|
||||
fix Attribute 232
|
||||
- STEC Mach2 CompactFlash Cards
|
||||
- Toshiba 2.5" HDD MK..55GSX: *55GSXF variants
|
||||
- Western Digital VelociRaptor (AF)
|
||||
|
||||
[CF] Windows: Remove EXPERIMENTAL notes for 64-bit version.
|
||||
|
||||
[CF] autogen.sh: automake 1.11.6 and 1.12.3 are OK.
|
||||
|
||||
[CF] smartctl: Fix '--identify' for big-endian CPUs.
|
||||
|
||||
[CF] ataidentify.cpp: Document some older (now obsolete) features.
|
||||
|
||||
[CF] ataidentify.cpp: Add some recent ACS-3 features.
|
||||
|
||||
[CF] smartctl: Support '-l sataphy' also for Packet interface devices.
|
||||
|
||||
[CF] atacmds.cpp: Add new ATA ACS-3 minor revision.
|
||||
|
||||
[CF] smartctl: Print SATA version and speed in '-i' output.
|
||||
|
||||
[CF] drivedb.h: Minor reordering of Seagate entries.
|
||||
|
||||
[CF] drivedb.h: Use "AF" for Advanced Format (4KiB LPS).
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- Seagate Barracuda SpinPoint F3
|
||||
- SAMSUNG SpinPoint F3 RE
|
||||
- Seagate Barracuda 7200.12: ST3750525AS
|
||||
- Seagate Barracuda 7200.14 (AF): change name, add -v options
|
||||
- Western Digital Red (AF)
|
||||
- USB: Seagate Backup Plus USB 3.0 (0x0bc2:0xa013) (ticket #235)
|
||||
- USB: Seagate Backup Plus Desktop USB 3.0 (0x0bc2:0xa0a4)
|
||||
|
||||
[CF] os_win32.cpp: Add support for SAS disks behind Areca SAS
|
||||
controllers. This includes SAS/SATA autodetection.
|
||||
|
||||
Patch was provided by Hank Wu from Areca.
|
||||
|
||||
[CF] ataidentify.cpp: Add some recent SATA features.
|
||||
|
||||
[CF] smartctl: Add '--identify[=wnvb]' option.
|
||||
Add new source files ataidentify.h/cpp.
|
||||
|
||||
[CF] Makefile.am: Reformat lists of sources.
|
||||
|
||||
[CF] Do not print HDD/SSD specific default attribute names if identify
|
||||
data reports SSD/HDD device.
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- Intel 320 and 710 Series SSDs: Set '-F nologdir'
|
||||
- Seagate Barracuda ES.2: Set '-F xerrorlba'
|
||||
|
||||
[CF] Create branches RELEASE_5_4[0-3]_DRIVEDB with last drivedb.h file
|
||||
compatible with smartmontools 5.4[0-3].
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- SAMSUNG SpinPoint M40/60/80: HM120IC
|
||||
- USB: Oxford (0x0928:0x0010)
|
||||
- USB: Seagate External Drive/Cypress (0x0bc2:0x0503)
|
||||
- USB: 0x1f75:0x0888 is Innostor IS888
|
||||
|
||||
[CF] smartctl: Print nominal media rotation rate in '-i' output (ATA).
|
||||
|
||||
[CF] knowndrives.cpp: Fix missing '-F xerrorlba' in '-P show' output.
|
||||
|
||||
[CF] os_win32.cpp: Use WMI to get serial number if
|
||||
IOCTL_STORAGE_QUERY_PROPERTY is used.
|
||||
|
||||
[CF] os_win32.cpp: Remove more Win9x/ME/NT4 specific code: ATA drive
|
||||
number, GetDevicePowerState() handling.
|
||||
|
||||
[CF] Add '-F xerrorlba' option/directive.
|
||||
|
||||
[CF] Rework '-F' option handling. Add support for multiple '-F' options
|
||||
and directives.
|
||||
|
||||
[CF] Makefile.am: Fix typo in ACLOCAL_AMFLAGS.
|
||||
|
||||
[CF] smartd.cpp: MailWarning(): Move variable declarations, use sizeof()
|
||||
instead of numbers.
|
||||
|
||||
[CF] smartd.cpp: Rework dnsname(). Print "[None]" instead of "[Unknown]"
|
||||
if domain is not set. Print NIS domain only if supported.
|
||||
|
||||
[CF] Windows smartd: Use gethostname/gethostbyname() from winsock.
|
||||
Remove os_win32/hostname_win32.*.
|
||||
|
||||
[CF] smartd: Include device identify info in warning emails (ticket #185).
|
||||
Add SMARTD_DEVICEINFO environment variable.
|
||||
|
||||
[CF] Add '-F nologdir' option/directive.
|
||||
Prevents freeze of some Intel SSDs (ticket #214).
|
||||
|
||||
[CF] smartd: Don't log ignored -W directive as critical.
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- Smart Storage Systems Xcel-10 SSDs: Move entry, change name
|
||||
- Samsung: Remove very old and already commented out entries
|
||||
- Seagate Momentus XT (Adv. Format)
|
||||
- WD My Passport: 3 -> 2 entries, add 2TB
|
||||
- USB: Imation (0x0718:0x1000) (ticket #231)
|
||||
- USB: Initio (0x13fd:0x1040): unsupported
|
||||
- USB: ASMedia USB 3.0 (0x174c:0x55aa): unsupported -> -d sat
|
||||
- USB: PQI H560 (0x3538:0x0902) (ticket #232)
|
||||
|
||||
[CF] smartctl: Override SMART disabled state with '-T permissive'.
|
||||
|
||||
[CF] os_win32/daemon_win32.cpp: Drop remaining WinNT4 compatibility.
|
||||
|
||||
[CF] Windows smartd: Add smartd.conf directives '-m console',
|
||||
'-m active', '-m connected'. Send warning messages via
|
||||
WTSSendMessage(). Remove use of MessageBox() which does no
|
||||
longer work for services since Vista/2008.
|
||||
|
||||
[CF] Fix 'smartctl -P show'. Regression from r3249.
|
||||
|
||||
[CF] smartd.cpp: Fix setting of temporary environment in MailWarning().
|
||||
Stack space was passed to putenv() but variable was not unset
|
||||
before return. Very old bug introduced 2003 in r1114.
|
||||
|
||||
[CF] smartd.cpp: Add fflush() to support redirection of debug output
|
||||
(Debian bug 681349).
|
||||
|
||||
[CF] os_generic.cpp: Add missing int64.h (Debian bug 619208)
|
||||
This obsoletes Debian patch fix-generic.diff.
|
||||
|
||||
[CF] cciss.cpp: Fix build on GNU/kFreeBSD (Debian bug 676142).
|
||||
This obsoletes Debian kfreebsd.patch.
|
||||
|
||||
[CF] Windows: Drop backward compatibility with WinNT4.
|
||||
|
||||
[CF] Windows: Drop backward compatibility with Win9x/ME.
|
||||
|
||||
smartmontools 5.43 2012-06-30
|
||||
|
||||
[CF] drivedb.h USB updates:
|
||||
- Toshiba Canvio Basics (0x0480:0xa006)
|
||||
- A-DATA DashDrive (0x125f:0xa94a)
|
||||
|
||||
[CF] drivedb.h: Hitachi Travelstar 7K500: *A362/3 variants
|
||||
|
||||
[CF] Windows: Add Windows Server 2012 to get_os_version_str().
|
||||
|
||||
[CF] drivedb.h updates:
|
||||
- Sandforce Driven SSDs: OWC Mercury Electra 3/6G SSD
|
||||
- Seagate Momentus SpinPoint M8
|
||||
- Hitachi Deskstar 5K4000
|
||||
- Toshiba 2.5" HDD MK..61GSYN
|
||||
- Seagate Barracuda (SATA 3Gb/s, 4K Sectors): 1TB, *DM003-* variant
|
||||
|
||||
[CF] smartctl.8.in: Note performance impact of self-tests.
|
||||
|
||||
[CF] os_win32.cpp: Add support for older Areca drivers which used a
|
||||
different target id. Patch was provided by Hank Wu from Areca.
|
||||
|
||||
[CF] smartctl.8.in: Add info about HP Smart Array controllers.
|
||||
Original patch was provided by Don Brace from HP.
|
||||
|
||||
[CF] os_freebsd.cpp: add SAT autodetection to '-d cciss,N' device type
|
||||
(ticket #202).
|
||||
Add missing freebsd_areca_device::m_encnum (regression from r3542).
|
||||
Patch was provided by Don Brace from HP.
|
||||
|
||||
[CF] os_linux.cpp: add SAT autodetection to '-d cciss,N' device type
|
||||
(ticket #202).
|
||||
|
||||
[CF] Makefile.am: FIXHTML modified for newer man2html versions.
|
||||
|
||||
[CF] autogen.sh: automake 1.11.5 is OK.
|
||||
|
||||
[CF] man pages: Minor updates and syntax fixes.
|
||||
|
||||
[CF] smartd.service.in: Add ExecReload and StandardOutput.
|
51
INSTALL
51
INSTALL
@ -1,7 +1,7 @@
|
||||
Smartmontools installation instructions
|
||||
=======================================
|
||||
|
||||
$Id: INSTALL 3555 2012-06-01 21:07:33Z chrfranke $
|
||||
$Id: INSTALL 3713 2012-11-23 21:26:17Z chrfranke $
|
||||
|
||||
Please also see the smartmontools home page:
|
||||
http://smartmontools.sourceforge.net/
|
||||
@ -97,7 +97,7 @@ Table of contents:
|
||||
|
||||
E) Cygwin
|
||||
|
||||
The code was tested on Cygwin 1.7.7-1. It should also work on other
|
||||
The code was tested on Cygwin 1.7.15-1. It should also work on other
|
||||
recent releases.
|
||||
|
||||
Both Cygwin and Windows versions of smartmontools share the same code
|
||||
@ -106,40 +106,14 @@ Table of contents:
|
||||
|
||||
F) Windows
|
||||
|
||||
The code was tested on Windows 98SE, ME, NT4(SP5,SP6), 2000(SP4),
|
||||
XP(up to SP3), 2003, Vista and Windows 7.
|
||||
|
||||
-- Windows 9x/ME
|
||||
|
||||
On 9x/ME, only standard (legacy) IDE/ATA devices 0-3 are supported.
|
||||
The driver SMARTVSD.VXD must be present in WINDOWS\SYSTEM\IOSUBSYS
|
||||
to get loaded at Windows startup. The default location in a new
|
||||
installation of some versions of Windows is the WINDOWS\SYSTEM folder.
|
||||
In this case, move SMARTVSD.VXD to WINDOWS\SYSTEM\IOSUBSYS and reboot
|
||||
(http://support.microsoft.com/kb/265854/en-us).
|
||||
|
||||
SMARTVSD.VXD relies on the standard IDE port driver ESDI_506.PDR.
|
||||
If the system uses a vendor specific driver, access of SMART data
|
||||
is not possible.
|
||||
|
||||
Some ATA controllers (e.g. Promise) provided a custom SMARTVSD.VXD
|
||||
for their Win9x/ME driver. To access SMART data from both the legacy
|
||||
(/dev/h[a-d]) and this additional (/dev/hd[e-h]) controller, rename
|
||||
this file to SMARTVSE.VXD. Open the file with a hex editor and replace
|
||||
all occurrences of the string "SMARTVSD" with "SMARTVSE". Then reinstall
|
||||
the original Windows SMARTVSD.VXD.
|
||||
|
||||
To access SCSI and USB devices, an installed ASPI interface (WNASPI32.DLL)
|
||||
is required. The code was tested with Adaptec Windows ASPI drivers 4.71.2.
|
||||
(http://www.adaptec.com/en-US/support/_eol/scsi_sw/ASPI-4.70/)
|
||||
Links to other ASPI drivers can be found at http://www.nu2.nu/aspi/.
|
||||
|
||||
-- Windows NT4/2000/XP/2003/Vista/Win7
|
||||
The code was tested on Windows XP SP3, 2003, Vista, Windows 7 and
|
||||
Windows 8 Release Preview. Support von Windows 9x/ME and NT4 was removed
|
||||
after smartmontools 5.43.
|
||||
|
||||
ATA or SATA devices are supported if the device driver implements
|
||||
the SMART IOCTLs or IOCTL_IDE_PASS_THROUGH or IOCTL_ATA_PASS_THROUGH.
|
||||
The ATA SMART READ LOG command (smartctl -l, --log, -a, --all) is not
|
||||
supported if only the SMART IOCTLs are implemented.
|
||||
Only the latter provides full pass-through support which is needed
|
||||
for all smartmontools features.
|
||||
|
||||
SCSI and USB devices are accessed through SPTI. Special driver support
|
||||
is not required.
|
||||
@ -458,8 +432,6 @@ Cross-compile statically linked 64-bit version with MinGW-w64:
|
||||
Tested on Cygwin and Debian Linux with MinGW-w64 from
|
||||
http://mingw-w64.sourceforge.net/.
|
||||
|
||||
WARNING: The smartmontools version for 64-bit Windows is still EXPERIMENTAL.
|
||||
|
||||
Cross-compile on Cygwin with old gcc-mingw 3.x:
|
||||
|
||||
./configure --build=$(./config.guess) \
|
||||
@ -532,10 +504,9 @@ use the following on MSYS or Cygwin:
|
||||
../configure [... any MinGW option set from above ...]
|
||||
make config-vc10
|
||||
|
||||
The MSVC project files (os_win32/smartmontools_vc10.sln,
|
||||
os_win32/smart{ctl,d}_vc10.vcxproj) are included in SVN (but not in
|
||||
source tarball). The target config-vc10 from a Makefile configured
|
||||
for MinGW creates os_win32/{config,svnversion}_vc10.h from
|
||||
The MSVC project files (os_win32/vc10/*) are included in SVN (but not
|
||||
in source tarball). The target config-vc10 from a Makefile configured
|
||||
for MinGW creates os_win32/vc10/{config,svnversion}.h from
|
||||
./{config,svnversion}.h. The configure skript must be run outside
|
||||
of the source directory to avoid inclusion of the original config.h.
|
||||
|
||||
@ -621,7 +592,7 @@ The following files are installed if ./configure has no options:
|
||||
/usr/local/share/man/man8/smartctl.8 [Manual page]
|
||||
/usr/local/share/man/man8/smartd.8 [Manual page]
|
||||
/usr/local/share/doc/smartmontools/AUTHORS [Information about the authors and developers]
|
||||
/usr/local/share/doc/smartmontools/CHANGELOG [A log of changes. Also see SVN]
|
||||
/usr/local/share/doc/smartmontools/ChangeLog [A log of changes. Also see SVN]
|
||||
/usr/local/share/doc/smartmontools/COPYING [GNU General Public License Version 2]
|
||||
/usr/local/share/doc/smartmontools/INSTALL [Installation instructions: what you're reading!]
|
||||
/usr/local/share/doc/smartmontools/NEWS [Significant bugs discovered in old versions]
|
||||
|
380
Makefile.am
380
Makefile.am
@ -1,11 +1,11 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
#
|
||||
# $Id: Makefile.am 3545 2012-05-25 21:19:03Z chrfranke $
|
||||
# $Id: Makefile.am 3759 2013-01-26 21:11:02Z chrfranke $
|
||||
#
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
ACLOCAL_AM_FLAGS = -I m4
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# Make sure .cpp takes precedence to avoid compiling old .c file
|
||||
SUFFIXES = .cpp .c .s .o
|
||||
@ -34,8 +34,9 @@ if NEED_REGEX
|
||||
AM_CPPFLAGS += -I$(srcdir)/regex
|
||||
endif
|
||||
|
||||
sbin_PROGRAMS = smartd \
|
||||
smartctl
|
||||
sbin_PROGRAMS = \
|
||||
smartctl \
|
||||
smartd
|
||||
|
||||
if ENABLE_DRIVEDB
|
||||
if OS_WIN32_MINGW
|
||||
@ -45,115 +46,136 @@ endif
|
||||
endif
|
||||
|
||||
|
||||
smartd_SOURCES = smartd.cpp \
|
||||
atacmdnames.cpp \
|
||||
atacmdnames.h \
|
||||
atacmds.cpp \
|
||||
atacmds.h \
|
||||
dev_ata_cmd_set.cpp \
|
||||
dev_ata_cmd_set.h \
|
||||
dev_interface.cpp \
|
||||
dev_interface.h \
|
||||
dev_tunnelled.h \
|
||||
drivedb.h \
|
||||
int64.h \
|
||||
knowndrives.cpp \
|
||||
knowndrives.h \
|
||||
scsicmds.cpp \
|
||||
scsicmds.h \
|
||||
scsiata.cpp \
|
||||
utility.cpp \
|
||||
utility.h
|
||||
smartctl_SOURCES = \
|
||||
smartctl.cpp \
|
||||
smartctl.h \
|
||||
atacmdnames.cpp \
|
||||
atacmdnames.h \
|
||||
atacmds.cpp \
|
||||
atacmds.h \
|
||||
ataidentify.cpp \
|
||||
ataidentify.h \
|
||||
ataprint.cpp \
|
||||
ataprint.h \
|
||||
dev_ata_cmd_set.cpp \
|
||||
dev_ata_cmd_set.h \
|
||||
dev_interface.cpp \
|
||||
dev_interface.h \
|
||||
dev_tunnelled.h \
|
||||
drivedb.h \
|
||||
int64.h \
|
||||
knowndrives.cpp \
|
||||
knowndrives.h \
|
||||
scsicmds.cpp \
|
||||
scsicmds.h \
|
||||
scsiata.cpp \
|
||||
scsiprint.cpp \
|
||||
scsiprint.h \
|
||||
utility.cpp \
|
||||
utility.h
|
||||
|
||||
smartctl_LDADD = @os_deps@ @os_libs@
|
||||
smartctl_DEPENDENCIES = @os_deps@
|
||||
|
||||
EXTRA_smartctl_SOURCES = \
|
||||
os_darwin.cpp \
|
||||
os_darwin.h \
|
||||
os_linux.cpp \
|
||||
os_linux.h \
|
||||
os_freebsd.cpp \
|
||||
os_freebsd.h \
|
||||
os_netbsd.cpp \
|
||||
os_netbsd.h \
|
||||
os_openbsd.cpp \
|
||||
os_openbsd.h \
|
||||
os_qnxnto.cpp \
|
||||
os_qnxnto.h \
|
||||
os_solaris.cpp \
|
||||
os_solaris.h \
|
||||
os_solaris_ata.s \
|
||||
os_win32.cpp \
|
||||
os_generic.cpp \
|
||||
os_generic.h \
|
||||
cciss.cpp \
|
||||
cciss.h \
|
||||
cissio_freebsd.h \
|
||||
dev_areca.cpp \
|
||||
dev_areca.h \
|
||||
dev_legacy.cpp \
|
||||
megaraid.h
|
||||
|
||||
if OS_WIN32_MINGW
|
||||
|
||||
smartctl_LDADD += smartctl_res.o
|
||||
smartctl_DEPENDENCIES += smartctl_res.o
|
||||
|
||||
endif
|
||||
|
||||
|
||||
smartd_SOURCES = \
|
||||
smartd.cpp \
|
||||
atacmdnames.cpp \
|
||||
atacmdnames.h \
|
||||
atacmds.cpp \
|
||||
atacmds.h \
|
||||
dev_ata_cmd_set.cpp \
|
||||
dev_ata_cmd_set.h \
|
||||
dev_interface.cpp \
|
||||
dev_interface.h \
|
||||
dev_tunnelled.h \
|
||||
drivedb.h \
|
||||
int64.h \
|
||||
knowndrives.cpp \
|
||||
knowndrives.h \
|
||||
scsicmds.cpp \
|
||||
scsicmds.h \
|
||||
scsiata.cpp \
|
||||
utility.cpp \
|
||||
utility.h
|
||||
|
||||
smartd_LDADD = @os_deps@ @os_libs@ @CAPNG_LDADD@
|
||||
smartd_DEPENDENCIES = @os_deps@
|
||||
|
||||
EXTRA_smartd_SOURCES = os_darwin.cpp \
|
||||
os_darwin.h \
|
||||
os_linux.cpp \
|
||||
os_linux.h \
|
||||
os_freebsd.cpp \
|
||||
os_freebsd.h \
|
||||
os_netbsd.cpp \
|
||||
os_netbsd.h \
|
||||
os_openbsd.cpp \
|
||||
os_openbsd.h \
|
||||
os_qnxnto.cpp \
|
||||
os_qnxnto.h \
|
||||
os_solaris.cpp \
|
||||
os_solaris.h \
|
||||
os_solaris_ata.s \
|
||||
os_win32.cpp \
|
||||
os_generic.cpp \
|
||||
os_generic.h \
|
||||
cciss.cpp \
|
||||
cciss.h \
|
||||
cissio_freebsd.h \
|
||||
dev_legacy.cpp \
|
||||
megaraid.h
|
||||
|
||||
EXTRA_smartd_SOURCES = \
|
||||
os_darwin.cpp \
|
||||
os_darwin.h \
|
||||
os_linux.cpp \
|
||||
os_linux.h \
|
||||
os_freebsd.cpp \
|
||||
os_freebsd.h \
|
||||
os_netbsd.cpp \
|
||||
os_netbsd.h \
|
||||
os_openbsd.cpp \
|
||||
os_openbsd.h \
|
||||
os_qnxnto.cpp \
|
||||
os_qnxnto.h \
|
||||
os_solaris.cpp \
|
||||
os_solaris.h \
|
||||
os_solaris_ata.s \
|
||||
os_win32.cpp \
|
||||
os_generic.cpp \
|
||||
os_generic.h \
|
||||
cciss.cpp \
|
||||
cciss.h \
|
||||
cissio_freebsd.h \
|
||||
dev_areca.cpp \
|
||||
dev_areca.h \
|
||||
dev_legacy.cpp \
|
||||
megaraid.h
|
||||
|
||||
if OS_WIN32_MINGW
|
||||
|
||||
smartd_SOURCES += \
|
||||
os_win32/daemon_win32.cpp \
|
||||
os_win32/daemon_win32.h \
|
||||
os_win32/hostname_win32.cpp \
|
||||
os_win32/hostname_win32.h \
|
||||
os_win32/syslog_win32.cpp \
|
||||
os_win32/syslog.h
|
||||
|
||||
smartd_LDADD += smartd_res.o
|
||||
smartd_DEPENDENCIES += smartd_res.o
|
||||
|
||||
endif
|
||||
|
||||
smartctl_SOURCES= smartctl.cpp \
|
||||
smartctl.h \
|
||||
atacmdnames.cpp \
|
||||
atacmdnames.h \
|
||||
atacmds.cpp \
|
||||
atacmds.h \
|
||||
ataprint.cpp \
|
||||
ataprint.h \
|
||||
dev_ata_cmd_set.cpp \
|
||||
dev_ata_cmd_set.h \
|
||||
dev_interface.cpp \
|
||||
dev_interface.h \
|
||||
dev_tunnelled.h \
|
||||
drivedb.h \
|
||||
int64.h \
|
||||
knowndrives.cpp \
|
||||
knowndrives.h \
|
||||
scsicmds.cpp \
|
||||
scsicmds.h \
|
||||
scsiata.cpp \
|
||||
scsiprint.cpp \
|
||||
scsiprint.h \
|
||||
utility.cpp \
|
||||
utility.h
|
||||
|
||||
|
||||
smartctl_LDADD = @os_deps@ @os_libs@
|
||||
smartctl_DEPENDENCIES = @os_deps@
|
||||
|
||||
EXTRA_smartctl_SOURCES = os_linux.cpp \
|
||||
os_linux.h \
|
||||
os_freebsd.cpp \
|
||||
os_freebsd.h \
|
||||
os_netbsd.cpp \
|
||||
os_netbsd.h \
|
||||
os_openbsd.cpp \
|
||||
os_openbsd.h \
|
||||
os_qnxnto.cpp \
|
||||
os_qnxnto.h \
|
||||
os_solaris.cpp \
|
||||
os_solaris.h \
|
||||
os_win32.cpp \
|
||||
os_generic.cpp \
|
||||
os_generic.h \
|
||||
cciss.cpp \
|
||||
cciss.h \
|
||||
cissio_freebsd.h \
|
||||
dev_legacy.cpp \
|
||||
megaraid.h
|
||||
|
||||
if NEED_GETOPT_LONG
|
||||
|
||||
@ -270,15 +292,17 @@ man_MANS = smartd.conf.5 \
|
||||
endif
|
||||
|
||||
docsdir=$(docdir)
|
||||
docs_DATA = AUTHORS \
|
||||
CHANGELOG \
|
||||
COPYING \
|
||||
INSTALL \
|
||||
NEWS \
|
||||
README \
|
||||
TODO \
|
||||
WARNINGS \
|
||||
smartd.conf
|
||||
docs_DATA = \
|
||||
AUTHORS \
|
||||
ChangeLog \
|
||||
ChangeLog-5.0-6.0 \
|
||||
COPYING \
|
||||
INSTALL \
|
||||
NEWS \
|
||||
README \
|
||||
TODO \
|
||||
WARNINGS \
|
||||
smartd.conf
|
||||
|
||||
examplesdir=$(exampledir)
|
||||
examples_DATA = \
|
||||
@ -321,6 +345,10 @@ uninstall-sysconfDATA:
|
||||
echo " rm -f $$f"; \
|
||||
rm -f "$$f"
|
||||
|
||||
# automake does not allow 'sysconf_SCRIPTS'
|
||||
sysscriptdir = $(sysconfdir)
|
||||
sysscript_SCRIPTS = smartd_warning.sh
|
||||
|
||||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
smartd.initd.in \
|
||||
@ -330,6 +358,7 @@ EXTRA_DIST = \
|
||||
smartd.conf.5.in \
|
||||
smartd.conf \
|
||||
smartd.service.in \
|
||||
smartd_warning.sh.in \
|
||||
update-smart-drivedb.in \
|
||||
m4/pkg.m4 \
|
||||
os_darwin/SMART.in \
|
||||
@ -339,10 +368,13 @@ EXTRA_DIST = \
|
||||
os_win32/runcmd.c \
|
||||
os_win32/runcmda.exe.manifest \
|
||||
os_win32/runcmdu.exe.manifest \
|
||||
os_win32/syslogevt.c \
|
||||
os_win32/smartctl_res.rc.in \
|
||||
os_win32/smartd_res.rc.in \
|
||||
os_win32/smartd_warning.cmd \
|
||||
os_win32/syslogevt.mc \
|
||||
os_win32/update-smart-drivedb.nsi \
|
||||
os_win32/wbemcli_small.h \
|
||||
os_win32/wtssendmsg.c \
|
||||
$(docs_DATA) \
|
||||
$(examples_DATA) \
|
||||
$(examples_SCRIPTS)
|
||||
@ -363,6 +395,7 @@ CLEANFILES = \
|
||||
smartd.initd \
|
||||
smartd.freebsd.initd \
|
||||
smartd.service \
|
||||
smartd_warning.sh \
|
||||
svnversion.h \
|
||||
update-smart-drivedb \
|
||||
SMART
|
||||
@ -386,7 +419,7 @@ utility.o: svnversion.h
|
||||
|
||||
if IS_SVN_BUILD
|
||||
# Get version info from SVN
|
||||
svnversion.h: CHANGELOG Makefile $(svn_deps)
|
||||
svnversion.h: ChangeLog Makefile $(svn_deps)
|
||||
echo '/* svnversion.h. Generated by Makefile from svn info. */' > $@
|
||||
(cd $(srcdir) \
|
||||
&& svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV "\1",p' \
|
||||
@ -396,9 +429,9 @@ svnversion.h: CHANGELOG Makefile $(svn_deps)
|
||||
else
|
||||
|
||||
# SVN not available, guess version info from Id strings
|
||||
svnversion.h: CHANGELOG Makefile
|
||||
svnversion.h: ChangeLog Makefile
|
||||
echo '/* svnversion.h. Generated by Makefile from Id strings. */' > $@
|
||||
(cd $(srcdir) && cat CHANGELOG Makefile.am configure.in smart*.in *.cpp *.h *.s) \
|
||||
(cd $(srcdir) && cat ChangeLog Makefile.am configure.ac smart*.in *.cpp *.h *.s) \
|
||||
| sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
|
||||
| sort -n -r \
|
||||
| sed -n 'h;s,^\([^ ]*\) .*$$,REV "\1",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
|
||||
@ -424,6 +457,9 @@ update-smart-drivedb: update-smart-drivedb.in config.status
|
||||
$(SHELL) ./config.status --file=$@
|
||||
chmod +x $@
|
||||
|
||||
smartd_warning.sh: smartd_warning.sh.in config.status
|
||||
$(SHELL) ./config.status --file=$@
|
||||
chmod +x $@
|
||||
|
||||
if INSTALL_INITSCRIPT
|
||||
if OS_DARWIN
|
||||
@ -494,8 +530,8 @@ systemdsystemunit_DATA = smartd.service
|
||||
endif
|
||||
|
||||
smartd.service: smartd.service.in Makefile
|
||||
sed "s|/usr/local/sbin/smartd|$(sbindir)/smartd|g; \
|
||||
s|/usr/local/etc/sysconfig/smartmontools|$(sysconfdir)/sysconfig/smartmontools|g" \
|
||||
sed -e 's|/usr/local/sbin/smartd|$(sbindir)/smartd|g' \
|
||||
-e 's|/usr/local/etc/sysconfig/smartmontools|$(sysconfdir)/sysconfig/smartmontools|g' \
|
||||
$(srcdir)/smartd.service.in > $@
|
||||
|
||||
if ENABLE_CAPABILITIES
|
||||
@ -523,17 +559,18 @@ MAN_ATTRIBUTELOG = sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_A
|
||||
endif
|
||||
|
||||
MAN_FILTER = \
|
||||
sed "s|CURRENT_SVN_VERSION|$(releaseversion)|g; \
|
||||
s|CURRENT_SVN_DATE|`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`|g; \
|
||||
s|CURRENT_SVN_REV|`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`|g; \
|
||||
s|/usr/local/share/man/|$(mandir)/|g; \
|
||||
s|/usr/local/sbin/|$(sbindir)/|g; \
|
||||
s|/usr/local/etc/rc\\.d/init.d/|$(initddir)/|g; \
|
||||
s|/usr/local/share/doc/smartmontools/examplescripts/|!exampledir!|g; \
|
||||
s|/usr/local/share/doc/smartmontools/|$(docsdir)/|g; \
|
||||
s|!exampledir!|$(exampledir)/|g; \
|
||||
s|/usr/local/etc/smartd\\.conf|$(sysconfdir)/smartd.conf|g; \
|
||||
s|/usr/local/etc/smart_drivedb\\.h|$(sysconfdir)/smart_drivedb\\.h|g" | \
|
||||
sed -e 's|CURRENT_SVN_VERSION|$(releaseversion)|g' \
|
||||
-e "s|CURRENT_SVN_DATE|`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`|g" \
|
||||
-e "s|CURRENT_SVN_REV|`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`|g" \
|
||||
-e 's|/usr/local/share/man/|$(mandir)/|g' \
|
||||
-e 's|/usr/local/sbin/|$(sbindir)/|g' \
|
||||
-e 's|/usr/local/etc/rc\.d/init.d/|$(initddir)/|g' \
|
||||
-e 's|/usr/local/share/doc/smartmontools/examplescripts/|!exampledir!|g' \
|
||||
-e 's|/usr/local/share/doc/smartmontools/|$(docsdir)/|g' \
|
||||
-e 's|!exampledir!|$(exampledir)/|g' \
|
||||
-e 's|/usr/local/etc/smartd\.conf|$(sysconfdir)/smartd.conf|g' \
|
||||
-e 's|/usr/local/etc/smartd_warning\.|$(sysconfdir)/smartd_warning.|g' \
|
||||
-e 's|/usr/local/etc/smart_drivedb\.h|$(sysconfdir)/smart_drivedb.h|g' | \
|
||||
$(MAN_ATTRIBUTELOG) | \
|
||||
$(MAN_CAPABILITIES) | \
|
||||
$(MAN_DRIVEDB) | \
|
||||
@ -567,11 +604,11 @@ MAN2HTML = man2html
|
||||
MAN2TXT = groff -man -Tascii -P'-bcou'
|
||||
|
||||
# Remove HTTP header and fix links in man2html output
|
||||
FIXHTML = sed '1s,^Content-type.*,,' \
|
||||
| sed 's,<A HREF="http://[-a-z/]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
|
||||
| sed 's,<A HREF="http://[-a-z/]*/man2html">,<A HREF=".">,g' \
|
||||
| sed 's,<A HREF="http://[-a-z/]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
|
||||
| sed 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
|
||||
FIXHTML = sed -e '1s,^Content-type.*,,' \
|
||||
-e 's,<A HREF="[^"]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
|
||||
-e 's,<A HREF="[^"]*/man2html">,<A HREF=".">,g' \
|
||||
-e 's,<A HREF="[^"]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
|
||||
-e 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
|
||||
|
||||
# Convert man pages into .html and .txt
|
||||
|
||||
@ -612,6 +649,30 @@ check:
|
||||
|
||||
|
||||
if OS_WIN32_MINGW
|
||||
# Windows resources
|
||||
|
||||
smartctl_res.o: smartctl_res.rc
|
||||
$(WINDRES) $< $@
|
||||
|
||||
smartd_res.o: smartd_res.rc syslogevt.rc
|
||||
$(WINDRES) -I. $< $@
|
||||
|
||||
# Convert version for VERSIONINFO resource: 6.1 r3754 -> 6.1.0.3754
|
||||
WIN_RC_FILTER = \
|
||||
( ver=`echo '$(PACKAGE_VERSION).0' | sed -n 's,^\([0-9]*\.[0-9]*\.[0-9]*\).*$$,\1,p'`; \
|
||||
rev=`sed -n 's,^.*REV[^"]*"\([0-9]*\).*$$,\1,p' svnversion.h`; \
|
||||
txtver="$${ver:-0.0.0}.$${rev:-0}"; binver=`echo "$$txtver" | sed 's|\.|,|g'`; \
|
||||
sed -e "s|@BINARY_VERSION@|$$binver|g" -e "s|@TEXT_VERSION@|$$txtver|g"; )
|
||||
|
||||
smartctl_res.rc: os_win32/smartctl_res.rc.in Makefile svnversion.h
|
||||
cat $< | $(WIN_RC_FILTER) > $@
|
||||
|
||||
smartd_res.rc: os_win32/smartd_res.rc.in Makefile svnversion.h
|
||||
cat $< | $(WIN_RC_FILTER) > $@
|
||||
|
||||
syslogevt.rc: os_win32/syslogevt.mc
|
||||
$(WINDMC) -b $<
|
||||
|
||||
# Definitions for Windows distribution
|
||||
|
||||
if OS_WIN64
|
||||
@ -631,13 +692,10 @@ EXEFILES_WIN32 = \
|
||||
$(exedir_win32)/smartctl.exe \
|
||||
$(exedir_win32)/smartctl-nc.exe \
|
||||
$(exedir_win32)/smartd.exe \
|
||||
$(exedir_win32)/smartd_warning.cmd \
|
||||
$(exedir_win32)/runcmda.exe \
|
||||
$(exedir_win32)/runcmdu.exe
|
||||
|
||||
if OS_WIN32_WINDMC
|
||||
EXEFILES_WIN32 += \
|
||||
$(exedir_win32)/syslogevt.exe
|
||||
endif
|
||||
$(exedir_win32)/runcmdu.exe \
|
||||
$(exedir_win32)/wtssendmsg.exe
|
||||
|
||||
if ENABLE_DRIVEDB
|
||||
if OS_WIN32_NSIS
|
||||
@ -649,7 +707,8 @@ endif
|
||||
FILES_WIN32 = \
|
||||
$(EXEFILES_WIN32) \
|
||||
$(docdir_win32)/AUTHORS.txt \
|
||||
$(docdir_win32)/CHANGELOG.txt \
|
||||
$(docdir_win32)/ChangeLog.txt \
|
||||
$(docdir_win32)/ChangeLog-5.0-6.0.txt \
|
||||
$(docdir_win32)/COPYING.txt \
|
||||
$(docdir_win32)/INSTALL.txt \
|
||||
$(docdir_win32)/NEWS.txt \
|
||||
@ -676,8 +735,11 @@ CLEANFILES += \
|
||||
$(FILES_WIN32) \
|
||||
runcmdu.exe \
|
||||
smartctl-nc.exe smartctl-nc.exe.tmp \
|
||||
syslogevt.exe syslogevt.h syslogevt.o \
|
||||
syslogevt.res.o syslogevt.rc syslogevt_*.bin \
|
||||
smartctl_res.rc smartctl_res.o \
|
||||
smartd_res.rc smartd_res.o \
|
||||
syslogevt.h syslogevt.o \
|
||||
syslogevt.rc syslogevt_*.bin \
|
||||
wtssendmsg.exe \
|
||||
update-smart-drivedb.exe \
|
||||
distdir.mkdir
|
||||
|
||||
@ -758,6 +820,10 @@ $(exedir_win32)/%.exe.manifest: $(srcdir)/os_win32/%.exe.manifest
|
||||
$(UNIX2DOS) < $< > $@
|
||||
touch -r $< $@
|
||||
|
||||
$(exedir_win32)/%.cmd: $(srcdir)/os_win32/%.cmd
|
||||
$(UNIX2DOS) < $< > $@
|
||||
touch -r $< $@
|
||||
|
||||
$(docdir_win32)/%.html: %.html
|
||||
$(UNIX2DOS) < $< > $@
|
||||
touch -r $< $@
|
||||
@ -794,36 +860,32 @@ smartctl-nc.exe: smartctl.exe
|
||||
else echo "EXE patch failed"; exit 1; fi
|
||||
mv -f $@.tmp $@
|
||||
|
||||
# Build runcmd?.exe
|
||||
# Build runcmd?.exe and wtssendmsg.exe
|
||||
runcmdu.exe: os_win32/runcmd.c
|
||||
$(CC) -Os -o $@ $<
|
||||
|
||||
if OS_WIN32_WINDMC
|
||||
# Build syslogevt.exe event message file tool
|
||||
wtssendmsg.exe: os_win32/wtssendmsg.c
|
||||
$(CC) -Os -o $@ $< -lwtsapi32
|
||||
|
||||
syslogevt.exe: syslogevt.o syslogevt.res.o
|
||||
$(LINK) $^
|
||||
# Build os_win32/vc10/{config.h,smart*.rc,svnversion.h} for MSVC10 from MinGW files
|
||||
|
||||
syslogevt.o: os_win32/syslogevt.c syslogevt.rc
|
||||
$(CC) -c -I. -Os -o $@ $<
|
||||
config-vc10: $(srcdir)/os_win32/vc10/config.h \
|
||||
$(srcdir)/os_win32/vc10/smartctl_res.rc \
|
||||
$(srcdir)/os_win32/vc10/smartd_res.rc \
|
||||
$(srcdir)/os_win32/vc10/svnversion.h
|
||||
|
||||
syslogevt.res.o: syslogevt.rc
|
||||
$(WINDRES) $< $@
|
||||
|
||||
syslogevt.rc: os_win32/syslogevt.mc
|
||||
$(WINDMC) -b $<
|
||||
endif
|
||||
|
||||
# Build {config,svnversion}_vc10.h for MSVC10 from MinGW {config,svnversion}.h
|
||||
|
||||
config-vc10: $(srcdir)/os_win32/config_vc10.h $(srcdir)/os_win32/svnversion_vc10.h
|
||||
|
||||
$(srcdir)/os_win32/config_vc10.h: config.h Makefile
|
||||
sed -e '1i/* config_vc10.h. Generated from config.h by Makefile. */' \
|
||||
$(srcdir)/os_win32/vc10/config.h: config.h Makefile
|
||||
sed -e '1i/* os_win32/vc10/config.h. Generated from config.h by Makefile. */' \
|
||||
-e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|INTTYPES_H\|[DK_]*NTDDDISK_H\|STRINGS_H\|STRTOULL\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */,' \
|
||||
-e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc10,' $< > $@
|
||||
|
||||
$(srcdir)/os_win32/svnversion_vc10.h: svnversion.h
|
||||
$(srcdir)/os_win32/vc10/svnversion.h: svnversion.h
|
||||
cp $< $@
|
||||
|
||||
$(srcdir)/os_win32/vc10/smartctl_res.rc: smartctl_res.rc
|
||||
cp $< $@
|
||||
|
||||
$(srcdir)/os_win32/vc10/smartd_res.rc: smartd_res.rc
|
||||
cp $< $@
|
||||
|
||||
endif
|
||||
|
67
NEWS
67
NEWS
@ -1,11 +1,73 @@
|
||||
smartmontools NEWS
|
||||
------------------
|
||||
$Id: NEWS 3557 2012-06-04 19:50:21Z chrfranke $
|
||||
$Id: NEWS 3808 2013-04-18 17:30:12Z chrfranke $
|
||||
|
||||
The most up-to-date version of this file is:
|
||||
http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/NEWS?view=markup
|
||||
|
||||
Date <Not released yet, please try current SVN>
|
||||
Summary: smartmontools release 6.2
|
||||
-----------------------------------------------------------
|
||||
- Cygwin: 64-bit compile fixes.
|
||||
|
||||
Date 2013-03-16
|
||||
Summary: smartmontools release 6.1
|
||||
-----------------------------------------------------------
|
||||
- smartctl '-l directory': improved output format.
|
||||
- smartctl: Fix parsing of '-l select,cont+SIZE' option.
|
||||
- smartctl prints ATA Additional Product Id (OEM Id).
|
||||
- smartctl '-s/-g wcache' for SCSI devices to control write cache.
|
||||
- smartctl '-s/-g rcache' for SCSI devices to control read cache.
|
||||
- smartctl prints more info for SCSI devices: media rotation rate,
|
||||
form factor, physical block size, lowest LBA alignement,
|
||||
logical block provisioning, disk protection type
|
||||
and selftest progress status.
|
||||
- smartctl '--identify' updated for latest ATA ACS-3 spec.
|
||||
- smartd runs /etc/smartd_warning.sh to generate warning emails
|
||||
(Windows: smartd_warning.cmd).
|
||||
- smartd '-w PATH' option to specify this executable.
|
||||
- smartd '-d ignore' directive.
|
||||
- smartd DEVICESCAN ignores devices already specified.
|
||||
- smartd: added support for state persistence ('-s') and attribute logging
|
||||
('-A') for SCSI devices.
|
||||
- smartd '-W' directive uses ATA attribute 190 if 194 is missing.
|
||||
- Support of larger SCSI defect lists via READ DEFECT(12).
|
||||
- Device type '-d usbjmicron,p' for Prolific USB bridges.
|
||||
- Many HDD, SSD and USB additions to drive database.
|
||||
- Linux: Support for SAS disks behind Areca controllers.
|
||||
- Linux: Improved support for SATA disks on LSI/Megaraid controllers
|
||||
- Linux: disks on MegaRaid controllers are automatically scanned
|
||||
- FreeBSD: Support for SAS disks behind Areca controllers.
|
||||
- FreeBSD: Enhanced ATA command support for 3ware.
|
||||
- FreeBSD: Support for 3ware 9750 (/dev/twsX).
|
||||
- FreeBSD: Fixed support for 48-bit ATA commands on legacy controllers
|
||||
with ATACAM driver.
|
||||
- FreeBSD: Improved support for SAS/SCSI disks on LSI/Megaraid controllers.
|
||||
- Windows: smartd.conf '-M exec' supports path names with spaces.
|
||||
- Windows: Tool wtssendmsg.exe to handle smartd.conf '-m console'.
|
||||
- Windows: DEVICESCAN now supports up to 128 drives.
|
||||
- Windows: smartctl.exe and smartd.exe include VERSIONINFO resource.
|
||||
- Windows: smartd.exe includes MESSAGETABLE resource.
|
||||
- Windows: syslogevt.exe is no longer provided.
|
||||
|
||||
Date 2012-10-10
|
||||
Summary: smartmontools release 6.0
|
||||
-----------------------------------------------------------
|
||||
- option/directive '-F nologdir' and '-F xerrorlba'.
|
||||
- smartctl '--identify' option.
|
||||
- smartctl prints nominal media rotation rate (ATA).
|
||||
- smartctl prints SATA version and speed.
|
||||
- smartctl '-l sataphy' works for CD/DVD drives also.
|
||||
- smartctl '-x' includes ATA Device Statistics.
|
||||
- smartd warning emails include device identify info.
|
||||
- smartd '-d' output is flushed to support redirection.
|
||||
- HDD, SSD and USB additions to drive database.
|
||||
- Windows smartd: smartd.conf directives '-m console',
|
||||
'-m active', '-m connected'.
|
||||
- Windows: Support for SAS disks behind Areca controllers.
|
||||
- Windows: Win9x/ME and NT4 are no longer supported.
|
||||
|
||||
Date 2012-06-30
|
||||
Summary: smartmontools release 5.43
|
||||
-----------------------------------------------------------
|
||||
- smartctl options '-g, --get' and '-s, --set' to get/set
|
||||
@ -21,7 +83,8 @@ Summary: smartmontools release 5.43
|
||||
- Controller-independent SAT detection: '-d sat,auto[+TYPE]'.
|
||||
- smartd.conf DEFAULT directive.
|
||||
- Many HDD, SSD and USB additions to drive database.
|
||||
- Linux and FreeBSD: Support for SATA disks behind Areca SAS controllers.
|
||||
- Linux and FreeBSD: Support for SATA disks behind Areca SAS
|
||||
RAID controllers and HP Smart Array controllers.
|
||||
- Windows: Support for SATA disks behind Areca controllers.
|
||||
- Windows smartd: directives '-l offlinests,ns' and
|
||||
'-l selfteststs,ns'.
|
||||
|
6
README
6
README
@ -3,7 +3,7 @@ smartmontools - S.M.A.R.T. utility toolset for Darwin/Mac
|
||||
OSX, FreeBSD, Linux, NetBSD, OpenBSD, Solaris, and Windows.
|
||||
==========================================================
|
||||
|
||||
$Id: README 2844 2009-07-18 12:59:21Z chrfranke $
|
||||
$Id: README 3727 2012-12-13 17:23:06Z samm2 $
|
||||
|
||||
== HOME ==
|
||||
The home for smartmontools is located at:
|
||||
@ -27,8 +27,8 @@ Software Foundation; either version 2, or (at your option) any later
|
||||
version.
|
||||
|
||||
You should have received a copy of the GNU General Public License (for
|
||||
example COPYING); if not, write to the Free Software Foundation, Inc., 675
|
||||
Mass Ave, Cambridge, MA 02139, USA.
|
||||
example COPYING); if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
== CREDITS ==
|
||||
|
231
atacmdnames.cpp
231
atacmdnames.cpp
@ -1,13 +1,10 @@
|
||||
/*
|
||||
* atacmdnames.cpp
|
||||
*
|
||||
* This module is based on the T13/1532D Volume 1 Revision 3 (ATA/ATAPI-7)
|
||||
* specification, which is available from http://www.t13.org/#FTP_site
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
* Address of support mailing list: smartmontools-support@lists.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2003-8 Philip Williams
|
||||
* Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -15,8 +12,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -24,32 +20,33 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COMMAND_TABLE_SIZE 256
|
||||
|
||||
const char *atacmdnames_c_cvsid="$Id: atacmdnames.cpp,v 1.17 2008/03/29 23:41:28 shattered Exp $" ATACMDNAMES_H_CVSID;
|
||||
const char * atacmdnames_cpp_cvsid = "$Id: atacmdnames.cpp 3670 2012-10-31 22:00:50Z chrfranke $"
|
||||
ATACMDNAMES_H_CVSID;
|
||||
|
||||
const char cmd_reserved[] = "[RESERVED]";
|
||||
const char cmd_vendor_specific[] = "[VENDOR SPECIFIC]";
|
||||
const char cmd_reserved_sa[] = "[RESERVED FOR SERIAL ATA]";
|
||||
const char cmd_reserved_cf[] = "[RESERVED FOR COMPACTFLASH ASSOCIATION]";
|
||||
const char cmd_reserved_mcpt[] = "[RESERVED FOR MEDIA CARD PASS THROUGH]";
|
||||
const char cmd_reserved_mcpt[] = "[RESERVED FOR MEDIA CARD PASS THROUGH]"; // ACS-3: Reserved
|
||||
const char cmd_recalibrate_ret4[]= "RECALIBRATE [RET-4]";
|
||||
const char cmd_seek_ret4[] = "SEEK [RET-4]";
|
||||
|
||||
const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
// Tables B.3 and B.4 of T13/2161-D (ACS-3) Revision 4, September 4, 2012
|
||||
|
||||
const char * const command_table[] = {
|
||||
/*-------------------------------------------------- 00h-0Fh -----*/
|
||||
"NOP",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"CFA REQUEST EXTENDED ERROR CODE",
|
||||
cmd_reserved,
|
||||
"CFA REQUEST EXTENDED ERROR",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"DATA SET MANAGEMENT", // ACS-2
|
||||
cmd_reserved,
|
||||
"DEVICE RESET",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"REQUEST SENSE DATA EXT", // ACS-2
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
@ -74,46 +71,46 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
/*-------------------------------------------------- 20h-2Fh -----*/
|
||||
"READ SECTOR(S)",
|
||||
"READ SECTOR(S) [OBS-5]",
|
||||
"READ LONG (w/ retry) [OBS-4]",
|
||||
"READ LONG [OBS-4]",
|
||||
"READ LONG (w/o retry) [OBS-4]",
|
||||
"READ SECTOR(S) EXT",
|
||||
"READ DMA EXT",
|
||||
"READ DMA QUEUED EXT",
|
||||
"READ NATIVE MAX ADDRESS EXT",
|
||||
"READ DMA QUEUED EXT [OBS-ACS-2]",
|
||||
"READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]",
|
||||
cmd_reserved,
|
||||
"READ MULTIPLE EXT",
|
||||
"READ STREAM DMA",
|
||||
"READ STREAM PIO",
|
||||
"READ STREAM",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"READ LOG EXT",
|
||||
/*-------------------------------------------------- 30h-3Fh -----*/
|
||||
"WRITE SECTOR(S)",
|
||||
"WRITE SECTOR(S) [OBS-5]",
|
||||
"WRITE LONG(w/ retry) [OBS-4]",
|
||||
"WRITE LONG(w/o retry) [OBS-4]",
|
||||
"WRITE SECTOR(S) (w/o retry) [OBS-5]",
|
||||
"WRITE LONG [OBS-4]",
|
||||
"WRITE LONG (w/o retry) [OBS-4]",
|
||||
"WRITE SECTORS(S) EXT",
|
||||
"WRITE DMA EXT",
|
||||
"WRITE DMA QUEUED EXT",
|
||||
"SET MAX ADDRESS EXT",
|
||||
"WRITE DMA QUEUED EXT [OBS-ACS-2]",
|
||||
"SET NATIVE MAX ADDRESS EXT [OBS-ACS-3]",
|
||||
"CFA WRITE SECTORS WITHOUT ERASE",
|
||||
"WRITE MULTIPLE EXT",
|
||||
"WRITE STREAM DMA",
|
||||
"WRITE STREAM PIO",
|
||||
"WRITE STREAM",
|
||||
"WRITE VERIFY [OBS-4]",
|
||||
"WRITE DMA FUA EXT",
|
||||
"WRITE DMA QUEUED FUA EXT",
|
||||
"WRITE DMA QUEUED FUA EXT [OBS-ACS-2]",
|
||||
"WRITE LOG EXT",
|
||||
/*-------------------------------------------------- 40h-4Fh -----*/
|
||||
"READ VERIFY SECTOR(S)",
|
||||
"READ VERIFY SECTOR(S) [OBS-5]",
|
||||
"READ VERIFY SECTOR(S) (w/o retry) [OBS-5]",
|
||||
"READ VERIFY SECTOR(S) EXT",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"WRITE UNCORRECTABLE EXT", // ATA-8
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"READ LOG DMA EXT", // ATA-8
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
@ -130,22 +127,22 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"WRITE LOG DMA EXT", // ATA-8
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"TRUSTED NON-DATA", // ATA-8
|
||||
"TRUSTED RECEIVE", // ATA-8
|
||||
"TRUSTED RECEIVE DMA", // ATA-8
|
||||
"TRUSTED SEND", // ATA-8
|
||||
"TRUSTED SEND DMA", // ATA-8
|
||||
/*-------------------------------------------------- 60h-6Fh -----*/
|
||||
"READ FPDMA QUEUED",
|
||||
"WRITE FPDMA QUEUED",
|
||||
cmd_reserved_sa,
|
||||
cmd_reserved_sa,
|
||||
cmd_reserved_sa,
|
||||
"READ FPDMA QUEUED", // ATA-8
|
||||
"WRITE FPDMA QUEUED", // ATA-8
|
||||
cmd_reserved_sa,
|
||||
"NCQ QUEUE MANAGEMENT", // ACS-3
|
||||
"SEND FPDMA QUEUED", // ACS-3
|
||||
"RECEIVE FPDMA QUEUED", // ACS-3
|
||||
cmd_reserved_sa,
|
||||
cmd_reserved_sa,
|
||||
cmd_reserved,
|
||||
@ -164,8 +161,8 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
cmd_seek_ret4,
|
||||
cmd_seek_ret4,
|
||||
cmd_seek_ret4,
|
||||
cmd_seek_ret4,
|
||||
cmd_seek_ret4,
|
||||
"SET DATE & TIME EXT", // ACS-3
|
||||
"ACCESSIBLE MAX ADDRESS CONFIGURATION", // ACS-3
|
||||
cmd_seek_ret4,
|
||||
cmd_seek_ret4,
|
||||
cmd_seek_ret4,
|
||||
@ -194,7 +191,7 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
"EXECUTE DEVICE DIAGNOSTIC",
|
||||
"INITIALIZE DEVICE PARAMETERS [OBS-6]",
|
||||
"DOWNLOAD MICROCODE",
|
||||
cmd_reserved,
|
||||
"DOWNLOAD MICROCODE DMA", // ACS-2
|
||||
"STANDBY IMMEDIATE [RET-4]",
|
||||
"IDLE IMMEDIATE [RET-4]",
|
||||
"STANDBY [RET-4]",
|
||||
@ -210,7 +207,7 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
/*-------------------------------------------------- A0h-AFh -----*/
|
||||
"PACKET",
|
||||
"IDENTIFY PACKET DEVICE",
|
||||
"SERVICE",
|
||||
"SERVICE [OBS-ACS-2]",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
@ -226,21 +223,21 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
cmd_reserved,
|
||||
/*-------------------------------------------------- B0h-BFh -----*/
|
||||
"SMART",
|
||||
"DEVICE CONFIGURATION",
|
||||
"DEVICE CONFIGURATION [OBS-ACS-3]",
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"SANITIZE DEVICE", // ACS-2
|
||||
cmd_reserved,
|
||||
"NV CACHE [OBS-ACS-3]", // ATA-8
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
cmd_reserved_cf,
|
||||
/*-------------------------------------------------- C0h-CFh -----*/
|
||||
"CFA ERASE SECTORS [VS IF NO CFA]",
|
||||
cmd_vendor_specific,
|
||||
@ -249,18 +246,18 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
"READ MULTIPLE",
|
||||
"WRITE MULTIPLE",
|
||||
"SET MULTIPLE MODE",
|
||||
"READ DMA QUEUED",
|
||||
"READ DMA QUEUED [OBS-ACS-2]",
|
||||
"READ DMA",
|
||||
"READ DMA [OBS-5]",
|
||||
"READ DMA (w/o retry) [OBS-5]",
|
||||
"WRITE DMA",
|
||||
"WRITE DMA [OBS-5]",
|
||||
"WRITE DMA QUEUED",
|
||||
"WRITE DMA (w/o retry) [OBS-5]",
|
||||
"WRITE DMA QUEUED [OBS-ACS-2]",
|
||||
"CFA WRITE MULTIPLE WITHOUT ERASE",
|
||||
"WRITE MULTIPLE FUA EXT",
|
||||
cmd_reserved,
|
||||
/*-------------------------------------------------- D0h-DFh -----*/
|
||||
cmd_reserved,
|
||||
"CHECK MEDIA CARD TYPE",
|
||||
"CHECK MEDIA CARD TYPE [OBS-ACS-2]",
|
||||
cmd_reserved_mcpt,
|
||||
cmd_reserved_mcpt,
|
||||
cmd_reserved_mcpt,
|
||||
@ -269,12 +266,12 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
cmd_reserved,
|
||||
"GET MEDIA STATUS",
|
||||
"GET MEDIA STATUS [OBS-8]",
|
||||
"ACKNOWLEDGE MEDIA CHANGE [RET-4]",
|
||||
"BOOT POST-BOOT [RET-4]",
|
||||
"BOOT PRE-BOOT [RET-4]",
|
||||
"MEDIA LOCK",
|
||||
"MEDIA UNLOCK",
|
||||
"MEDIA LOCK [OBS-8]",
|
||||
"MEDIA UNLOCK [OBS-8]",
|
||||
/*-------------------------------------------------- E0h-EFh -----*/
|
||||
"STANDBY IMMEDIATE",
|
||||
"IDLE IMMEDIATE",
|
||||
@ -285,14 +282,11 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
"SLEEP",
|
||||
"FLUSH CACHE",
|
||||
"WRITE BUFFER",
|
||||
"WRITE SAME [RET-4]", /* Warning! This command is retired but the value of
|
||||
f_reg is used in look_up_ata_command(). If this
|
||||
command code is reclaimed in a future standard then
|
||||
be sure to update look_up_ata_command(). */
|
||||
"READ BUFFER DMA", // ACS-2 (was: WRITE SAME [RET-4])
|
||||
"FLUSH CACHE EXT",
|
||||
cmd_reserved,
|
||||
"WRITE BUFFER DMA", // ACS-2
|
||||
"IDENTIFY DEVICE",
|
||||
"MEDIA EJECT",
|
||||
"MEDIA EJECT [OBS-8]",
|
||||
"IDENTIFY DEVICE DMA [OBS-4]",
|
||||
"SET FEATURES",
|
||||
/*-------------------------------------------------- F0h-FFh -----*/
|
||||
@ -304,8 +298,8 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
"SECURITY FREEZE LOCK",
|
||||
"SECURITY DISABLE PASSWORD",
|
||||
cmd_vendor_specific,
|
||||
"READ NATIVE MAX ADDRESS",
|
||||
"SET MAX",
|
||||
"READ NATIVE MAX ADDRESS [OBS-ACS-3]",
|
||||
"SET MAX ADDRESS [OBS-ACS-3]",
|
||||
cmd_vendor_specific,
|
||||
cmd_vendor_specific,
|
||||
cmd_vendor_specific,
|
||||
@ -314,6 +308,9 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
cmd_vendor_specific
|
||||
};
|
||||
|
||||
typedef char ASSERT_command_table_size[
|
||||
sizeof(command_table)/sizeof(command_table[0]) == 256 ? 1 : -1];
|
||||
|
||||
/* Returns the name of the command (and possibly sub-command) with the given
|
||||
command code and feature register values. For most command codes this
|
||||
simply returns the corresponding entry in the command_table array, but for
|
||||
@ -321,33 +318,28 @@ const char *command_table[COMMAND_TABLE_SIZE] = {
|
||||
distinguishes commands. */
|
||||
const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
|
||||
|
||||
// check that command table not messed up. The compiler will issue
|
||||
// warnings if there are too many array elements, but won't issue
|
||||
// warnings if there are not enough of them.
|
||||
if (sizeof(command_table) != sizeof(char *)*COMMAND_TABLE_SIZE){
|
||||
fprintf(stderr,
|
||||
"Problem in atacmdnames.c. Command Table command_table[] does\n"
|
||||
"not have %d entries! It has %d entries. Please fix it.\n",
|
||||
COMMAND_TABLE_SIZE, (int)(sizeof(command_table)/sizeof(char *)));
|
||||
abort();
|
||||
}
|
||||
|
||||
switch (c_code) {
|
||||
case 0x00: /* NOP */
|
||||
switch (f_reg) {
|
||||
case 0x00:
|
||||
return "NOP [Abort queued commands]";
|
||||
case 0x01:
|
||||
return "NOP [Don't abort queued commands]";
|
||||
return "NOP [Don't abort queued commands] [OBS-ACS-2]";
|
||||
default:
|
||||
return "NOP [Reserved subcommand]";
|
||||
return "NOP [Reserved subcommand] [OBS-ACS-2]";
|
||||
}
|
||||
case 0x92: /* DOWNLOAD MICROCODE */
|
||||
switch (f_reg) {
|
||||
case 0x01:
|
||||
return "DOWNLOAD MICROCODE [Temporary]";
|
||||
return "DOWNLOAD MICROCODE [Temporary] [OBS-8]";
|
||||
case 0x03:
|
||||
return "DOWNLOAD MICROCODE [Save with offsets]"; // ATA-8
|
||||
case 0x07:
|
||||
return "DOWNLOAD MICROCODE [Save]";
|
||||
case 0x0e:
|
||||
return "DOWNLOAD MICROCODE [Save for future use]"; // ACS-3
|
||||
case 0x0f:
|
||||
return "DOWNLOAD MICROCODE [Activate]"; // ACS-3
|
||||
default:
|
||||
return "DOWNLOAD MICROCODE [Reserved subcommand]";
|
||||
}
|
||||
@ -379,36 +371,27 @@ const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
|
||||
return "SMART EN/DISABLE AUTO OFFLINE [NS (SFF-8035i)]";
|
||||
default:
|
||||
if (f_reg >= 0xE0)
|
||||
return "[Vendor specific SMART command]";
|
||||
return "SMART [Vendor specific subcommand]";
|
||||
else
|
||||
return "[Reserved SMART command]";
|
||||
return "SMART [Reserved subcommand]";
|
||||
}
|
||||
case 0xB1: /* DEVICE CONFIGURATION */
|
||||
switch (f_reg) {
|
||||
case 0xC0:
|
||||
return "DEVICE CONFIGURATION RESTORE";
|
||||
return "DEVICE CONFIGURATION RESTORE [OBS-ACS-3]";
|
||||
case 0xC1:
|
||||
return "DEVICE CONFIGURATION FREEZE LOCK";
|
||||
return "DEVICE CONFIGURATION FREEZE LOCK [OBS-ACS-3]";
|
||||
case 0xC2:
|
||||
return "DEVICE CONFIGURATION IDENTIFY";
|
||||
return "DEVICE CONFIGURATION IDENTIFY [OBS-ACS-3]";
|
||||
case 0xC3:
|
||||
return "DEVICE CONFIGURATION SET";
|
||||
return "DEVICE CONFIGURATION SET [OBS-ACS-3]";
|
||||
default:
|
||||
return "DEVICE CONFIGURATION [Reserved command]";
|
||||
}
|
||||
case 0xE9: /* WRITE SAME */
|
||||
switch (f_reg) {
|
||||
case 0x22:
|
||||
return "WRITE SAME [Start specified] [RET-4]";
|
||||
case 0xDD:
|
||||
return "WRITE SAME [Start unspecified] [RET-4]";
|
||||
default:
|
||||
return "WRITE SAME [Invalid subcommand] [RET-4]";
|
||||
return "DEVICE CONFIGURATION [Reserved subcommand] [OBS-ACS-3]";
|
||||
}
|
||||
case 0xEF: /* SET FEATURES */
|
||||
switch (f_reg) {
|
||||
case 0x01:
|
||||
return "SET FEATURES [Enable 8-bit PIO]";
|
||||
return "SET FEATURES [Enable 8-bit PIO] [OBS-3]"; // Now CFA
|
||||
case 0x02:
|
||||
return "SET FEATURES [Enable write cache]";
|
||||
case 0x03:
|
||||
@ -422,39 +405,45 @@ const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
|
||||
case 0x07:
|
||||
return "SET FEATURES [Set device spin-up]";
|
||||
case 0x09:
|
||||
return "SET FEATURES [Reserved (address offset)]";
|
||||
return "SET FEATURES [Reserved (address offset)] [OPS-ACS-3]";
|
||||
case 0x0A:
|
||||
return "SET FEATURES [Enable CFA power mode 1]";
|
||||
case 0x10:
|
||||
return "SET FEATURES [Reserved for Serial ATA]";
|
||||
return "SET FEATURES [Enable SATA feature]"; // ACS-3
|
||||
case 0x20:
|
||||
return "SET FEATURES [Set Time-ltd R/W WCT]";
|
||||
case 0x21:
|
||||
return "SET FEATURES [Set Time-ltd R/W EH]";
|
||||
case 0x31:
|
||||
return "SET FEATURES [Disable Media Status Notf]";
|
||||
return "SET FEATURES [Disable Media Status Notf] [OBS-8]";
|
||||
case 0x33:
|
||||
return "SET FEATURES [Disable retry] [OBS-4]";
|
||||
case 0x41:
|
||||
return "SET FEATURES [Enable Free-fall Control]"; // ATA-8
|
||||
case 0x42:
|
||||
return "SET FEATURES [Enable AAM]";
|
||||
return "SET FEATURES [Enable AAM] [OBS-ACS-2]";
|
||||
case 0x43:
|
||||
return "SET FEATURES [Set Max Host I/F S Times]";
|
||||
case 0x44:
|
||||
return "SET FEATURES [Length of VS data] [OBS-4]";
|
||||
case 0x4a:
|
||||
return "SET FEATURES [Ext. Power Conditions]"; // ACS-2
|
||||
case 0x54:
|
||||
return "SET FEATURES [Set cache segs] [OBS-4]";
|
||||
case 0x55:
|
||||
return "SET FEATURES [Disable read look-ahead]";
|
||||
case 0x5D:
|
||||
return "SET FEATURES [Enable release interrupt]";
|
||||
return "SET FEATURES [Enable release interrupt] [OBS-ACS-2]";
|
||||
case 0x5E:
|
||||
return "SET FEATURES [Enable SERVICE interrupt]";
|
||||
return "SET FEATURES [Enable SERVICE interrupt] [OBS-ACS-2]";
|
||||
case 0x66:
|
||||
return "SET FEATURES [Disable revert defaults]";
|
||||
case 0x69:
|
||||
return "SET FEATURES [LPS Error Reporting Control]"; // ACS-2
|
||||
case 0x77:
|
||||
return "SET FEATURES [Disable ECC] [OBS-4]";
|
||||
case 0x81:
|
||||
return "SET FEATURES [Disable 8-bit PIO]";
|
||||
return "SET FEATURES [Disable 8-bit PIO] [OBS-3]"; // Now CFA
|
||||
case 0x82:
|
||||
return "SET FEATURES [Disable write cache]";
|
||||
case 0x84:
|
||||
@ -470,9 +459,9 @@ const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
|
||||
case 0x8A:
|
||||
return "SET FEATURES [Disable CFA power mode 1]";
|
||||
case 0x90:
|
||||
return "SET FEATURES [Reserved for Serial ATA]";
|
||||
return "SET FEATURES [Disable SATA feature]"; // ACS-3
|
||||
case 0x95:
|
||||
return "SET FEATURES [Enable Media Status Notf]";
|
||||
return "SET FEATURES [Enable Media Status Notf] [OBS-8]";
|
||||
case 0x99:
|
||||
return "SET FEATURES [Enable retries] [OBS-4]";
|
||||
case 0x9A:
|
||||
@ -483,16 +472,20 @@ const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
|
||||
return "SET FEATURES [Set max prefetch] [OBS-4]";
|
||||
case 0xBB:
|
||||
return "SET FEATURES [4 bytes VS data] [OBS-4]";
|
||||
case 0xC1:
|
||||
return "SET FEATURES [Disable Free-fall Control]"; // ATA-8
|
||||
case 0xC2:
|
||||
return "SET FEATURES [Disable AAM]";
|
||||
return "SET FEATURES [Disable AAM] [OBS-ACS-2]";
|
||||
case 0xC3:
|
||||
return "SET FEATURES [Sense Data Reporting]"; // ACS-2
|
||||
case 0xCC:
|
||||
return "SET FEATURES [Enable revert to defaults]";
|
||||
case 0xDD:
|
||||
return "SET FEATURES [Disable release interrupt]";
|
||||
return "SET FEATURES [Disable release interrupt] [OBS-ACS-2]";
|
||||
case 0xDE:
|
||||
return "SET FEATURES [Disable SERVICE interrupt]";
|
||||
return "SET FEATURES [Disable SERVICE interrupt] [OBS-ACS-2]";
|
||||
case 0xE0:
|
||||
return "SET FEATURES [Obsolete subcommand]";
|
||||
return "SET FEATURES [Vendor specific] [OBS-7]";
|
||||
default:
|
||||
if (f_reg >= 0xF0)
|
||||
return "SET FEATURES [Reserved for CFA]";
|
||||
@ -504,15 +497,15 @@ const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
|
||||
case 0x00:
|
||||
return "SET MAX ADDRESS [OBS-6]";
|
||||
case 0x01:
|
||||
return "SET MAX SET PASSWORD";
|
||||
return "SET MAX SET PASSWORD [OBS-ACS-3]";
|
||||
case 0x02:
|
||||
return "SET MAX LOCK";
|
||||
return "SET MAX LOCK [OBS-ACS-3]";
|
||||
case 0x03:
|
||||
return "SET MAX UNLOCK";
|
||||
return "SET MAX UNLOCK [OBS-ACS-3]";
|
||||
case 0x04:
|
||||
return "SET MAX FREEZE LOCK";
|
||||
return "SET MAX FREEZE LOCK [OBS-ACS-3]";
|
||||
default:
|
||||
return "[Reserved SET MAX command]";
|
||||
return "SET MAX [Reserved subcommand] [OBS-ACS-3]";
|
||||
}
|
||||
default:
|
||||
return command_table[c_code];
|
||||
|
@ -15,15 +15,15 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ATACMDNAMES_H_
|
||||
#define ATACMDNAMES_H_
|
||||
|
||||
#define ATACMDNAMES_H_CVSID "$Id: atacmdnames.h,v 1.6 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define ATACMDNAMES_H_CVSID "$Id: atacmdnames.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
/* Returns the name of the command (and possibly sub-command) with the given
|
||||
command code and feature register values. */
|
||||
|
397
atacmds.cpp
397
atacmds.cpp
@ -4,7 +4,7 @@
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2002-11 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
|
||||
* Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
|
||||
*
|
||||
@ -14,8 +14,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -36,7 +35,7 @@
|
||||
#include "utility.h"
|
||||
#include "dev_ata_cmd_set.h" // for parsed_ata_device
|
||||
|
||||
const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 3528 2012-03-25 17:13:47Z chrfranke $"
|
||||
const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 3777 2013-02-19 18:32:15Z samm2 $"
|
||||
ATACMDS_H_CVSID;
|
||||
|
||||
// Print ATA debug messages?
|
||||
@ -57,103 +56,6 @@ bool dont_print_serial_number = false;
|
||||
#define SRET_STATUS_HI_EXCEEDED 0x2C
|
||||
#define SRET_STATUS_MID_EXCEEDED 0xF4
|
||||
|
||||
// These Drive Identity tables are taken from hdparm 5.2, and are also
|
||||
// given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note
|
||||
// that SMART was first added into the ATA/ATAPI-3 Standard with
|
||||
// Revision 3 of the document, July 25, 1995. Look at the "Document
|
||||
// Status" revision commands at the beginning of
|
||||
// http://www.t13.org/Documents/UploadedDocuments/project/d2008r7b-ATA-3.pdf
|
||||
// to see this.
|
||||
#define NOVAL_0 0x0000
|
||||
#define NOVAL_1 0xffff
|
||||
/* word 81: minor version number */
|
||||
#define MINOR_MAX 0x22
|
||||
static const char * const minor_str[] = { /* word 81 value: */
|
||||
"Device does not report version", /* 0x0000 */
|
||||
"ATA-1 X3T9.2 781D prior to revision 4", /* 0x0001 */
|
||||
"ATA-1 published, ANSI X3.221-1994", /* 0x0002 */
|
||||
"ATA-1 X3T9.2 781D revision 4", /* 0x0003 */
|
||||
"ATA-2 published, ANSI X3.279-1996", /* 0x0004 */
|
||||
"ATA-2 X3T10 948D prior to revision 2k", /* 0x0005 */
|
||||
"ATA-3 X3T10 2008D revision 1", /* 0x0006 */ /* SMART NOT INCLUDED */
|
||||
"ATA-2 X3T10 948D revision 2k", /* 0x0007 */
|
||||
"ATA-3 X3T10 2008D revision 0", /* 0x0008 */
|
||||
"ATA-2 X3T10 948D revision 3", /* 0x0009 */
|
||||
"ATA-3 published, ANSI X3.298-199x", /* 0x000a */
|
||||
"ATA-3 X3T10 2008D revision 6", /* 0x000b */ /* 1st VERSION WITH SMART */
|
||||
"ATA-3 X3T13 2008D revision 7 and 7a", /* 0x000c */
|
||||
"ATA/ATAPI-4 X3T13 1153D revision 6", /* 0x000d */
|
||||
"ATA/ATAPI-4 T13 1153D revision 13", /* 0x000e */
|
||||
"ATA/ATAPI-4 X3T13 1153D revision 7", /* 0x000f */
|
||||
"ATA/ATAPI-4 T13 1153D revision 18", /* 0x0010 */
|
||||
"ATA/ATAPI-4 T13 1153D revision 15", /* 0x0011 */
|
||||
"ATA/ATAPI-4 published, ANSI NCITS 317-1998", /* 0x0012 */
|
||||
"ATA/ATAPI-5 T13 1321D revision 3", /* 0x0013 */
|
||||
"ATA/ATAPI-4 T13 1153D revision 14", /* 0x0014 */
|
||||
"ATA/ATAPI-5 T13 1321D revision 1", /* 0x0015 */
|
||||
"ATA/ATAPI-5 published, ANSI NCITS 340-2000", /* 0x0016 */
|
||||
"ATA/ATAPI-4 T13 1153D revision 17", /* 0x0017 */
|
||||
"ATA/ATAPI-6 T13 1410D revision 0", /* 0x0018 */
|
||||
"ATA/ATAPI-6 T13 1410D revision 3a", /* 0x0019 */
|
||||
"ATA/ATAPI-7 T13 1532D revision 1", /* 0x001a */
|
||||
"ATA/ATAPI-6 T13 1410D revision 2", /* 0x001b */
|
||||
"ATA/ATAPI-6 T13 1410D revision 1", /* 0x001c */
|
||||
"ATA/ATAPI-7 published, ANSI INCITS 397-2005",/* 0x001d */
|
||||
"ATA/ATAPI-7 T13 1532D revision 0", /* 0x001e */
|
||||
"reserved", /* 0x001f */
|
||||
"reserved", /* 0x0020 */
|
||||
"ATA/ATAPI-7 T13 1532D revision 4a", /* 0x0021 */
|
||||
"ATA/ATAPI-6 published, ANSI INCITS 361-2002" /* 0x0022 */
|
||||
};
|
||||
|
||||
// NOTE ATA/ATAPI-4 REV 4 was the LAST revision where the device
|
||||
// attribute structures were NOT completely vendor specific. So any
|
||||
// disk that is ATA/ATAPI-4 or above can not be trusted to show the
|
||||
// vendor values in sensible format.
|
||||
|
||||
// Negative values below are because it doesn't support SMART
|
||||
static const int actual_ver[] = {
|
||||
/* word 81 value: */
|
||||
0, /* 0x0000 WARNING: */
|
||||
1, /* 0x0001 WARNING: */
|
||||
1, /* 0x0002 WARNING: */
|
||||
1, /* 0x0003 WARNING: */
|
||||
2, /* 0x0004 WARNING: This array */
|
||||
2, /* 0x0005 WARNING: corresponds */
|
||||
-3, /*<== */ /* 0x0006 WARNING: *exactly* */
|
||||
2, /* 0x0007 WARNING: to the ATA/ */
|
||||
-3, /*<== */ /* 0x0008 WARNING: ATAPI version */
|
||||
2, /* 0x0009 WARNING: listed in */
|
||||
3, /* 0x000a WARNING: the */
|
||||
3, /* 0x000b WARNING: minor_str */
|
||||
3, /* 0x000c WARNING: array */
|
||||
4, /* 0x000d WARNING: above. */
|
||||
4, /* 0x000e WARNING: */
|
||||
4, /* 0x000f WARNING: If you change */
|
||||
4, /* 0x0010 WARNING: that one, */
|
||||
4, /* 0x0011 WARNING: change this one */
|
||||
4, /* 0x0012 WARNING: too!!! */
|
||||
5, /* 0x0013 WARNING: */
|
||||
4, /* 0x0014 WARNING: */
|
||||
5, /* 0x0015 WARNING: */
|
||||
5, /* 0x0016 WARNING: */
|
||||
4, /* 0x0017 WARNING: */
|
||||
6, /* 0x0018 WARNING: */
|
||||
6, /* 0x0019 WARNING: */
|
||||
7, /* 0x001a WARNING: */
|
||||
6, /* 0x001b WARNING: */
|
||||
6, /* 0x001c WARNING: */
|
||||
7, /* 0x001d WARNING: */
|
||||
7, /* 0x001e WARNING: */
|
||||
0, /* 0x001f WARNING: */
|
||||
0, /* 0x0020 WARNING: */
|
||||
7, /* 0x0021 WARNING: */
|
||||
6 /* 0x0022 WARNING: */
|
||||
};
|
||||
|
||||
// Compile time check of above array sizes
|
||||
typedef char assert_sizeof_minor_str [sizeof(minor_str) /sizeof(minor_str[0]) == MINOR_MAX+1 ? 1 : -1];
|
||||
typedef char assert_sizeof_actual_ver[sizeof(actual_ver)/sizeof(actual_ver[0]) == MINOR_MAX+1 ? 1 : -1];
|
||||
|
||||
// Get ID and increase flag of current pending or offline
|
||||
// uncorrectable attribute.
|
||||
@ -246,7 +148,7 @@ const char * map_old_vendor_opts[][2] = {
|
||||
{"198,increasing" , "198,raw48+,Total_Offl_Uncorrectabl"}, // '+' sets flag
|
||||
{"200,writeerrorcount" , "200,raw48,Write_Error_Count"},
|
||||
{"201,detectedtacount" , "201,raw48,Detected_TA_Count"},
|
||||
{"220,temp" , "220,raw48,Temperature_Celsius"},
|
||||
{"220,temp" , "220,tempminmax,Temperature_Celsius"},
|
||||
};
|
||||
|
||||
const unsigned num_old_vendor_opts = sizeof(map_old_vendor_opts)/sizeof(map_old_vendor_opts[0]);
|
||||
@ -327,7 +229,7 @@ bool parse_attribute_def(const char * opt, ata_vendor_attr_defs & defs,
|
||||
defs[i].priority = priority;
|
||||
defs[i].raw_format = format;
|
||||
defs[i].flags = flags;
|
||||
strcpy(defs[i].byteorder, byteorder);
|
||||
snprintf(defs[i].byteorder, sizeof(defs[i].byteorder), "%s", byteorder);
|
||||
}
|
||||
}
|
||||
else if (defs[id].priority <= priority) {
|
||||
@ -337,7 +239,7 @@ bool parse_attribute_def(const char * opt, ata_vendor_attr_defs & defs,
|
||||
defs[id].raw_format = format;
|
||||
defs[id].priority = priority;
|
||||
defs[id].flags = flags;
|
||||
strcpy(defs[id].byteorder, byteorder);
|
||||
snprintf(defs[id].byteorder, sizeof(defs[id].byteorder), "%s", byteorder);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -359,6 +261,35 @@ std::string create_vendor_attribute_arg_list()
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
// Parse firmwarebug def (-F option).
|
||||
// Return false on error.
|
||||
bool parse_firmwarebug_def(const char * opt, firmwarebug_defs & firmwarebugs)
|
||||
{
|
||||
if (!strcmp(opt, "none"))
|
||||
firmwarebugs.set(BUG_NONE);
|
||||
else if (!strcmp(opt, "nologdir"))
|
||||
firmwarebugs.set(BUG_NOLOGDIR);
|
||||
else if (!strcmp(opt, "samsung"))
|
||||
firmwarebugs.set(BUG_SAMSUNG);
|
||||
else if (!strcmp(opt, "samsung2"))
|
||||
firmwarebugs.set(BUG_SAMSUNG2);
|
||||
else if (!strcmp(opt, "samsung3"))
|
||||
firmwarebugs.set(BUG_SAMSUNG3);
|
||||
else if (!strcmp(opt, "xerrorlba"))
|
||||
firmwarebugs.set(BUG_XERRORLBA);
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Return a string of valid argument words for parse_firmwarebug_def()
|
||||
const char * get_valid_firmwarebug_args()
|
||||
{
|
||||
return "none, nologdir, samsung, samsung2, samsung3, xerrorlba";
|
||||
}
|
||||
|
||||
|
||||
// swap two bytes. Point to low address
|
||||
void swap2(char *location){
|
||||
char tmp=*location;
|
||||
@ -433,17 +364,18 @@ static const char * const commandstrings[]={
|
||||
};
|
||||
|
||||
|
||||
static const char * preg(const ata_register & r, char * buf)
|
||||
static const char * preg(const ata_register & r, char (& buf)[8])
|
||||
{
|
||||
if (!r.is_set())
|
||||
//return "n/a ";
|
||||
return "....";
|
||||
sprintf(buf, "0x%02x", r.val()); return buf;
|
||||
snprintf(buf, sizeof(buf), "0x%02x", r.val());
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void print_regs(const char * prefix, const ata_in_regs & r, const char * suffix = "\n")
|
||||
{
|
||||
char bufs[7][4+1+13];
|
||||
char bufs[7][8];
|
||||
pout("%s FR=%s, SC=%s, LL=%s, LM=%s, LH=%s, DEV=%s, CMD=%s%s", prefix,
|
||||
preg(r.features, bufs[0]), preg(r.sector_count, bufs[1]), preg(r.lba_low, bufs[2]),
|
||||
preg(r.lba_mid, bufs[3]), preg(r.lba_high, bufs[4]), preg(r.device, bufs[5]),
|
||||
@ -452,7 +384,7 @@ static void print_regs(const char * prefix, const ata_in_regs & r, const char *
|
||||
|
||||
static void print_regs(const char * prefix, const ata_out_regs & r, const char * suffix = "\n")
|
||||
{
|
||||
char bufs[7][4+1+13];
|
||||
char bufs[7][8];
|
||||
pout("%sERR=%s, SC=%s, LL=%s, LM=%s, LH=%s, DEV=%s, STS=%s%s", prefix,
|
||||
preg(r.error, bufs[0]), preg(r.sector_count, bufs[1]), preg(r.lba_low, bufs[2]),
|
||||
preg(r.lba_mid, bufs[3]), preg(r.lba_high, bufs[4]), preg(r.device, bufs[5]),
|
||||
@ -672,7 +604,7 @@ int smartcommandhandler(ata_device * device, smart_command_set command, int sele
|
||||
}
|
||||
else {
|
||||
// We haven't gotten output that makes sense; print out some debugging info
|
||||
pout("Error SMART Status command failed\n");
|
||||
pout("SMART Status command failed\n");
|
||||
pout("Please get assistance from %s\n", PACKAGE_HOMEPAGE);
|
||||
pout("Register values returned from SMART Status command are:\n");
|
||||
print_regs(" ", out.out_regs);
|
||||
@ -883,7 +815,8 @@ bool ata_set_features(ata_device * device, unsigned char features,
|
||||
// capable). The value of the integer helps identify the type of
|
||||
// Packet device, which is useful so that the user can connect the
|
||||
// formal device number with whatever object is inside their computer.
|
||||
int ata_read_identity(ata_device * device, ata_identify_device * buf, bool fix_swapped_id)
|
||||
int ata_read_identity(ata_device * device, ata_identify_device * buf, bool fix_swapped_id,
|
||||
unsigned char * raw_buf /* = 0 */)
|
||||
{
|
||||
unsigned short *rawshort=(unsigned short *)buf;
|
||||
unsigned char *rawbyte =(unsigned char *)buf;
|
||||
@ -909,6 +842,10 @@ int ata_read_identity(ata_device * device, ata_identify_device * buf, bool fix_s
|
||||
swap2((char *)(buf->model+i));
|
||||
}
|
||||
|
||||
// If requested, save raw data before endianness adjustments
|
||||
if (raw_buf)
|
||||
memcpy(raw_buf, buf, sizeof(*buf));
|
||||
|
||||
#ifndef __NetBSD__
|
||||
// if machine is big-endian, swap byte order as needed
|
||||
// NetBSD kernel delivers IDENTIFY data in host byte order
|
||||
@ -963,68 +900,6 @@ int ata_read_identity(ata_device * device, ata_identify_device * buf, bool fix_s
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Returns ATA version as an integer, and a pointer to a string
|
||||
// describing which revision. Note that Revision 0 of ATA-3 does NOT
|
||||
// support SMART. For this one case we return -3 rather than +3 as
|
||||
// the version number. See notes above.
|
||||
int ataVersionInfo(const char ** description, const ata_identify_device * drive, unsigned short * minor)
|
||||
{
|
||||
// get major and minor ATA revision numbers
|
||||
unsigned short major = drive->major_rev_num;
|
||||
*minor=drive->minor_rev_num;
|
||||
|
||||
// First check if device has ANY ATA version information in it
|
||||
if (major==NOVAL_0 || major==NOVAL_1) {
|
||||
*description=NULL;
|
||||
return 0; // No info found
|
||||
}
|
||||
|
||||
// The minor revision number has more information - try there first
|
||||
if (*minor && (*minor<=MINOR_MAX)){
|
||||
int std = actual_ver[*minor];
|
||||
if (std) {
|
||||
*description=minor_str[*minor];
|
||||
return std;
|
||||
}
|
||||
}
|
||||
|
||||
// Try new ATA-8 ACS minor revision numbers.
|
||||
// Table 55 of T13/2015-D Revision 4a (ACS-2), December 9, 2010.
|
||||
// (not in actual_ver/minor_str to avoid large sparse tables)
|
||||
const char *desc;
|
||||
switch (*minor) {
|
||||
case 0x0027: desc = "ATA-8-ACS revision 3c"; break;
|
||||
case 0x0028: desc = "ATA-8-ACS revision 6"; break;
|
||||
case 0x0029: desc = "ATA-8-ACS revision 4"; break;
|
||||
case 0x0031: desc = "ACS-2 revision 2"; break;
|
||||
case 0x0033: desc = "ATA-8-ACS revision 3e"; break;
|
||||
case 0x0039: desc = "ATA-8-ACS revision 4c"; break;
|
||||
case 0x0042: desc = "ATA-8-ACS revision 3f"; break;
|
||||
case 0x0052: desc = "ATA-8-ACS revision 3b"; break;
|
||||
case 0x0107: desc = "ATA-8-ACS revision 2d"; break;
|
||||
case 0x0110: desc = "ACS-2 revision 3"; break;
|
||||
default: desc = 0; break;
|
||||
}
|
||||
if (desc) {
|
||||
*description = desc;
|
||||
return 8;
|
||||
}
|
||||
|
||||
// HDPARM has a very complicated algorithm from here on. Since SMART only
|
||||
// exists on ATA-3 and later standards, let's punt on this. If you don't
|
||||
// like it, please fix it. The code's in CVS.
|
||||
int i;
|
||||
for (i=15; i>0; i--)
|
||||
if (major & (0x1<<i))
|
||||
break;
|
||||
|
||||
*description=NULL;
|
||||
if (i==0)
|
||||
return 1;
|
||||
else
|
||||
return i;
|
||||
}
|
||||
|
||||
// Get World Wide Name (WWN) fields.
|
||||
// Return NAA field or -1 if WWN is unsupported.
|
||||
// Table 34 of T13/1699-D Revision 6a (ATA8-ACS), September 6, 2008.
|
||||
@ -1047,6 +922,23 @@ int ata_get_wwn(const ata_identify_device * id, unsigned & oui, uint64_t & uniqu
|
||||
return (word108 >> 12);
|
||||
}
|
||||
|
||||
// Get nominal media rotation rate.
|
||||
// Returns: 0 = not reported, 1 = SSD, >1 = HDD rpm, < 0 = -(Unknown value)
|
||||
int ata_get_rotation_rate(const ata_identify_device * id)
|
||||
{
|
||||
// Table 37 of T13/1699-D (ATA8-ACS) Revision 6a, September 6, 2008
|
||||
// Table A.31 of T13/2161-D (ACS-3) Revision 3b, August 25, 2012
|
||||
unsigned short word217 = id->words088_255[217-88];
|
||||
if (word217 == 0x0000 || word217 == 0xffff)
|
||||
return 0;
|
||||
else if (word217 == 0x0001)
|
||||
return 1;
|
||||
else if (word217 > 0x0400)
|
||||
return word217;
|
||||
else
|
||||
return -(int)word217;
|
||||
}
|
||||
|
||||
// returns 1 if SMART supported, 0 if SMART unsupported, -1 if can't tell
|
||||
int ataSmartSupport(const ata_identify_device * drive)
|
||||
{
|
||||
@ -1082,7 +974,6 @@ int ataIsSmartEnabled(const ata_identify_device * drive)
|
||||
int ataReadSmartValues(ata_device * device, struct ata_smart_values *data){
|
||||
|
||||
if (smartcommandhandler(device, READ_VALUES, 0, (char *)data)){
|
||||
pout("Error SMART Values Read failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1127,12 +1018,11 @@ static void fixsamsungselftestlog(ata_smart_selftestlog * data)
|
||||
|
||||
// Reads the Self Test Log (log #6)
|
||||
int ataReadSelfTestLog (ata_device * device, ata_smart_selftestlog * data,
|
||||
unsigned char fix_firmwarebug)
|
||||
firmwarebug_defs firmwarebugs)
|
||||
{
|
||||
|
||||
// get data from device
|
||||
if (smartcommandhandler(device, READ_LOG, 0x06, (char *)data)){
|
||||
pout("Error SMART Error Self-Test Log Read failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1141,7 +1031,7 @@ int ataReadSelfTestLog (ata_device * device, ata_smart_selftestlog * data,
|
||||
checksumwarning("SMART Self-Test Log Structure");
|
||||
|
||||
// fix firmware bugs in self-test log
|
||||
if (fix_firmwarebug == FIX_SAMSUNG)
|
||||
if (firmwarebugs.is_set(BUG_SAMSUNG))
|
||||
fixsamsungselftestlog(data);
|
||||
|
||||
// swap endian order if needed
|
||||
@ -1272,7 +1162,6 @@ int ataReadSelectiveSelfTestLog(ata_device * device, struct ata_selective_self_t
|
||||
|
||||
// get data from device
|
||||
if (smartcommandhandler(device, READ_LOG, 0x09, (char *)data)){
|
||||
pout("Error SMART Read Selective Self-Test Log failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1294,9 +1183,6 @@ int ataReadSelectiveSelfTestLog(ata_device * device, struct ata_selective_self_t
|
||||
swap2((char *)&(data->pendingtime));
|
||||
}
|
||||
|
||||
if (data->logversion != 1)
|
||||
pout("Note: selective self-test log revision number (%d) not 1 implies that no selective self-test has ever been run\n", data->logversion);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1315,6 +1201,7 @@ int ataWriteSelectiveSelfTestLog(ata_device * device, ata_selective_selftest_arg
|
||||
struct ata_selective_self_test_log sstlog, *data=&sstlog;
|
||||
unsigned char *ptr=(unsigned char *)data;
|
||||
if (ataReadSelectiveSelfTestLog(device, data)) {
|
||||
pout("SMART Read Selective Self-test Log failed: %s\n", device->get_errmsg());
|
||||
pout("Since Read failed, will not attempt to WRITE Selective Self-test Log\n");
|
||||
return -1;
|
||||
}
|
||||
@ -1325,7 +1212,7 @@ int ataWriteSelectiveSelfTestLog(ata_device * device, ata_selective_selftest_arg
|
||||
// Host is NOT allowed to write selective self-test log if a selective
|
||||
// self-test is in progress.
|
||||
if (0<data->currentspan && data->currentspan<6 && ((sv->self_test_exec_status)>>4)==15) {
|
||||
pout("Error SMART Selective or other Self-Test in progress.\n");
|
||||
pout("SMART Selective or other Self-test in progress\n");
|
||||
return -4;
|
||||
}
|
||||
|
||||
@ -1470,7 +1357,7 @@ int ataWriteSelectiveSelfTestLog(ata_device * device, ata_selective_selftest_arg
|
||||
|
||||
// write new selective self-test log
|
||||
if (smartcommandhandler(device, WRITE_LOG, 0x09, (char *)data)){
|
||||
pout("Error Write Selective Self-Test Log failed: %s\n", device->get_errmsg());
|
||||
pout("Write Selective Self-test Log failed: %s\n", device->get_errmsg());
|
||||
return -3;
|
||||
}
|
||||
|
||||
@ -1512,12 +1399,11 @@ static void fixsamsungerrorlog2(ata_smart_errorlog * data)
|
||||
// Error Log is #2, and the Extended Comprehensive SMART Error log is
|
||||
// #3
|
||||
int ataReadErrorLog (ata_device * device, ata_smart_errorlog *data,
|
||||
unsigned char fix_firmwarebug)
|
||||
firmwarebug_defs firmwarebugs)
|
||||
{
|
||||
|
||||
// get data from device
|
||||
if (smartcommandhandler(device, READ_LOG, 0x01, (char *)data)){
|
||||
pout("Error SMART Error Log Read failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1527,9 +1413,9 @@ int ataReadErrorLog (ata_device * device, ata_smart_errorlog *data,
|
||||
|
||||
// Some disks have the byte order reversed in some SMART Summary
|
||||
// Error log entries
|
||||
if (fix_firmwarebug == FIX_SAMSUNG)
|
||||
if (firmwarebugs.is_set(BUG_SAMSUNG))
|
||||
fixsamsungerrorlog(data);
|
||||
else if (fix_firmwarebug == FIX_SAMSUNG2)
|
||||
else if (firmwarebugs.is_set(BUG_SAMSUNG2))
|
||||
fixsamsungerrorlog2(data);
|
||||
|
||||
// swap endian order if needed
|
||||
@ -1553,9 +1439,34 @@ int ataReadErrorLog (ata_device * device, ata_smart_errorlog *data,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Fix LBA byte ordering of Extended Comprehensive Error Log
|
||||
// if little endian instead of ATA register ordering is provided
|
||||
template <class T>
|
||||
static inline void fix_exterrlog_lba_cmd(T & cmd)
|
||||
{
|
||||
T org = cmd;
|
||||
cmd.lba_mid_register_hi = org.lba_high_register;
|
||||
cmd.lba_low_register_hi = org.lba_mid_register_hi;
|
||||
cmd.lba_high_register = org.lba_mid_register;
|
||||
cmd.lba_mid_register = org.lba_low_register_hi;
|
||||
}
|
||||
|
||||
static void fix_exterrlog_lba(ata_smart_exterrlog * log, unsigned nsectors)
|
||||
{
|
||||
for (unsigned i = 0; i < nsectors; i++) {
|
||||
for (int ei = 0; ei < 4; ei++) {
|
||||
ata_smart_exterrlog_error_log & entry = log[i].error_logs[ei];
|
||||
fix_exterrlog_lba_cmd(entry.error);
|
||||
for (int ci = 0; ci < 5; ci++)
|
||||
fix_exterrlog_lba_cmd(entry.commands[ci]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read Extended Comprehensive Error Log
|
||||
bool ataReadExtErrorLog(ata_device * device, ata_smart_exterrlog * log,
|
||||
unsigned nsectors)
|
||||
unsigned nsectors, firmwarebug_defs firmwarebugs)
|
||||
{
|
||||
if (!ataReadLogExt(device, 0x03, 0x00, 0, log, nsectors))
|
||||
return false;
|
||||
@ -1573,6 +1484,9 @@ bool ataReadExtErrorLog(ata_device * device, ata_smart_exterrlog * log,
|
||||
}
|
||||
}
|
||||
|
||||
if (firmwarebugs.is_set(BUG_XERRORLBA))
|
||||
fix_exterrlog_lba(log, nsectors);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1581,7 +1495,6 @@ int ataReadSmartThresholds (ata_device * device, struct ata_smart_thresholds_pvt
|
||||
|
||||
// get data from device
|
||||
if (smartcommandhandler(device, READ_THRESHOLDS, 0, (char *)data)){
|
||||
pout("Error SMART Thresholds Read failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1598,7 +1511,6 @@ int ataReadSmartThresholds (ata_device * device, struct ata_smart_thresholds_pvt
|
||||
|
||||
int ataEnableSmart (ata_device * device ){
|
||||
if (smartcommandhandler(device, ENABLE, 0, NULL)){
|
||||
pout("Error SMART Enable failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -1607,7 +1519,6 @@ int ataEnableSmart (ata_device * device ){
|
||||
int ataDisableSmart (ata_device * device ){
|
||||
|
||||
if (smartcommandhandler(device, DISABLE, 0, NULL)){
|
||||
pout("Error SMART Disable failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -1615,7 +1526,6 @@ int ataDisableSmart (ata_device * device ){
|
||||
|
||||
int ataEnableAutoSave(ata_device * device){
|
||||
if (smartcommandhandler(device, AUTOSAVE, 241, NULL)){
|
||||
pout("Error SMART Enable Auto-save failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -1624,7 +1534,6 @@ int ataEnableAutoSave(ata_device * device){
|
||||
int ataDisableAutoSave(ata_device * device){
|
||||
|
||||
if (smartcommandhandler(device, AUTOSAVE, 0, NULL)){
|
||||
pout("Error SMART Disable Auto-save failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -1638,7 +1547,6 @@ int ataEnableAutoOffline (ata_device * device){
|
||||
|
||||
/* timer hard coded to 4 hours */
|
||||
if (smartcommandhandler(device, AUTO_OFFLINE, 248, NULL)){
|
||||
pout("Error SMART Enable Automatic Offline failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -1649,7 +1557,6 @@ int ataEnableAutoOffline (ata_device * device){
|
||||
int ataDisableAutoOffline (ata_device * device){
|
||||
|
||||
if (smartcommandhandler(device, AUTO_OFFLINE, 0, NULL)){
|
||||
pout("Error SMART Disable Automatic Offline failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -1730,11 +1637,11 @@ int ataSmartTest(ata_device * device, int testtype, bool force,
|
||||
|
||||
// Print ouf message that we are sending the command to test
|
||||
if (testtype==ABORT_SELF_TEST)
|
||||
sprintf(cmdmsg,"Abort SMART off-line mode self-test routine");
|
||||
snprintf(cmdmsg, sizeof(cmdmsg), "Abort SMART off-line mode self-test routine");
|
||||
else if (!type)
|
||||
sprintf(cmdmsg, "SMART EXECUTE OFF-LINE IMMEDIATE subcommand 0x%02x", testtype);
|
||||
snprintf(cmdmsg, sizeof(cmdmsg), "SMART EXECUTE OFF-LINE IMMEDIATE subcommand 0x%02x", testtype);
|
||||
else
|
||||
sprintf(cmdmsg,"Execute SMART %s routine immediately in %s mode",type,captive);
|
||||
snprintf(cmdmsg, sizeof(cmdmsg), "Execute SMART %s routine immediately in %s mode", type, captive);
|
||||
pout("Sending command: \"%s\".\n",cmdmsg);
|
||||
|
||||
if (select) {
|
||||
@ -2195,8 +2102,13 @@ std::string ata_format_attr_raw_value(const ata_smart_attribute & attr,
|
||||
|
||||
// Attribute names shouldn't be longer than 23 chars, otherwise they break the
|
||||
// output of smartctl.
|
||||
static const char * get_default_attr_name(unsigned char id)
|
||||
static const char * get_default_attr_name(unsigned char id, int rpm)
|
||||
{
|
||||
bool hdd = (rpm > 1), ssd = (rpm == 1);
|
||||
|
||||
static const char Unknown_HDD_Attribute[] = "Unknown_HDD_Attribute";
|
||||
static const char Unknown_SSD_Attribute[] = "Unknown_SSD_Attribute";
|
||||
|
||||
switch (id) {
|
||||
case 1:
|
||||
return "Raw_Read_Error_Rate";
|
||||
@ -2209,36 +2121,48 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
case 5:
|
||||
return "Reallocated_Sector_Ct";
|
||||
case 6:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Read_Channel_Margin";
|
||||
case 7:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Seek_Error_Rate";
|
||||
case 8:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Seek_Time_Performance";
|
||||
case 9:
|
||||
return "Power_On_Hours";
|
||||
case 10:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Spin_Retry_Count";
|
||||
case 11:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Calibration_Retry_Count";
|
||||
case 12:
|
||||
return "Power_Cycle_Count";
|
||||
case 13:
|
||||
return "Read_Soft_Error_Rate";
|
||||
case 175:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Program_Fail_Count_Chip";
|
||||
case 176:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Erase_Fail_Count_Chip";
|
||||
case 177:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Wear_Leveling_Count";
|
||||
case 178:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Used_Rsvd_Blk_Cnt_Chip";
|
||||
case 179:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Used_Rsvd_Blk_Cnt_Tot";
|
||||
case 180:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Unused_Rsvd_Blk_Cnt_Tot";
|
||||
case 181:
|
||||
return "Program_Fail_Cnt_Total";
|
||||
case 182:
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Erase_Fail_Count_Total";
|
||||
case 183:
|
||||
return "Runtime_Bad_Block";
|
||||
@ -2249,6 +2173,7 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
case 188:
|
||||
return "Command_Timeout";
|
||||
case 189:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "High_Fly_Writes";
|
||||
case 190:
|
||||
// Western Digital uses this for temperature.
|
||||
@ -2260,10 +2185,12 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
// 55C sometime in the past.
|
||||
return "Airflow_Temperature_Cel";
|
||||
case 191:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "G-Sense_Error_Rate";
|
||||
case 192:
|
||||
return "Power-Off_Retract_Count";
|
||||
case 193:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Load_Cycle_Count";
|
||||
case 194:
|
||||
return "Temperature_Celsius";
|
||||
@ -2279,11 +2206,14 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
case 199:
|
||||
return "UDMA_CRC_Error_Count";
|
||||
case 200:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
// Western Digital
|
||||
return "Multi_Zone_Error_Rate";
|
||||
case 201:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Soft_Read_Error_Rate";
|
||||
case 202:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
// Fujitsu: "TA_Increase_Count"
|
||||
return "Data_Address_Mark_Errs";
|
||||
case 203:
|
||||
@ -2298,36 +2228,49 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
return "Thermal_Asperity_Rate";
|
||||
case 206:
|
||||
// Fujitsu
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Flying_Height";
|
||||
case 207:
|
||||
// Maxtor
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Spin_High_Current";
|
||||
case 208:
|
||||
// Maxtor
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Spin_Buzz";
|
||||
case 209:
|
||||
// Maxtor
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Offline_Seek_Performnce";
|
||||
case 220:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Disk_Shift";
|
||||
case 221:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "G-Sense_Error_Rate";
|
||||
case 222:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Loaded_Hours";
|
||||
case 223:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Load_Retry_Count";
|
||||
case 224:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Load_Friction";
|
||||
case 225:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Load_Cycle_Count";
|
||||
case 226:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Load-in_Time";
|
||||
case 227:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Torq-amp_Count";
|
||||
case 228:
|
||||
return "Power-off_Retract_Count";
|
||||
case 230:
|
||||
// seen in IBM DTPA-353750
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Head_Amplitude";
|
||||
case 231:
|
||||
return "Temperature_Celsius";
|
||||
@ -2336,8 +2279,10 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
return "Available_Reservd_Space";
|
||||
case 233:
|
||||
// seen in Intel X25-E SSD
|
||||
if (hdd) return Unknown_HDD_Attribute;
|
||||
return "Media_Wearout_Indicator";
|
||||
case 240:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Head_Flying_Hours";
|
||||
case 241:
|
||||
return "Total_LBAs_Written";
|
||||
@ -2346,6 +2291,7 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
case 250:
|
||||
return "Read_Error_Retry_Rate";
|
||||
case 254:
|
||||
if (ssd) return Unknown_SSD_Attribute;
|
||||
return "Free_Fall_Sensor";
|
||||
default:
|
||||
return "Unknown_Attribute";
|
||||
@ -2353,12 +2299,13 @@ static const char * get_default_attr_name(unsigned char id)
|
||||
}
|
||||
|
||||
// Get attribute name
|
||||
std::string ata_get_smart_attr_name(unsigned char id, const ata_vendor_attr_defs & defs)
|
||||
std::string ata_get_smart_attr_name(unsigned char id, const ata_vendor_attr_defs & defs,
|
||||
int rpm /* = 0 */)
|
||||
{
|
||||
if (!defs[id].name.empty())
|
||||
return defs[id].name;
|
||||
else
|
||||
return get_default_attr_name(id);
|
||||
return get_default_attr_name(id, rpm);
|
||||
}
|
||||
|
||||
// Find attribute index for attribute id, -1 if not found.
|
||||
@ -2377,11 +2324,11 @@ int ata_find_attr_index(unsigned char id, const ata_smart_values & smartval)
|
||||
// non-default interpretations. If the Attribute does not exist, return 0
|
||||
unsigned char ata_return_temperature_value(const ata_smart_values * data, const ata_vendor_attr_defs & defs)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
static const unsigned char ids[3] = {194, 9, 220};
|
||||
for (int i = 0; i < 4; i++) {
|
||||
static const unsigned char ids[4] = {194, 190, 9, 220};
|
||||
unsigned char id = ids[i];
|
||||
const ata_attr_raw_format format = defs[id].raw_format;
|
||||
if (!( (id == 194 && format == RAWFMT_DEFAULT)
|
||||
if (!( ((id == 194 || id == 190) && format == RAWFMT_DEFAULT)
|
||||
|| format == RAWFMT_TEMPMINMAX || format == RAWFMT_TEMP10X))
|
||||
continue;
|
||||
int idx = ata_find_attr_index(id, *data);
|
||||
@ -2409,7 +2356,7 @@ int ataReadSCTStatus(ata_device * device, ata_sct_status_response * sts)
|
||||
// read SCT status via SMART log 0xe0
|
||||
memset(sts, 0, sizeof(*sts));
|
||||
if (smartcommandhandler(device, READ_LOG, 0xe0, (char *)sts)){
|
||||
pout("Error Read SCT Status failed: %s\n", device->get_errmsg());
|
||||
pout("Read SCT Status failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2427,7 +2374,7 @@ int ataReadSCTStatus(ata_device * device, ata_sct_status_response * sts)
|
||||
|
||||
// Check format version
|
||||
if (!(sts->format_version == 2 || sts->format_version == 3)) {
|
||||
pout("Error unknown SCT Status format version %u, should be 2 or 3.\n", sts->format_version);
|
||||
pout("Unknown SCT Status format version %u, should be 2 or 3.\n", sts->format_version);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@ -2464,14 +2411,14 @@ int ataReadSCTTempHist(ata_device * device, ata_sct_temperature_history_table *
|
||||
|
||||
// write command via SMART log page 0xe0
|
||||
if (smartcommandhandler(device, WRITE_LOG, 0xe0, (char *)&cmd)){
|
||||
pout("Error Write SCT Data Table command failed: %s\n", device->get_errmsg());
|
||||
pout("Write SCT Data Table failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
// read SCT data via SMART log page 0xe1
|
||||
memset(tmh, 0, sizeof(*tmh));
|
||||
if (smartcommandhandler(device, READ_LOG, 0xe1, (char *)tmh)){
|
||||
pout("Error Read SCT Data Table failed: %s\n", device->get_errmsg());
|
||||
pout("Read SCT Data Table failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2480,7 +2427,7 @@ int ataReadSCTTempHist(ata_device * device, ata_sct_temperature_history_table *
|
||||
return -1;
|
||||
|
||||
if (!(sts->ext_status_code == 0 && sts->action_code == 5 && sts->function_code == 1)) {
|
||||
pout("Error unexpected SCT status 0x%04x (action_code=%u, function_code=%u)\n",
|
||||
pout("Unexpected SCT status 0x%04x (action_code=%u, function_code=%u)\n",
|
||||
sts->ext_status_code, sts->action_code, sts->function_code);
|
||||
return -1;
|
||||
}
|
||||
@ -2490,12 +2437,8 @@ int ataReadSCTTempHist(ata_device * device, ata_sct_temperature_history_table *
|
||||
swapx(&tmh->format_version);
|
||||
swapx(&tmh->sampling_period);
|
||||
swapx(&tmh->interval);
|
||||
}
|
||||
|
||||
// Check format version
|
||||
if (tmh->format_version != 2) {
|
||||
pout("Error unknown SCT Temperature History Format Version (%u), should be 2.\n", tmh->format_version);
|
||||
return -1;
|
||||
swapx(&tmh->cb_index);
|
||||
swapx(&tmh->cb_size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2535,7 +2478,7 @@ int ataSetSCTTempInterval(ata_device * device, unsigned interval, bool persisten
|
||||
|
||||
// write command via SMART log page 0xe0
|
||||
if (smartcommandhandler(device, WRITE_LOG, 0xe0, (char *)&cmd)){
|
||||
pout("Error Write SCT Feature Control Command failed: %s\n", device->get_errmsg());
|
||||
pout("Write SCT Feature Control Command failed: %s\n", device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2544,7 +2487,7 @@ int ataSetSCTTempInterval(ata_device * device, unsigned interval, bool persisten
|
||||
return -1;
|
||||
|
||||
if (!(sts.ext_status_code == 0 && sts.action_code == 4 && sts.function_code == 1)) {
|
||||
pout("Error unexcepted SCT status 0x%04x (action_code=%u, function_code=%u)\n",
|
||||
pout("Unexpected SCT status 0x%04x (action_code=%u, function_code=%u)\n",
|
||||
sts.ext_status_code, sts.action_code, sts.function_code);
|
||||
return -1;
|
||||
}
|
||||
@ -2599,7 +2542,7 @@ static int ataGetSetSCTErrorRecoveryControltime(ata_device * device, unsigned ty
|
||||
|
||||
ata_cmd_out out;
|
||||
if (!device->ata_pass_through(in, out)) {
|
||||
pout("Error Write SCT (%cet) Error Recovery Control Command failed: %s\n",
|
||||
pout("Write SCT (%cet) Error Recovery Control Command failed: %s\n",
|
||||
(!set ? 'G' : 'S'), device->get_errmsg());
|
||||
return -1;
|
||||
}
|
||||
@ -2609,7 +2552,7 @@ static int ataGetSetSCTErrorRecoveryControltime(ata_device * device, unsigned ty
|
||||
return -1;
|
||||
|
||||
if (!(sts.ext_status_code == 0 && sts.action_code == 3 && sts.function_code == (set ? 1 : 2))) {
|
||||
pout("Error unexcepted SCT status 0x%04x (action_code=%u, function_code=%u)\n",
|
||||
pout("Unexpected SCT status 0x%04x (action_code=%u, function_code=%u)\n",
|
||||
sts.ext_status_code, sts.action_code, sts.function_code);
|
||||
return -1;
|
||||
}
|
||||
@ -2619,9 +2562,16 @@ static int ataGetSetSCTErrorRecoveryControltime(ata_device * device, unsigned ty
|
||||
if (!(out.out_regs.sector_count.is_set() && out.out_regs.lba_low.is_set())) {
|
||||
// TODO: Output register support should be checked within each ata_pass_through()
|
||||
// implementation before command is issued.
|
||||
pout("Error SMART WRITE LOG does not return COUNT and LBA_LOW register\n");
|
||||
pout("SMART WRITE LOG does not return COUNT and LBA_LOW register\n");
|
||||
return -1;
|
||||
}
|
||||
if ( out.out_regs.sector_count == in.in_regs.sector_count
|
||||
&& out.out_regs.lba_low == in.in_regs.lba_low ) {
|
||||
// 0xe001 (5734.5s) - this is most likely a broken ATA pass-through implementation
|
||||
pout("SMART WRITE LOG returns COUNT and LBA_LOW register unchanged\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Return value to caller
|
||||
time_limit = out.out_regs.sector_count | (out.out_regs.lba_low << 8);
|
||||
}
|
||||
@ -2713,8 +2663,9 @@ int ataPrintSmartSelfTestEntry(unsigned testnum, unsigned char test_type,
|
||||
char msglba[32];
|
||||
if (retval < 0 && failing_lba < 0xffffffffffffULL)
|
||||
snprintf(msglba, sizeof(msglba), "%"PRIu64, failing_lba);
|
||||
else
|
||||
strcpy(msglba, "-");
|
||||
else {
|
||||
msglba[0] = '-'; msglba[1] = 0;
|
||||
}
|
||||
|
||||
pout("#%2u %-19s %-29s %1d0%% %8u %s\n", testnum,
|
||||
msgtest.c_str(), msgstat.c_str(), test_status & 0x0f, timestamp, msglba);
|
||||
@ -2727,11 +2678,11 @@ int ataPrintSmartSelfTestEntry(unsigned testnum, unsigned char test_type,
|
||||
// bottom 8 bits: number of entries found where self-test showed an error
|
||||
// remaining bits: if nonzero, power on hours of last self-test where error was found
|
||||
int ataPrintSmartSelfTestlog(const ata_smart_selftestlog * data, bool allentries,
|
||||
unsigned char fix_firmwarebug)
|
||||
firmwarebug_defs firmwarebugs)
|
||||
{
|
||||
if (allentries)
|
||||
pout("SMART Self-test log structure revision number %d\n",(int)data->revnumber);
|
||||
if ((data->revnumber!=0x0001) && allentries && fix_firmwarebug != FIX_SAMSUNG)
|
||||
if (data->revnumber != 0x0001 && allentries && !firmwarebugs.is_set(BUG_SAMSUNG))
|
||||
pout("Warning: ATA Specification requires self-test log structure revision number = 1\n");
|
||||
if (data->mostrecenttest==0){
|
||||
if (allentries)
|
||||
|
89
atacmds.h
89
atacmds.h
@ -13,8 +13,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -26,7 +25,7 @@
|
||||
#ifndef ATACMDS_H_
|
||||
#define ATACMDS_H_
|
||||
|
||||
#define ATACMDS_H_CVSID "$Id: atacmds.h 3528 2012-03-25 17:13:47Z chrfranke $"
|
||||
#define ATACMDS_H_CVSID "$Id: atacmds.h 3632 2012-10-09 10:10:53Z chrfranke $"
|
||||
|
||||
#include "dev_interface.h" // ata_device
|
||||
|
||||
@ -67,14 +66,6 @@ typedef enum {
|
||||
WRITE_LOG
|
||||
} smart_command_set;
|
||||
|
||||
// Possible values for fix_firmwarebug.
|
||||
enum {
|
||||
FIX_NOTSPECIFIED = 0,
|
||||
FIX_NONE,
|
||||
FIX_SAMSUNG,
|
||||
FIX_SAMSUNG2,
|
||||
FIX_SAMSUNG3
|
||||
};
|
||||
|
||||
// ATA Specification Command Register Values (Commands)
|
||||
#define ATA_CHECK_POWER_MODE 0xe5
|
||||
@ -727,6 +718,37 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// Possible values for firmwarebugs
|
||||
enum firmwarebug_t {
|
||||
BUG_NONE = 0,
|
||||
BUG_NOLOGDIR,
|
||||
BUG_SAMSUNG,
|
||||
BUG_SAMSUNG2,
|
||||
BUG_SAMSUNG3,
|
||||
BUG_XERRORLBA
|
||||
};
|
||||
|
||||
// Set of firmware bugs
|
||||
class firmwarebug_defs
|
||||
{
|
||||
public:
|
||||
firmwarebug_defs()
|
||||
: m_bugs(0) { }
|
||||
|
||||
bool is_set(firmwarebug_t bug) const
|
||||
{ return !!(m_bugs & (1 << bug)); }
|
||||
|
||||
void set(firmwarebug_t bug)
|
||||
{ m_bugs |= (1 << bug); }
|
||||
|
||||
void set(firmwarebug_defs bugs)
|
||||
{ m_bugs |= bugs.m_bugs; }
|
||||
|
||||
private:
|
||||
unsigned m_bugs;
|
||||
};
|
||||
|
||||
|
||||
// Print ATA debug messages?
|
||||
extern unsigned char ata_debugmode;
|
||||
|
||||
@ -734,7 +756,8 @@ extern unsigned char ata_debugmode;
|
||||
extern bool dont_print_serial_number;
|
||||
|
||||
// Get information from drive
|
||||
int ata_read_identity(ata_device * device, ata_identify_device * buf, bool fix_swapped_id);
|
||||
int ata_read_identity(ata_device * device, ata_identify_device * buf, bool fix_swapped_id,
|
||||
unsigned char * raw_buf = 0);
|
||||
int ataCheckPowerMode(ata_device * device);
|
||||
|
||||
// Issue a no-data ATA command with optional sector count register value
|
||||
@ -747,11 +770,10 @@ bool ata_set_features(ata_device * device, unsigned char features, int sector_co
|
||||
int ataReadSmartValues(ata_device * device,struct ata_smart_values *);
|
||||
int ataReadSmartThresholds(ata_device * device, struct ata_smart_thresholds_pvt *);
|
||||
int ataReadErrorLog (ata_device * device, ata_smart_errorlog *data,
|
||||
unsigned char fix_firmwarebug);
|
||||
firmwarebug_defs firmwarebugs);
|
||||
int ataReadSelfTestLog(ata_device * device, ata_smart_selftestlog * data,
|
||||
unsigned char fix_firmwarebug);
|
||||
firmwarebug_defs firmwarebugs);
|
||||
int ataReadSelectiveSelfTestLog(ata_device * device, struct ata_selective_self_test_log *data);
|
||||
int ataSetSmartThresholds(ata_device * device, struct ata_smart_thresholds_pvt *);
|
||||
int ataReadLogDirectory(ata_device * device, ata_smart_log_directory *, bool gpl);
|
||||
|
||||
// Read GP Log page(s)
|
||||
@ -763,7 +785,7 @@ bool ataReadSmartLog(ata_device * device, unsigned char logaddr,
|
||||
void * data, unsigned nsectors);
|
||||
// Read SMART Extended Comprehensive Error Log
|
||||
bool ataReadExtErrorLog(ata_device * device, ata_smart_exterrlog * log,
|
||||
unsigned nsectors);
|
||||
unsigned nsectors, firmwarebug_defs firwarebugs);
|
||||
// Read SMART Extended Self-test Log
|
||||
bool ataReadExtSelfTestLog(ata_device * device, ata_smart_extselftestlog * log,
|
||||
unsigned nsectors);
|
||||
@ -799,14 +821,14 @@ int ataWriteSelectiveSelfTestLog(ata_device * device, ata_selective_selftest_arg
|
||||
const ata_smart_values * sv, uint64_t num_sectors,
|
||||
const ata_selective_selftest_args * prev_spans = 0);
|
||||
|
||||
// Returns the latest compatibility of ATA/ATAPI Version the device
|
||||
// supports. Returns -1 if Version command is not supported
|
||||
int ataVersionInfo(const char ** description, const ata_identify_device * drive, unsigned short * minor);
|
||||
|
||||
// Get World Wide Name (WWN) fields.
|
||||
// Return NAA field or -1 if WWN is unsupported.
|
||||
int ata_get_wwn(const ata_identify_device * id, unsigned & oui, uint64_t & unique_id);
|
||||
|
||||
// Get nominal media rotation rate.
|
||||
// Returns: 0 = not reported, 1 = SSD, >1 = HDD rpm, < 0 = -(Unknown value)
|
||||
int ata_get_rotation_rate(const ata_identify_device * id);
|
||||
|
||||
// If SMART supported, this is guaranteed to return 1 if SMART is enabled, else 0.
|
||||
int ataDoesSmartWork(ata_device * device);
|
||||
|
||||
@ -883,7 +905,8 @@ std::string ata_format_attr_raw_value(const ata_smart_attribute & attr,
|
||||
|
||||
// Get attribute name
|
||||
std::string ata_get_smart_attr_name(unsigned char id,
|
||||
const ata_vendor_attr_defs & defs);
|
||||
const ata_vendor_attr_defs & defs,
|
||||
int rpm = 0);
|
||||
|
||||
// External handler function, for when a checksum is not correct. Can
|
||||
// simply return if no action is desired, or can print error messages
|
||||
@ -899,15 +922,6 @@ int ata_find_attr_index(unsigned char id, const ata_smart_values & smartval);
|
||||
unsigned char ata_return_temperature_value(const ata_smart_values * data, const ata_vendor_attr_defs & defs);
|
||||
|
||||
|
||||
// This are the meanings of the Self-test failure checkpoint byte.
|
||||
// This is in the self-test log at offset 4 bytes into the self-test
|
||||
// descriptor and in the SMART READ DATA structure at byte offset
|
||||
// 371. These codes are not well documented. The meanings returned by
|
||||
// this routine are used (at least) by Maxtor and IBM. Returns NULL if
|
||||
// not recognized.
|
||||
const char *SelfTestFailureCodeName(unsigned char which);
|
||||
|
||||
|
||||
#define MAX_ATTRIBUTE_NUM 256
|
||||
|
||||
// Parse vendor attribute display def (-v option).
|
||||
@ -924,6 +938,13 @@ unsigned char get_unc_attr_id(bool offline, const ata_vendor_attr_defs & defs,
|
||||
// parse_attribute_def().
|
||||
std::string create_vendor_attribute_arg_list();
|
||||
|
||||
// Parse firmwarebug def (-F option).
|
||||
// Return false on error.
|
||||
bool parse_firmwarebug_def(const char * opt, firmwarebug_defs & firmwarebugs);
|
||||
|
||||
// Return a string of valid argument words for parse_firmwarebug_def()
|
||||
const char * get_valid_firmwarebug_args();
|
||||
|
||||
|
||||
// These are two of the functions that are defined in os_*.c and need
|
||||
// to be ported to get smartmontools onto another OS.
|
||||
@ -935,12 +956,6 @@ std::string create_vendor_attribute_arg_list();
|
||||
//int areca_command_interface(int fd, int disknum, smart_command_set command, int select, char *data);
|
||||
|
||||
|
||||
// Optional functions of os_*.c
|
||||
#ifdef HAVE_ATA_IDENTIFY_IS_CACHED
|
||||
// Return true if OS caches the ATA identify sector
|
||||
//int ata_identify_is_cached(int fd);
|
||||
#endif
|
||||
|
||||
// This function is exported to give low-level capability
|
||||
int smartcommandhandler(ata_device * device, smart_command_set command, int select, char *data);
|
||||
|
||||
@ -957,7 +972,7 @@ int ataPrintSmartSelfTestEntry(unsigned testnum, unsigned char test_type,
|
||||
|
||||
// Print Smart self-test log, used by smartctl and smartd.
|
||||
int ataPrintSmartSelfTestlog(const ata_smart_selftestlog * data, bool allentries,
|
||||
unsigned char fix_firmwarebug);
|
||||
firmwarebug_defs firmwarebugs);
|
||||
|
||||
// Get capacity and sector sizes from IDENTIFY data
|
||||
struct ata_size_info
|
||||
|
708
ataidentify.cpp
Normal file
708
ataidentify.cpp
Normal file
@ -0,0 +1,708 @@
|
||||
/*
|
||||
* ataidentify.cpp
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "ataidentify.h"
|
||||
|
||||
const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 3785 2013-03-07 21:58:05Z chrfranke $"
|
||||
ATAIDENTIFY_H_CVSID;
|
||||
|
||||
#include "int64.h"
|
||||
#include "utility.h"
|
||||
|
||||
|
||||
// Table 12 of X3T10/0948D (ATA-2) Revision 4c, March 18, 1996
|
||||
// Table 9 of X3T13/2008D (ATA-3) Revision 7b, January 27, 1997
|
||||
// Tables 11 and 13 of T13/1153D (ATA/ATAPI-4) revision 18, August 19, 1998
|
||||
// Tables 20 and 22 of T13/1321D (ATA/ATAPI-5) Revision 3, February 29, 2000
|
||||
// Tables 27 and 29 of T13/1410D (ATA/ATAPI-6) Revision 3b, February 26, 2002
|
||||
// Tables 16 and 18 of T13/1532D (ATA/ATAPI-7) Volume 1 Revision 4b, April 21, 2004
|
||||
// Tables 29 and 39 of T13/1699-D (ATA8-ACS) Revision 6a, September 6, 2008
|
||||
// Tables 50 and 61 of T13/2015-D (ACS-2) Revision 7, June 22, 2011
|
||||
// Tables 51 and 56 of T13/2161-D (ACS-3) Revision 4g, February 27, 2013
|
||||
|
||||
const char * const identify_descriptions[] = {
|
||||
" 0 General configuration",
|
||||
". 15 Device identifier: 0 = ATA, 1 = ATAPI",
|
||||
". 14:8 ATA: Vendor specific [RET-3]",
|
||||
". 14 ATAPI: Must be set to 0",
|
||||
". 13 ATAPI: Reserved",
|
||||
". 12:8 ATAPI: Command set: 0x05 = CD/DVD",
|
||||
". 7 Removable media device",
|
||||
". 6 ATA: Not removable controller and/or device [OBS-6]",
|
||||
". 5:3 ATA: Vendor specific [RET-3]",
|
||||
". 6:5 ATAPI: DRQ after PACKET cmd: 0x0 = 3ms, 0x2 = 50us",
|
||||
". 4:3 ATAPI: Reserved",
|
||||
". 2 Response incomplete",
|
||||
". 1 ATA: Vendor specific [RET-3]",
|
||||
". 0 ATA: Reserved",
|
||||
". 1:0 ATAPI: Packet size: 0x0 = 12 byte, 0x1 = 16 byte",
|
||||
|
||||
" 1 Cylinders [OBS-6]",
|
||||
" 2 Specific configuration (0x37c8/738c/8c73/c837)",
|
||||
" 3 Heads [OBS-6]",
|
||||
" 4 Vendor specific [RET-3]",
|
||||
" 5 Vendor specific [RET-3]",
|
||||
" 6 Sectors per track [OBS-6]",
|
||||
" 7-8 Reserved for CFA (Sectors per card)",
|
||||
" 9 Vendor specific [RET-4]",
|
||||
" 10-19 Serial number (String)",
|
||||
" 20 Vendor specific [RET-3]",
|
||||
" 21 Vendor specific [RET-3]",
|
||||
" 22 Vendor specific bytes on READ/WRITE LONG [OBS-4]",
|
||||
" 23-26 Firmware revision (String)",
|
||||
" 27-46 Model number (String)",
|
||||
|
||||
" 47 READ/WRITE MULTIPLE support",
|
||||
". 15:8 Must be set to 0x80",
|
||||
". 7:0 Maximum sectors per DRQ on READ/WRITE MULTIPLE",
|
||||
|
||||
" 48 Trusted Computing feature set options",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13:1 Reserved for the Trusted Computing Group",
|
||||
". 0 Trusted Computing feature set supported",
|
||||
|
||||
" 49 Capabilities",
|
||||
". 15:14 ATA: Reserved for IDENTIFY PACKET DEVICE",
|
||||
". 15 ATAPI: Interleaved DMA supported [OBS-8]",
|
||||
". 14 ATAPI: Command queuing supported [OBS-8]",
|
||||
". 13 ATA: Standard standby timer values supported",
|
||||
". 13 ATAPI: Overlap operation supported [OBS-8]",
|
||||
". 12 ATA: Reserved for IDENTIFY PACKET DEVICE",
|
||||
". 12 ATAPI: ATA software reset required [OBS-5]",
|
||||
". 11 IORDY supported",
|
||||
". 10 IORDY may be disabled",
|
||||
". 9 LBA supported",
|
||||
". 8 DMA supported",
|
||||
". 7:0 Vendor specific [RET-4]",
|
||||
|
||||
" 50 Capabilities",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13:2 Reserved",
|
||||
". 1 Reserved [OBS-6]",
|
||||
". 0 Vendor specific minimum standby timer value",
|
||||
|
||||
" 51 PIO data transfer mode [OBS-5]",
|
||||
" 52 Single Word DMA data transfer mode [OBS-3]",
|
||||
|
||||
" 53 Field validity / Free-fall Control",
|
||||
". 15:8 Free-fall Control sensitivity",
|
||||
". 7:3 Reserved",
|
||||
". 2 Word 88 (Ultra DMA modes) is valid",
|
||||
". 1 Words 64-70 (PIO modes) are valid",
|
||||
". 0 Words 54-58 (CHS) are valid [OBS-6]",
|
||||
|
||||
" 54 Current cylinders [OBS-6]",
|
||||
" 55 Current heads [OBS-6]",
|
||||
" 56 Current sectors per track [OBS-6]",
|
||||
" 57-58 Current capacity in sectors (DWord) [OBS-6]",
|
||||
|
||||
" 59 Sanitize Device - READ/WRITE MULTIPLE support",
|
||||
". 15 BLOCK ERASE EXT supported",
|
||||
". 14 OVERWRITE EXT supported",
|
||||
". 13 CRYPTO SCRAMBLE EXT supported",
|
||||
". 12 Sanitize Device feature set supported",
|
||||
". 11:9 Reserved",
|
||||
". 8 Bits 7:0 are valid",
|
||||
". 7:0 Current sectors per DRQ on READ/WRITE MULTIPLE",
|
||||
|
||||
" 60-61 User addressable sectors for 28-bit commands (DWord)",
|
||||
" 62 Single Word DMA modes [OBS-3]",
|
||||
|
||||
" 63 Multiword DMA modes",
|
||||
". 15:11 Reserved",
|
||||
". 10 Multiword DMA mode 2 selected",
|
||||
". 9 Multiword DMA mode 1 selected",
|
||||
". 8 Multiword DMA mode 0 selected",
|
||||
". 7:3 Reserved",
|
||||
". 2 Multiword DMA mode 2 and below supported",
|
||||
". 1 Multiword DMA mode 1 and below supported",
|
||||
". 0 Multiword DMA mode 0 supported",
|
||||
|
||||
" 64 PIO modes",
|
||||
". 15:2 Reserved",
|
||||
". 1 PIO mode 4 supported",
|
||||
". 0 PIO mode 3 supported",
|
||||
|
||||
" 65 Minimum Multiword DMA cycle time per word in ns",
|
||||
" 66 Recommended Multiword DMA cycle time in ns",
|
||||
" 67 Minimum PIO cycle time without flow control in ns",
|
||||
" 68 Minimum PIO cycle time with IORDY flow control in ns",
|
||||
|
||||
" 69 Additional support",
|
||||
". 15 CFast specification supported",
|
||||
". 14 Deterministic data after trim supported",
|
||||
". 13 LPS Alignment Error Reporting Control supported",
|
||||
". 12 DCO IDENTIFY/SET DMA supported [OBS-ACS-3]",
|
||||
". 11 READ BUFFER DMA supported",
|
||||
". 10 WRITE BUFFER DMA supported",
|
||||
". 9 SET MAX SET PASSWORD/UNLOCK DMA supported [OBS-ACS-3]",
|
||||
". 8 DOWNLOAD MICROCODE DMA supported",
|
||||
". 7 Reserved for IEEE 1667",
|
||||
". 6 Optional ATA device 28-bit commands supported",
|
||||
". 5 Trimmed LBA range(s) returning zeroed data supported",
|
||||
". 4 Device encrypts all user data",
|
||||
". 3 Extended number of user addressable sectors supported",
|
||||
". 2 All write cache is non-volatile",
|
||||
". 1:0 Reserved",
|
||||
|
||||
" 70 Reserved",
|
||||
" 71-74 ATA: Reserved for IDENTIFY PACKET DEVICE",
|
||||
" 71 ATAPI: Time in ns from PACKET to bus release [OBS-8]",
|
||||
" 72 ATAPI: Time in ns from SERVICE to BSY cleared [OBS-8]",
|
||||
" 73-74 ATAPI: Reserved",
|
||||
|
||||
" 75 Queue depth",
|
||||
". 15:5 Reserved",
|
||||
". 4:0 Maximum queue depth - 1",
|
||||
|
||||
" 76 Serial ATA capabilities",
|
||||
". 15 READ LOG DMA EXT as equiv to READ LOG EXT supported",
|
||||
". 14 Device Auto Partial to Slumber transitions supported",
|
||||
". 13 Host Auto Partial to Slumber transitions supported",
|
||||
". 12 NCQ priority information supported",
|
||||
". 11 Unload while NCQ commands are outstanding supported",
|
||||
". 10 Phy Event Counters supported",
|
||||
". 9 Receipt of host initiated PM requests supported",
|
||||
". 8 NCQ feature set supported",
|
||||
". 7:4 Reserved for Serial ATA",
|
||||
". 3 SATA Gen3 signaling speed (6.0 Gb/s) supported",
|
||||
". 2 SATA Gen2 signaling speed (3.0 Gb/s) supported",
|
||||
". 1 SATA Gen1 signaling speed (1.5 Gb/s) supported",
|
||||
". 0 Must be set to 0",
|
||||
|
||||
" 77 Serial ATA additional capabilities", // ACS-3
|
||||
". 15:7 Reserved for Serial ATA",
|
||||
". 6 RECEIVE/SEND FPDMA QUEUED supported",
|
||||
". 5 NCQ Queue Management supported",
|
||||
". 4 NCQ Streaming supported",
|
||||
". 3:1 Current Serial ATA signal speed",
|
||||
". 0 Must be set to 0",
|
||||
|
||||
" 78 Serial ATA features supported",
|
||||
". 15:8 Reserved for Serial ATA",
|
||||
". 7 NCQ Autosense supported", // ACS-3
|
||||
". 6 Software Settings Preservation supported",
|
||||
". 5 Hardware Feature Control supported", // ACS-3
|
||||
". 4 In-order data delivery supported",
|
||||
". 3 Device initiated power management supported",
|
||||
". 2 DMA Setup auto-activation supported",
|
||||
". 1 Non-zero buffer offsets supported",
|
||||
". 0 Must be set to 0",
|
||||
|
||||
" 79 Serial ATA features enabled",
|
||||
". 15:8 Reserved for Serial ATA",
|
||||
". 7 Automatic Partial to Slumber transitions enabled", // ACS-3
|
||||
". 6 Software Settings Preservation enabled",
|
||||
". 5 Hardware Feature Control enabled", // ACS-3
|
||||
". 4 In-order data delivery enabled",
|
||||
". 3 Device initiated power management enabled",
|
||||
". 2 DMA Setup auto-activation enabled",
|
||||
". 1 Non-zero buffer offsets enabled",
|
||||
". 0 Must be set to 0",
|
||||
|
||||
" 80 Major version number",
|
||||
". 15:11 Reserved",
|
||||
". 10 ACS-3 supported",
|
||||
". 9 ACS-2 supported",
|
||||
". 8 ATA8-ACS supported",
|
||||
". 7 ATA/ATAPI-7 supported",
|
||||
". 6 ATA/ATAPI-6 supported",
|
||||
". 5 ATA/ATAPI-5 supported",
|
||||
". 4 ATA/ATAPI-4 supported [OBS-8]",
|
||||
". 3 ATA-3 supported [OBS-7]",
|
||||
". 2 ATA-2 supported [OBS-6]",
|
||||
". 1 ATA-1 supported [OBS-5]",
|
||||
". 0 Reserved",
|
||||
|
||||
" 81 Minor version number",
|
||||
|
||||
" 82 Commands and feature sets supported",
|
||||
". 15 IDENTIFY DEVICE DMA supported [OBS-4]", // ATA-4 r07-r14 only
|
||||
". 14 NOP supported",
|
||||
". 13 READ BUFFER supported",
|
||||
". 12 WRITE BUFFER supported",
|
||||
". 11 WRITE VERIFY supported [OBS-4]", // ATA-4 r07-r13 only
|
||||
". 10 HPA feature set supported [OBS-ACS-3]",
|
||||
". 9 DEVICE RESET supported", // ATA:0, ATAPI:1
|
||||
". 8 SERVICE interrupt supported [OBS-ACS-2]",
|
||||
". 7 Release interrupt supported [OBS-ACS-2]",
|
||||
". 6 Read look-ahead supported",
|
||||
". 5 Volatile write cache supported",
|
||||
". 4 PACKET feature set supported", // ATA:0, ATAPI:1
|
||||
". 3 Power Management feature set supported",
|
||||
". 2 Removable Media feature set supported [OBS-8]",
|
||||
". 1 Security feature set supported",
|
||||
". 0 SMART feature set supported",
|
||||
|
||||
" 83 Commands and feature sets supported",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13 FLUSH CACHE EXT supported",
|
||||
". 12 FLUSH CACHE supported",
|
||||
". 11 DCO feature set supported [OBS-ACS-3]",
|
||||
". 10 48-bit Address feature set supported",
|
||||
". 9 AAM feature set supported [OBS-ACS-2]",
|
||||
". 8 SET MAX security extension supported [OBS-ACS-3]",
|
||||
". 7 Reserved for Address Offset Reserved Area Boot Method",
|
||||
". 6 SET FEATURES subcommand required to spin-up",
|
||||
". 5 PUIS feature set supported",
|
||||
". 4 Removable Media Status Notification supported [OBS-8]",
|
||||
". 3 APM feature set supported",
|
||||
". 2 CFA feature set supported",
|
||||
". 1 TCQ feature set supported [OBS-ACS-2]",
|
||||
". 0 DOWNLOAD MICROCODE supported",
|
||||
|
||||
" 84 Commands and feature sets supported",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13 IDLE IMMEDIATE with UNLOAD feature supported",
|
||||
". 12:11 Reserved for TLC [OBS-ACS-3]",
|
||||
". 10 URG bit for WRITE STREAM (DMA) EXT supported [OBS-8]",
|
||||
". 9 URG bit for READ STREAM (DMA) EXT supported [OBS-8]",
|
||||
". 8 64-bit World Wide Name supported",
|
||||
". 7 WRITE DMA QUEUED FUA EXT supported",
|
||||
". 6 WRITE DMA/MULTIPLE FUA EXT supported",
|
||||
". 5 GPL feature set supported",
|
||||
". 4 Streaming feature set supported [OBS-ACS-3]",
|
||||
". 3 Media Card Pass Through Command supported [OBS-ACS-2]",
|
||||
". 2 Media serial number supported", // ACS-3 r3 or later: Reserved
|
||||
". 1 SMART self-test supported",
|
||||
". 0 SMART error logging supported",
|
||||
|
||||
" 85 Commands and feature sets supported or enabled",
|
||||
". 15 IDENTIFY DEVICE DMA supported [OBS-4]", // ATA-4 r07-r14 only
|
||||
". 14 NOP supported",
|
||||
". 13 READ BUFFER supported",
|
||||
". 12 WRITE BUFFER supported",
|
||||
". 11 WRITE VERIFY supported [OBS-4]", // ATA-4 r07-r13 only
|
||||
". 10 HPA feature set supported [OBS-ACS-3]",
|
||||
". 9 DEVICE RESET supported", // ATA:0, ATAPI:1
|
||||
". 8 SERVICE interrupt enabled [OBS-ACS-2]",
|
||||
". 7 Release interrupt enabled [OBS-ACS-2]",
|
||||
". 6 Read look-ahead enabled",
|
||||
". 5 Write cache enabled",
|
||||
". 4 PACKET feature set supported", // ATA:0, ATAPI:1
|
||||
". 3 Power Management feature set supported",
|
||||
". 2 Removable Media feature set supported [OBS-8]",
|
||||
". 1 Security feature set enabled",
|
||||
". 0 SMART feature set enabled",
|
||||
|
||||
" 86 Commands and feature sets supported or enabled",
|
||||
". 15 Words 119-120 are valid",
|
||||
". 14 Reserved",
|
||||
". 13 FLUSH CACHE EXT supported",
|
||||
". 12 FLUSH CACHE supported",
|
||||
". 11 DCO feature set supported [OBS-ACS-3]",
|
||||
". 10 48-bit Address features set supported",
|
||||
". 9 AAM feature set enabled [OBS-ACS-2]",
|
||||
". 8 SET MAX security extension enabled [OBS-ACS-3]",
|
||||
". 7 Reserved for Address Offset Reserved Area Boot Method",
|
||||
". 6 SET FEATURES subcommand required to spin-up",
|
||||
". 5 PUIS feature set enabled",
|
||||
". 4 Removable Media Status Notification enabled [OBS-8]",
|
||||
". 3 APM feature set enabled",
|
||||
". 2 CFA feature set supported",
|
||||
". 1 TCQ feature set supported [OBS-ACS-2]",
|
||||
". 0 DOWNLOAD MICROCODE supported",
|
||||
|
||||
" 87 Commands and feature sets supported or enabled",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13 IDLE IMMEDIATE with UNLOAD FEATURE supported",
|
||||
". 12:11 Reserved for TLC [OBS-ACS-3]",
|
||||
". 10 URG bit for WRITE STREAM (DMA) EXT supported [OBS-8]",
|
||||
". 9 URG bit for READ STREAM (DMA) EXT supported [OBS-8]",
|
||||
". 8 64-bit World Wide Name supported",
|
||||
". 7 WRITE DMA QUEUED FUA EXT supported [OBS-ACS-2]",
|
||||
". 6 WRITE DMA/MULTIPLE FUA EXT supported",
|
||||
". 5 GPL feature set supported",
|
||||
". 4 Valid CONFIGURE STREAM has been executed [OBS-8]",
|
||||
". 3 Media Card Pass Through Command supported [OBS-ACS-2]",
|
||||
". 2 Media serial number is valid",
|
||||
". 1 SMART self-test supported",
|
||||
". 0 SMART error logging supported",
|
||||
|
||||
" 88 Ultra DMA modes",
|
||||
". 15 Reserved",
|
||||
". 14 Ultra DMA mode 6 selected",
|
||||
". 13 Ultra DMA mode 5 selected",
|
||||
". 12 Ultra DMA mode 4 selected",
|
||||
". 11 Ultra DMA mode 3 selected",
|
||||
". 10 Ultra DMA mode 2 selected",
|
||||
". 9 Ultra DMA mode 1 selected",
|
||||
". 8 Ultra DMA mode 0 selected",
|
||||
". 7 Reserved",
|
||||
". 6 Ultra DMA mode 6 and below supported",
|
||||
". 5 Ultra DMA mode 5 and below supported",
|
||||
". 4 Ultra DMA mode 4 and below supported",
|
||||
". 3 Ultra DMA mode 3 and below supported",
|
||||
". 2 Ultra DMA mode 2 and below supported",
|
||||
". 1 Ultra DMA mode 1 and below supported",
|
||||
". 0 Ultra DMA mode 0 supported",
|
||||
|
||||
" 89 SECURITY ERASE UNIT time",
|
||||
" 90 ENHANCED SECURITY ERASE UNIT time",
|
||||
" 91 Current APM level",
|
||||
" 92 Master password revision code",
|
||||
|
||||
" 93 Hardware reset result (PATA)",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13 Device detected CBLID- above(1)/below(0) ViHB",
|
||||
". 12 Reserved",
|
||||
". 11 Device 1 asserted PDIAG-",
|
||||
". 10:9 Device 1 detection method: -, Jumper, CSEL, other",
|
||||
". 8 Must be set to 1",
|
||||
". 7 Reserved",
|
||||
". 6 Device 0 responds when device 1 selected",
|
||||
". 5 Device 0 detected the assertion of DASP-",
|
||||
". 4 Device 0 detected the assertion of PDIAG-",
|
||||
". 3 Device 0 passed diagnostics",
|
||||
". 2:1 Device 0 detection method: -, Jumper, CSEL, other",
|
||||
". 0 Must be set to 1",
|
||||
|
||||
" 94 AAM level [OBS-ACS-2]",
|
||||
". 15:8 Recommended AAM level [OBS-ACS-2]",
|
||||
". 7:0 Current AAM level [OBS-ACS-2]",
|
||||
|
||||
" 95 Stream Minimum Request Size",
|
||||
" 96 Streaming Transfer Time - DMA",
|
||||
" 97 Streaming Access Latency - DMA and PIO",
|
||||
" 98-99 Streaming Performance Granularity (DWord)",
|
||||
"100-103 User addressable sectors for 48-bit commands (QWord)",
|
||||
"104 Streaming Transfer Time - PIO",
|
||||
"105 Max blocks of LBA Range Entries per DS MANAGEMENT cmd",
|
||||
|
||||
"106 Physical sector size / logical sector size",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13 Multiple logical sectors per physical sector",
|
||||
". 12 Logical Sector longer than 256 words",
|
||||
". 11:4 Reserved",
|
||||
". 3:0 2^X logical sectors per physical sector",
|
||||
|
||||
"107 Inter-seek delay for ISO 7779 acoustic testing",
|
||||
"108-111 64-bit World Wide Name",
|
||||
"112-115 Reserved for a 128-bit World Wide Name",
|
||||
"116 Reserved for TLC [OBS-ACS-3]",
|
||||
"117-118 Logical sector size (DWord)",
|
||||
|
||||
"119 Commands and feature sets supported",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13:10 Reserved",
|
||||
". 9 DSN feature set supported", // ACS-3
|
||||
". 8 Accessible Max Address Config feature set supported", // ACS-3
|
||||
". 7 Extended Power Conditions feature set supported",
|
||||
". 6 Sense Data Reporting feature set supported",
|
||||
". 5 Free-fall Control feature set supported",
|
||||
". 4 DOWNLOAD MICROCODE with mode 3 supported",
|
||||
". 3 READ/WRITE LOG DMA EXT supported",
|
||||
". 2 WRITE UNCORRECTABLE EXT supported",
|
||||
". 1 Write-Read-Verify feature set supported",
|
||||
". 0 Reserved for DDT [OBS-ACS-3]",
|
||||
|
||||
"120 Commands and feature sets supported or enabled",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13:10 Reserved",
|
||||
". 9 DSN feature set enabled", // ACS-3
|
||||
". 8 Reserved",
|
||||
". 7 Extended Power Conditions feature set enabled",
|
||||
". 6 Sense Data Reporting feature set enabled",
|
||||
". 5 Free-fall Control feature set enabled",
|
||||
". 4 DOWNLOAD MICROCODE with mode 3 supported",
|
||||
". 3 READ/WRITE LOG DMA EXT supported",
|
||||
". 2 WRITE UNCORRECTABLE EXT supported",
|
||||
". 1 Write-Read-Verify feature set enabled",
|
||||
". 0 Reserved for DDT [OBS-ACS-3]",
|
||||
|
||||
"121-126 ATA: Reserved",
|
||||
"121-124 ATAPI: Reserved",
|
||||
"125 ATAPI: Byte count = 0 behavior",
|
||||
"126 ATAPI: Byte count = 0 behavior [OBS-6]",
|
||||
|
||||
"127 Removable Media Status Notification [OBS-8]",
|
||||
". 15:1 Reserved",
|
||||
". 0 Removable Media Status Notification supported",
|
||||
|
||||
"128 Security status",
|
||||
". 15:9 Reserved",
|
||||
". 8 Master password capability: 0 = High, 1 = Maximum",
|
||||
". 7:6 Reserved",
|
||||
". 5 Enhanced security erase supported",
|
||||
". 4 Security count expired",
|
||||
". 3 Security frozen",
|
||||
". 2 Security locked",
|
||||
". 1 Security enabled",
|
||||
". 0 Security supported",
|
||||
|
||||
"129-159 Vendor specific",
|
||||
|
||||
"160 CFA power mode",
|
||||
// ". 15 Word 160 supported",
|
||||
// ". 14 Reserved",
|
||||
// ". 13 CFA power mode 1 is required for some commands",
|
||||
// ". 12 CFA power mode 1 disabled",
|
||||
// ". 11:0 Maximum current in mA",
|
||||
"161-167 Reserved for CFA",
|
||||
|
||||
"168 Form factor",
|
||||
". 15:4 Reserved",
|
||||
". 3:0 Nominal form factor: -, 5.25, 3.5, 2.5, 1.8, <1.8",
|
||||
|
||||
"169 Data Set Management support",
|
||||
". 15:1 Reserved",
|
||||
". 0 Trim bit in DATA SET MANAGEMENT command supported",
|
||||
|
||||
"170-173 Additional product identifier (String)",
|
||||
"174-175 Reserved",
|
||||
"176-205 Current media serial number (String)",
|
||||
|
||||
"206 SCT Command Transport",
|
||||
". 15:12 Vendor Specific",
|
||||
". 11:8 Reserved",
|
||||
". 7 Reserved for Serial ATA",
|
||||
". 6 Reserved",
|
||||
". 5 SCT Data Tables supported",
|
||||
". 4 SCT Feature Control supported",
|
||||
". 3 SCT Error Recovery Control supported",
|
||||
". 2 SCT Write Same supported",
|
||||
". 1 SCT Read/Write Long supported [OBS-ACS-2]",
|
||||
". 0 SCT Command Transport supported",
|
||||
|
||||
"207-208 Reserved for CE-ATA",
|
||||
|
||||
"209 Alignment of logical sectors",
|
||||
". 15:14 Must be set to 0x1",
|
||||
". 13:0 Logical sector offset",
|
||||
|
||||
"210-211 Write-Read-Verify sector count mode 3 (DWord)",
|
||||
"212-213 Write-Read-Verify sector count mode 2 (DWord)",
|
||||
|
||||
"214 NV Cache capabilities [OBS-ACS-3]",
|
||||
". 15:12 NV Cache feature set version [OBS-ACS-3]",
|
||||
". 11:8 NV Cache Power Mode feature set version [OBS-ACS-3]",
|
||||
". 7:5 Reserved [OBS-ACS-3]",
|
||||
". 4 NV Cache feature set enabled [OBS-ACS-3]",
|
||||
". 3:2 Reserved",
|
||||
". 1 NV Cache Power Mode feature set enabled [OBS-ACS-3]",
|
||||
". 0 NV Cache Power Mode feature set supported [OBS-ACS-3]",
|
||||
|
||||
"215-216 NV Cache size in logical blocks (DWord) [OBS-ACS-3]",
|
||||
"217 Nominal media rotation rate",
|
||||
"218 Reserved",
|
||||
|
||||
"219 NV Cache options [OBS-ACS-3]",
|
||||
". 15:8 Reserved [OBS-ACS-3]",
|
||||
". 7:0 Estimated time to spin up in seconds [OBS-ACS-3]",
|
||||
|
||||
"220 Write-Read-Verify mode",
|
||||
". 15:8 Reserved",
|
||||
". 7:0 Write-Read-Verify feature set current mode",
|
||||
|
||||
"221 Reserved",
|
||||
|
||||
"222 Transport major version number",
|
||||
". 15:12 Transport type: 0x0 = Parallel, 0x1 = Serial",
|
||||
". 11:7 Reserved | Reserved",
|
||||
". 6 Reserved | SATA 3.1",
|
||||
". 5 Reserved | SATA 3.0",
|
||||
". 4 Reserved | SATA 2.6",
|
||||
". 3 Reserved | SATA 2.5",
|
||||
". 2 Reserved | SATA II: Extensions",
|
||||
". 1 ATA/ATAPI-7 | SATA 1.0a",
|
||||
". 0 ATA8-APT | ATA8-AST",
|
||||
|
||||
"223 Transport minor version number",
|
||||
"224-229 Reserved",
|
||||
"230-233 Extended number of user addressable sectors (QWord)",
|
||||
"234 Minimum blocks per DOWNLOAD MICROCODE mode 3 command",
|
||||
"235 Maximum blocks per DOWNLOAD MICROCODE mode 3 command",
|
||||
"236-254 Reserved",
|
||||
|
||||
"255 Integrity word",
|
||||
". 15:8 Checksum",
|
||||
". 7:0 Signature"
|
||||
};
|
||||
|
||||
const int num_identify_descriptions = sizeof(identify_descriptions)/sizeof(identify_descriptions[0]);
|
||||
|
||||
static inline unsigned short get_word(const void * id, int word)
|
||||
{
|
||||
const unsigned char * p = ((const unsigned char *)id) + 2 * word;
|
||||
return p[0] + (p[1] << 8);
|
||||
}
|
||||
|
||||
void ata_print_identify_data(const void * id, bool all_words, int bit_level)
|
||||
{
|
||||
// ATA or ATAPI ?
|
||||
unsigned short w = get_word(id, 0);
|
||||
bool is_atapi = ((w & 0x8000) && (w != 0x848a/*CompactFlash Signature*/));
|
||||
|
||||
int prev_word = -1, prev_bit = -1;
|
||||
pout("Word %s Value Description\n", (bit_level >= 0 ? "Bit " : " "));
|
||||
|
||||
for (int i = 0; i < num_identify_descriptions; i++) {
|
||||
// Parse table entry
|
||||
const char * desc = identify_descriptions[i];
|
||||
|
||||
int word = prev_word, word2 = -1;
|
||||
int bit = -1, bit2 = -1;
|
||||
|
||||
int nc;
|
||||
unsigned v1, v2;
|
||||
if (word >= 0 && sscanf(desc, ". %u:%u %n", &v1, &v2, (nc=-1, &nc)) == 2 && nc > 0 && 16 > v1 && v1 > v2) {
|
||||
bit = v1; bit2 = v2;
|
||||
}
|
||||
else if (word >= 0 && sscanf(desc, ". %u %n", &v1, (nc=-1, &nc)) == 1 && nc > 0 && v1 < 16) {
|
||||
bit = v1;
|
||||
}
|
||||
else if (sscanf(desc, "%u-%u %n", &v1, &v2, (nc=-1, &nc)) == 2 && nc > 0 && v1 < v2 && v2 < 256) {
|
||||
word = v1, word2 = v2;
|
||||
}
|
||||
else if (sscanf(desc, "%u %n", &v1, (nc=-1, &nc)) == 1 && nc > 0 && v1 < 256) {
|
||||
word = v1;
|
||||
}
|
||||
else {
|
||||
pout("Error: #%d: Syntax\n", i);
|
||||
continue;
|
||||
}
|
||||
desc += nc;
|
||||
|
||||
// Check for ATA/ATAPI specific entries
|
||||
if (str_starts_with(desc, "ATA: ")) {
|
||||
if (is_atapi)
|
||||
continue;
|
||||
desc += sizeof("ATA: ")-1;
|
||||
}
|
||||
else if (str_starts_with(desc, "ATAPI: ")) {
|
||||
if (!is_atapi)
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check table entry
|
||||
if (bit < 0) {
|
||||
if (word != prev_word+1) {
|
||||
pout("Error: #%d: Missing word %d\n", i, prev_word+1);
|
||||
return;
|
||||
}
|
||||
else if (prev_bit > 0) {
|
||||
pout("Error: #%d: Missing bit 0 from word %d\n", i, prev_word);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!((prev_bit < 0 && bit == 15) || bit == prev_bit-1)) {
|
||||
pout("Error: #%d: Missing bit %d from word %d\n", i, bit+1, word);
|
||||
return;
|
||||
}
|
||||
|
||||
w = get_word(id, word);
|
||||
bool w_is_set = (w != 0x0000 && w != 0xffff);
|
||||
|
||||
if (bit >= 0) {
|
||||
int b;
|
||||
if (bit2 >= 0)
|
||||
b = (w >> bit2) & ~(~0 << (bit-bit2+1));
|
||||
else
|
||||
b = (w >> bit) & 1;
|
||||
|
||||
if ( (bit_level >= 0 && b)
|
||||
|| (bit_level >= 1 && w_is_set)
|
||||
|| (bit_level >= 2 && all_words)) {
|
||||
if (bit2 >= 0) {
|
||||
// Print bitfield
|
||||
char valstr[20];
|
||||
snprintf(valstr, sizeof(valstr), "0x%0*x", (bit - bit2 + 4) >> 2, b);
|
||||
pout("%4d %2d:%-2d %6s %s\n", word, bit, bit2, valstr, desc);
|
||||
}
|
||||
else {
|
||||
// Print bit
|
||||
pout("%4d %2d %u %s\n", word, bit, b, desc);
|
||||
}
|
||||
}
|
||||
|
||||
prev_bit = (bit2 >= 0 ? bit2 : bit);
|
||||
}
|
||||
else {
|
||||
if (word2 >= 0) {
|
||||
for (int j = word+1; !w_is_set && j <= word2; j++) {
|
||||
if (get_word(id, j) != w)
|
||||
w_is_set = true;
|
||||
}
|
||||
|
||||
// Print word array
|
||||
if (all_words || w_is_set) {
|
||||
pout("%s%4d-%-3d %s",
|
||||
(bit_level >= 0 ? "\n" : ""), word, word2,
|
||||
(bit_level >= 0 ? "- " : ""));
|
||||
|
||||
if (!w_is_set) {
|
||||
pout("0x%02x... %s\n", w & 0xff, desc);
|
||||
}
|
||||
else {
|
||||
bool is_str = !!strstr(desc, "(String)");
|
||||
pout(". %s", desc);
|
||||
|
||||
for (int j = word; j <= word2; j += 4) {
|
||||
if (j + 2*4 < word2 && !nonempty((const unsigned char *)id + 2*j, 2*(word2-j+1))) {
|
||||
// Remaining words are null
|
||||
pout("\n%4d-%-3d %s0x0000:0000:0000:00...", j, word2,
|
||||
(bit_level >= 0 ? ". " : ""));
|
||||
break;
|
||||
}
|
||||
// Print 4 words in a row
|
||||
pout("\n%4d-%-3d %s0x", j, (j+3 <= word2 ? j+3 : word2),
|
||||
(bit_level >= 0 ? ". " : ""));
|
||||
int k;
|
||||
for (k = 0; k < 4 && j+k <= word2; k++)
|
||||
pout("%s%04x", (k == 0 ? "" : ":"), get_word(id, j+k));
|
||||
|
||||
if (is_str) {
|
||||
// Append little endian string
|
||||
pout("%*s \"", 20 - 5 * k, "");
|
||||
for (k = 0; k < 4 && j+k <= word2; k++) {
|
||||
char c2 = ((const char *)id)[2*(j+k) ];
|
||||
char c1 = ((const char *)id)[2*(j+k) + 1];
|
||||
pout("%c%c", (' ' <= c1 && c1 <= '~' ? c1 : '.'),
|
||||
(' ' <= c2 && c2 <= '~' ? c2 : '.') );
|
||||
}
|
||||
pout("\"");
|
||||
}
|
||||
}
|
||||
|
||||
// Print decimal value of D/QWords
|
||||
if (word + 1 == word2 && strstr(desc, "(DWord)"))
|
||||
pout(" (%u)\n", ((unsigned)get_word(id, word2) << 16) | w);
|
||||
else if (word + 3 == word2 && strstr(desc, "(QWord)"))
|
||||
pout(" (%"PRIu64")\n", ((uint64_t)get_word(id, word + 3) << 48)
|
||||
| ((uint64_t)get_word(id, word + 2) << 32)
|
||||
| ((unsigned)get_word(id, word + 1) << 16) | (unsigned)w);
|
||||
else
|
||||
pout("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Print word
|
||||
if (all_words || w_is_set)
|
||||
pout("%s%4d %s0x%04x %s\n",
|
||||
(bit_level >= 0 ? "\n" : ""), word,
|
||||
(bit_level >= 0 ? "- " : ""), w, desc);
|
||||
}
|
||||
|
||||
prev_word = (word2 >= 0 ? word2 : word);
|
||||
prev_bit = -1;
|
||||
}
|
||||
}
|
||||
|
||||
pout("\n");
|
||||
}
|
25
ataidentify.h
Normal file
25
ataidentify.h
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* ataidentify.h
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ATAIDENTIFY_H
|
||||
#define ATAIDENTIFY_H
|
||||
|
||||
#define ATAIDENTIFY_H_CVSID "$Id: ataidentify.h 3610 2012-09-20 21:27:19Z chrfranke $"
|
||||
|
||||
void ata_print_identify_data(const void * id, bool all_words, int bit_level);
|
||||
|
||||
#endif // ATAIDENTIFY_H
|
652
ataprint.cpp
652
ataprint.cpp
File diff suppressed because it is too large
Load Diff
10
ataprint.h
10
ataprint.h
@ -13,8 +13,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -26,7 +25,7 @@
|
||||
#ifndef ATAPRINT_H_
|
||||
#define ATAPRINT_H_
|
||||
|
||||
#define ATAPRINT_H_CVSID "$Id: ataprint.h 3530 2012-03-27 19:54:06Z chrfranke $\n"
|
||||
#define ATAPRINT_H_CVSID "$Id: ataprint.h 3609 2012-09-20 21:24:43Z chrfranke $\n"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -47,6 +46,7 @@ struct ata_log_request
|
||||
struct ata_print_options
|
||||
{
|
||||
bool drive_info;
|
||||
int identify_word_level, identify_bit_level;
|
||||
bool smart_check_status;
|
||||
bool smart_general_values;
|
||||
bool smart_vendor_attrib;
|
||||
@ -84,7 +84,7 @@ struct ata_print_options
|
||||
enum { FMT_BRIEF = 0x01, FMT_HEX_ID = 0x02, FMT_HEX_VAL = 0x04 };
|
||||
unsigned char output_format; // FMT_* flags
|
||||
|
||||
unsigned char fix_firmwarebug; // FIX_*, see atacmds.h
|
||||
firmwarebug_defs firmwarebugs; // -F options
|
||||
bool fix_swapped_id; // Fix swapped ID strings returned by some buggy drivers
|
||||
|
||||
ata_vendor_attr_defs attribute_defs; // -v options
|
||||
@ -109,6 +109,7 @@ struct ata_print_options
|
||||
|
||||
ata_print_options()
|
||||
: drive_info(false),
|
||||
identify_word_level(-1), identify_bit_level(-1),
|
||||
smart_check_status(false),
|
||||
smart_general_values(false),
|
||||
smart_vendor_attrib(false),
|
||||
@ -131,7 +132,6 @@ struct ata_print_options
|
||||
smart_selftest_type(-1), smart_selftest_force(false),
|
||||
sct_temp_int(0), sct_temp_int_pers(false),
|
||||
output_format(0),
|
||||
fix_firmwarebug(FIX_NOTSPECIFIED),
|
||||
fix_swapped_id(false),
|
||||
ignore_presets(false),
|
||||
show_presets(false),
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# $Id: autogen.sh 3537 2012-04-28 13:22:41Z chrfranke $
|
||||
# $Id: autogen.sh 3748 2013-01-18 20:12:44Z chrfranke $
|
||||
#
|
||||
# Generate ./configure from config.in and Makefile.in from Makefile.am.
|
||||
# This also adds files like missing,depcomp,install-sh to the source
|
||||
@ -32,7 +32,8 @@ typep()
|
||||
return 1
|
||||
}
|
||||
|
||||
test -x "$AUTOMAKE" || AUTOMAKE=`typep automake-1.11` || AUTOMAKE=`typep automake-1.10` ||
|
||||
test -x "$AUTOMAKE" || AUTOMAKE=`typep automake-1.12` ||
|
||||
AUTOMAKE=`typep automake-1.11` || AUTOMAKE=`typep automake-1.10` ||
|
||||
AUTOMAKE=`typep automake-1.9` || AUTOMAKE=`typep automake-1.8` ||
|
||||
AUTOMAKE=`typep automake-1.7` || AUTOMAKE=`typep automake17` ||
|
||||
{
|
||||
@ -83,7 +84,7 @@ case "$ver" in
|
||||
rm -f casetest.tmp
|
||||
;;
|
||||
|
||||
1.9.[1-6]|1.10|1.10.[12]|1.11|1.11.[1-3])
|
||||
1.9.[1-6]|1.10|1.10.[12]|1.11|1.11.[1-6]|1.12.[3-5])
|
||||
# OK
|
||||
;;
|
||||
|
||||
|
@ -24,6 +24,10 @@
|
||||
# define _HAVE_CCISS
|
||||
#elif defined(__FreeBSD_kernel__)
|
||||
# include <endian.h>
|
||||
# ifdef __GLIBC__
|
||||
# include <bsd/sys/cdefs.h>
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
# include CISS_LOCATION
|
||||
# define _HAVE_CCISS
|
||||
#endif
|
||||
@ -34,7 +38,7 @@
|
||||
#include "scsicmds.h"
|
||||
#include "utility.h"
|
||||
|
||||
const char * cciss_cpp_cvsid = "$Id: cciss.cpp 3446 2011-10-13 22:36:28Z samm2 $"
|
||||
const char * cciss_cpp_cvsid = "$Id: cciss.cpp 3578 2012-07-20 17:26:32Z chrfranke $"
|
||||
CCISS_H_CVSID;
|
||||
|
||||
typedef struct _ReportLUNdata_struct
|
||||
|
@ -1,15 +1,15 @@
|
||||
#
|
||||
# $Id: configure.in 3527 2012-03-25 16:42:24Z chrfranke $
|
||||
# $Id: configure.ac 3811 2013-04-20 17:10:41Z chrfranke $
|
||||
#
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(smartmontools, 5.43, smartmontools-support@lists.sourceforge.net)
|
||||
AC_INIT(smartmontools, 6.2, smartmontools-support@lists.sourceforge.net)
|
||||
AC_CONFIG_SRCDIR(smartctl.cpp)
|
||||
|
||||
smartmontools_configure_date=`date -u +'%Y-%m-%d %T %Z'`
|
||||
smartmontools_cvs_tag=`echo '$Id: configure.in 3527 2012-03-25 16:42:24Z chrfranke $'`
|
||||
smartmontools_release_date=2011-10-20
|
||||
smartmontools_release_time="19:19:34 UTC"
|
||||
smartmontools_cvs_tag=`echo '$Id: configure.ac 3811 2013-04-20 17:10:41Z chrfranke $'`
|
||||
smartmontools_release_date=2013-03-16
|
||||
smartmontools_release_time="14:35:27 UTC"
|
||||
|
||||
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args", [smartmontools Configure Arguments])
|
||||
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_DATE, "$smartmontools_configure_date", [smartmontools Configure Date])
|
||||
@ -48,8 +48,8 @@ case "${host}" in
|
||||
/usr/bin/uname | grep -i '^CYGWIN' >/dev/null; then
|
||||
AC_MSG_ERROR([Build with MinGW on Cygwin requires cross-compilation, see INSTALL file.])
|
||||
fi
|
||||
AC_CHECK_PROGS(WINDMC, [${host}-windmc windmc])
|
||||
AC_CHECK_PROGS(WINDRES, [${host}-windres windres])
|
||||
AC_CHECK_TOOL(WINDMC, [windmc])
|
||||
AC_CHECK_TOOL(WINDRES, [windres])
|
||||
|
||||
AC_MSG_CHECKING([checking for makensis])
|
||||
if test -z "$MAKENSIS"; then
|
||||
@ -80,14 +80,6 @@ AC_SUBST([svn_deps])
|
||||
AM_CONDITIONAL(IS_SVN_BUILD, [test "$is_svn_build" = "yes"])
|
||||
AC_MSG_RESULT([$is_svn_build])
|
||||
|
||||
dnl Checks for libraries needed for name services (Solaris needs
|
||||
dnl libnsl, might in the future also need libsocket)
|
||||
# AC_SEARCH_LIBS (FUNCTION, SEARCH-LIBS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
AC_SEARCH_LIBS(getaddrinfo, nsl)
|
||||
AC_SEARCH_LIBS(getdomainname, nsl)
|
||||
|
||||
# Note: On Linux, clock_gettime() requires -lrt which implies -lpthreads
|
||||
# Check ommitted for now, gettimeofday() provides reasonable precision
|
||||
# AC_SEARCH_LIBS(clock_gettime, rt)
|
||||
@ -134,10 +126,6 @@ AM_CONDITIONAL(NEED_GETOPT_LONG, [test "$need_getopt_long" = "yes"])
|
||||
AC_CHECK_FUNCS([regcomp], [need_regex=no], [need_regex=yes])
|
||||
AM_CONDITIONAL(NEED_REGEX, [test "$need_regex" = "yes"])
|
||||
|
||||
AC_CHECK_FUNCS([getdomainname])
|
||||
AC_CHECK_FUNCS([gethostname])
|
||||
AC_CHECK_FUNCS([getaddrinfo])
|
||||
AC_CHECK_FUNCS([gethostbyname])
|
||||
AC_CHECK_FUNCS([sigset])
|
||||
AC_CHECK_FUNCS([strtoull])
|
||||
AC_CHECK_FUNCS([uname])
|
||||
@ -347,7 +335,10 @@ AC_SUBST(smartmontools_release_time)
|
||||
# Set platform-specific modules and symbols
|
||||
os_libs=
|
||||
os_dltools='curl wget lynx'
|
||||
os_mailer=
|
||||
os_mailer=mail
|
||||
os_hostname="'hostname'"
|
||||
os_dnsdomainname=
|
||||
os_nisdomainname="'domainname'"
|
||||
os_darwin=no
|
||||
os_solaris=no
|
||||
os_win32=no
|
||||
@ -356,11 +347,13 @@ os_win64=no
|
||||
os_man_filter=
|
||||
case "${host}" in
|
||||
*-*-linux*)
|
||||
os_deps='os_linux.o cciss.o'
|
||||
os_deps='os_linux.o cciss.o dev_areca.o'
|
||||
os_dnsdomainname="'dnsdomainname' 'hostname -d'"
|
||||
os_nisdomainname="'nisdomainname' 'hostname -y' 'domainname'"
|
||||
os_man_filter=Linux
|
||||
;;
|
||||
*-*-freebsd*|*-*-dragonfly*|*-*-kfreebsd*-gnu*)
|
||||
os_deps='os_freebsd.o cciss.o'
|
||||
os_deps='os_freebsd.o cciss.o dev_areca.o'
|
||||
os_libs='-lcam'
|
||||
os_dltools='curl wget lynx fetch'
|
||||
AC_CHECK_LIB(usb, libusb20_dev_get_device_desc)
|
||||
@ -390,19 +383,22 @@ case "${host}" in
|
||||
os_man_filter=OpenBSD
|
||||
;;
|
||||
*-*-cygwin*)
|
||||
os_deps='os_win32.o'
|
||||
os_deps='os_win32.o dev_areca.o'
|
||||
os_hostname="'hostname' 'echo "'"${HOSTNAME?unset}"'"'"
|
||||
os_dnsdomainname="'dnsdomainname' 'hostname -d' 'echo "'"${USERDNSDOMAIN?unset}"'"'"
|
||||
os_nisdomainname=
|
||||
os_win32=yes
|
||||
os_man_filter=Cygwin
|
||||
;;
|
||||
x86_64-*-mingw*)
|
||||
os_deps='os_win32.o'
|
||||
os_deps='os_win32.o dev_areca.o'
|
||||
os_win32=yes
|
||||
os_win32_mingw=yes
|
||||
os_win64=yes
|
||||
os_man_filter=Windows
|
||||
;;
|
||||
*-*-mingw*)
|
||||
os_deps='os_win32.o'
|
||||
os_deps='os_win32.o dev_areca.o'
|
||||
os_win32=yes
|
||||
os_win32_mingw=yes
|
||||
os_man_filter=Windows
|
||||
@ -439,10 +435,11 @@ AC_MSG_RESULT([$os_new_interface])
|
||||
AC_SUBST([os_deps])
|
||||
AC_SUBST([os_libs])
|
||||
AC_SUBST([os_dltools])
|
||||
AC_SUBST([os_mailer])
|
||||
AC_SUBST([os_hostname])
|
||||
AC_SUBST([os_dnsdomainname])
|
||||
AC_SUBST([os_nisdomainname])
|
||||
AC_SUBST([os_man_filter])
|
||||
if test -n "$os_mailer"; then
|
||||
AC_DEFINE_UNQUOTED(DEFAULT_MAILER, "$os_mailer", [Default mailer if "mail" is unavailable])
|
||||
fi
|
||||
|
||||
# Create drivedb.h update branch name from version: 5.41[.X] -> RELEASE_5_41_DRIVEDB
|
||||
DRIVEDB_BRANCH=`echo $VERSION | sed 's,^\([[0-9]]*\.[[0-9]]*\)\..*$,\1,' \
|
||||
@ -458,7 +455,6 @@ AM_CONDITIONAL(OS_SOLARIS, [test "$os_solaris" = "yes"])
|
||||
AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
|
||||
AM_CONDITIONAL(OS_WIN32_MINGW, [test "$os_win32_mingw" = "yes"])
|
||||
AM_CONDITIONAL(OS_WIN32_NSIS, [test -n "$MAKENSIS"])
|
||||
AM_CONDITIONAL(OS_WIN32_WINDMC, [test -n "$WINDMC" && test "$WINDMC" != "no" && test -n "$WINDRES"])
|
||||
AM_CONDITIONAL(OS_WIN64, [test "$os_win64" = "yes"])
|
||||
|
||||
dnl Add -Wall and -W if using g++ and its not already specified.
|
||||
@ -548,6 +544,7 @@ case "$host_os" in
|
||||
fi
|
||||
echo "local drive database: `eval eval eval echo $sysconfdir`/smart_drivedb.h" >&AS_MESSAGE_FD
|
||||
echo "smartd config file: `eval eval eval echo $sysconfdir`/smartd.conf${smartd_suffix}" >&AS_MESSAGE_FD
|
||||
echo "smartd warning script: `eval eval eval echo $sysconfdir`/smartd_warning.sh" >&AS_MESSAGE_FD
|
||||
if test -n "$initddir"; then
|
||||
echo "smartd initd script: `eval eval eval echo $initddir`/smartd${smartd_suffix}" >&AS_MESSAGE_FD
|
||||
elif test -z "$systemdsystemunitdir"; then
|
@ -236,7 +236,11 @@ typedef struct _IOCTL_HEADER {
|
||||
|
||||
#define __u8 unsigned char
|
||||
#define __u16 unsigned short
|
||||
#ifndef __LP64__ // ILP32 (32-bit), LLP64 (64-bit MSVC, MinGW)
|
||||
#define __u32 unsigned long
|
||||
#else // LP64 (64-bit Cygwin)
|
||||
#define __u32 unsigned int
|
||||
#endif
|
||||
#define __u64 unsigned __int64
|
||||
|
||||
#define __i8 char
|
||||
|
704
dev_areca.cpp
Normal file
704
dev_areca.cpp
Normal file
@ -0,0 +1,704 @@
|
||||
/*
|
||||
* dev_areca.cpp
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2012 Hank Wu <hank@areca.com.tw>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "int64.h"
|
||||
|
||||
#include "dev_interface.h"
|
||||
#include "dev_areca.h"
|
||||
|
||||
const char * dev_areca_cpp_cvsid = "$Id: dev_areca.cpp 3803 2013-03-24 18:52:54Z chrfranke $"
|
||||
DEV_ARECA_H_CVSID;
|
||||
|
||||
#include "atacmds.h"
|
||||
#include "scsicmds.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#if 0 // For debugging areca code
|
||||
static void dumpdata(unsigned char *block, int len)
|
||||
{
|
||||
int ln = (len / 16) + 1; // total line#
|
||||
unsigned char c;
|
||||
int pos = 0;
|
||||
|
||||
printf(" Address = %p, Length = (0x%x)%d\n", block, len, len);
|
||||
printf(" 0 1 2 3 4 5 6 7 8 9 A B C D E F ASCII \n");
|
||||
printf("=====================================================================\n");
|
||||
|
||||
for ( int l = 0; l < ln && len; l++ )
|
||||
{
|
||||
// printf the line# and the HEX data
|
||||
// if a line data length < 16 then append the space to the tail of line to reach 16 chars
|
||||
printf("%02X | ", l);
|
||||
for ( pos = 0; pos < 16 && len; pos++, len-- )
|
||||
{
|
||||
c = block[l*16+pos];
|
||||
printf("%02X ", c);
|
||||
}
|
||||
|
||||
if ( pos < 16 )
|
||||
{
|
||||
for ( int loop = pos; loop < 16; loop++ )
|
||||
{
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
|
||||
// print ASCII char
|
||||
for ( int loop = 0; loop < pos; loop++ )
|
||||
{
|
||||
c = block[l*16+loop];
|
||||
if ( c >= 0x20 && c <= 0x7F )
|
||||
{
|
||||
printf("%c", c);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(".");
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("=====================================================================\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
generic_areca_device::generic_areca_device(smart_interface * intf, const char * dev_name, int disknum, int encnum)
|
||||
: smart_device(intf, dev_name, "areca", "areca"),
|
||||
m_disknum(disknum),
|
||||
m_encnum(encnum)
|
||||
{
|
||||
set_info().info_name = strprintf("%s [areca_disk#%02d_enc#%02d]", dev_name, disknum, encnum);
|
||||
}
|
||||
|
||||
generic_areca_device::~generic_areca_device() throw()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// PURPOSE
|
||||
// This is an interface routine meant to isolate the OS dependent
|
||||
// parts of the code, and to provide a debugging interface. Each
|
||||
// different port and OS needs to provide it's own interface. This
|
||||
// is the Windows interface to the Areca "arcmsr" driver. It allows ATA
|
||||
// commands to be passed through the SCSI driver.
|
||||
// DETAILED DESCRIPTION OF ARGUMENTS
|
||||
// fd: is the file descriptor provided by open()
|
||||
// disknum is the disk number (0 to 127) in the RAID array
|
||||
// command: defines the different operations.
|
||||
// select: additional input data if needed (which log, which type of
|
||||
// self-test).
|
||||
// data: location to write output data, if needed (512 bytes).
|
||||
// Note: not all commands use all arguments.
|
||||
// RETURN VALUES
|
||||
// -1 if the command failed
|
||||
// 0 if the command succeeded,
|
||||
// STATUS_CHECK routine:
|
||||
// -1 if the command failed
|
||||
// 0 if the command succeeded and disk SMART status is "OK"
|
||||
// 1 if the command succeeded and disk SMART status is "FAILING"
|
||||
int generic_areca_device::arcmsr_command_handler(unsigned long arcmsr_cmd, unsigned char *data, int data_len)
|
||||
{
|
||||
unsigned int cmds[] =
|
||||
{
|
||||
ARCMSR_IOCTL_READ_RQBUFFER,
|
||||
ARCMSR_IOCTL_WRITE_WQBUFFER,
|
||||
ARCMSR_IOCTL_CLEAR_RQBUFFER,
|
||||
ARCMSR_IOCTL_CLEAR_WQBUFFER,
|
||||
ARCMSR_IOCTL_RETURN_CODE_3F
|
||||
};
|
||||
|
||||
int ioctlreturn = 0;
|
||||
sSRB_BUFFER sBuf;
|
||||
struct scsi_cmnd_io iop;
|
||||
int dir = DXFER_TO_DEVICE;
|
||||
|
||||
UINT8 cdb[10]={0};
|
||||
UINT8 sense[32]={0};
|
||||
|
||||
unsigned char *areca_return_packet;
|
||||
int total = 0;
|
||||
int expected = -1;
|
||||
unsigned char return_buff[2048]={0};
|
||||
unsigned char *ptr = &return_buff[0];
|
||||
|
||||
memset((unsigned char *)&sBuf, 0, sizeof(sBuf));
|
||||
memset(&iop, 0, sizeof(iop));
|
||||
|
||||
sBuf.srbioctl.HeaderLength = sizeof(sARCMSR_IO_HDR);
|
||||
memcpy(sBuf.srbioctl.Signature, ARECA_SIG_STR, strlen(ARECA_SIG_STR));
|
||||
sBuf.srbioctl.Timeout = 10000;
|
||||
sBuf.srbioctl.ControlCode = cmds[arcmsr_cmd];
|
||||
|
||||
if(arcmsr_cmd >= ARCMSR_CMD_TOTAL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch ( arcmsr_cmd )
|
||||
{
|
||||
// command for writing data to driver
|
||||
case ARCMSR_WRITE_WQBUFFER:
|
||||
if ( data && data_len )
|
||||
{
|
||||
sBuf.srbioctl.Length = data_len;
|
||||
memcpy((unsigned char *)sBuf.ioctldatabuffer, (unsigned char *)data, data_len);
|
||||
}
|
||||
// commands for clearing related buffer of driver
|
||||
case ARCMSR_CLEAR_RQBUFFER:
|
||||
case ARCMSR_CLEAR_WQBUFFER:
|
||||
cdb[0] = 0x3B; //SCSI_WRITE_BUF command;
|
||||
break;
|
||||
// command for reading data from driver
|
||||
case ARCMSR_READ_RQBUFFER:
|
||||
// command for identifying driver
|
||||
case ARCMSR_RETURN_CODE_3F:
|
||||
cdb[0] = 0x3C; //SCSI_READ_BUF command;
|
||||
dir = DXFER_FROM_DEVICE;
|
||||
break;
|
||||
default:
|
||||
// unknown arcmsr commands
|
||||
return -1;
|
||||
}
|
||||
|
||||
cdb[1] = 0x01;
|
||||
cdb[2] = 0xf0;
|
||||
cdb[5] = cmds[arcmsr_cmd] >> 24;
|
||||
cdb[6] = cmds[arcmsr_cmd] >> 16;
|
||||
cdb[7] = cmds[arcmsr_cmd] >> 8;
|
||||
cdb[8] = cmds[arcmsr_cmd] & 0x0F;
|
||||
|
||||
iop.dxfer_dir = dir;
|
||||
iop.dxfer_len = sizeof(sBuf);
|
||||
iop.dxferp = (unsigned char *)&sBuf;
|
||||
iop.cmnd = cdb;
|
||||
iop.cmnd_len = sizeof(cdb);
|
||||
iop.sensep = sense;
|
||||
iop.max_sense_len = sizeof(sense);
|
||||
iop.timeout = SCSI_TIMEOUT_DEFAULT;
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
ioctlreturn = arcmsr_do_scsi_io(&iop);
|
||||
if(ioctlreturn || iop.scsi_status)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if ( arcmsr_cmd != ARCMSR_READ_RQBUFFER )
|
||||
{
|
||||
// if succeeded, just returns the length of outgoing data
|
||||
return data_len;
|
||||
}
|
||||
|
||||
if ( sBuf.srbioctl.Length )
|
||||
{
|
||||
memcpy(ptr, &sBuf.ioctldatabuffer[0], sBuf.srbioctl.Length);
|
||||
ptr += sBuf.srbioctl.Length;
|
||||
total += sBuf.srbioctl.Length;
|
||||
// the returned bytes enough to compute payload length ?
|
||||
if ( expected < 0 && total >= 5 )
|
||||
{
|
||||
areca_return_packet = (unsigned char *)&return_buff[0];
|
||||
if ( areca_return_packet[0] == 0x5E &&
|
||||
areca_return_packet[1] == 0x01 &&
|
||||
areca_return_packet[2] == 0x61 )
|
||||
{
|
||||
// valid header, let's compute the returned payload length,
|
||||
// we expected the total length is
|
||||
// payload + 3 bytes header + 2 bytes length + 1 byte checksum
|
||||
expected = areca_return_packet[4] * 256 + areca_return_packet[3] + 6;
|
||||
}
|
||||
}
|
||||
|
||||
if ( total >= 7 && total >= expected )
|
||||
{
|
||||
//printf("total bytes received = %d, expected length = %d\n", total, expected);
|
||||
|
||||
// ------ Okay! we received enough --------
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deal with the different error cases
|
||||
if ( arcmsr_cmd == ARCMSR_RETURN_CODE_3F )
|
||||
{
|
||||
// Silence the ARCMSR_IOCTL_RETURN_CODE_3F's error, no pout(...)
|
||||
return -4;
|
||||
}
|
||||
|
||||
if ( ioctlreturn )
|
||||
{
|
||||
pout("do_scsi_cmnd_io with write buffer failed code = %x\n", ioctlreturn);
|
||||
return -2;
|
||||
}
|
||||
|
||||
if ( iop.scsi_status )
|
||||
{
|
||||
pout("io_hdr.scsi_status with write buffer failed code = %x\n", iop.scsi_status);
|
||||
return -3;
|
||||
}
|
||||
|
||||
if ( data )
|
||||
{
|
||||
memcpy(data, return_buff, total);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
bool generic_areca_device::arcmsr_probe()
|
||||
{
|
||||
if(!is_open())
|
||||
{
|
||||
open();
|
||||
}
|
||||
|
||||
if(arcmsr_command_handler(ARCMSR_RETURN_CODE_3F, NULL, 0) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int generic_areca_device::arcmsr_ui_handler(unsigned char *areca_packet, int areca_packet_len, unsigned char *result)
|
||||
{
|
||||
int expected = 0;
|
||||
unsigned char return_buff[2048];
|
||||
unsigned char cs = 0;
|
||||
int cs_pos = 0;
|
||||
|
||||
// ----- ADD CHECKSUM -----
|
||||
cs_pos = areca_packet_len - 1;
|
||||
for(int i = 3; i < cs_pos; i++)
|
||||
{
|
||||
areca_packet[cs_pos] += areca_packet[i];
|
||||
}
|
||||
|
||||
if(!arcmsr_lock())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
expected = arcmsr_command_handler(ARCMSR_CLEAR_RQBUFFER, NULL, 0);
|
||||
if (expected==-3) {
|
||||
return set_err(EIO);
|
||||
}
|
||||
expected = arcmsr_command_handler(ARCMSR_CLEAR_WQBUFFER, NULL, 0);
|
||||
expected = arcmsr_command_handler(ARCMSR_WRITE_WQBUFFER, areca_packet, areca_packet_len);
|
||||
if ( expected > 0 )
|
||||
{
|
||||
expected = arcmsr_command_handler(ARCMSR_READ_RQBUFFER, return_buff, sizeof(return_buff));
|
||||
}
|
||||
|
||||
if ( expected < 0 )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!arcmsr_unlock())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ----- VERIFY THE CHECKSUM -----
|
||||
cs = 0;
|
||||
for ( int loop = 3; loop < expected - 1; loop++ )
|
||||
{
|
||||
cs += return_buff[loop];
|
||||
}
|
||||
|
||||
if ( return_buff[expected - 1] != cs )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(result, return_buff, expected);
|
||||
|
||||
return expected;
|
||||
}
|
||||
|
||||
int generic_areca_device::arcmsr_get_controller_type()
|
||||
{
|
||||
int expected = 0;
|
||||
unsigned char return_buff[2048];
|
||||
unsigned char areca_packet[] = {0x5E, 0x01, 0x61, 0x01, 0x00, 0x23, 0x00};
|
||||
|
||||
memset(return_buff, 0, sizeof(return_buff));
|
||||
expected = arcmsr_ui_handler(areca_packet, sizeof(areca_packet), return_buff);
|
||||
if ( expected < 0 )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return return_buff[0xc2];
|
||||
}
|
||||
|
||||
int generic_areca_device::arcmsr_get_dev_type()
|
||||
{
|
||||
int expected = 0;
|
||||
unsigned char return_buff[2048];
|
||||
int ctlr_type = -1;
|
||||
int encnum = get_encnum();
|
||||
int disknum = get_disknum();
|
||||
unsigned char areca_packet[] = {0x5E, 0x01, 0x61, 0x03, 0x00, 0x22,
|
||||
(unsigned char)(disknum - 1), (unsigned char)(encnum - 1), 0x00};
|
||||
|
||||
memset(return_buff, 0, sizeof(return_buff));
|
||||
expected = arcmsr_ui_handler(areca_packet, sizeof(areca_packet), return_buff);
|
||||
if ( expected < 0 )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ctlr_type = arcmsr_get_controller_type();
|
||||
|
||||
if( ctlr_type < 0 )
|
||||
{
|
||||
return ctlr_type;
|
||||
}
|
||||
|
||||
if( ctlr_type == 0x02/* SATA Controllers */ ||
|
||||
(ctlr_type == 0x03 /* SAS Controllers */ && return_buff[0x52] & 0x01 /* SATA devices behind SAS Controller */) )
|
||||
{
|
||||
// SATA device
|
||||
return 1;
|
||||
}
|
||||
|
||||
// SAS device
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool generic_areca_device::arcmsr_ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
|
||||
{
|
||||
// ATA input registers
|
||||
typedef struct _ATA_INPUT_REGISTERS
|
||||
{
|
||||
unsigned char features;
|
||||
unsigned char sector_count;
|
||||
unsigned char sector_number;
|
||||
unsigned char cylinder_low;
|
||||
unsigned char cylinder_high;
|
||||
unsigned char device_head;
|
||||
unsigned char command;
|
||||
unsigned char reserved[8];
|
||||
unsigned char data[512]; // [in/out] buffer for outgoing/incoming data
|
||||
} sATA_INPUT_REGISTERS;
|
||||
|
||||
// ATA output registers
|
||||
// Note: The output registers is re-sorted for areca internal use only
|
||||
typedef struct _ATA_OUTPUT_REGISTERS
|
||||
{
|
||||
unsigned char error;
|
||||
unsigned char status;
|
||||
unsigned char sector_count;
|
||||
unsigned char sector_number;
|
||||
unsigned char cylinder_low;
|
||||
unsigned char cylinder_high;
|
||||
} sATA_OUTPUT_REGISTERS;
|
||||
|
||||
// Areca packet format for outgoing:
|
||||
// B[0~2] : 3 bytes header, fixed value 0x5E, 0x01, 0x61
|
||||
// B[3~4] : 2 bytes command length + variant data length, little endian
|
||||
// B[5] : 1 bytes areca defined command code, ATA passthrough command code is 0x1c
|
||||
// B[6~last-1] : variant bytes payload data
|
||||
// B[last] : 1 byte checksum, simply sum(B[3] ~ B[last -1])
|
||||
//
|
||||
//
|
||||
// header 3 bytes length 2 bytes cmd 1 byte payload data x bytes cs 1 byte
|
||||
// +--------------------------------------------------------------------------------+
|
||||
// + 0x5E 0x01 0x61 | 0x00 0x00 | 0x1c | .................... | 0x00 |
|
||||
// +--------------------------------------------------------------------------------+
|
||||
//
|
||||
|
||||
//Areca packet format for incoming:
|
||||
// B[0~2] : 3 bytes header, fixed value 0x5E, 0x01, 0x61
|
||||
// B[3~4] : 2 bytes payload length, little endian
|
||||
// B[5~last-1] : variant bytes returned payload data
|
||||
// B[last] : 1 byte checksum, simply sum(B[3] ~ B[last -1])
|
||||
//
|
||||
//
|
||||
// header 3 bytes length 2 bytes payload data x bytes cs 1 byte
|
||||
// +-------------------------------------------------------------------+
|
||||
// + 0x5E 0x01 0x61 | 0x00 0x00 | .................... | 0x00 |
|
||||
// +-------------------------------------------------------------------+
|
||||
unsigned char areca_packet[640];
|
||||
int areca_packet_len = sizeof(areca_packet);
|
||||
unsigned char return_buff[2048];
|
||||
int expected = 0;
|
||||
|
||||
sATA_INPUT_REGISTERS *ata_cmd;
|
||||
|
||||
// For debugging
|
||||
#if 0
|
||||
memset(sInq, 0, sizeof(sInq));
|
||||
scsiStdInquiry(fd, (unsigned char *)sInq, (int)sizeof(sInq));
|
||||
dumpdata((unsigned char *)sInq, sizeof(sInq));
|
||||
#endif
|
||||
memset(areca_packet, 0, areca_packet_len);
|
||||
|
||||
// ----- BEGIN TO SETUP HEADERS -------
|
||||
areca_packet[0] = 0x5E;
|
||||
areca_packet[1] = 0x01;
|
||||
areca_packet[2] = 0x61;
|
||||
areca_packet[3] = (unsigned char)((areca_packet_len - 6) & 0xff);
|
||||
areca_packet[4] = (unsigned char)(((areca_packet_len - 6) >> 8) & 0xff);
|
||||
areca_packet[5] = 0x1c; // areca defined code for ATA passthrough command
|
||||
|
||||
// ----- BEGIN TO SETUP PAYLOAD DATA -----
|
||||
memcpy(&areca_packet[7], "SmrT", 4); // areca defined password
|
||||
ata_cmd = (sATA_INPUT_REGISTERS *)&areca_packet[12];
|
||||
|
||||
// Set registers
|
||||
{
|
||||
const ata_in_regs & r = in.in_regs;
|
||||
ata_cmd->features = r.features;
|
||||
ata_cmd->sector_count = r.sector_count;
|
||||
ata_cmd->sector_number = r.lba_low;
|
||||
ata_cmd->cylinder_low = r.lba_mid;
|
||||
ata_cmd->cylinder_high = r.lba_high;
|
||||
ata_cmd->device_head = r.device;
|
||||
ata_cmd->command = r.command;
|
||||
}
|
||||
bool readdata = false;
|
||||
if (in.direction == ata_cmd_in::data_in) {
|
||||
readdata = true;
|
||||
// the command will read data
|
||||
areca_packet[6] = 0x13;
|
||||
}
|
||||
else if ( in.direction == ata_cmd_in::no_data )
|
||||
{
|
||||
// the commands will return no data
|
||||
areca_packet[6] = 0x15;
|
||||
}
|
||||
else if (in.direction == ata_cmd_in::data_out)
|
||||
{
|
||||
// the commands will write data
|
||||
memcpy(ata_cmd->data, in.buffer, in.size);
|
||||
areca_packet[6] = 0x14;
|
||||
}
|
||||
else {
|
||||
// COMMAND NOT SUPPORTED VIA ARECA IOCTL INTERFACE
|
||||
return set_err(ENOSYS);
|
||||
}
|
||||
|
||||
areca_packet[11] = get_disknum() - 1; // disk#
|
||||
areca_packet[19] = get_encnum() - 1; // enc#
|
||||
|
||||
// ----- BEGIN TO SEND TO ARECA DRIVER ------
|
||||
expected = arcmsr_ui_handler(areca_packet, areca_packet_len, return_buff);
|
||||
if ( expected < 0 )
|
||||
{
|
||||
return set_err(EIO);
|
||||
}
|
||||
|
||||
sATA_OUTPUT_REGISTERS *ata_out = (sATA_OUTPUT_REGISTERS *)&return_buff[5] ;
|
||||
if ( ata_out->status )
|
||||
{
|
||||
if ( in.in_regs.command == ATA_IDENTIFY_DEVICE
|
||||
&& !nonempty((unsigned char *)in.buffer, in.size))
|
||||
{
|
||||
return set_err(ENODEV, "No drive on port %d", get_disknum());
|
||||
}
|
||||
}
|
||||
|
||||
// returns with data
|
||||
if (readdata)
|
||||
{
|
||||
memcpy(in.buffer, &return_buff[7], in.size);
|
||||
}
|
||||
|
||||
// Return register values
|
||||
{
|
||||
ata_out_regs & r = out.out_regs;
|
||||
r.error = ata_out->error;
|
||||
r.sector_count = ata_out->sector_count;
|
||||
r.lba_low = ata_out->sector_number;
|
||||
r.lba_mid = ata_out->cylinder_low;
|
||||
r.lba_high = ata_out->cylinder_high;
|
||||
r.status = ata_out->status;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool generic_areca_device::arcmsr_scsi_pass_through(struct scsi_cmnd_io * iop)
|
||||
{
|
||||
// Areca packet format for outgoing:
|
||||
// B[0~2] : 3 bytes header, fixed value 0x5E, 0x01, 0x61
|
||||
// B[3~4] : 2 bytes command length + variant data length, little endian
|
||||
// B[5] : 1 bytes areca defined command code
|
||||
// B[6~last-1] : variant bytes payload data
|
||||
// B[last] : 1 byte checksum, simply sum(B[3] ~ B[last -1])
|
||||
//
|
||||
//
|
||||
// header 3 bytes length 2 bytes cmd 1 byte payload data x bytes cs 1 byte
|
||||
// +--------------------------------------------------------------------------------+
|
||||
// + 0x5E 0x01 0x61 | 0x00 0x00 | 0x1c | .................... | 0x00 |
|
||||
// +--------------------------------------------------------------------------------+
|
||||
//
|
||||
|
||||
//Areca packet format for incoming:
|
||||
// B[0~2] : 3 bytes header, fixed value 0x5E, 0x01, 0x61
|
||||
// B[3~4] : 2 bytes payload length, little endian
|
||||
// B[5~last-1] : variant bytes returned payload data
|
||||
// B[last] : 1 byte checksum, simply sum(B[3] ~ B[last -1])
|
||||
//
|
||||
//
|
||||
// header 3 bytes length 2 bytes payload data x bytes cs 1 byte
|
||||
// +-------------------------------------------------------------------+
|
||||
// + 0x5E 0x01 0x61 | 0x00 0x00 | .................... | 0x00 |
|
||||
// +-------------------------------------------------------------------+
|
||||
unsigned char areca_packet[640];
|
||||
int areca_packet_len = sizeof(areca_packet);
|
||||
unsigned char return_buff[2048];
|
||||
int expected = 0;
|
||||
|
||||
if (iop->cmnd_len > 16) {
|
||||
set_err(EINVAL, "cmnd_len too large");
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(areca_packet, 0, areca_packet_len);
|
||||
|
||||
// ----- BEGIN TO SETUP HEADERS -------
|
||||
areca_packet[0] = 0x5E;
|
||||
areca_packet[1] = 0x01;
|
||||
areca_packet[2] = 0x61;
|
||||
areca_packet[3] = (unsigned char)((areca_packet_len - 6) & 0xff);
|
||||
areca_packet[4] = (unsigned char)(((areca_packet_len - 6) >> 8) & 0xff);
|
||||
areca_packet[5] = 0x1c;
|
||||
|
||||
// ----- BEGIN TO SETUP PAYLOAD DATA -----
|
||||
areca_packet[6] = 0x16; // scsi pass through
|
||||
memcpy(&areca_packet[7], "SmrT", 4); // areca defined password
|
||||
areca_packet[12] = iop->cmnd_len; // cdb length
|
||||
memcpy( &areca_packet[35], iop->cmnd, iop->cmnd_len); // cdb
|
||||
areca_packet[15] = (unsigned char)iop->dxfer_len; // 15(LSB) ~ 18(MSB): data length ( max=512 bytes)
|
||||
areca_packet[16] = (unsigned char)(iop->dxfer_len >> 8);
|
||||
areca_packet[17] = (unsigned char)(iop->dxfer_len >> 16);
|
||||
areca_packet[18] = (unsigned char)(iop->dxfer_len >> 24);
|
||||
if(iop->dxfer_dir == DXFER_TO_DEVICE)
|
||||
{
|
||||
areca_packet[13] |= 0x01;
|
||||
memcpy(&areca_packet[67], iop->dxferp, iop->dxfer_len);
|
||||
}
|
||||
else if (iop->dxfer_dir == DXFER_FROM_DEVICE)
|
||||
{
|
||||
}
|
||||
else if( iop->dxfer_dir == DXFER_NONE)
|
||||
{
|
||||
}
|
||||
else {
|
||||
// COMMAND NOT SUPPORTED VIA ARECA IOCTL INTERFACE
|
||||
return set_err(ENOSYS);
|
||||
}
|
||||
|
||||
areca_packet[11] = get_disknum() - 1; // disk#
|
||||
areca_packet[19] = get_encnum() - 1; // enc#
|
||||
|
||||
// ----- BEGIN TO SEND TO ARECA DRIVER ------
|
||||
expected = arcmsr_ui_handler(areca_packet, areca_packet_len, return_buff);
|
||||
if ( expected < 0 )
|
||||
{
|
||||
return set_err(EIO);
|
||||
}
|
||||
|
||||
int scsi_status = return_buff[5];
|
||||
int in_data_len = return_buff[11] | return_buff[12] << 8 | return_buff[13] << 16 | return_buff[14] << 24;
|
||||
|
||||
if (iop->dxfer_dir == DXFER_FROM_DEVICE)
|
||||
{
|
||||
memset(iop->dxferp, 0, iop->dxfer_len); // need?
|
||||
memcpy(iop->dxferp, &return_buff[15], in_data_len);
|
||||
}
|
||||
|
||||
if(scsi_status == 0xE1 /* Underrun, actual data length < requested data length */)
|
||||
{
|
||||
// don't care, just ignore
|
||||
scsi_status = 0x0;
|
||||
}
|
||||
|
||||
if(scsi_status != 0x00 && scsi_status != SCSI_STATUS_CHECK_CONDITION)
|
||||
{
|
||||
return set_err(EIO);
|
||||
}
|
||||
|
||||
if(scsi_status == SCSI_STATUS_CHECK_CONDITION)
|
||||
{
|
||||
// check condition
|
||||
iop->scsi_status = SCSI_STATUS_CHECK_CONDITION;
|
||||
iop->resp_sense_len = 4;
|
||||
iop->sensep[0] = return_buff[7];
|
||||
iop->sensep[1] = return_buff[8];
|
||||
iop->sensep[2] = return_buff[9];
|
||||
iop->sensep[3] = return_buff[10];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
areca_ata_device::areca_ata_device(smart_interface * intf, const char * dev_name, int disknum, int encnum)
|
||||
: smart_device(intf, dev_name, "areca", "areca")
|
||||
{
|
||||
set_encnum(encnum);
|
||||
set_disknum(disknum);
|
||||
set_info().info_name = strprintf("%s [areca_disk#%02d_enc#%02d]", dev_name, disknum, encnum);
|
||||
}
|
||||
|
||||
areca_ata_device::~areca_ata_device() throw()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool areca_ata_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
|
||||
{
|
||||
if (!ata_cmd_is_supported(in,
|
||||
ata_device::supports_data_out |
|
||||
ata_device::supports_output_regs |
|
||||
//ata_device::supports_multi_sector | // TODO
|
||||
ata_device::supports_48bit_hi_null,
|
||||
"Areca")
|
||||
)
|
||||
return false;
|
||||
|
||||
return arcmsr_ata_pass_through(in, out);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
areca_scsi_device::areca_scsi_device(smart_interface * intf, const char * dev_name, int disknum, int encnum)
|
||||
: smart_device(intf, dev_name, "areca", "areca")
|
||||
{
|
||||
set_encnum(encnum);
|
||||
set_disknum(disknum);
|
||||
set_info().info_name = strprintf("%s [areca_disk#%02d_enc#%02d]", dev_name, disknum, encnum);
|
||||
}
|
||||
|
||||
areca_scsi_device::~areca_scsi_device() throw()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool areca_scsi_device::scsi_pass_through(struct scsi_cmnd_io * iop)
|
||||
{
|
||||
return arcmsr_scsi_pass_through(iop);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
184
dev_areca.h
Normal file
184
dev_areca.h
Normal file
@ -0,0 +1,184 @@
|
||||
/*
|
||||
* dev_areca.h
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2012 Hank Wu <hank@areca.com.tw>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DEV_ARECA_H
|
||||
#define DEV_ARECA_H
|
||||
|
||||
#define DEV_ARECA_H_CVSID "$Id: dev_areca.h 3763 2013-01-31 22:25:25Z chrfranke $"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/// Areca RAID support
|
||||
|
||||
/* GENERIC ARECA IO CONTROL CODE*/
|
||||
enum _GENERIC_ARCMSR_CMDS
|
||||
{
|
||||
ARCMSR_READ_RQBUFFER = 0,
|
||||
ARCMSR_WRITE_WQBUFFER,
|
||||
ARCMSR_CLEAR_RQBUFFER,
|
||||
ARCMSR_CLEAR_WQBUFFER,
|
||||
ARCMSR_RETURN_CODE_3F,
|
||||
ARCMSR_CMD_TOTAL
|
||||
};
|
||||
|
||||
#define ARECA_SIG_STR "ARCMSR"
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#define ARCMSR_IOCTL_READ_RQBUFFER 0x90002004
|
||||
#define ARCMSR_IOCTL_WRITE_WQBUFFER 0x90002008
|
||||
#define ARCMSR_IOCTL_CLEAR_RQBUFFER 0x9000200C
|
||||
#define ARCMSR_IOCTL_CLEAR_WQBUFFER 0x90002010
|
||||
#define ARCMSR_IOCTL_RETURN_CODE_3F 0x90002018
|
||||
#elif defined(__linux__)
|
||||
/*DeviceType*/
|
||||
#define ARECA_SATA_RAID 0x90000000
|
||||
/*FunctionCode*/
|
||||
#define FUNCTION_READ_RQBUFFER 0x0801
|
||||
#define FUNCTION_WRITE_WQBUFFER 0x0802
|
||||
#define FUNCTION_CLEAR_RQBUFFER 0x0803
|
||||
#define FUNCTION_CLEAR_WQBUFFER 0x0804
|
||||
#define FUNCTION_RETURN_CODE_3F 0x0806
|
||||
|
||||
/* ARECA IO CONTROL CODE*/
|
||||
#define ARCMSR_IOCTL_READ_RQBUFFER (ARECA_SATA_RAID | FUNCTION_READ_RQBUFFER)
|
||||
#define ARCMSR_IOCTL_WRITE_WQBUFFER (ARECA_SATA_RAID | FUNCTION_WRITE_WQBUFFER)
|
||||
#define ARCMSR_IOCTL_CLEAR_RQBUFFER (ARECA_SATA_RAID | FUNCTION_CLEAR_RQBUFFER)
|
||||
#define ARCMSR_IOCTL_CLEAR_WQBUFFER (ARECA_SATA_RAID | FUNCTION_CLEAR_WQBUFFER)
|
||||
#define ARCMSR_IOCTL_RETURN_CODE_3F (ARECA_SATA_RAID | FUNCTION_RETURN_CODE_3F)
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/ioctl.h> // _IOWR
|
||||
|
||||
/*FunctionCode*/
|
||||
#define FUNCTION_READ_RQBUFFER 0x0801
|
||||
#define FUNCTION_WRITE_WQBUFFER 0x0802
|
||||
#define FUNCTION_CLEAR_RQBUFFER 0x0803
|
||||
#define FUNCTION_CLEAR_WQBUFFER 0x0804
|
||||
#define FUNCTION_RETURN_CODE_3F 0x0806
|
||||
|
||||
/* ARECA IO CONTROL CODE*/
|
||||
#define ARCMSR_IOCTL_READ_RQBUFFER _IOWR('F', FUNCTION_READ_RQBUFFER, sSRB_BUFFER)
|
||||
#define ARCMSR_IOCTL_WRITE_WQBUFFER _IOWR('F', FUNCTION_WRITE_WQBUFFER, sSRB_BUFFER)
|
||||
#define ARCMSR_IOCTL_CLEAR_RQBUFFER _IOWR('F', FUNCTION_CLEAR_RQBUFFER, sSRB_BUFFER)
|
||||
#define ARCMSR_IOCTL_CLEAR_WQBUFFER _IOWR('F', FUNCTION_CLEAR_WQBUFFER, sSRB_BUFFER)
|
||||
#define ARCMSR_IOCTL_RETURN_CODE_3F _IOWR('F', FUNCTION_RETURN_CODE_3F, sSRB_BUFFER)
|
||||
#endif
|
||||
|
||||
|
||||
// The SRB_IO_CONTROL & SRB_BUFFER structures are used to communicate(to/from) to areca driver
|
||||
typedef struct _ARCMSR_IO_HDR
|
||||
{
|
||||
unsigned int HeaderLength;
|
||||
unsigned char Signature[8];
|
||||
unsigned int Timeout;
|
||||
unsigned int ControlCode;
|
||||
unsigned int ReturnCode;
|
||||
unsigned int Length;
|
||||
} sARCMSR_IO_HDR;
|
||||
|
||||
typedef struct _SRB_BUFFER
|
||||
{
|
||||
sARCMSR_IO_HDR srbioctl;
|
||||
unsigned char ioctldatabuffer[1032]; // the buffer to put the command data to/from firmware
|
||||
} sSRB_BUFFER;
|
||||
|
||||
class generic_areca_device :
|
||||
virtual public smart_device
|
||||
{
|
||||
public:
|
||||
generic_areca_device(smart_interface * intf, const char * dev_name, int disknum, int encnum = 1);
|
||||
~generic_areca_device() throw();
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// OS-dependent functions
|
||||
virtual bool arcmsr_lock() = 0;
|
||||
virtual bool arcmsr_unlock() = 0;
|
||||
virtual int arcmsr_do_scsi_io(struct scsi_cmnd_io * iop) = 0;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// OS-independent functions
|
||||
virtual int arcmsr_command_handler(unsigned long arcmsr_cmd, unsigned char *data, int data_len);
|
||||
virtual int arcmsr_ui_handler(unsigned char *areca_packet, int areca_packet_len, unsigned char *result);
|
||||
virtual bool arcmsr_probe();
|
||||
virtual int arcmsr_get_dev_type();
|
||||
virtual int arcmsr_get_controller_type();
|
||||
virtual bool arcmsr_scsi_pass_through(scsi_cmnd_io * iop);
|
||||
virtual bool arcmsr_ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out);
|
||||
|
||||
protected:
|
||||
generic_areca_device() : smart_device(never_called)
|
||||
{
|
||||
}
|
||||
|
||||
void set_disknum(int disknum)
|
||||
{m_disknum = disknum;}
|
||||
|
||||
void set_encnum(int encnum)
|
||||
{m_encnum = encnum;}
|
||||
|
||||
int get_disknum()
|
||||
{return m_disknum;}
|
||||
|
||||
int get_encnum()
|
||||
{return m_encnum;}
|
||||
|
||||
private:
|
||||
int m_disknum; ///< Disk number.
|
||||
int m_encnum; ///< Enclosure number.
|
||||
};
|
||||
|
||||
// SATA(ATA) device behind Areca RAID Controller
|
||||
class areca_ata_device
|
||||
: public ata_device,
|
||||
public generic_areca_device
|
||||
{
|
||||
public:
|
||||
areca_ata_device(smart_interface * intf, const char * dev_name, int disknum, int encnum = 1);
|
||||
~areca_ata_device() throw();
|
||||
bool arcmsr_lock() { return true; }
|
||||
bool arcmsr_unlock() { return true; }
|
||||
int arcmsr_do_scsi_io(struct scsi_cmnd_io * /* iop */)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
protected:
|
||||
areca_ata_device(): smart_device(never_called)
|
||||
{
|
||||
}
|
||||
virtual bool ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out);
|
||||
};
|
||||
|
||||
// SAS(SCSI) device behind Areca RAID Controller
|
||||
class areca_scsi_device
|
||||
: public scsi_device,
|
||||
public generic_areca_device
|
||||
{
|
||||
public:
|
||||
areca_scsi_device(smart_interface * intf, const char * dev_name, int disknum, int encnum = 1);
|
||||
~areca_scsi_device() throw();
|
||||
bool arcmsr_lock() { return true; }
|
||||
bool arcmsr_unlock() { return true; }
|
||||
int arcmsr_do_scsi_io(struct scsi_cmnd_io * /* iop */)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
protected:
|
||||
areca_scsi_device(): smart_device(never_called)
|
||||
{
|
||||
}
|
||||
virtual bool scsi_pass_through(scsi_cmnd_io * iop);
|
||||
};
|
||||
|
||||
#endif
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -19,6 +19,7 @@
|
||||
#include "int64.h"
|
||||
#include "dev_interface.h"
|
||||
#include "dev_tunnelled.h"
|
||||
#include "atacmds.h" // ATA_SMART_CMD/STATUS
|
||||
#include "utility.h"
|
||||
|
||||
#include <errno.h>
|
||||
@ -31,7 +32,7 @@
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
const char * dev_interface_cpp_cvsid = "$Id: dev_interface.cpp 3554 2012-06-01 20:11:46Z chrfranke $"
|
||||
const char * dev_interface_cpp_cvsid = "$Id: dev_interface.cpp 3741 2013-01-02 17:06:54Z chrfranke $"
|
||||
DEV_INTERFACE_H_CVSID;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -138,10 +139,8 @@ bool ata_device::ata_pass_through(const ata_cmd_in & in)
|
||||
return ata_pass_through(in, dummy);
|
||||
}
|
||||
|
||||
bool ata_device::ata_cmd_is_ok(const ata_cmd_in & in,
|
||||
bool data_out_support /*= false*/,
|
||||
bool multi_sector_support /*= false*/,
|
||||
bool ata_48bit_support /*= false*/)
|
||||
bool ata_device::ata_cmd_is_supported(const ata_cmd_in & in,
|
||||
unsigned flags, const char * type /* = 0 */)
|
||||
{
|
||||
// Check DATA IN/OUT
|
||||
switch (in.direction) {
|
||||
@ -167,12 +166,25 @@ bool ata_device::ata_cmd_is_ok(const ata_cmd_in & in,
|
||||
}
|
||||
|
||||
// Check features
|
||||
if (in.direction == ata_cmd_in::data_out && !data_out_support)
|
||||
return set_err(ENOSYS, "DATA OUT ATA commands not supported");
|
||||
if (!(in.size == 0 || in.size == 512) && !multi_sector_support)
|
||||
return set_err(ENOSYS, "Multi-sector ATA commands not supported");
|
||||
if (in.in_regs.is_48bit_cmd() && !ata_48bit_support)
|
||||
return set_err(ENOSYS, "48-bit ATA commands not supported");
|
||||
const char * errmsg = 0;
|
||||
if (in.direction == ata_cmd_in::data_out && !(flags & supports_data_out))
|
||||
errmsg = "DATA OUT ATA commands not implemented";
|
||||
else if ( in.out_needed.is_set() && !(flags & supports_output_regs)
|
||||
&& !( in.in_regs.command == ATA_SMART_CMD
|
||||
&& in.in_regs.features == ATA_SMART_STATUS
|
||||
&& (flags & supports_smart_status)))
|
||||
errmsg = "Read of ATA output registers not implemented";
|
||||
else if (!(in.size == 0 || in.size == 512) && !(flags & supports_multi_sector))
|
||||
errmsg = "Multi-sector ATA commands not implemented";
|
||||
else if (in.in_regs.is_48bit_cmd() && !(flags & (supports_48bit_hi_null|supports_48bit)))
|
||||
errmsg = "48-bit ATA commands not implemented";
|
||||
else if (in.in_regs.is_real_48bit_cmd() && !(flags & supports_48bit))
|
||||
errmsg = "48-bit ATA commands not fully implemented";
|
||||
|
||||
if (errmsg)
|
||||
return set_err(ENOSYS, "%s%s%s%s", errmsg,
|
||||
(type ? " [" : ""), (type ? type : ""), (type ? "]" : ""));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -246,7 +258,7 @@ std::string smart_interface::get_valid_dev_types_str()
|
||||
{
|
||||
// default
|
||||
std::string s =
|
||||
"ata, scsi, sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,x][,N], usbsunplus";
|
||||
"ata, scsi, sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbsunplus";
|
||||
// append custom
|
||||
std::string s2 = get_valid_custom_dev_types_str();
|
||||
if (!s2.empty()) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef DEV_INTERFACE_H
|
||||
#define DEV_INTERFACE_H
|
||||
|
||||
#define DEV_INTERFACE_H_CVSID "$Id: dev_interface.h 3554 2012-06-01 20:11:46Z chrfranke $\n"
|
||||
#define DEV_INTERFACE_H_CVSID "$Id: dev_interface.h 3663 2012-10-24 20:35:55Z chrfranke $\n"
|
||||
|
||||
#include "utility.h"
|
||||
|
||||
@ -506,12 +506,35 @@ public:
|
||||
virtual bool ata_identify_is_cached() const;
|
||||
|
||||
protected:
|
||||
/// Flags for ata_cmd_is_supported().
|
||||
enum {
|
||||
supports_data_out = 0x01, // PIO DATA OUT
|
||||
supports_smart_status = 0x02, // read output registers for SMART STATUS only
|
||||
supports_output_regs = 0x04, // read output registers for all commands
|
||||
supports_multi_sector = 0x08, // more than one sector (1 DRQ/sector variant)
|
||||
supports_48bit_hi_null = 0x10, // 48-bit commands with null high bytes only
|
||||
supports_48bit = 0x20, // all 48-bit commands
|
||||
};
|
||||
|
||||
/// Check command input parameters.
|
||||
/// Return false if required features are not implemented.
|
||||
/// Calls set_err(...) accordingly.
|
||||
bool ata_cmd_is_supported(const ata_cmd_in & in, unsigned flags,
|
||||
const char * type = 0);
|
||||
|
||||
/// Check command input parameters (old version).
|
||||
// TODO: Remove if no longer used.
|
||||
bool ata_cmd_is_ok(const ata_cmd_in & in,
|
||||
bool data_out_support = false,
|
||||
bool multi_sector_support = false,
|
||||
bool ata_48bit_support = false);
|
||||
bool ata_48bit_support = false)
|
||||
{
|
||||
return ata_cmd_is_supported(in,
|
||||
(data_out_support ? supports_data_out : 0) |
|
||||
supports_output_regs |
|
||||
(multi_sector_support ? supports_multi_sector : 0) |
|
||||
(ata_48bit_support ? supports_48bit : 0));
|
||||
}
|
||||
|
||||
/// Hide/unhide ATA interface.
|
||||
void hide_ata(bool hide = true)
|
||||
|
30
do_release
30
do_release
@ -3,27 +3,27 @@
|
||||
# do a smartmontools release
|
||||
# (C) 2003-11 Bruce Allen <ballen4705@users.sourceforge.net>,
|
||||
# Guido Guenther <agx@sigxcpu.org>
|
||||
# Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
# $Id: do_release 3282 2011-03-04 19:26:59Z chrfranke $
|
||||
# (C) 2006-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
# $Id: do_release 3765 2013-02-05 17:17:13Z chrfranke $
|
||||
|
||||
# Notes on generating releases:
|
||||
# (1) update NEWS
|
||||
# (2) update CHANGELOG -- put in release number
|
||||
# (3) update release number in configure.in
|
||||
# (2) update ChangeLog -- put in release number
|
||||
# (3) update release number in configure.ac
|
||||
# (4) to test, run without '--commit'
|
||||
# (5) when satisfied, add option '--commit'
|
||||
|
||||
set -e
|
||||
|
||||
# Smartmontools Signing Key (through 2012)
|
||||
KEYID=0x2753E77A
|
||||
# Smartmontools Signing Key (through 2014)
|
||||
KEYID=0x8F6ED8AA
|
||||
|
||||
inc_release()
|
||||
{
|
||||
MINOR=`echo $VERSION | cut -d. -f2`
|
||||
MAJOR=`echo $VERSION | cut -d. -f1`
|
||||
PERL_OLD=$MAJOR\\.$MINOR
|
||||
((MINOR++))
|
||||
((++MINOR))
|
||||
NEW_VERSION=$MAJOR.$MINOR
|
||||
PERL_NEW=$MAJOR\\.$MINOR
|
||||
NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
|
||||
@ -63,9 +63,9 @@ fi
|
||||
|
||||
(cd $WDROOT && svn status) | while read s; do
|
||||
case "`echo $s | tr -s ' '`" in
|
||||
"M "$DIRPAT/smartmontools/CHANGELOG) echo "$s: OK";;
|
||||
"M "$DIRPAT/smartmontools/ChangeLog) echo "$s: OK";;
|
||||
"M "$DIRPAT/smartmontools/NEWS) echo "$s: OK";;
|
||||
"M "$DIRPAT/smartmontools/configure.in) echo "$s: OK";;
|
||||
"M "$DIRPAT/smartmontools/configure.ac) echo "$s: OK";;
|
||||
*) echo "$s: not allowed"; exit 1;;
|
||||
esac
|
||||
done
|
||||
@ -74,9 +74,9 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
# Get release number
|
||||
VERSION=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.in`
|
||||
VERSION=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.ac`
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "AC_INIT not found in configure.in"; exit 1
|
||||
echo "AC_INIT not found in configure.ac"; exit 1
|
||||
fi
|
||||
VERSIONRC="$VERSION"
|
||||
RELEASE="RELEASE_${VERSION//\./_}"
|
||||
@ -95,8 +95,8 @@ echo "r$REV: Release $VERSIONRC $RELEASE"
|
||||
# Update timestamp
|
||||
smartmontools_release_date=`date -u +"%Y-%m-%d"`
|
||||
smartmontools_release_time=`date -u +"%T %Z"`
|
||||
cat configure.in | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
|
||||
cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
|
||||
cat configure.ac | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
|
||||
cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.ac
|
||||
rm -f configure.tmp
|
||||
|
||||
# Review changes
|
||||
@ -134,8 +134,8 @@ md5sum $TARFILE > $TARFILE.md5
|
||||
if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
|
||||
inc_release
|
||||
if [ "$COMMIT" = "yes" ]; then
|
||||
perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in
|
||||
# svn commit -m "Bump release number to $NEW_VERSION" configure.in
|
||||
perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.ac
|
||||
# svn commit -m "Bump release number to $NEW_VERSION" configure.ac
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Home page: http://smartmontools.sourceforge.net
|
||||
#
|
||||
# $Id: README,v 1.7 2008/03/04 22:09:47 ballen4705 Exp $
|
||||
# $Id: README 3728 2012-12-13 17:57:50Z chrfranke $
|
||||
#
|
||||
# Copyright (C) 2003-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
#
|
||||
@ -10,8 +10,8 @@
|
||||
# version.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License (for
|
||||
# example COPYING); if not, write to the Free Software Foundation, Inc., 675
|
||||
# Mass Ave, Cambridge, MA 02139, USA.
|
||||
# example COPYING); if not, write to the Free Software Foundation, Inc., 51
|
||||
# Franklin Street, Fifth Floor, Boston, 02110-1301 USA.
|
||||
#
|
||||
# This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
# at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
|
@ -18,9 +18,9 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
#ifndef _NO_PROTO
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
|
||||
|
6
int64.h
6
int64.h
@ -12,15 +12,15 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INT64_H_
|
||||
#define INT64_H_
|
||||
|
||||
#define INT64_H_CVSID "$Id: int64.h 3475 2011-11-10 21:43:40Z chrfranke $"
|
||||
#define INT64_H_CVSID "$Id: int64.h 3727 2012-12-13 17:23:06Z samm2 $"
|
||||
|
||||
// 64 bit integer typedefs and format strings
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Address of support mailing list: smartmontools-support@lists.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2003-11 Philip Williams, Bruce Allen
|
||||
* Copyright (C) 2008-11 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -13,8 +13,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -34,7 +33,7 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
const char * knowndrives_cpp_cvsid = "$Id: knowndrives.cpp 3447 2011-10-14 20:32:00Z chrfranke $"
|
||||
const char * knowndrives_cpp_cvsid = "$Id: knowndrives.cpp 3719 2012-12-03 21:19:33Z chrfranke $"
|
||||
KNOWNDRIVES_H_CVSID;
|
||||
|
||||
#define MODEL_STRING_LENGTH 40
|
||||
@ -124,14 +123,16 @@ void drive_database::push_back(const drive_settings & src)
|
||||
|
||||
const char * drive_database::copy_string(const char * src)
|
||||
{
|
||||
char * dest = new char[strlen(src)+1];
|
||||
size_t len = strlen(src);
|
||||
char * dest = new char[len+1];
|
||||
memcpy(dest, src, len+1);
|
||||
try {
|
||||
m_custom_strings.push_back(dest);
|
||||
}
|
||||
catch (...) {
|
||||
delete [] dest; throw;
|
||||
}
|
||||
return strcpy(dest, src);
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
@ -208,7 +209,7 @@ static const drive_settings * lookup_drive(const char * model, const char * firm
|
||||
|
||||
// Parse drive or USB options in preset string, return false on error.
|
||||
static bool parse_db_presets(const char * presets, ata_vendor_attr_defs * defs,
|
||||
unsigned char * fix_firmwarebug, std::string * type)
|
||||
firmwarebug_defs * firmwarebugs, std::string * type)
|
||||
{
|
||||
for (int i = 0; ; ) {
|
||||
i += strspn(presets+i, " \t");
|
||||
@ -222,19 +223,13 @@ static bool parse_db_presets(const char * presets, ata_vendor_attr_defs * defs,
|
||||
if (!parse_attribute_def(arg, *defs, PRIOR_DATABASE))
|
||||
return false;
|
||||
}
|
||||
else if (opt == 'F' && fix_firmwarebug) {
|
||||
unsigned char fix;
|
||||
if (!strcmp(arg, "samsung"))
|
||||
fix = FIX_SAMSUNG;
|
||||
else if (!strcmp(arg, "samsung2"))
|
||||
fix = FIX_SAMSUNG2;
|
||||
else if (!strcmp(arg, "samsung3"))
|
||||
fix = FIX_SAMSUNG3;
|
||||
else
|
||||
else if (opt == 'F' && firmwarebugs) {
|
||||
firmwarebug_defs bug;
|
||||
if (!parse_firmwarebug_def(arg, bug))
|
||||
return false;
|
||||
// Set only if not set by user
|
||||
if (*fix_firmwarebug == FIX_NOTSPECIFIED)
|
||||
*fix_firmwarebug = fix;
|
||||
// Don't set if user specified '-F none'.
|
||||
if (!firmwarebugs->is_set(BUG_NONE))
|
||||
firmwarebugs->set(bug);
|
||||
}
|
||||
else if (opt == 'd' && type) {
|
||||
// TODO: Check valid types
|
||||
@ -251,9 +246,9 @@ static bool parse_db_presets(const char * presets, ata_vendor_attr_defs * defs,
|
||||
// Parse '-v' and '-F' options in preset string, return false on error.
|
||||
static inline bool parse_presets(const char * presets,
|
||||
ata_vendor_attr_defs & defs,
|
||||
unsigned char & fix_firmwarebug)
|
||||
firmwarebug_defs & firmwarebugs)
|
||||
{
|
||||
return parse_db_presets(presets, &defs, &fix_firmwarebug, 0);
|
||||
return parse_db_presets(presets, &defs, &firmwarebugs, 0);
|
||||
}
|
||||
|
||||
// Parse '-d' option in preset string, return false on error.
|
||||
@ -365,11 +360,11 @@ static int showonepreset(const drive_settings * dbentry)
|
||||
pout("%-*s %s\n", TABLEPRINTWIDTH, "MODEL FAMILY:", dbentry->modelfamily);
|
||||
|
||||
// if there are any presets, then show them
|
||||
unsigned char fix_firmwarebug = 0;
|
||||
firmwarebug_defs firmwarebugs;
|
||||
bool first_preset = true;
|
||||
if (*dbentry->presets) {
|
||||
ata_vendor_attr_defs defs;
|
||||
if (!parse_presets(dbentry->presets, defs, fix_firmwarebug)) {
|
||||
if (!parse_presets(dbentry->presets, defs, firmwarebugs)) {
|
||||
pout("Syntax error in preset option string \"%s\"\n", dbentry->presets);
|
||||
errcnt++;
|
||||
}
|
||||
@ -393,18 +388,26 @@ static int showonepreset(const drive_settings * dbentry)
|
||||
pout("%-*s %s\n", TABLEPRINTWIDTH, "ATTRIBUTE OPTIONS:", "None preset; no -v options are required.");
|
||||
|
||||
// describe firmwarefix
|
||||
if (fix_firmwarebug) {
|
||||
for (int b = BUG_NOLOGDIR; b <= BUG_XERRORLBA; b++) {
|
||||
if (!firmwarebugs.is_set((firmwarebug_t)b))
|
||||
continue;
|
||||
const char * fixdesc;
|
||||
switch (fix_firmwarebug) {
|
||||
case FIX_SAMSUNG:
|
||||
switch ((firmwarebug_t)b) {
|
||||
case BUG_NOLOGDIR:
|
||||
fixdesc = "Avoids reading GP/SMART Log Directories (same as -F nologdir)";
|
||||
break;
|
||||
case BUG_SAMSUNG:
|
||||
fixdesc = "Fixes byte order in some SMART data (same as -F samsung)";
|
||||
break;
|
||||
case FIX_SAMSUNG2:
|
||||
case BUG_SAMSUNG2:
|
||||
fixdesc = "Fixes byte order in some SMART data (same as -F samsung2)";
|
||||
break;
|
||||
case FIX_SAMSUNG3:
|
||||
case BUG_SAMSUNG3:
|
||||
fixdesc = "Fixes completed self-test reported as in progress (same as -F samsung3)";
|
||||
break;
|
||||
case BUG_XERRORLBA:
|
||||
fixdesc = "Fixes LBA byte ordering in Ext. Comprehensive SMART error log (same as -F xerrorlba)";
|
||||
break;
|
||||
default:
|
||||
fixdesc = "UNKNOWN"; errcnt++;
|
||||
break;
|
||||
@ -525,12 +528,12 @@ void show_presets(const ata_identify_device * drive)
|
||||
}
|
||||
|
||||
// Searches drive database and sets preset vendor attribute
|
||||
// options in defs and fix_firmwarebug.
|
||||
// options in defs and firmwarebugs.
|
||||
// Values that have already been set will not be changed.
|
||||
// Returns pointer to database entry or nullptr if none found
|
||||
const drive_settings * lookup_drive_apply_presets(
|
||||
const ata_identify_device * drive, ata_vendor_attr_defs & defs,
|
||||
unsigned char & fix_firmwarebug)
|
||||
firmwarebug_defs & firmwarebugs)
|
||||
{
|
||||
// get the drive's model/firmware strings
|
||||
char model[MODEL_STRING_LENGTH+1], firmware[FIRMWARE_STRING_LENGTH+1];
|
||||
@ -544,7 +547,7 @@ const drive_settings * lookup_drive_apply_presets(
|
||||
|
||||
if (*dbentry->presets) {
|
||||
// Apply presets
|
||||
if (!parse_presets(dbentry->presets, defs, fix_firmwarebug))
|
||||
if (!parse_presets(dbentry->presets, defs, firmwarebugs))
|
||||
pout("Syntax error in preset option string \"%s\"\n", dbentry->presets);
|
||||
}
|
||||
return dbentry;
|
||||
@ -765,7 +768,7 @@ static bool parse_drive_database(parse_ptr src, drive_database & db, const char
|
||||
case 4:
|
||||
if (!token.value.empty()) {
|
||||
if (!is_usb_modelfamily(values[0].c_str())) {
|
||||
ata_vendor_attr_defs defs; unsigned char fix = 0;
|
||||
ata_vendor_attr_defs defs; firmwarebug_defs fix;
|
||||
if (!parse_presets(token.value.c_str(), defs, fix)) {
|
||||
pout("%s(%d): Syntax error in preset option string\n", path, token.line);
|
||||
ok = false;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Address of support mailing list: smartmontools-support@lists.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2003-11 Philip Williams, Bruce Allen
|
||||
* Copyright (C) 2008-11 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -13,15 +13,14 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef KNOWNDRIVES_H_
|
||||
#define KNOWNDRIVES_H_
|
||||
|
||||
#define KNOWNDRIVES_H_CVSID "$Id: knowndrives.h 3288 2011-03-09 18:40:36Z chrfranke $\n"
|
||||
#define KNOWNDRIVES_H_CVSID "$Id: knowndrives.h 3597 2012-09-04 21:10:37Z chrfranke $\n"
|
||||
|
||||
// Structure to store drive database entries, see drivedb.h for a description.
|
||||
struct drive_settings {
|
||||
@ -56,12 +55,12 @@ int showallpresets();
|
||||
int showmatchingpresets(const char *model, const char *firmware);
|
||||
|
||||
// Searches drive database and sets preset vendor attribute
|
||||
// options in defs and fix_firmwarebug.
|
||||
// options in defs and firmwarebugs.
|
||||
// Values that have already been set will not be changed.
|
||||
// Returns pointer to database entry or nullptr if none found.
|
||||
const drive_settings * lookup_drive_apply_presets(
|
||||
const ata_identify_device * drive, ata_vendor_attr_defs & defs,
|
||||
unsigned char & fix_firmwarebug);
|
||||
firmwarebug_defs & firmwarebugs);
|
||||
|
||||
// Get path for additional database file
|
||||
const char * get_drivedb_path_add();
|
||||
|
274
megaraid.h
274
megaraid.h
@ -8,14 +8,14 @@ int megaraid_io_interface(int device, int target, struct scsi_cmnd_io *, int);
|
||||
#define u64 uint64_t
|
||||
|
||||
/*======================================================
|
||||
* PERC2/3/4 Passthrough SCSI Command Interface
|
||||
*
|
||||
* Contents from:
|
||||
* drivers/scsi/megaraid/megaraid_ioctl.h
|
||||
* drivers/scsi/megaraid/mbox_defs.h
|
||||
*======================================================*/
|
||||
#define MEGAIOC_MAGIC 'm'
|
||||
#define MEGAIOCCMD _IOWR(MEGAIOC_MAGIC, 0, struct uioctl_t)
|
||||
* PERC2/3/4 Passthrough SCSI Command Interface
|
||||
*
|
||||
* Contents from:
|
||||
* drivers/scsi/megaraid/megaraid_ioctl.h
|
||||
* drivers/scsi/megaraid/mbox_defs.h
|
||||
*======================================================*/
|
||||
#define MEGAIOC_MAGIC 'm'
|
||||
#define MEGAIOCCMD _IOWR(MEGAIOC_MAGIC, 0, struct uioctl_t)
|
||||
|
||||
/* Following subopcode work for opcode == 0x82 */
|
||||
#define MKADAP(adapno) (MEGAIOC_MAGIC << 8 | adapno)
|
||||
@ -30,42 +30,42 @@ int megaraid_io_interface(int device, int target, struct scsi_cmnd_io *, int);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t timeout : 3;
|
||||
uint8_t ars : 1;
|
||||
uint8_t reserved : 3;
|
||||
uint8_t islogical : 1;
|
||||
uint8_t logdrv;
|
||||
uint8_t channel;
|
||||
uint8_t target;
|
||||
uint8_t queuetag;
|
||||
uint8_t queueaction;
|
||||
uint8_t cdb[MAX_CDB_LEN];
|
||||
uint8_t cdblen;
|
||||
uint8_t reqsenselen;
|
||||
uint8_t reqsensearea[MAX_REQ_SENSE_LEN];
|
||||
uint8_t numsgelements;
|
||||
uint8_t scsistatus;
|
||||
uint32_t dataxferaddr;
|
||||
uint32_t dataxferlen;
|
||||
uint8_t timeout : 3;
|
||||
uint8_t ars : 1;
|
||||
uint8_t reserved : 3;
|
||||
uint8_t islogical : 1;
|
||||
uint8_t logdrv;
|
||||
uint8_t channel;
|
||||
uint8_t target;
|
||||
uint8_t queuetag;
|
||||
uint8_t queueaction;
|
||||
uint8_t cdb[MAX_CDB_LEN];
|
||||
uint8_t cdblen;
|
||||
uint8_t reqsenselen;
|
||||
uint8_t reqsensearea[MAX_REQ_SENSE_LEN];
|
||||
uint8_t numsgelements;
|
||||
uint8_t scsistatus;
|
||||
uint32_t dataxferaddr;
|
||||
uint32_t dataxferlen;
|
||||
} __attribute__((packed)) mega_passthru;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t cmd;
|
||||
uint8_t cmdid;
|
||||
uint8_t opcode;
|
||||
uint8_t subopcode;
|
||||
uint32_t lba;
|
||||
uint32_t xferaddr;
|
||||
uint8_t logdrv;
|
||||
uint8_t resvd[3];
|
||||
uint8_t numstatus;
|
||||
uint8_t status;
|
||||
uint8_t cmd;
|
||||
uint8_t cmdid;
|
||||
uint8_t opcode;
|
||||
uint8_t subopcode;
|
||||
uint32_t lba;
|
||||
uint32_t xferaddr;
|
||||
uint8_t logdrv;
|
||||
uint8_t resvd[3];
|
||||
uint8_t numstatus;
|
||||
uint8_t status;
|
||||
} __attribute__((packed)) megacmd_t;
|
||||
|
||||
typedef union {
|
||||
uint8_t *pointer;
|
||||
uint8_t pad[8];
|
||||
uint8_t *pointer;
|
||||
uint8_t pad[8];
|
||||
} ptr_t;
|
||||
|
||||
// The above definition assumes sizeof(void*) <= 8.
|
||||
@ -79,151 +79,177 @@ typedef char assert_sizeof_ptr_t[sizeof(ptr_t) == 8 ? 1 : -1];
|
||||
|
||||
struct uioctl_t
|
||||
{
|
||||
uint32_t inlen;
|
||||
uint32_t outlen;
|
||||
union {
|
||||
uint8_t fca[16];
|
||||
struct {
|
||||
uint8_t opcode;
|
||||
uint8_t subopcode;
|
||||
uint16_t adapno;
|
||||
ptr_t buffer;
|
||||
uint32_t length;
|
||||
} __attribute__((packed)) fcs;
|
||||
} __attribute__((packed)) ui;
|
||||
uint32_t inlen;
|
||||
uint32_t outlen;
|
||||
union {
|
||||
uint8_t fca[16];
|
||||
struct {
|
||||
uint8_t opcode;
|
||||
uint8_t subopcode;
|
||||
uint16_t adapno;
|
||||
ptr_t buffer;
|
||||
uint32_t length;
|
||||
} __attribute__((packed)) fcs;
|
||||
} __attribute__((packed)) ui;
|
||||
|
||||
megacmd_t mbox;
|
||||
mega_passthru pthru;
|
||||
ptr_t data;
|
||||
megacmd_t mbox;
|
||||
mega_passthru pthru;
|
||||
ptr_t data;
|
||||
} __attribute__((packed));
|
||||
|
||||
/*===================================================
|
||||
* PERC5/6 Passthrough SCSI Command Interface
|
||||
*
|
||||
* Contents from:
|
||||
* drivers/scsi/megaraid/megaraid_sas.h
|
||||
*===================================================*/
|
||||
* PERC5/6 Passthrough SCSI Command Interface
|
||||
*
|
||||
* Contents from:
|
||||
* drivers/scsi/megaraid/megaraid_sas.h
|
||||
*===================================================*/
|
||||
#define MEGASAS_MAGIC 'M'
|
||||
#define MEGASAS_IOC_FIRMWARE _IOWR(MEGASAS_MAGIC, 1, struct megasas_iocpacket)
|
||||
|
||||
#define MFI_CMD_PD_SCSI_IO 0x04
|
||||
#define MFI_CMD_DCMD 0x05
|
||||
#define MFI_FRAME_SGL64 0x02
|
||||
#define MFI_FRAME_DIR_READ 0x10
|
||||
#define MFI_STAT_OK 0x00
|
||||
#define MFI_DCMD_PD_GET_LIST 0x02010000
|
||||
/*
|
||||
* Number of mailbox bytes in DCMD message frame
|
||||
*/
|
||||
#define MFI_MBOX_SIZE 12
|
||||
#define MAX_IOCTL_SGE 16
|
||||
#define MFI_FRAME_DIR_NONE 0x0000
|
||||
#define MFI_FRAME_DIR_WRITE 0x0008
|
||||
#define MFI_FRAME_DIR_READ 0x0010
|
||||
#define MFI_FRAME_DIR_BOTH 0x0018
|
||||
|
||||
#define MAX_IOCTL_SGE 16
|
||||
#define MAX_SYS_PDS 240
|
||||
|
||||
struct megasas_sge32 {
|
||||
|
||||
u32 phys_addr;
|
||||
u32 length;
|
||||
u32 phys_addr;
|
||||
u32 length;
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct megasas_sge64 {
|
||||
|
||||
u64 phys_addr;
|
||||
u32 length;
|
||||
u64 phys_addr;
|
||||
u32 length;
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
union megasas_sgl {
|
||||
|
||||
struct megasas_sge32 sge32[1];
|
||||
struct megasas_sge64 sge64[1];
|
||||
struct megasas_sge32 sge32[1];
|
||||
struct megasas_sge64 sge64[1];
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct megasas_header {
|
||||
|
||||
u8 cmd; /*00h */
|
||||
u8 sense_len; /*01h */
|
||||
u8 cmd_status; /*02h */
|
||||
u8 scsi_status; /*03h */
|
||||
u8 cmd; /*00h */
|
||||
u8 sense_len; /*01h */
|
||||
u8 cmd_status; /*02h */
|
||||
u8 scsi_status; /*03h */
|
||||
|
||||
u8 target_id; /*04h */
|
||||
u8 lun; /*05h */
|
||||
u8 cdb_len; /*06h */
|
||||
u8 sge_count; /*07h */
|
||||
u8 target_id; /*04h */
|
||||
u8 lun; /*05h */
|
||||
u8 cdb_len; /*06h */
|
||||
u8 sge_count; /*07h */
|
||||
|
||||
u32 context; /*08h */
|
||||
u32 pad_0; /*0Ch */
|
||||
u32 context; /*08h */
|
||||
u32 pad_0; /*0Ch */
|
||||
|
||||
u16 flags; /*10h */
|
||||
u16 timeout; /*12h */
|
||||
u32 data_xferlen; /*14h */
|
||||
u16 flags; /*10h */
|
||||
u16 timeout; /*12h */
|
||||
u32 data_xferlen; /*14h */
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct megasas_pthru_frame {
|
||||
|
||||
u8 cmd; /*00h */
|
||||
u8 sense_len; /*01h */
|
||||
u8 cmd_status; /*02h */
|
||||
u8 scsi_status; /*03h */
|
||||
u8 cmd; /*00h */
|
||||
u8 sense_len; /*01h */
|
||||
u8 cmd_status; /*02h */
|
||||
u8 scsi_status; /*03h */
|
||||
|
||||
u8 target_id; /*04h */
|
||||
u8 lun; /*05h */
|
||||
u8 cdb_len; /*06h */
|
||||
u8 sge_count; /*07h */
|
||||
u8 target_id; /*04h */
|
||||
u8 lun; /*05h */
|
||||
u8 cdb_len; /*06h */
|
||||
u8 sge_count; /*07h */
|
||||
|
||||
u32 context; /*08h */
|
||||
u32 pad_0; /*0Ch */
|
||||
u32 context; /*08h */
|
||||
u32 pad_0; /*0Ch */
|
||||
|
||||
u16 flags; /*10h */
|
||||
u16 timeout; /*12h */
|
||||
u32 data_xfer_len; /*14h */
|
||||
u16 flags; /*10h */
|
||||
u16 timeout; /*12h */
|
||||
u32 data_xfer_len; /*14h */
|
||||
|
||||
u32 sense_buf_phys_addr_lo; /*18h */
|
||||
u32 sense_buf_phys_addr_hi; /*1Ch */
|
||||
u32 sense_buf_phys_addr_lo; /*18h */
|
||||
u32 sense_buf_phys_addr_hi; /*1Ch */
|
||||
|
||||
u8 cdb[16]; /*20h */
|
||||
union megasas_sgl sgl; /*30h */
|
||||
u8 cdb[16]; /*20h */
|
||||
union megasas_sgl sgl; /*30h */
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct megasas_dcmd_frame {
|
||||
|
||||
u8 cmd; /*00h */
|
||||
u8 reserved_0; /*01h */
|
||||
u8 cmd_status; /*02h */
|
||||
u8 reserved_1[4]; /*03h */
|
||||
u8 sge_count; /*07h */
|
||||
u8 cmd; /*00h */
|
||||
u8 reserved_0; /*01h */
|
||||
u8 cmd_status; /*02h */
|
||||
u8 reserved_1[4]; /*03h */
|
||||
u8 sge_count; /*07h */
|
||||
|
||||
u32 context; /*08h */
|
||||
u32 pad_0; /*0Ch */
|
||||
u32 context; /*08h */
|
||||
u32 pad_0; /*0Ch */
|
||||
|
||||
u16 flags; /*10h */
|
||||
u16 timeout; /*12h */
|
||||
u16 flags; /*10h */
|
||||
u16 timeout; /*12h */
|
||||
|
||||
u32 data_xfer_len; /*14h */
|
||||
u32 opcode; /*18h */
|
||||
u32 data_xfer_len; /*14h */
|
||||
u32 opcode; /*18h */
|
||||
|
||||
union { /*1Ch */
|
||||
u8 b[12];
|
||||
u16 s[6];
|
||||
u32 w[3];
|
||||
} mbox;
|
||||
union { /*1Ch */
|
||||
u8 b[12];
|
||||
u16 s[6];
|
||||
u32 w[3];
|
||||
} mbox;
|
||||
|
||||
union megasas_sgl sgl; /*28h */
|
||||
union megasas_sgl sgl; /*28h */
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct megasas_iocpacket {
|
||||
u16 host_no;
|
||||
u16 __pad1;
|
||||
u32 sgl_off;
|
||||
u32 sge_count;
|
||||
u32 sense_off;
|
||||
u32 sense_len;
|
||||
union {
|
||||
u8 raw[128];
|
||||
struct megasas_header hdr;
|
||||
struct megasas_pthru_frame pthru;
|
||||
struct megasas_dcmd_frame dcmd;
|
||||
} frame;
|
||||
|
||||
u16 host_no;
|
||||
u16 __pad1;
|
||||
u32 sgl_off;
|
||||
u32 sge_count;
|
||||
u32 sense_off;
|
||||
u32 sense_len;
|
||||
union {
|
||||
u8 raw[128];
|
||||
struct megasas_header hdr;
|
||||
struct megasas_pthru_frame pthru;
|
||||
} frame;
|
||||
struct iovec sgl[MAX_IOCTL_SGE];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct iovec sgl[MAX_IOCTL_SGE];
|
||||
struct megasas_pd_address {
|
||||
u16 device_id;
|
||||
u16 encl_device_id;
|
||||
u8 encl_index;
|
||||
u8 slot_number;
|
||||
u8 scsi_dev_type; /* 0 = disk */
|
||||
u8 connect_port_bitmap;
|
||||
u64 sas_addr[2];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct megasas_pd_list {
|
||||
u32 size;
|
||||
u32 count;
|
||||
struct megasas_pd_address addr[MAX_SYS_PDS];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#undef u8
|
||||
|
@ -11,8 +11,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
@ -44,7 +44,7 @@
|
||||
#include "os_darwin.h"
|
||||
|
||||
// Needed by '-V' option (CVS versioning) of smartd/smartctl
|
||||
const char *os_XXXX_c_cvsid="$Id: os_darwin.cpp,v 1.21 2008/06/12 21:46:31 ballen4705 Exp $" \
|
||||
const char *os_XXXX_c_cvsid="$Id: os_darwin.cpp 3805 2013-03-29 19:54:18Z chrfranke $" \
|
||||
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_DARWIN_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
|
||||
|
||||
// Print examples for smartctl.
|
||||
@ -72,9 +72,8 @@ void print_smartctl_examples(){
|
||||
|
||||
// tries to guess device type given the name (a path). See utility.h
|
||||
// for return values.
|
||||
int guess_device_type (const char* dev_name) {
|
||||
int guess_device_type (const char * /* dev_name */) {
|
||||
// Only ATA is supported right now, so that's what it'd better be.
|
||||
dev_name = dev_name; // suppress unused warning.
|
||||
return CONTROLLER_ATA;
|
||||
}
|
||||
|
||||
@ -420,59 +419,7 @@ ata_command_interface(int fd, smart_command_set command,
|
||||
return err == kIOReturnSuccess ? 0 : -1;
|
||||
}
|
||||
|
||||
// There's no special handling needed for hidden devices, the kernel
|
||||
// must deal with them.
|
||||
int escalade_command_interface(int fd, int escalade_port, int escalade_type,
|
||||
smart_command_set command, int select,
|
||||
char *data)
|
||||
{
|
||||
fd = fd;
|
||||
escalade_port = escalade_port;
|
||||
escalade_type = escalade_type;
|
||||
command = command;
|
||||
select = select;
|
||||
data = data;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int areca_command_interface(int fd, int escalade_port,
|
||||
smart_command_set command, int select,
|
||||
char *data)
|
||||
{
|
||||
fd = fd;
|
||||
escalade_port = escalade_port;
|
||||
command = command;
|
||||
select = select;
|
||||
data = data;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int marvell_command_interface(int fd, smart_command_set command,
|
||||
int select, char *data)
|
||||
{
|
||||
fd = fd;
|
||||
command = command;
|
||||
select = select;
|
||||
data = data;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
fd = fd;
|
||||
command = command;
|
||||
select = select;
|
||||
data = data;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Interface to SCSI devices. See os_linux.c
|
||||
int do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report) {
|
||||
fd = fd;
|
||||
iop = iop;
|
||||
report = report;
|
||||
int do_scsi_cmnd_io(int /* fd */, struct scsi_cmnd_io * /* iop */, int /* report */) {
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
@ -11,8 +11,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -24,7 +24,7 @@
|
||||
#ifndef OS_DARWIN_H_
|
||||
#define OS_DARWIN_H_
|
||||
|
||||
#define OS_DARWIN_H_CVSID "$Id: os_darwin.h,v 1.7 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_DARWIN_H_CVSID "$Id: os_darwin.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
// Isn't in 10.3.9?
|
||||
|
||||
|
@ -12,10 +12,10 @@
|
||||
# version.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License (for
|
||||
# example COPYING); if not, write to the Free Software Foundation, Inc., 675
|
||||
# Mass Ave, Cambridge, MA 02139, USA.
|
||||
# example COPYING); if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# $Id: SMART.in,v 1.5 2008/03/04 22:09:47 ballen4705 Exp $
|
||||
# $Id: SMART.in 3728 2012-12-13 17:57:50Z chrfranke $
|
||||
|
||||
##
|
||||
# SMART monitoring
|
||||
|
850
os_freebsd.cpp
850
os_freebsd.cpp
File diff suppressed because it is too large
Load Diff
@ -11,8 +11,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -82,7 +82,7 @@
|
||||
#ifndef OS_FREEBSD_H_
|
||||
#define OS_FREEBSD_H_
|
||||
|
||||
#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 3266 2011-02-21 16:33:04Z chrfranke $"
|
||||
#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h 3727 2012-12-13 17:23:06Z samm2 $"
|
||||
|
||||
#define MAX_NUM_DEV 26
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* os_generic.c
|
||||
* os_generic.cpp
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
@ -13,8 +13,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@ -71,6 +71,7 @@
|
||||
|
||||
// These are needed to define prototypes and structures for the
|
||||
// functions defined below
|
||||
#include "int64.h"
|
||||
#include "atacmds.h"
|
||||
#include "utility.h"
|
||||
|
||||
@ -82,8 +83,8 @@
|
||||
// should have one *_H_CVSID macro appearing below for each file
|
||||
// appearing with #include "*.h" above. Please list these (below) in
|
||||
// alphabetic/dictionary order.
|
||||
const char *os_XXXX_c_cvsid="$Id: os_generic.cpp 3191 2010-10-27 19:55:33Z chrfranke $" \
|
||||
ATACMDS_H_CVSID CONFIG_H_CVSID OS_GENERIC_H_CVSID UTILITY_H_CVSID;
|
||||
const char * os_XXXX_cpp_cvsid="$Id: os_generic.cpp 3579 2012-07-20 17:50:12Z chrfranke $"
|
||||
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_GENERIC_H_CVSID UTILITY_H_CVSID;
|
||||
|
||||
// This is here to prevent compiler warnings for unused arguments of
|
||||
// functions.
|
||||
|
@ -12,8 +12,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -25,7 +25,7 @@
|
||||
// In the three following lines, change 'GENERIC' to your OS name
|
||||
#ifndef OS_GENERIC_H_
|
||||
#define OS_GENERIC_H_
|
||||
#define OS_GENERIC_H_CVSID "$Id: os_generic.h,v 1.7 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_GENERIC_H_CVSID "$Id: os_generic.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
// Additional material should start here. Note: to keep the '-V' CVS
|
||||
// reporting option working as intended, you should only #include
|
||||
|
881
os_linux.cpp
881
os_linux.cpp
File diff suppressed because it is too large
Load Diff
@ -24,8 +24,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -38,7 +38,7 @@
|
||||
#ifndef OS_LINUX_H_
|
||||
#define OS_LINUX_H_
|
||||
|
||||
#define OS_LINUX_H_CVSID "$Id: os_linux.h,v 1.27 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_LINUX_H_CVSID "$Id: os_linux.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
/*
|
||||
The following definitions/macros/prototypes are used for three
|
||||
|
@ -11,8 +11,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
const char * os_netbsd_cpp_cvsid = "$Id: os_netbsd.cpp 3265 2011-02-21 16:21:14Z chrfranke $"
|
||||
const char * os_netbsd_cpp_cvsid = "$Id: os_netbsd.cpp 3806 2013-03-29 20:17:03Z chrfranke $"
|
||||
OS_NETBSD_H_CVSID;
|
||||
|
||||
/* global variable holding byte count of allocated memory */
|
||||
@ -169,14 +169,6 @@ deviceclose(int fd)
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
int
|
||||
marvell_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{ return -1; }
|
||||
|
||||
int
|
||||
highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{ return -1; }
|
||||
|
||||
int
|
||||
ata_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
@ -345,20 +337,6 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
escalade_command_interface(int fd, int disknum, int escalade_type, smart_command_set command, int select, char *data)
|
||||
{
|
||||
printwarning(NO_3WARE, NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
areca_command_interface(int fd, int disknum, smart_command_set command, int select, char *data)
|
||||
{
|
||||
printwarning(NO_ARECA, NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
|
||||
{
|
||||
|
@ -11,8 +11,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -24,7 +24,7 @@
|
||||
#ifndef OS_NETBSD_H_
|
||||
#define OS_NETBSD_H_
|
||||
|
||||
#define OS_NETBSD_H_CVSID "$Id: os_netbsd.h,v 1.10 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_NETBSD_H_CVSID "$Id: os_netbsd.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
#include <sys/device.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -13,8 +13,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
const char * os_openbsd_cpp_cvsid = "$Id: os_openbsd.cpp 3265 2011-02-21 16:21:14Z chrfranke $"
|
||||
const char * os_openbsd_cpp_cvsid = "$Id: os_openbsd.cpp 3727 2012-12-13 17:23:06Z samm2 $"
|
||||
OS_OPENBSD_H_CVSID;
|
||||
|
||||
/* global variable holding byte count of allocated memory */
|
||||
@ -173,14 +173,6 @@ deviceclose(int fd)
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
int
|
||||
marvell_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{ return -1; }
|
||||
|
||||
int
|
||||
highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{ return -1; }
|
||||
|
||||
int
|
||||
ata_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
@ -359,20 +351,6 @@ ata_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
escalade_command_interface(int fd, int disknum, int escalade_type, smart_command_set command, int select, char *data)
|
||||
{
|
||||
printwarning(NO_3WARE, NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
areca_command_interface(int fd, int disknum, smart_command_set command, int select, char *data)
|
||||
{
|
||||
printwarning(NO_ARECA, NULL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report)
|
||||
{
|
||||
|
@ -13,8 +13,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -26,7 +26,7 @@
|
||||
#ifndef OS_OPENBSD_H_
|
||||
#define OS_OPENBSD_H_
|
||||
|
||||
#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h,v 1.6 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_OPENBSD_H_CVSID "$Id: os_openbsd.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
/* from NetBSD: atareg.h,v 1.17, by Manuel Bouyer */
|
||||
/* Actually fits _perfectly_ into OBSDs wdcreg.h, but... */
|
||||
|
31
os_os2.cpp
31
os_os2.cpp
@ -11,8 +11,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -31,7 +31,7 @@
|
||||
#include "os_os2.h"
|
||||
|
||||
// Needed by '-V' option (CVS versioning) of smartd/smartctl
|
||||
const char *os_XXXX_c_cvsid="$Id: os_os2.cpp 3191 2010-10-27 19:55:33Z chrfranke $" \
|
||||
const char *os_XXXX_c_cvsid="$Id: os_os2.cpp 3806 2013-03-29 20:17:03Z chrfranke $" \
|
||||
ATACMDS_H_CVSID OS_XXXX_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
|
||||
|
||||
// global handle to device driver
|
||||
@ -522,31 +522,6 @@ int ata_command_interface(int device, smart_command_set command, int select, cha
|
||||
return 0;
|
||||
}
|
||||
|
||||
int marvell_command_interface(int fd, smart_command_set command, int select, char *data){
|
||||
unsupported(1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
unsupported(1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Interface to ATA devices behind 3ware escalade RAID controller
|
||||
// cards. Same description as ata_command_interface() above except
|
||||
// that 0 <= disknum <= 15 specifies the ATA disk attached to the
|
||||
// controller.
|
||||
int escalade_command_interface(int fd, int disknum, int escalade_type, smart_command_set command, int select, char *data){
|
||||
unsupported(2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int areca_command_interface(int fd, int disknum, smart_command_set command, int select, char *data){
|
||||
unsupported(2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Interface to SCSI devices. See os_linux.c
|
||||
int do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report) {
|
||||
unsupported(3);
|
||||
|
6
os_os2.h
6
os_os2.h
@ -11,14 +11,14 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef OS_OS2_H_
|
||||
#define OS_OS2_H_
|
||||
|
||||
#define OS_XXXX_H_CVSID "$Id: os_os2.h,v 1.5 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_XXXX_H_CVSID "$Id: os_os2.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
// Additional material should start here. Note: to keep the '-V' CVS
|
||||
// reporting option working as intended, you should only #include
|
||||
|
@ -13,12 +13,13 @@
|
||||
// This is to include whatever structures and prototypes you define in
|
||||
// os_generic.h
|
||||
#include "os_qnxnto.h"
|
||||
#include <errno.h>
|
||||
|
||||
// Needed by '-V' option (CVS versioning) of smartd/smartctl. You
|
||||
// should have one *_H_CVSID macro appearing below for each file
|
||||
// appearing with #include "*.h" above. Please list these (below) in
|
||||
// alphabetic/dictionary order.
|
||||
const char *os_XXXX_c_cvsid="$Id: os_qnxnto.cpp 3191 2010-10-27 19:55:33Z chrfranke $" \
|
||||
const char *os_XXXX_c_cvsid="$Id: os_qnxnto.cpp 3806 2013-03-29 20:17:03Z chrfranke $" \
|
||||
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_QNXNTO_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
|
||||
|
||||
|
||||
@ -370,57 +371,6 @@ int status,rc;
|
||||
return(rc);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
int marvell_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
ARGUSED(fd);
|
||||
ARGUSED(command);
|
||||
ARGUSED(select);
|
||||
ARGUSED(data);
|
||||
unsupported();
|
||||
return -1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
int highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
ARGUSED(fd);
|
||||
ARGUSED(command);
|
||||
ARGUSED(select);
|
||||
ARGUSED(data);
|
||||
unsupported();
|
||||
return -1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// Interface to ATA devices behind 3ware escalade/apache RAID
|
||||
// controller cards. Same description as ata_command_interface()
|
||||
// above except that 0 <= disknum <= 15 specifies the ATA disk
|
||||
// attached to the controller, and controller_type specifies the
|
||||
// precise type of 3ware controller. See os_linux.c
|
||||
int escalade_command_interface(int fd,int disknum,int controller_type,smart_command_set command,int select,char *data)
|
||||
{
|
||||
ARGUSED(fd);
|
||||
ARGUSED(disknum);
|
||||
ARGUSED(controller_type);
|
||||
ARGUSED(command);
|
||||
ARGUSED(select);
|
||||
ARGUSED(data);
|
||||
|
||||
unsupported();
|
||||
return -1;
|
||||
}
|
||||
|
||||
int areca_command_interface(int fd,int disknum,smart_command_set command,int select,char *data)
|
||||
{
|
||||
ARGUSED(fd);
|
||||
ARGUSED(disknum);
|
||||
ARGUSED(command);
|
||||
ARGUSED(select);
|
||||
ARGUSED(data);
|
||||
|
||||
unsupported();
|
||||
return -1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
#include <errno.h>
|
||||
// Interface to SCSI devices. See os_linux.c
|
||||
int do_scsi_cmnd_io(int fd,struct scsi_cmnd_io * iop,int report)
|
||||
{
|
||||
|
@ -12,8 +12,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
#ifndef OS_QNXNTO_H_
|
||||
#define OS_QNXNTO_H_
|
||||
#define OS_QNXNTO_H_CVSID "$Id: os_qnxnto.h,v 1.2 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_QNXNTO_H_CVSID "$Id: os_qnxnto.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
// Additional material should start here. Note: to keep the '-V' CVS
|
||||
// reporting option working as intended, you should only #include
|
||||
|
@ -12,8 +12,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -39,9 +39,9 @@
|
||||
|
||||
extern long long bytes;
|
||||
|
||||
static const char *filenameandversion="$Id: os_solaris.cpp,v 1.32 2008/06/12 21:46:31 ballen4705 Exp $";
|
||||
static const char *filenameandversion="$Id: os_solaris.cpp 3806 2013-03-29 20:17:03Z chrfranke $";
|
||||
|
||||
const char *os_XXXX_c_cvsid="$Id: os_solaris.cpp,v 1.32 2008/06/12 21:46:31 ballen4705 Exp $" \
|
||||
const char *os_XXXX_c_cvsid="$Id: os_solaris.cpp 3806 2013-03-29 20:17:03Z chrfranke $" \
|
||||
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_SOLARIS_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
|
||||
|
||||
// The printwarning() function warns about unimplemented functions
|
||||
@ -285,17 +285,6 @@ static void swap_sector(void *p)
|
||||
#endif
|
||||
|
||||
// Interface to ATA devices. See os_linux.c
|
||||
int marvell_command_interface(int fd, smart_command_set command, int select, char *data){
|
||||
ARGUSED(fd); ARGUSED(command); ARGUSED(select); ARGUSED(data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int highpoint_command_interface(int fd, smart_command_set command, int select, char *data)
|
||||
{
|
||||
ARGUSED(fd); ARGUSED(command); ARGUSED(select); ARGUSED(data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ata_command_interface(int fd, smart_command_set command, int select, char *data){
|
||||
#if defined(__sparc)
|
||||
int err;
|
||||
@ -352,25 +341,6 @@ int ata_command_interface(int fd, smart_command_set command, int select, char *d
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Interface to ATA devices behind 3ware escalade RAID controller cards. See os_linux.c
|
||||
int escalade_command_interface(int fd, int disknum, int escalade_type, smart_command_set command, int select, char *data){
|
||||
ARGUSED(fd); ARGUSED(disknum); ARGUSED(escalade_type);
|
||||
ARGUSED(command); ARGUSED(select); ARGUSED(data);
|
||||
|
||||
if (printwarning(1))
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int areca_command_interface(int fd, int disknum, smart_command_set command, int select, char *data){
|
||||
ARGUSED(fd); ARGUSED(disknum);
|
||||
ARGUSED(command); ARGUSED(select); ARGUSED(data);
|
||||
|
||||
if (printwarning(1))
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/scsi/generic/commands.h>
|
||||
#include <sys/scsi/generic/status.h>
|
||||
|
@ -12,8 +12,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -25,7 +25,7 @@
|
||||
#ifndef OS_SOLARIS_H_
|
||||
#define OS_SOLARIS_H_
|
||||
|
||||
#define OS_SOLARIS_H_CVSID "$Id: os_solaris.h,v 1.14 2008/03/04 22:09:47 ballen4705 Exp $\n"
|
||||
#define OS_SOLARIS_H_CVSID "$Id: os_solaris.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
// Additional material should start here. Note: to keep the '-V' CVS
|
||||
// reporting option working as intended, you should only #include
|
||||
|
@ -16,8 +16,8 @@
|
||||
! General Public License for more details.
|
||||
!
|
||||
! You should have received a copy of the GNU General Public License
|
||||
! along with this program; if not, write to the Free Software
|
||||
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
! along with this program; if not, write to the Free Software Foundation,
|
||||
! Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
!
|
||||
!
|
||||
! --------------------------------------------------------
|
||||
@ -97,7 +97,7 @@
|
||||
.section ".rodata"
|
||||
.align 8
|
||||
.LLC0:
|
||||
.asciz "$Id: os_solaris_ata.s,v 1.6 2008/03/04 22:09:47 ballen4705 Exp $"
|
||||
.asciz "$Id: os_solaris_ata.s 3728 2012-12-13 17:57:50Z chrfranke $"
|
||||
.global os_solaris_ata_s_cvsid
|
||||
.section ".data"
|
||||
.align 4
|
||||
|
2077
os_win32.cpp
2077
os_win32.cpp
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2004-8 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2004-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -11,15 +11,14 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DAEMON_WIN32_H
|
||||
#define DAEMON_WIN32_H
|
||||
|
||||
#define DAEMON_WIN32_H_CVSID "$Id: daemon_win32.h,v 1.7 2008/03/04 22:09:48 ballen4705 Exp $\n"
|
||||
#define DAEMON_WIN32_H_CVSID "$Id: daemon_win32.h 3584 2012-08-05 17:05:32Z chrfranke $"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
@ -60,9 +59,6 @@ int daemon_enable_console(const char * title);
|
||||
// Detach from console
|
||||
int daemon_detach(const char * ident);
|
||||
|
||||
// Display a message box
|
||||
int daemon_messagebox(int system, const char * title, const char * text);
|
||||
|
||||
// Spawn a process and redirect stdio
|
||||
int daemon_spawn(const char * cmd,
|
||||
const char * inpbuf, int inpsize,
|
||||
|
@ -1,186 +0,0 @@
|
||||
/*
|
||||
* os_win32/hostname_win32.cpp
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2004-8 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hostname_win32.h"
|
||||
|
||||
const char * hostname_win32_c_cvsid = "$Id: hostname_win32.cpp,v 1.6 2008/03/04 22:09:48 ballen4705 Exp $" HOSTNAME_WIN32_H_CVSID;
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef MAX_HOSTNAME_LEN
|
||||
|
||||
// From IPHlpApi.dll:
|
||||
|
||||
#define MAX_HOSTNAME_LEN 132
|
||||
#define MAX_DOMAIN_NAME_LEN 132
|
||||
#define MAX_SCOPE_ID_LEN 260
|
||||
|
||||
typedef struct {
|
||||
char String[4 * 4];
|
||||
} IP_ADDRESS_STRING,
|
||||
*PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
|
||||
|
||||
typedef struct _IP_ADDR_STRING {
|
||||
struct _IP_ADDR_STRING* Next;
|
||||
IP_ADDRESS_STRING IpAddress;
|
||||
IP_MASK_STRING IpMask;
|
||||
DWORD Context;
|
||||
} IP_ADDR_STRING,
|
||||
*PIP_ADDR_STRING;
|
||||
|
||||
typedef struct {
|
||||
char HostName[MAX_HOSTNAME_LEN];
|
||||
char DomainName[MAX_DOMAIN_NAME_LEN];
|
||||
PIP_ADDR_STRING CurrentDnsServer;
|
||||
IP_ADDR_STRING DnsServerList;
|
||||
UINT NodeType;
|
||||
char ScopeId[MAX_SCOPE_ID_LEN];
|
||||
UINT EnableRouting;
|
||||
UINT EnableProxy;
|
||||
UINT EnableDns;
|
||||
} FIXED_INFO,
|
||||
*PFIXED_INFO;
|
||||
|
||||
DWORD WINAPI GetNetworkParams(PFIXED_INFO info, PULONG size);
|
||||
|
||||
#endif // MAX_HOSTNAME_LEN
|
||||
|
||||
|
||||
// Call GetComputerNameEx() if available (Win2000/XP)
|
||||
|
||||
static BOOL CallGetComputerNameExA(int type, LPSTR name, LPDWORD size)
|
||||
{
|
||||
HINSTANCE hdll;
|
||||
BOOL (WINAPI * GetComputerNameExA_p)(int/*enum COMPUTER_NAME_FORMAT*/, LPSTR, LPDWORD);
|
||||
BOOL ret;
|
||||
if (!(hdll = LoadLibraryA("KERNEL32.DLL")))
|
||||
return FALSE;
|
||||
if (!(GetComputerNameExA_p = (BOOL (WINAPI *)(int, LPSTR, LPDWORD))GetProcAddress(hdll, "GetComputerNameExA")))
|
||||
ret = FALSE;
|
||||
else
|
||||
ret = GetComputerNameExA_p(type, name, size);
|
||||
FreeLibrary(hdll);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
// Call GetNetworkParams() if available (Win98/ME/2000/XP)
|
||||
|
||||
static DWORD CallGetNetworkParams(PFIXED_INFO info, PULONG size)
|
||||
{
|
||||
HINSTANCE hdll;
|
||||
DWORD (WINAPI * GetNetworkParams_p)(PFIXED_INFO, PULONG);
|
||||
DWORD ret;
|
||||
if (!(hdll = LoadLibraryA("IPHlpApi.dll")))
|
||||
return ERROR_NOT_SUPPORTED;
|
||||
if (!(GetNetworkParams_p = (DWORD (WINAPI *)(PFIXED_INFO, PULONG))GetProcAddress(hdll, "GetNetworkParams")))
|
||||
ret = ERROR_NOT_SUPPORTED;
|
||||
else
|
||||
ret = GetNetworkParams_p(info, size);
|
||||
FreeLibrary(hdll);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
// Get host/domainname from registry (Win98/ME/NT4/2000/XP)
|
||||
|
||||
static DWORD GetNamesFromRegistry(BOOL domain, char * name, int len)
|
||||
{
|
||||
HKEY hk; DWORD size, type;
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
||||
(GetVersion() & 0x80000000
|
||||
? "System\\CurrentControlSet\\Services\\VxD\\MSTCP" //Win9x/ME
|
||||
: "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"),
|
||||
0, KEY_READ, &hk) != ERROR_SUCCESS)
|
||||
return 0;
|
||||
size = len-1;
|
||||
if (!(RegQueryValueExA(hk, (!domain?"HostName":"Domain"), 0, &type, (unsigned char *)name, &size) == ERROR_SUCCESS && type == REG_SZ))
|
||||
size = 0;
|
||||
if (size == 0 && domain) {
|
||||
size = len-1;
|
||||
if (!(RegQueryValueExA(hk, "DhcpDomain", 0, &type, (unsigned char *)name, &size) == ERROR_SUCCESS && type == REG_SZ))
|
||||
size = 0;
|
||||
}
|
||||
RegCloseKey(hk);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
static int gethostdomname(int domain, char * name, int len)
|
||||
{
|
||||
DWORD size; FIXED_INFO info;
|
||||
|
||||
// try KERNEL32.dll::GetComputerNameEx()
|
||||
size = len - 1;
|
||||
if (CallGetComputerNameExA((!domain ? 1:2/*ComputerNameDnsHost:Domain*/), name, &size))
|
||||
return 0;
|
||||
|
||||
// try IPHlpApi.dll::GetNetworkParams()
|
||||
size = sizeof(info);
|
||||
if (CallGetNetworkParams(&info, &size) == ERROR_SUCCESS) {
|
||||
strncpy(name, (!domain?info.HostName:info.DomainName), len-1); name[len-1] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// try registry
|
||||
if (GetNamesFromRegistry(domain, name, len))
|
||||
return 0;
|
||||
|
||||
if (domain)
|
||||
return -1;
|
||||
|
||||
// last resort: get NETBIOS name
|
||||
size = len - 1;
|
||||
if (GetComputerNameA(name, &size))
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int gethostname(char * name, int len)
|
||||
{
|
||||
return gethostdomname(0, name, len);
|
||||
}
|
||||
|
||||
|
||||
int getdomainname(char * name, int len)
|
||||
{
|
||||
return gethostdomname(1, name, len);
|
||||
}
|
||||
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
char name[256];
|
||||
if (gethostname(name, sizeof(name)))
|
||||
strcpy(name, "Error");
|
||||
printf("hostname=\"%s\"\n", name);
|
||||
if (getdomainname(name, sizeof(name)))
|
||||
strcpy(name, "Error");
|
||||
printf("domainname=\"%s\"\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* os_win32/hostname_win32.h
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2004-8 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HOSTNAME_WIN32_H
|
||||
#define HOSTNAME_WIN32_H
|
||||
|
||||
#define HOSTNAME_WIN32_H_CVSID "$Id: hostname_win32.h,v 1.5 2008/03/04 22:09:48 ballen4705 Exp $\n"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int gethostname(char * name, int len);
|
||||
int getdomainname(char * name, int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HOSTNAME_WIN32_H
|
@ -3,7 +3,7 @@
|
||||
;
|
||||
; Home page of code is: http://smartmontools.sourceforge.net
|
||||
;
|
||||
; Copyright (C) 2006-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
; Copyright (C) 2006-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
;
|
||||
; This program is free software; you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
@ -13,7 +13,7 @@
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
; $Id: installer.nsi 3545 2012-05-25 21:19:03Z chrfranke $
|
||||
; $Id: installer.nsi 3759 2013-01-26 21:11:02Z chrfranke $
|
||||
;
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ InstType "Drive menu"
|
||||
; Sections
|
||||
|
||||
!ifdef INPDIR64
|
||||
Section "64-bit version (EXPERIMENTAL)" X64_SECTION
|
||||
Section "64-bit version" X64_SECTION
|
||||
; Handled in Function CheckX64
|
||||
SectionEnd
|
||||
!endif
|
||||
@ -135,16 +135,15 @@ SectionGroup "!Program files"
|
||||
!insertmacro FileExe "bin\smartd.exe" ""
|
||||
|
||||
IfFileExists "$INSTDIR\bin\smartd.conf" 0 +2
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Replace existing configuration file$\n$INSTDIR\bin\smartd.conf ?" IDYES 0 IDNO +2
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Replace existing configuration file$\n$INSTDIR\bin\smartd.conf ?" /SD IDNO IDYES 0 IDNO +2
|
||||
File "${INPDIR}\doc\smartd.conf"
|
||||
|
||||
IfFileExists "$WINDIR\system32\cmd.exe" 0 nosysl
|
||||
!insertmacro FileExe "bin\syslogevt.exe" /nonfatal
|
||||
nosysl:
|
||||
File "${INPDIR}\bin\smartd_warning.cmd"
|
||||
!insertmacro FileExe "bin\wtssendmsg.exe" ""
|
||||
|
||||
; Restart service ?
|
||||
StrCmp $1 "0" 0 +3
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Restart smartd service ?" IDYES 0 IDNO +2
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Restart smartd service ?" /SD IDNO IDYES 0 IDNO +2
|
||||
ExecWait "net start smartd"
|
||||
|
||||
SectionEnd
|
||||
@ -176,7 +175,8 @@ Section "!Documentation" DOC_SECTION
|
||||
|
||||
SetOutPath "$INSTDIR\doc"
|
||||
File "${INPDIR}\doc\AUTHORS.txt"
|
||||
File "${INPDIR}\doc\CHANGELOG.txt"
|
||||
File "${INPDIR}\doc\ChangeLog.txt"
|
||||
File "${INPDIR}\doc\ChangeLog-5.0-6.0.txt"
|
||||
File "${INPDIR}\doc\COPYING.txt"
|
||||
File "${INPDIR}\doc\INSTALL.txt"
|
||||
File "${INPDIR}\doc\NEWS.txt"
|
||||
@ -253,16 +253,14 @@ Section "Start Menu Shortcuts" MENU_SECTION
|
||||
; smartctl
|
||||
IfFileExists "$INSTDIR\bin\smartctl.exe" 0 noctl
|
||||
SetOutPath "$INSTDIR\bin"
|
||||
IfFileExists "$WINDIR\system32\cmd.exe" 0 nocmd
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl (Admin CMD).lnk" "$WINDIR\system32\cmd.exe" '/k PATH=$INSTDIR\bin;%PATH%&cd /d "$INSTDIR\bin"'
|
||||
nocmd:
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl (Admin CMD).lnk" "$WINDIR\system32\cmd.exe" '/k PATH=$INSTDIR\bin;%PATH%&cd /d "$INSTDIR\bin"'
|
||||
CreateDirectory "$SMPROGRAMS\smartmontools\smartctl Examples"
|
||||
FileOpen $0 "$SMPROGRAMS\smartmontools\smartctl Examples\!Read this first!.txt" "w"
|
||||
FileWrite $0 "All the example commands in this directory$\r$\napply to the first drive (sda).$\r$\n"
|
||||
FileClose $0
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\All info (-a).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -a sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\All info (-x).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -x sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\Identify drive (-i).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -i sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART attributes (-A).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -A sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART attributes (-A -f brief).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -A -f brief sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART capabilities (-c).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -c sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART health status (-H).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -H sda"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartctl Examples\SMART error log (-l error).lnk" "$INSTDIR\bin\runcmdu.exe" "smartctl -l error sda"
|
||||
@ -288,15 +286,13 @@ Section "Start Menu Shortcuts" MENU_SECTION
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.conf (view).lnk" "$EDITOR" "$INSTDIR\bin\smartd.conf"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\smartd Examples\smartd.log (view).lnk" "$EDITOR" "$INSTDIR\bin\smartd.log"
|
||||
|
||||
; smartd service (not on 9x/ME)
|
||||
IfFileExists "$WINDIR\system32\cmd.exe" 0 nosvc
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, eventlog, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 10min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0 -i 600"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service remove.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd remove"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service start.lnk" "$INSTDIR\bin\runcmdu.exe" "net start smartd"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service stop.lnk" "$INSTDIR\bin\runcmdu.exe" "net stop smartd"
|
||||
nosvc:
|
||||
; smartd service
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, eventlog, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 10min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0 -i 600"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service install, smartd.log, 30min.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd install -l local0"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service remove.lnk" "$INSTDIR\bin\runcmdu.exe" "smartd remove"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service start.lnk" "$INSTDIR\bin\runcmdu.exe" "net start smartd"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\smartd Examples\Service stop.lnk" "$INSTDIR\bin\runcmdu.exe" "net stop smartd"
|
||||
nod:
|
||||
|
||||
; Documentation
|
||||
@ -314,14 +310,9 @@ Section "Start Menu Shortcuts" MENU_SECTION
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb.h (view).lnk" "$EDITOR" "$INSTDIR\bin\drivedb.h"
|
||||
!insertmacro CreateAdminShortCut "$SMPROGRAMS\smartmontools\Documentation\drivedb-add.h (create, edit).lnk" "$EDITOR" "$INSTDIR\bin\drivedb-add.h"
|
||||
nodb:
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\AUTHORS.lnk" "$INSTDIR\doc\AUTHORS.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\CHANGELOG.lnk" "$INSTDIR\doc\CHANGELOG.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\ChangeLog.lnk" "$INSTDIR\doc\ChangeLog.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\COPYING.lnk" "$INSTDIR\doc\COPYING.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\INSTALL.lnk" "$INSTDIR\doc\INSTALL.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\NEWS.lnk" "$INSTDIR\doc\NEWS.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\README.lnk" "$INSTDIR\doc\README.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\TODO.lnk" "$INSTDIR\doc\TODO.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\WARNINGS.lnk" "$INSTDIR\doc\WARNINGS.txt"
|
||||
CreateShortCut "$SMPROGRAMS\smartmontools\Documentation\Windows version download page.lnk" "http://smartmontools-win32.dyndns.org/smartmontools/"
|
||||
nodoc:
|
||||
|
||||
@ -346,9 +337,8 @@ Section "Add install dir to PATH" PATH_SECTION
|
||||
|
||||
SectionIn 1
|
||||
|
||||
IfFileExists "$WINDIR\system32\cmd.exe" 0 +3
|
||||
Push "$INSTDIR\bin"
|
||||
Call AddToPath
|
||||
Push "$INSTDIR\bin"
|
||||
Call AddToPath
|
||||
|
||||
SectionEnd
|
||||
|
||||
@ -379,9 +369,9 @@ SectionGroup "Add smartctl to drive menu"
|
||||
SectionEnd
|
||||
!macroend
|
||||
|
||||
!insertmacro DriveSection 0 "SMART all info" "-a"
|
||||
!insertmacro DriveSection 0 "SMART all info" "-x"
|
||||
!insertmacro DriveSection 1 "SMART status" "-Hc"
|
||||
!insertmacro DriveSection 2 "SMART attributes" "-A"
|
||||
!insertmacro DriveSection 2 "SMART attributes" "-A -f brief"
|
||||
!insertmacro DriveSection 3 "SMART short selftest" "-t short"
|
||||
!insertmacro DriveSection 4 "SMART long selftest" "-t long"
|
||||
!insertmacro DriveSection 5 "SMART continue selective selftest" '-t "selective,cont"'
|
||||
@ -397,7 +387,7 @@ Section "Uninstall"
|
||||
ReadRegStr $0 HKLM "System\CurrentControlSet\Services\smartd" "ImagePath"
|
||||
StrCmp $0 "" nosrv
|
||||
ExecWait "net stop smartd"
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Remove smartd service ?" IDYES 0 IDNO nosrv
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Remove smartd service ?" /SD IDNO IDYES 0 IDNO nosrv
|
||||
ExecWait "$INSTDIR\bin\smartd.exe remove"
|
||||
nosrv:
|
||||
|
||||
@ -411,25 +401,25 @@ Section "Uninstall"
|
||||
GetFileTime "$INSTDIR\bin\smartd.conf" $0 $1
|
||||
GetFileTime "$INSTDIR\doc\smartd.conf" $2 $3
|
||||
StrCmp "$0:$1" "$2:$3" +2 0
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete configuration file$\n$INSTDIR\bin\smartd.conf ?" IDYES 0 IDNO noconf
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete configuration file$\n$INSTDIR\bin\smartd.conf ?" /SD IDNO IDYES 0 IDNO noconf
|
||||
Delete "$INSTDIR\bin\smartd.conf"
|
||||
noconf:
|
||||
|
||||
; Remove log file ?
|
||||
IfFileExists "$INSTDIR\bin\smartd.log" 0 +3
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete log file$\n$INSTDIR\bin\smartd.log ?" IDYES 0 IDNO +2
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete log file$\n$INSTDIR\bin\smartd.log ?" /SD IDNO IDYES 0 IDNO +2
|
||||
Delete "$INSTDIR\bin\smartd.log"
|
||||
|
||||
; Remove drivedb-add file ?
|
||||
IfFileExists "$INSTDIR\bin\drivedb-add.h" 0 +3
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete local drive database file$\n$INSTDIR\bin\drivedb-add.h ?" IDYES 0 IDNO +2
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Delete local drive database file$\n$INSTDIR\bin\drivedb-add.h ?" /SD IDNO IDYES 0 IDNO +2
|
||||
Delete "$INSTDIR\bin\drivedb-add.h"
|
||||
|
||||
; Remove files
|
||||
Delete "$INSTDIR\bin\smartctl.exe"
|
||||
Delete "$INSTDIR\bin\smartctl-nc.exe"
|
||||
Delete "$INSTDIR\bin\smartd.exe"
|
||||
Delete "$INSTDIR\bin\syslogevt.exe"
|
||||
Delete "$INSTDIR\bin\smartd_warning.cmd" ; TODO: Check for modifications?
|
||||
Delete "$INSTDIR\bin\drivedb.h"
|
||||
Delete "$INSTDIR\bin\drivedb.h.error"
|
||||
Delete "$INSTDIR\bin\drivedb.h.lastcheck"
|
||||
@ -442,8 +432,10 @@ Section "Uninstall"
|
||||
Delete "$INSTDIR\bin\runcmda.exe.manifest"
|
||||
Delete "$INSTDIR\bin\runcmdu.exe"
|
||||
Delete "$INSTDIR\bin\runcmdu.exe.manifest"
|
||||
Delete "$INSTDIR\bin\wtssendmsg.exe"
|
||||
Delete "$INSTDIR\doc\AUTHORS.txt"
|
||||
Delete "$INSTDIR\doc\CHANGELOG.txt"
|
||||
Delete "$INSTDIR\doc\ChangeLog.txt"
|
||||
Delete "$INSTDIR\doc\ChangeLog-5.0-6.0.txt"
|
||||
Delete "$INSTDIR\doc\COPYING.txt"
|
||||
Delete "$INSTDIR\doc\INSTALL.txt"
|
||||
Delete "$INSTDIR\doc\NEWS.txt"
|
||||
@ -477,22 +469,21 @@ Section "Uninstall"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
; Remove install dir from PATH
|
||||
IfFileExists "$WINDIR\system32\cmd.exe" 0 +3
|
||||
Push "$INSTDIR\bin"
|
||||
Call un.RemoveFromPath
|
||||
Push "$INSTDIR\bin"
|
||||
Call un.RemoveFromPath
|
||||
|
||||
; Remove drive menu registry entries
|
||||
!insertmacro DriveMenuRemove
|
||||
|
||||
; Check for still existing entries
|
||||
IfFileExists "$INSTDIR\bin\smartd.exe" 0 +3
|
||||
MessageBox MB_OK|MB_ICONEXCLAMATION "$INSTDIR\bin\smartd.exe could not be removed.$\nsmartd is possibly still running."
|
||||
MessageBox MB_OK|MB_ICONEXCLAMATION "$INSTDIR\bin\smartd.exe could not be removed.$\nsmartd is possibly still running." /SD IDOK
|
||||
Goto +3
|
||||
IfFileExists "$INSTDIR" 0 +2
|
||||
MessageBox MB_OK "Note: $INSTDIR could not be removed."
|
||||
MessageBox MB_OK "Note: $INSTDIR could not be removed." /SD IDOK
|
||||
|
||||
IfFileExists "$SMPROGRAMS\smartmontools" 0 +2
|
||||
MessageBox MB_OK "Note: $SMPROGRAMS\smartmontools could not be removed."
|
||||
MessageBox MB_OK "Note: $SMPROGRAMS\smartmontools could not be removed." /SD IDOK
|
||||
|
||||
SectionEnd
|
||||
|
||||
@ -530,10 +521,6 @@ Function .onInit
|
||||
IfFileExists "$EDITOR" +2 0
|
||||
StrCpy $EDITOR "notepad.exe"
|
||||
|
||||
; Hide "Add install dir to PATH" on 9x/ME
|
||||
IfFileExists "$WINDIR\system32\cmd.exe" +2 0
|
||||
SectionSetText ${PATH_SECTION} ""
|
||||
|
||||
Call ParseCmdLine
|
||||
FunctionEnd
|
||||
|
||||
|
34
os_win32/smartctl_res.rc.in
Normal file
34
os_win32/smartctl_res.rc.in
Normal file
@ -0,0 +1,34 @@
|
||||
//
|
||||
// os_win32/smartctl_res.rc.in
|
||||
//
|
||||
// $Id: smartctl_res.rc.in 3755 2013-01-26 15:13:08Z chrfranke $
|
||||
//
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION @BINARY_VERSION@
|
||||
PRODUCTVERSION @BINARY_VERSION@
|
||||
FILEFLAGSMASK 0x0
|
||||
FILEFLAGS 0x0
|
||||
FILEOS 0x4 // VOS__WINDOWS32
|
||||
FILETYPE 0x1 // VFT_APP
|
||||
FILESUBTYPE 0x0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "04090000"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "www.smartmontools.org"
|
||||
VALUE "FileDescription", "Control and Monitor Utility for SMART Disks"
|
||||
VALUE "FileVersion", "@TEXT_VERSION@"
|
||||
VALUE "InternalName", "smartctl"
|
||||
VALUE "LegalCopyright", "(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org"
|
||||
VALUE "OriginalFilename", "smartctl.exe"
|
||||
VALUE "ProductName", "smartmontools"
|
||||
VALUE "ProductVersion", "@TEXT_VERSION@"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x0000
|
||||
END
|
||||
END
|
@ -1,154 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="os_win32">
|
||||
<UniqueIdentifier>{9321e988-dd03-496d-9933-7c8b235a46bf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="regex">
|
||||
<UniqueIdentifier>{bfbfd4ea-fae3-45ec-9cfb-c5424218c47c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="getopt">
|
||||
<UniqueIdentifier>{8ff0bf5f-c96e-45c3-bcb4-7450cecfa0d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="daemon_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="hostname_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="syslog_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="wmiquery.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regcomp.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regex.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regex_internal.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regexec.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\getopt\getopt.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\getopt\getopt1.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\atacmds.cpp" />
|
||||
<ClCompile Include="..\ataprint.cpp" />
|
||||
<ClCompile Include="..\cciss.cpp" />
|
||||
<ClCompile Include="..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\dev_legacy.cpp" />
|
||||
<ClCompile Include="..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\os_darwin.cpp" />
|
||||
<ClCompile Include="..\os_freebsd.cpp" />
|
||||
<ClCompile Include="..\os_generic.cpp" />
|
||||
<ClCompile Include="..\os_linux.cpp" />
|
||||
<ClCompile Include="..\os_netbsd.cpp" />
|
||||
<ClCompile Include="..\os_openbsd.cpp" />
|
||||
<ClCompile Include="..\os_os2.cpp" />
|
||||
<ClCompile Include="..\os_qnxnto.cpp" />
|
||||
<ClCompile Include="..\os_solaris.cpp" />
|
||||
<ClCompile Include="..\os_win32.cpp" />
|
||||
<ClCompile Include="..\scsiata.cpp" />
|
||||
<ClCompile Include="..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\scsiprint.cpp" />
|
||||
<ClCompile Include="..\smartctl.cpp" />
|
||||
<ClCompile Include="..\smartd.cpp" />
|
||||
<ClCompile Include="..\utility.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="wbemcli_small.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="wmiquery.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\regex\regex.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\regex\regex_internal.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\getopt\getopt.h">
|
||||
<Filter>getopt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\atacmdnames.h" />
|
||||
<ClInclude Include="..\atacmds.h" />
|
||||
<ClInclude Include="..\ataprint.h" />
|
||||
<ClInclude Include="..\cissio_freebsd.h" />
|
||||
<ClInclude Include="..\csmisas.h" />
|
||||
<ClInclude Include="..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\dev_interface.h" />
|
||||
<ClInclude Include="..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\drivedb.h" />
|
||||
<ClInclude Include="..\int64.h" />
|
||||
<ClInclude Include="..\knowndrives.h" />
|
||||
<ClInclude Include="..\scsicmds.h" />
|
||||
<ClInclude Include="..\scsiprint.h" />
|
||||
<ClInclude Include="..\smartctl.h" />
|
||||
<ClInclude Include="..\utility.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="installer.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="update-smart-drivedb.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\AUTHORS" />
|
||||
<None Include="..\autogen.sh" />
|
||||
<None Include="..\CHANGELOG" />
|
||||
<None Include="..\config.h.in" />
|
||||
<None Include="..\configure.in" />
|
||||
<None Include="..\do_release" />
|
||||
<None Include="..\Doxyfile" />
|
||||
<None Include="..\INSTALL" />
|
||||
<None Include="..\Makefile.am" />
|
||||
<None Include="..\NEWS" />
|
||||
<None Include="..\README" />
|
||||
<None Include="..\smartctl.8.in" />
|
||||
<None Include="..\smartd.8.in" />
|
||||
<None Include="..\smartd.conf.5.in" />
|
||||
<None Include="..\smartd.initd.in" />
|
||||
<None Include="..\TODO" />
|
||||
<None Include="..\update-smart-drivedb.in" />
|
||||
<None Include="..\WARNINGS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="daemon_win32.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="hostname_win32.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="syslog.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\cciss.h" />
|
||||
<CustomBuildStep Include="..\megaraid.h" />
|
||||
<CustomBuildStep Include="..\os_darwin.h" />
|
||||
<CustomBuildStep Include="..\os_freebsd.h" />
|
||||
<CustomBuildStep Include="..\os_generic.h" />
|
||||
<CustomBuildStep Include="..\os_linux.h" />
|
||||
<CustomBuildStep Include="..\os_netbsd.h" />
|
||||
<CustomBuildStep Include="..\os_openbsd.h" />
|
||||
<CustomBuildStep Include="..\os_os2.h" />
|
||||
<CustomBuildStep Include="..\os_qnxnto.h" />
|
||||
<CustomBuildStep Include="..\os_solaris.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="config_vc10.h" />
|
||||
<CustomBuild Include="svnversion_vc10.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
37
os_win32/smartd_res.rc.in
Normal file
37
os_win32/smartd_res.rc.in
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// os_win32/smartd_res.rc.in
|
||||
//
|
||||
// $Id: smartd_res.rc.in 3756 2013-01-26 16:16:35Z chrfranke $
|
||||
//
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION @BINARY_VERSION@
|
||||
PRODUCTVERSION @BINARY_VERSION@
|
||||
FILEFLAGSMASK 0x0
|
||||
FILEFLAGS 0x0
|
||||
FILEOS 0x4 // VOS__WINDOWS32
|
||||
FILETYPE 0x1 // VFT_APP
|
||||
FILESUBTYPE 0x0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "04090000"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "www.smartmontools.org"
|
||||
VALUE "FileDescription", "SMART Disk Monitoring Daemon"
|
||||
VALUE "FileVersion", "@TEXT_VERSION@"
|
||||
VALUE "InternalName", "smartd"
|
||||
VALUE "LegalCopyright", "(C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org"
|
||||
VALUE "OriginalFilename", "smartd.exe"
|
||||
VALUE "ProductName", "smartmontools"
|
||||
VALUE "ProductVersion", "@TEXT_VERSION@"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x0000
|
||||
END
|
||||
END
|
||||
|
||||
// eventlog MESSAGETABLE for syslog() emulation
|
||||
#include "syslogevt.rc"
|
@ -1,154 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="os_win32">
|
||||
<UniqueIdentifier>{44bb110e-4d44-4d5e-8186-354210a8d3ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="regex">
|
||||
<UniqueIdentifier>{fd3bb1d5-a72e-4f92-84a3-6eac97975ec7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="getopt">
|
||||
<UniqueIdentifier>{1d1b67d5-219f-4e86-a5ff-9d94f1f751f9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="daemon_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="hostname_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="syslog_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="wmiquery.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regcomp.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regex.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regex_internal.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regexec.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\getopt\getopt.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\getopt\getopt1.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\atacmds.cpp" />
|
||||
<ClCompile Include="..\ataprint.cpp" />
|
||||
<ClCompile Include="..\cciss.cpp" />
|
||||
<ClCompile Include="..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\dev_legacy.cpp" />
|
||||
<ClCompile Include="..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\os_darwin.cpp" />
|
||||
<ClCompile Include="..\os_freebsd.cpp" />
|
||||
<ClCompile Include="..\os_generic.cpp" />
|
||||
<ClCompile Include="..\os_linux.cpp" />
|
||||
<ClCompile Include="..\os_netbsd.cpp" />
|
||||
<ClCompile Include="..\os_openbsd.cpp" />
|
||||
<ClCompile Include="..\os_os2.cpp" />
|
||||
<ClCompile Include="..\os_qnxnto.cpp" />
|
||||
<ClCompile Include="..\os_solaris.cpp" />
|
||||
<ClCompile Include="..\os_win32.cpp" />
|
||||
<ClCompile Include="..\scsiata.cpp" />
|
||||
<ClCompile Include="..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\scsiprint.cpp" />
|
||||
<ClCompile Include="..\smartctl.cpp" />
|
||||
<ClCompile Include="..\smartd.cpp" />
|
||||
<ClCompile Include="..\utility.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="daemon_win32.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="hostname_win32.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="syslog.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="wbemcli_small.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="wmiquery.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\regex\regex.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\regex\regex_internal.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\getopt\getopt.h">
|
||||
<Filter>getopt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\atacmdnames.h" />
|
||||
<ClInclude Include="..\atacmds.h" />
|
||||
<ClInclude Include="..\cissio_freebsd.h" />
|
||||
<ClInclude Include="..\csmisas.h" />
|
||||
<ClInclude Include="..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\dev_interface.h" />
|
||||
<ClInclude Include="..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\drivedb.h" />
|
||||
<ClInclude Include="..\int64.h" />
|
||||
<ClInclude Include="..\knowndrives.h" />
|
||||
<ClInclude Include="..\scsicmds.h" />
|
||||
<ClInclude Include="..\utility.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="installer.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="update-smart-drivedb.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\AUTHORS" />
|
||||
<None Include="..\autogen.sh" />
|
||||
<None Include="..\CHANGELOG" />
|
||||
<None Include="..\config.h.in" />
|
||||
<None Include="..\configure.in" />
|
||||
<None Include="..\do_release" />
|
||||
<None Include="..\Doxyfile" />
|
||||
<None Include="..\INSTALL" />
|
||||
<None Include="..\Makefile.am" />
|
||||
<None Include="..\NEWS" />
|
||||
<None Include="..\README" />
|
||||
<None Include="..\smartctl.8.in" />
|
||||
<None Include="..\smartd.8.in" />
|
||||
<None Include="..\smartd.conf.5.in" />
|
||||
<None Include="..\smartd.initd.in" />
|
||||
<None Include="..\TODO" />
|
||||
<None Include="..\update-smart-drivedb.in" />
|
||||
<None Include="..\WARNINGS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="..\ataprint.h" />
|
||||
<CustomBuildStep Include="..\cciss.h" />
|
||||
<CustomBuildStep Include="..\megaraid.h" />
|
||||
<CustomBuildStep Include="..\os_darwin.h" />
|
||||
<CustomBuildStep Include="..\os_freebsd.h" />
|
||||
<CustomBuildStep Include="..\os_generic.h" />
|
||||
<CustomBuildStep Include="..\os_linux.h" />
|
||||
<CustomBuildStep Include="..\os_netbsd.h" />
|
||||
<CustomBuildStep Include="..\os_openbsd.h" />
|
||||
<CustomBuildStep Include="..\os_os2.h" />
|
||||
<CustomBuildStep Include="..\os_qnxnto.h" />
|
||||
<CustomBuildStep Include="..\os_solaris.h" />
|
||||
<CustomBuildStep Include="..\scsiprint.h" />
|
||||
<CustomBuildStep Include="..\smartctl.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="config_vc10.h" />
|
||||
<CustomBuild Include="svnversion_vc10.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
159
os_win32/smartd_warning.cmd
Normal file
159
os_win32/smartd_warning.cmd
Normal file
@ -0,0 +1,159 @@
|
||||
@echo off
|
||||
::
|
||||
:: smartd warning script
|
||||
::
|
||||
:: Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
::
|
||||
:: This program is free software; you can redistribute it and/or modify
|
||||
:: it under the terms of the GNU General Public License as published by
|
||||
:: the Free Software Foundation; either version 2, or (at your option)
|
||||
:: any later version.
|
||||
::
|
||||
:: You should have received a copy of the GNU General Public License
|
||||
:: (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
::
|
||||
:: $Id: smartd_warning.cmd 3810 2013-04-18 20:08:39Z chrfranke $
|
||||
::
|
||||
|
||||
set err=
|
||||
|
||||
:: Parse options
|
||||
set dryrun=
|
||||
if "%1" == "--dryrun" (
|
||||
set dryrun=t
|
||||
shift
|
||||
)
|
||||
|
||||
if not "%1" == "" (
|
||||
echo smartd warning message script
|
||||
echo.
|
||||
echo Usage:
|
||||
echo set SMARTD_MAILER='Path to external script, empty for "blat"'
|
||||
echo set SMARTD_ADDRESS='Space separated mail adresses, empty if none'
|
||||
echo set SMARTD_MESSAGE='Error Message'
|
||||
echo set SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'
|
||||
echo set SMARTD_TFIRST='Date of first message sent, empty if none'
|
||||
echo :: set SMARTD_TFIRSTEPOCH='time_t format of above'
|
||||
echo set SMARTD_PREVCNT='Number of previous messages, 0 if none'
|
||||
echo set SMARTD_NEXTDAYS='Number of days until next message, empty if none'
|
||||
echo set SMARTD_DEVICEINFO='Device identify information'
|
||||
echo :: set SMARTD_DEVICE='Device name'
|
||||
echo :: set SMARTD_DEVICESTRING='Annotated device name'
|
||||
echo :: set SMARTD_DEVICETYPE='Device type from -d directive, "auto" if none'
|
||||
|
||||
echo smartd_warning.cmd [--dryrun]
|
||||
goto EOF
|
||||
)
|
||||
|
||||
if "%SMARTD_ADDRESS%%SMARTD_MAILER%" == "" (
|
||||
echo smartd_warning.cmd: SMARTD_ADDRESS or SMARTD_MAILER must be set
|
||||
goto EOF
|
||||
)
|
||||
|
||||
:: USERDNSDOMAIN may be unset if running as service
|
||||
if "%USERDNSDOMAIN%" == "" (
|
||||
for /f "delims== tokens=2 usebackq" %%d in (`WMIC PATH Win32_Computersystem WHERE "PartOfDomain=TRUE" GET Domain /VALUE 2^>nul ^| find "Domain=" 2^>nul`) do set USERDNSDOMAIN=%%~d
|
||||
)
|
||||
|
||||
:: Format subject
|
||||
set SMARTD_SUBJECT=SMART error (%SMARTD_FAILTYPE%) detected on host: %COMPUTERNAME%
|
||||
|
||||
:: Temp file for message
|
||||
if not "%TMP%" == "" set SMARTD_FULLMSGFILE=%TMP%\smartd_warning-%DATE%-%RANDOM%.txt
|
||||
if "%TMP%" == "" set SMARTD_FULLMSGFILE=smartd_warning-%DATE%-%RANDOM%.txt
|
||||
|
||||
:: Format message
|
||||
(
|
||||
echo This message was generated by the smartd service running on:
|
||||
echo.
|
||||
echo. host name: %COMPUTERNAME%
|
||||
if not "%USERDNSDOMAIN%" == "" echo. DNS domain: %USERDNSDOMAIN%
|
||||
if "%USERDNSDOMAIN%" == "" echo. DNS domain: [Empty]
|
||||
if not "%USERDOMAIN%" == "" echo. Win domain: %USERDOMAIN%
|
||||
echo.
|
||||
echo The following warning/error was logged by the smartd service:
|
||||
echo.
|
||||
:: SMARTD_MESSAGE and SMARTD_DEVICEINFO may contain parentheses
|
||||
for %%m in ("%SMARTD_MESSAGE%") do echo.%%~m
|
||||
echo.
|
||||
echo Device info:
|
||||
for %%m in ("%SMARTD_DEVICEINFO%") do echo.%%~m
|
||||
set m=
|
||||
echo.
|
||||
echo For details see the event log or log file of smartd.
|
||||
if not "%SMARTD_FAILTYPE%" == "EmailTest" (
|
||||
echo.
|
||||
echo You can also use the smartctl utility for further investigation.
|
||||
if not "%SMARTD_PREVCNT%" == "0" echo The original message about this issue was sent at %SMARTD_TFIRST%
|
||||
if "%SMARTD_NEXTDAYS%" == "" (
|
||||
echo No additional messages about this problem will be sent.
|
||||
) else ( if "%SMARTD_NEXTDAYS%" == "1" (
|
||||
echo Another message will be sent in 24 hours if the problem persists.
|
||||
) else (
|
||||
echo Another message will be sent in %SMARTD_NEXTDAYS% days if the problem persists.
|
||||
))
|
||||
)
|
||||
) > "%SMARTD_FULLMSGFILE%"
|
||||
|
||||
if not "%dryrun%" == "" (
|
||||
echo %SMARTD_FULLMSGFILE%:
|
||||
type "%SMARTD_FULLMSGFILE%"
|
||||
echo --EOF--
|
||||
)
|
||||
|
||||
:: Check first address
|
||||
set first=
|
||||
for /F "tokens=1*" %%a in ("%SMARTD_ADDRESS%") do (set first=%%a)
|
||||
set wtssend=
|
||||
if "%first%" == "console" set wtssend=-c
|
||||
if "%first%" == "active" set wtssend=-a
|
||||
if "%first%" == "connected" set wtssend=-s
|
||||
set first=
|
||||
|
||||
if not "%wtssend%" == "" (
|
||||
:: Show Message box(es) via WTSSendMessage()
|
||||
if not "%dryrun%" == "" (
|
||||
echo call wtssendmsg %wtssend% "%SMARTD_SUBJECT%" - ^< "%SMARTD_FULLMSGFILE%"
|
||||
) else (
|
||||
call wtssendmsg %wtssend% "%SMARTD_SUBJECT%" - < "%SMARTD_FULLMSGFILE%"
|
||||
if errorlevel 1 set err=t
|
||||
)
|
||||
:: Remove first address
|
||||
for /F "tokens=1*" %%a in ("%SMARTD_ADDRESS%") do (set SMARTD_ADDRESS=%%b)
|
||||
)
|
||||
set wtssend=
|
||||
|
||||
:: Make comma separated address list
|
||||
set SMARTD_ADDRCSV=
|
||||
if not "%SMARTD_ADDRESS%" == "" set SMARTD_ADDRCSV=%SMARTD_ADDRESS: =,%
|
||||
|
||||
:: Use blat mailer by default
|
||||
if not "%SMARTD_ADDRESS%" == "" if "%SMARTD_MAILER%" == "" set SMARTD_MAILER=blat
|
||||
|
||||
:: Send mail or run command
|
||||
if not "%SMARTD_ADDRCSV%" == "" (
|
||||
|
||||
:: Send mail
|
||||
if not "%dryrun%" == "" (
|
||||
echo call "%SMARTD_MAILER%" - -q -subject "%SMARTD_SUBJECT%" -to "%SMARTD_ADDRCSV%" ^< "%SMARTD_FULLMSGFILE%"
|
||||
) else (
|
||||
call "%SMARTD_MAILER%" - -q -subject "%SMARTD_SUBJECT%" -to "%SMARTD_ADDRCSV%" < "%SMARTD_FULLMSGFILE%"
|
||||
if errorlevel 1 set err=t
|
||||
)
|
||||
|
||||
) else ( if not "%SMARTD_MAILER%" == "" (
|
||||
|
||||
:: Run command
|
||||
if not "%dryrun%" == "" (
|
||||
echo call "%SMARTD_MAILER%" ^<nul
|
||||
) else (
|
||||
call "%SMARTD_MAILER%" <nul
|
||||
if errorlevel 1 set err=t
|
||||
)
|
||||
|
||||
))
|
||||
|
||||
del "%SMARTD_FULLMSGFILE%" >nul 2>nul
|
||||
|
||||
:EOF
|
||||
if not "%err%" == "" goto ERROR 2>nul
|
@ -11,15 +11,15 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SYSLOG_H
|
||||
#define SYSLOG_H
|
||||
|
||||
#define SYSLOG_H_CVSID "$Id: syslog.h,v 1.6 2008/03/04 22:09:48 ballen4705 Exp $\n"
|
||||
#define SYSLOG_H_CVSID "$Id: syslog.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2004-8 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2004-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -11,15 +11,13 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
// Win32 Emulation of syslog() for smartd
|
||||
// Writes to windows event log on NT4/2000/XP
|
||||
// (Register syslogevt.exe as event message file)
|
||||
// Writes to file "<ident>.log" on 9x/ME.
|
||||
// If facility is set to LOG_LOCAL[0-7], log is written to
|
||||
// file "<ident>.log", stdout, stderr, "<ident>[1-5].log".
|
||||
|
||||
@ -35,8 +33,8 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h> // RegisterEventSourceA(), ReportEventA(), ...
|
||||
|
||||
const char *syslog_win32_c_cvsid = "$Id: syslog_win32.cpp,v 1.8 2008/03/04 22:09:48 ballen4705 Exp $"
|
||||
SYSLOG_H_CVSID;
|
||||
const char *syslog_win32_cpp_cvsid = "$Id: syslog_win32.cpp 3575 2012-07-19 21:32:56Z chrfranke $"
|
||||
SYSLOG_H_CVSID;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// MSVC
|
||||
@ -350,12 +348,8 @@ void openlog(const char *ident, int logopt, int facility)
|
||||
// Cannot open => Use logfile
|
||||
long err = GetLastError();
|
||||
strcat(strcpy(sl_logpath, sl_ident), ".log");
|
||||
if (GetVersion() & 0x80000000)
|
||||
fprintf(stderr, "%s: No event log on Win9x/ME, writing to %s\n",
|
||||
sl_ident, sl_logpath);
|
||||
else
|
||||
fprintf(stderr, "%s: Cannot register event source (Error=%ld), writing to %s\n",
|
||||
sl_ident, err, sl_logpath);
|
||||
fprintf(stderr, "%s: Cannot register event source (Error=%ld), writing to %s\n",
|
||||
sl_ident, err, sl_logpath);
|
||||
}
|
||||
else {
|
||||
// Start event log thread
|
||||
|
@ -1,152 +0,0 @@
|
||||
/*
|
||||
* os_win32/syslogevt.c
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2004-10 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
static char rcsid[] = "$Id: syslogevt.c 3257 2011-02-14 22:19:42Z manfred99 $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <process.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#include "syslogevt.h"
|
||||
// Compile time check for Message Ids, see also syslog_win32.cpp
|
||||
typedef assert_msg_syslog [MSG_SYSLOG == 0 ? 1 : -1];
|
||||
typedef assert_msg_syslog_01[MSG_SYSLOG_01 == 1 ? 1 : -1];
|
||||
typedef assert_msg_syslog_10[MSG_SYSLOG_10 == 10 ? 1 : -1];
|
||||
|
||||
|
||||
static int usage()
|
||||
{
|
||||
puts(
|
||||
"syslogevt $Revision: 3257 $ Copyright (C) 2004-10 Christian Franke\n"
|
||||
"Home page is http://smartmontools.sourceforge.net/\n"
|
||||
"\n"
|
||||
"Usage: syslogevt [-ru] name [ident ...]\n"
|
||||
"\n"
|
||||
"Creates registry files \"name-r.reg\" and \"name-u.reg\" to (un)register\n"
|
||||
"this program as an event message file for message source(s) \"ident\".\n"
|
||||
"If \"ident\" is ommited, \"name\" is used. Options:\n"
|
||||
"\n"
|
||||
" -r run \"regedit name-r.reg\" after creating files\n"
|
||||
" -u run \"regedit name-u.reg\" after creating files\n"
|
||||
"\n"
|
||||
"Examples:\n"
|
||||
"\n"
|
||||
"syslogevt smartd (Create smartd-r.reg and smartd-u.reg)\n"
|
||||
"regedit smartd-r.reg (Register syslogevt.exe for smartd messages)\n"
|
||||
"\n"
|
||||
"syslogevt -r smartd (Same as above in one step)\n"
|
||||
"\n"
|
||||
"regedit smartd-u.reg (Undo the registration)\n"
|
||||
"\n"
|
||||
"CAUTION: A registry entry of an existing event source with the same \"ident\"\n"
|
||||
" will be overwritten by regedit without notice."
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
int regedit, a1, ai;
|
||||
char name1[30+1], name2[30+1], mypath[MAX_PATH+1];
|
||||
const char * ident;
|
||||
FILE * f1, * f2;
|
||||
|
||||
if (argc < 2)
|
||||
return usage();
|
||||
|
||||
a1 = 1;
|
||||
regedit = 0;
|
||||
if (!strcmp(argv[a1], "-r")) {
|
||||
regedit = 1; a1++;
|
||||
}
|
||||
else if (!strcmp(argv[a1], "-u")) {
|
||||
regedit = -1; a1++;
|
||||
}
|
||||
|
||||
for (ai = a1; ai < argc; ai++) {
|
||||
ident = argv[ai];
|
||||
if (!(ident[0] && strlen(ident) < sizeof(name1)-10
|
||||
&& strcspn(ident, "-.:/\\") == strlen(ident) )) {
|
||||
return usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (!GetModuleFileName(NULL, mypath, sizeof(mypath)-1)) {
|
||||
fputs("GetModuleFileName failed\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ident = argv[a1];
|
||||
strcpy(name1, ident); strcat(name1, "-r.reg");
|
||||
strcpy(name2, ident); strcat(name2, "-u.reg");
|
||||
|
||||
if (!(f1 = fopen(name1, "w"))) {
|
||||
perror(name1); return 1;
|
||||
}
|
||||
if (!(f2 = fopen(name2, "w"))) {
|
||||
perror(name2); fclose(f1); unlink(name1); return 1;
|
||||
}
|
||||
|
||||
fputs("REGEDIT4\n\n", f1);
|
||||
fputs("REGEDIT4\n\n", f2);
|
||||
|
||||
for (ai = (argc > a1+1 ? a1+1 : a1); ai < argc; ai++) {
|
||||
int i;
|
||||
ident = argv[ai];
|
||||
fputs("[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\", f1);
|
||||
fputs(ident, f1); fputs("]\n\"EventMessageFile\"=\"", f1);
|
||||
for (i = 0; mypath[i]; i++) {
|
||||
if (mypath[i] == '\\')
|
||||
fputc('\\', f1);
|
||||
fputc(mypath[i], f1);
|
||||
}
|
||||
fputs("\"\n\"TypesSupported\"=dword:00000007\n\n", f1);
|
||||
|
||||
fputs("[-HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\", f2);
|
||||
fputs(ident, f2); fputs("]\n\n", f2);
|
||||
}
|
||||
|
||||
fclose(f1);
|
||||
fclose(f2);
|
||||
|
||||
if (GetVersion() & 0x80000000) {
|
||||
puts("Warning: Event log not supported on Win9x/ME\n");
|
||||
if (regedit)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (regedit) {
|
||||
if (spawnlp(P_WAIT, "regedit", "regedit", (regedit > 0 ? name1 : name2), (const char *)0) == -1) {
|
||||
fputs("regedit: cannot execute\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fputs("Files generated. Use\n\n regedit ", stdout);
|
||||
puts(name1);
|
||||
fputs("\nto register event message file, and\n\n regedit ", stdout);
|
||||
puts(name2);
|
||||
fputs("\nto remove registration later.\n\n"
|
||||
"Do not remove this program when registered.\n", stdout);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -11,12 +11,12 @@
|
||||
; * any later version.
|
||||
; *
|
||||
; * You should have received a copy of the GNU General Public License
|
||||
; * (for example COPYING); if not, write to the Free
|
||||
; * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
; * (for example COPYING); if not, write to the Free Software Foundation,
|
||||
; * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
; *
|
||||
; */
|
||||
;
|
||||
;// $Id: syslogevt.mc 3166 2010-09-24 19:43:31Z chrfranke $
|
||||
;// $Id: syslogevt.mc 3727 2012-12-13 17:23:06Z samm2 $
|
||||
;
|
||||
;// Use message compiler "mc" or "windmc" to generate
|
||||
;// syslogevt.rc, syslogevt.h, msg00001.bin
|
||||
|
@ -1,103 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FAB7557B-86EA-405D-B49D-33AB3F4D3E33}</ProjectGuid>
|
||||
<RootNamespace>syslogevt</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectName>syslogevt</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">syslogevt_vc10.d\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">syslogevt_vc10.d\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">syslogevt_vc10.r\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>syslogevt.exe</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="syslogevt.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="syslogevt.mc">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -r $(IntDir) syslogevt.mc</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -r $(IntDir) syslogevt.mc
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)syslogevt.rc;$(IntDir)msg00001.bin;syslogevt.h;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -r $(IntDir) syslogevt.mc</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -r $(IntDir) syslogevt.mc
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)syslogevt.rc;$(IntDir)msg00001.bin;syslogevt.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -40,14 +40,12 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>.\runcmdu_vc10.d\</OutDir>
|
||||
<IntDir>.\runcmdu_vc10.d\</IntDir>
|
||||
<IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
<TargetName>$(ProjectName)u</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>.\runcmdu_vc10.r\</OutDir>
|
||||
<IntDir>.\runcmdu_vc10.r\</IntDir>
|
||||
<IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
<TargetName>$(ProjectName)u</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
@ -77,7 +75,7 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="runcmd.c" />
|
||||
<ClCompile Include="..\runcmd.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
@ -11,10 +11,10 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}</ProjectGuid>
|
||||
<RootNamespace>smartd</RootNamespace>
|
||||
<ProjectGuid>{3AFEDCDD-D289-4543-A91D-EFBA6C710247}</ProjectGuid>
|
||||
<RootNamespace>smartctl</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectName>smartd</ProjectName>
|
||||
<ProjectName>smartctl</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
@ -38,17 +38,15 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\smartd_vc10.d\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\smartd_vc10.d\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\smartd_vc10.r\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;..\getopt;..\regex;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@ -67,7 +65,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\getopt;..\regex;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
@ -78,7 +76,6 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@ -86,214 +83,207 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="daemon_win32.cpp" />
|
||||
<ClCompile Include="hostname_win32.cpp" />
|
||||
<ClCompile Include="syslog_win32.cpp" />
|
||||
<ClCompile Include="wmiquery.cpp" />
|
||||
<ClCompile Include="..\regex\regcomp.c">
|
||||
<ClCompile Include="..\..\ataidentify.cpp" />
|
||||
<ClCompile Include="..\..\dev_areca.cpp" />
|
||||
<ClCompile Include="..\daemon_win32.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regex.c" />
|
||||
<ClCompile Include="..\regex\regex_internal.c">
|
||||
<ClCompile Include="..\syslog_win32.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regexec.c">
|
||||
<ClCompile Include="..\wmiquery.cpp" />
|
||||
<ClCompile Include="..\..\regex\regcomp.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\getopt\getopt.c" />
|
||||
<ClCompile Include="..\getopt\getopt1.c" />
|
||||
<ClCompile Include="..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\atacmds.cpp" />
|
||||
<ClCompile Include="..\ataprint.cpp">
|
||||
<ClCompile Include="..\..\regex\regex.c" />
|
||||
<ClCompile Include="..\..\regex\regex_internal.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cciss.cpp">
|
||||
<ClCompile Include="..\..\regex\regexec.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\dev_legacy.cpp">
|
||||
<ClCompile Include="..\..\getopt\getopt.c" />
|
||||
<ClCompile Include="..\..\getopt\getopt1.c" />
|
||||
<ClCompile Include="..\..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\..\atacmds.cpp" />
|
||||
<ClCompile Include="..\..\ataprint.cpp" />
|
||||
<ClCompile Include="..\..\cciss.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\os_darwin.cpp">
|
||||
<ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\..\dev_legacy.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_freebsd.cpp">
|
||||
<ClCompile Include="..\..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\..\os_darwin.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_generic.cpp">
|
||||
<ClCompile Include="..\..\os_freebsd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_linux.cpp">
|
||||
<ClCompile Include="..\..\os_generic.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_netbsd.cpp">
|
||||
<ClCompile Include="..\..\os_linux.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_openbsd.cpp">
|
||||
<ClCompile Include="..\..\os_netbsd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_os2.cpp">
|
||||
<ClCompile Include="..\..\os_openbsd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_qnxnto.cpp">
|
||||
<ClCompile Include="..\..\os_os2.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_solaris.cpp">
|
||||
<ClCompile Include="..\..\os_qnxnto.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_win32.cpp" />
|
||||
<ClCompile Include="..\scsiata.cpp" />
|
||||
<ClCompile Include="..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\scsiprint.cpp">
|
||||
<ClCompile Include="..\..\os_solaris.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\smartctl.cpp">
|
||||
<ClCompile Include="..\..\os_win32.cpp" />
|
||||
<ClCompile Include="..\..\scsiata.cpp" />
|
||||
<ClCompile Include="..\..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\..\scsiprint.cpp" />
|
||||
<ClCompile Include="..\..\smartctl.cpp" />
|
||||
<ClCompile Include="..\..\smartd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\smartd.cpp" />
|
||||
<ClCompile Include="..\utility.cpp" />
|
||||
<ClCompile Include="..\..\utility.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="daemon_win32.h" />
|
||||
<ClInclude Include="hostname_win32.h" />
|
||||
<ClInclude Include="syslog.h" />
|
||||
<ClInclude Include="wbemcli_small.h" />
|
||||
<ClInclude Include="wmiquery.h" />
|
||||
<ClInclude Include="..\regex\regex.h" />
|
||||
<ClInclude Include="..\regex\regex_internal.h" />
|
||||
<ClInclude Include="..\getopt\getopt.h" />
|
||||
<ClInclude Include="..\atacmdnames.h" />
|
||||
<ClInclude Include="..\atacmds.h" />
|
||||
<CustomBuildStep Include="..\ataprint.h">
|
||||
<ClInclude Include="..\..\ataidentify.h" />
|
||||
<ClInclude Include="..\..\dev_areca.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="svnversion.h" />
|
||||
<CustomBuildStep Include="..\daemon_win32.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\cciss.h">
|
||||
<CustomBuildStep Include="..\syslog.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\cissio_freebsd.h">
|
||||
<ClInclude Include="..\wbemcli_small.h" />
|
||||
<ClInclude Include="..\wmiquery.h" />
|
||||
<ClInclude Include="..\..\regex\regex.h" />
|
||||
<ClInclude Include="..\..\regex\regex_internal.h" />
|
||||
<ClInclude Include="..\..\getopt\getopt.h" />
|
||||
<ClInclude Include="..\..\atacmdnames.h" />
|
||||
<ClInclude Include="..\..\atacmds.h" />
|
||||
<ClInclude Include="..\..\ataprint.h" />
|
||||
<CustomBuildStep Include="..\..\cciss.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\..\cissio_freebsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<CustomBuild Include="config_vc10.h">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copy %(FullPath) $(IntDir)config.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy %(FullPath) $(IntDir)config.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)config.h;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Copy %(FullPath) $(IntDir)config.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy %(FullPath) $(IntDir)config.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)config.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="..\csmisas.h" />
|
||||
<ClInclude Include="..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\dev_interface.h" />
|
||||
<ClInclude Include="..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\drivedb.h" />
|
||||
<ClInclude Include="..\int64.h" />
|
||||
<ClInclude Include="..\knowndrives.h" />
|
||||
<CustomBuildStep Include="..\megaraid.h">
|
||||
<ClInclude Include="..\..\csmisas.h" />
|
||||
<ClInclude Include="..\..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\..\dev_interface.h" />
|
||||
<ClInclude Include="..\..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\..\drivedb.h" />
|
||||
<ClInclude Include="..\..\int64.h" />
|
||||
<ClInclude Include="..\..\knowndrives.h" />
|
||||
<CustomBuildStep Include="..\..\megaraid.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_darwin.h">
|
||||
<CustomBuildStep Include="..\..\os_darwin.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_freebsd.h">
|
||||
<CustomBuildStep Include="..\..\os_freebsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_generic.h">
|
||||
<CustomBuildStep Include="..\..\os_generic.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_linux.h">
|
||||
<CustomBuildStep Include="..\..\os_linux.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_netbsd.h">
|
||||
<CustomBuildStep Include="..\..\os_netbsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_openbsd.h">
|
||||
<CustomBuildStep Include="..\..\os_openbsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_os2.h">
|
||||
<CustomBuildStep Include="..\..\os_os2.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_qnxnto.h">
|
||||
<CustomBuildStep Include="..\..\os_qnxnto.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_solaris.h">
|
||||
<CustomBuildStep Include="..\..\os_solaris.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\scsicmds.h" />
|
||||
<CustomBuildStep Include="..\scsiprint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\smartctl.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuild Include="svnversion_vc10.h">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copy %(FullPath) $(IntDir)svnversion.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy %(FullPath) $(IntDir)svnversion.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)svnversion.h;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Copy %(FullPath) $(IntDir)svnversion.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy %(FullPath) $(IntDir)svnversion.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)svnversion.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="..\utility.h" />
|
||||
<ClInclude Include="..\..\scsicmds.h" />
|
||||
<ClInclude Include="..\..\scsiprint.h" />
|
||||
<ClInclude Include="..\..\smartctl.h" />
|
||||
<ClInclude Include="..\..\utility.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="installer.nsi" />
|
||||
<None Include="update-smart-drivedb.nsi" />
|
||||
<None Include="..\AUTHORS" />
|
||||
<None Include="..\autogen.sh" />
|
||||
<None Include="..\CHANGELOG" />
|
||||
<None Include="..\config.h.in" />
|
||||
<None Include="..\configure.in" />
|
||||
<None Include="..\do_release" />
|
||||
<None Include="..\Doxyfile" />
|
||||
<None Include="..\INSTALL" />
|
||||
<None Include="..\Makefile.am" />
|
||||
<None Include="..\NEWS" />
|
||||
<None Include="..\README" />
|
||||
<None Include="..\smartctl.8.in" />
|
||||
<None Include="..\smartd.8.in" />
|
||||
<None Include="..\smartd.conf.5.in" />
|
||||
<None Include="..\smartd.initd.in" />
|
||||
<None Include="..\TODO" />
|
||||
<None Include="..\update-smart-drivedb.in" />
|
||||
<None Include="..\WARNINGS" />
|
||||
<None Include="..\..\smartd_warning.sh.in" />
|
||||
<None Include="..\installer.nsi" />
|
||||
<None Include="..\smartctl_res.rc.in" />
|
||||
<None Include="..\smartd_res.rc.in" />
|
||||
<None Include="..\smartd_warning.cmd" />
|
||||
<None Include="..\syslogevt.mc" />
|
||||
<None Include="..\update-smart-drivedb.nsi" />
|
||||
<None Include="..\..\AUTHORS" />
|
||||
<None Include="..\..\autogen.sh" />
|
||||
<None Include="..\..\ChangeLog" />
|
||||
<None Include="..\..\config.h.in" />
|
||||
<None Include="..\..\configure.ac" />
|
||||
<None Include="..\..\do_release" />
|
||||
<None Include="..\..\Doxyfile" />
|
||||
<None Include="..\..\INSTALL" />
|
||||
<None Include="..\..\Makefile.am" />
|
||||
<None Include="..\..\NEWS" />
|
||||
<None Include="..\..\README" />
|
||||
<None Include="..\..\smartctl.8.in" />
|
||||
<None Include="..\..\smartd.8.in" />
|
||||
<None Include="..\..\smartd.conf.5.in" />
|
||||
<None Include="..\..\smartd.initd.in" />
|
||||
<None Include="..\..\TODO" />
|
||||
<None Include="..\..\update-smart-drivedb.in" />
|
||||
<None Include="..\..\WARNINGS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="smartctl_res.rc" />
|
||||
<ResourceCompile Include="smartd_res.rc">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
171
os_win32/vc10/smartctl.vcxproj.filters
Normal file
171
os_win32/vc10/smartctl.vcxproj.filters
Normal file
@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="os_win32">
|
||||
<UniqueIdentifier>{9321e988-dd03-496d-9933-7c8b235a46bf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="regex">
|
||||
<UniqueIdentifier>{bfbfd4ea-fae3-45ec-9cfb-c5424218c47c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="getopt">
|
||||
<UniqueIdentifier>{8ff0bf5f-c96e-45c3-bcb4-7450cecfa0d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\daemon_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\syslog_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\wmiquery.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regcomp.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regex.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regex_internal.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regexec.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\getopt\getopt.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\getopt\getopt1.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\..\atacmds.cpp" />
|
||||
<ClCompile Include="..\..\ataprint.cpp" />
|
||||
<ClCompile Include="..\..\cciss.cpp" />
|
||||
<ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\..\dev_legacy.cpp" />
|
||||
<ClCompile Include="..\..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\..\os_darwin.cpp" />
|
||||
<ClCompile Include="..\..\os_freebsd.cpp" />
|
||||
<ClCompile Include="..\..\os_generic.cpp" />
|
||||
<ClCompile Include="..\..\os_linux.cpp" />
|
||||
<ClCompile Include="..\..\os_netbsd.cpp" />
|
||||
<ClCompile Include="..\..\os_openbsd.cpp" />
|
||||
<ClCompile Include="..\..\os_os2.cpp" />
|
||||
<ClCompile Include="..\..\os_qnxnto.cpp" />
|
||||
<ClCompile Include="..\..\os_solaris.cpp" />
|
||||
<ClCompile Include="..\..\os_win32.cpp" />
|
||||
<ClCompile Include="..\..\scsiata.cpp" />
|
||||
<ClCompile Include="..\..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\..\scsiprint.cpp" />
|
||||
<ClCompile Include="..\..\smartctl.cpp" />
|
||||
<ClCompile Include="..\..\smartd.cpp" />
|
||||
<ClCompile Include="..\..\utility.cpp" />
|
||||
<ClCompile Include="..\..\ataidentify.cpp" />
|
||||
<ClCompile Include="..\..\dev_areca.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\wbemcli_small.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\wmiquery.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\regex\regex.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\regex\regex_internal.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\getopt\getopt.h">
|
||||
<Filter>getopt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\atacmdnames.h" />
|
||||
<ClInclude Include="..\..\atacmds.h" />
|
||||
<ClInclude Include="..\..\ataprint.h" />
|
||||
<ClInclude Include="..\..\cissio_freebsd.h" />
|
||||
<ClInclude Include="..\..\csmisas.h" />
|
||||
<ClInclude Include="..\..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\..\dev_interface.h" />
|
||||
<ClInclude Include="..\..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\..\drivedb.h" />
|
||||
<ClInclude Include="..\..\int64.h" />
|
||||
<ClInclude Include="..\..\knowndrives.h" />
|
||||
<ClInclude Include="..\..\scsicmds.h" />
|
||||
<ClInclude Include="..\..\scsiprint.h" />
|
||||
<ClInclude Include="..\..\smartctl.h" />
|
||||
<ClInclude Include="..\..\utility.h" />
|
||||
<ClInclude Include="..\..\ataidentify.h" />
|
||||
<ClInclude Include="..\..\dev_areca.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="svnversion.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\installer.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\update-smart-drivedb.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\..\AUTHORS" />
|
||||
<None Include="..\..\autogen.sh" />
|
||||
<None Include="..\..\ChangeLog" />
|
||||
<None Include="..\..\config.h.in" />
|
||||
<None Include="..\..\configure.ac" />
|
||||
<None Include="..\..\do_release" />
|
||||
<None Include="..\..\Doxyfile" />
|
||||
<None Include="..\..\INSTALL" />
|
||||
<None Include="..\..\Makefile.am" />
|
||||
<None Include="..\..\NEWS" />
|
||||
<None Include="..\..\README" />
|
||||
<None Include="..\..\smartctl.8.in" />
|
||||
<None Include="..\..\smartd.8.in" />
|
||||
<None Include="..\..\smartd.conf.5.in" />
|
||||
<None Include="..\..\smartd.initd.in" />
|
||||
<None Include="..\..\TODO" />
|
||||
<None Include="..\..\update-smart-drivedb.in" />
|
||||
<None Include="..\..\WARNINGS" />
|
||||
<None Include="..\smartd_warning.cmd">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\..\smartd_warning.sh.in" />
|
||||
<None Include="..\smartctl_res.rc.in">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\smartd_res.rc.in">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\syslogevt.mc">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="..\daemon_win32.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\syslog.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\cciss.h" />
|
||||
<CustomBuildStep Include="..\..\megaraid.h" />
|
||||
<CustomBuildStep Include="..\..\os_darwin.h" />
|
||||
<CustomBuildStep Include="..\..\os_freebsd.h" />
|
||||
<CustomBuildStep Include="..\..\os_generic.h" />
|
||||
<CustomBuildStep Include="..\..\os_linux.h" />
|
||||
<CustomBuildStep Include="..\..\os_netbsd.h" />
|
||||
<CustomBuildStep Include="..\..\os_openbsd.h" />
|
||||
<CustomBuildStep Include="..\..\os_os2.h" />
|
||||
<CustomBuildStep Include="..\..\os_qnxnto.h" />
|
||||
<CustomBuildStep Include="..\..\os_solaris.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="smartctl_res.rc">
|
||||
<Filter>os_win32</Filter>
|
||||
</ResourceCompile>
|
||||
<ResourceCompile Include="smartd_res.rc">
|
||||
<Filter>os_win32</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -11,10 +11,10 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{3AFEDCDD-D289-4543-A91D-EFBA6C710247}</ProjectGuid>
|
||||
<RootNamespace>smartctl</RootNamespace>
|
||||
<ProjectGuid>{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}</ProjectGuid>
|
||||
<RootNamespace>smartd</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectName>smartctl</ProjectName>
|
||||
<ProjectName>smartd</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
@ -38,17 +38,15 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\smartctl_vc10.d\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\smartctl_vc10.d\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\smartctl_vc10.r\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;..\getopt;..\regex;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@ -67,7 +65,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\getopt;..\regex;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..;..\..\getopt;..\..\regex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;HAVE_CONFIG_H;_USE_32BIT_TIME_T;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
@ -78,7 +76,6 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@ -86,217 +83,227 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="daemon_win32.cpp">
|
||||
<ClCompile Include="..\..\ataidentify.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="hostname_win32.cpp">
|
||||
<ClCompile Include="..\..\dev_areca.cpp" />
|
||||
<ClCompile Include="..\daemon_win32.cpp" />
|
||||
<ClCompile Include="..\syslog_win32.cpp" />
|
||||
<ClCompile Include="..\wmiquery.cpp" />
|
||||
<ClCompile Include="..\..\regex\regcomp.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="syslog_win32.cpp">
|
||||
<ClCompile Include="..\..\regex\regex.c" />
|
||||
<ClCompile Include="..\..\regex\regex_internal.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="wmiquery.cpp" />
|
||||
<ClCompile Include="..\regex\regcomp.c">
|
||||
<ClCompile Include="..\..\regex\regexec.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regex.c" />
|
||||
<ClCompile Include="..\regex\regex_internal.c">
|
||||
<ClCompile Include="..\..\getopt\getopt.c" />
|
||||
<ClCompile Include="..\..\getopt\getopt1.c" />
|
||||
<ClCompile Include="..\..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\..\atacmds.cpp" />
|
||||
<ClCompile Include="..\..\ataprint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\regex\regexec.c">
|
||||
<ClCompile Include="..\..\cciss.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\getopt\getopt.c" />
|
||||
<ClCompile Include="..\getopt\getopt1.c" />
|
||||
<ClCompile Include="..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\atacmds.cpp" />
|
||||
<ClCompile Include="..\ataprint.cpp" />
|
||||
<ClCompile Include="..\cciss.cpp">
|
||||
<ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\..\dev_legacy.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\dev_legacy.cpp">
|
||||
<ClCompile Include="..\..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\..\os_darwin.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\os_darwin.cpp">
|
||||
<ClCompile Include="..\..\os_freebsd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_freebsd.cpp">
|
||||
<ClCompile Include="..\..\os_generic.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_generic.cpp">
|
||||
<ClCompile Include="..\..\os_linux.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_linux.cpp">
|
||||
<ClCompile Include="..\..\os_netbsd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_netbsd.cpp">
|
||||
<ClCompile Include="..\..\os_openbsd.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_openbsd.cpp">
|
||||
<ClCompile Include="..\..\os_os2.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_os2.cpp">
|
||||
<ClCompile Include="..\..\os_qnxnto.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_qnxnto.cpp">
|
||||
<ClCompile Include="..\..\os_solaris.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_solaris.cpp">
|
||||
<ClCompile Include="..\..\os_win32.cpp" />
|
||||
<ClCompile Include="..\..\scsiata.cpp" />
|
||||
<ClCompile Include="..\..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\..\scsiprint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\os_win32.cpp" />
|
||||
<ClCompile Include="..\scsiata.cpp" />
|
||||
<ClCompile Include="..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\scsiprint.cpp" />
|
||||
<ClCompile Include="..\smartctl.cpp" />
|
||||
<ClCompile Include="..\smartd.cpp">
|
||||
<ClCompile Include="..\..\smartctl.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utility.cpp" />
|
||||
<ClCompile Include="..\..\smartd.cpp" />
|
||||
<ClCompile Include="..\..\utility.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="daemon_win32.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="hostname_win32.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="syslog.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="wbemcli_small.h" />
|
||||
<ClInclude Include="wmiquery.h" />
|
||||
<ClInclude Include="..\regex\regex.h" />
|
||||
<ClInclude Include="..\regex\regex_internal.h" />
|
||||
<ClInclude Include="..\getopt\getopt.h" />
|
||||
<ClInclude Include="..\atacmdnames.h" />
|
||||
<ClInclude Include="..\atacmds.h" />
|
||||
<ClInclude Include="..\ataprint.h" />
|
||||
<CustomBuildStep Include="..\cciss.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\cissio_freebsd.h">
|
||||
<ClInclude Include="..\..\ataidentify.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<CustomBuild Include="config_vc10.h">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copy %(FullPath) $(IntDir)config.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy %(FullPath) $(IntDir)config.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)config.h;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Copy %(FullPath) $(IntDir)config.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy %(FullPath) $(IntDir)config.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)config.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="..\csmisas.h" />
|
||||
<ClInclude Include="..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\dev_interface.h" />
|
||||
<ClInclude Include="..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\drivedb.h" />
|
||||
<ClInclude Include="..\int64.h" />
|
||||
<ClInclude Include="..\knowndrives.h" />
|
||||
<CustomBuildStep Include="..\megaraid.h">
|
||||
<ClInclude Include="..\..\dev_areca.h" />
|
||||
<ClInclude Include="..\daemon_win32.h" />
|
||||
<ClInclude Include="..\syslog.h" />
|
||||
<ClInclude Include="..\wbemcli_small.h" />
|
||||
<ClInclude Include="..\wmiquery.h" />
|
||||
<ClInclude Include="..\..\regex\regex.h" />
|
||||
<ClInclude Include="..\..\regex\regex_internal.h" />
|
||||
<ClInclude Include="..\..\getopt\getopt.h" />
|
||||
<ClInclude Include="..\..\atacmdnames.h" />
|
||||
<ClInclude Include="..\..\atacmds.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="svnversion.h" />
|
||||
<CustomBuildStep Include="..\..\ataprint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_darwin.h">
|
||||
<CustomBuildStep Include="..\..\cciss.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_freebsd.h">
|
||||
<ClInclude Include="..\..\cissio_freebsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\csmisas.h" />
|
||||
<ClInclude Include="..\..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\..\dev_interface.h" />
|
||||
<ClInclude Include="..\..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\..\drivedb.h" />
|
||||
<ClInclude Include="..\..\int64.h" />
|
||||
<ClInclude Include="..\..\knowndrives.h" />
|
||||
<CustomBuildStep Include="..\..\megaraid.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_generic.h">
|
||||
<CustomBuildStep Include="..\..\os_darwin.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_linux.h">
|
||||
<CustomBuildStep Include="..\..\os_freebsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_netbsd.h">
|
||||
<CustomBuildStep Include="..\..\os_generic.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_openbsd.h">
|
||||
<CustomBuildStep Include="..\..\os_linux.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_os2.h">
|
||||
<CustomBuildStep Include="..\..\os_netbsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_qnxnto.h">
|
||||
<CustomBuildStep Include="..\..\os_openbsd.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\os_solaris.h">
|
||||
<CustomBuildStep Include="..\..\os_os2.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\scsicmds.h" />
|
||||
<ClInclude Include="..\scsiprint.h" />
|
||||
<ClInclude Include="..\smartctl.h" />
|
||||
<CustomBuild Include="svnversion_vc10.h">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Copy %(FullPath) $(IntDir)svnversion.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy %(FullPath) $(IntDir)svnversion.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)svnversion.h;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Copy %(FullPath) $(IntDir)svnversion.h</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy %(FullPath) $(IntDir)svnversion.h
|
||||
</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)svnversion.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="..\utility.h" />
|
||||
<CustomBuildStep Include="..\..\os_qnxnto.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\os_solaris.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\..\scsicmds.h" />
|
||||
<CustomBuildStep Include="..\..\scsiprint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\smartctl.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<ClInclude Include="..\..\utility.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="installer.nsi" />
|
||||
<None Include="update-smart-drivedb.nsi" />
|
||||
<None Include="..\AUTHORS" />
|
||||
<None Include="..\autogen.sh" />
|
||||
<None Include="..\CHANGELOG" />
|
||||
<None Include="..\config.h.in" />
|
||||
<None Include="..\configure.in" />
|
||||
<None Include="..\do_release" />
|
||||
<None Include="..\Doxyfile" />
|
||||
<None Include="..\INSTALL" />
|
||||
<None Include="..\Makefile.am" />
|
||||
<None Include="..\NEWS" />
|
||||
<None Include="..\README" />
|
||||
<None Include="..\smartctl.8.in" />
|
||||
<None Include="..\smartd.8.in" />
|
||||
<None Include="..\smartd.conf.5.in" />
|
||||
<None Include="..\smartd.initd.in" />
|
||||
<None Include="..\TODO" />
|
||||
<None Include="..\update-smart-drivedb.in" />
|
||||
<None Include="..\WARNINGS" />
|
||||
<None Include="..\..\smartd_warning.sh.in" />
|
||||
<None Include="..\installer.nsi" />
|
||||
<None Include="..\smartctl_res.rc.in" />
|
||||
<None Include="..\smartd_res.rc.in" />
|
||||
<None Include="..\smartd_warning.cmd" />
|
||||
<CustomBuild Include="..\syslogevt.mc">
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)syslogevt.rc;$(IntDir)msg00001.bin;syslogevt.h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -r $(IntDir) ..\syslogevt.mc</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)syslogevt.rc;$(IntDir)msg00001.bin;syslogevt.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<None Include="..\update-smart-drivedb.nsi" />
|
||||
<None Include="..\..\AUTHORS" />
|
||||
<None Include="..\..\autogen.sh" />
|
||||
<None Include="..\..\ChangeLog" />
|
||||
<None Include="..\..\config.h.in" />
|
||||
<None Include="..\..\configure.ac" />
|
||||
<None Include="..\..\do_release" />
|
||||
<None Include="..\..\Doxyfile" />
|
||||
<None Include="..\..\INSTALL" />
|
||||
<None Include="..\..\Makefile.am" />
|
||||
<None Include="..\..\NEWS" />
|
||||
<None Include="..\..\README" />
|
||||
<None Include="..\..\smartctl.8.in" />
|
||||
<None Include="..\..\smartd.8.in" />
|
||||
<None Include="..\..\smartd.conf.5.in" />
|
||||
<None Include="..\..\smartd.initd.in" />
|
||||
<None Include="..\..\TODO" />
|
||||
<None Include="..\..\update-smart-drivedb.in" />
|
||||
<None Include="..\..\WARNINGS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="smartctl_res.rc">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ResourceCompile>
|
||||
<ResourceCompile Include="smartd_res.rc">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
173
os_win32/vc10/smartd.vcxproj.filters
Normal file
173
os_win32/vc10/smartd.vcxproj.filters
Normal file
@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="os_win32">
|
||||
<UniqueIdentifier>{44bb110e-4d44-4d5e-8186-354210a8d3ba}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="regex">
|
||||
<UniqueIdentifier>{fd3bb1d5-a72e-4f92-84a3-6eac97975ec7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="getopt">
|
||||
<UniqueIdentifier>{1d1b67d5-219f-4e86-a5ff-9d94f1f751f9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\daemon_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\syslog_win32.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\wmiquery.cpp">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regcomp.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regex.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regex_internal.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\regex\regexec.c">
|
||||
<Filter>regex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\getopt\getopt.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\getopt\getopt1.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\atacmdnames.cpp" />
|
||||
<ClCompile Include="..\..\atacmds.cpp" />
|
||||
<ClCompile Include="..\..\ataprint.cpp" />
|
||||
<ClCompile Include="..\..\cciss.cpp" />
|
||||
<ClCompile Include="..\..\dev_ata_cmd_set.cpp" />
|
||||
<ClCompile Include="..\..\dev_interface.cpp" />
|
||||
<ClCompile Include="..\..\dev_legacy.cpp" />
|
||||
<ClCompile Include="..\..\knowndrives.cpp" />
|
||||
<ClCompile Include="..\..\os_darwin.cpp" />
|
||||
<ClCompile Include="..\..\os_freebsd.cpp" />
|
||||
<ClCompile Include="..\..\os_generic.cpp" />
|
||||
<ClCompile Include="..\..\os_linux.cpp" />
|
||||
<ClCompile Include="..\..\os_netbsd.cpp" />
|
||||
<ClCompile Include="..\..\os_openbsd.cpp" />
|
||||
<ClCompile Include="..\..\os_os2.cpp" />
|
||||
<ClCompile Include="..\..\os_qnxnto.cpp" />
|
||||
<ClCompile Include="..\..\os_solaris.cpp" />
|
||||
<ClCompile Include="..\..\os_win32.cpp" />
|
||||
<ClCompile Include="..\..\scsiata.cpp" />
|
||||
<ClCompile Include="..\..\scsicmds.cpp" />
|
||||
<ClCompile Include="..\..\scsiprint.cpp" />
|
||||
<ClCompile Include="..\..\smartctl.cpp" />
|
||||
<ClCompile Include="..\..\smartd.cpp" />
|
||||
<ClCompile Include="..\..\utility.cpp" />
|
||||
<ClCompile Include="..\..\ataidentify.cpp" />
|
||||
<ClCompile Include="..\..\dev_areca.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\daemon_win32.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\syslog.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\wbemcli_small.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\wmiquery.h">
|
||||
<Filter>os_win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\regex\regex.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\regex\regex_internal.h">
|
||||
<Filter>regex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\getopt\getopt.h">
|
||||
<Filter>getopt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\atacmdnames.h" />
|
||||
<ClInclude Include="..\..\atacmds.h" />
|
||||
<ClInclude Include="..\..\cissio_freebsd.h" />
|
||||
<ClInclude Include="..\..\csmisas.h" />
|
||||
<ClInclude Include="..\..\dev_ata_cmd_set.h" />
|
||||
<ClInclude Include="..\..\dev_interface.h" />
|
||||
<ClInclude Include="..\..\dev_tunnelled.h" />
|
||||
<ClInclude Include="..\..\drivedb.h" />
|
||||
<ClInclude Include="..\..\int64.h" />
|
||||
<ClInclude Include="..\..\knowndrives.h" />
|
||||
<ClInclude Include="..\..\scsicmds.h" />
|
||||
<ClInclude Include="..\..\utility.h" />
|
||||
<ClInclude Include="..\..\ataidentify.h" />
|
||||
<ClInclude Include="..\..\dev_areca.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="svnversion.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\installer.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\update-smart-drivedb.nsi">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\..\AUTHORS" />
|
||||
<None Include="..\..\autogen.sh" />
|
||||
<None Include="..\..\ChangeLog" />
|
||||
<None Include="..\..\config.h.in" />
|
||||
<None Include="..\..\configure.ac" />
|
||||
<None Include="..\..\do_release" />
|
||||
<None Include="..\..\Doxyfile" />
|
||||
<None Include="..\..\INSTALL" />
|
||||
<None Include="..\..\Makefile.am" />
|
||||
<None Include="..\..\NEWS" />
|
||||
<None Include="..\..\README" />
|
||||
<None Include="..\..\smartctl.8.in" />
|
||||
<None Include="..\..\smartd.8.in" />
|
||||
<None Include="..\..\smartd.conf.5.in" />
|
||||
<None Include="..\..\smartd.initd.in" />
|
||||
<None Include="..\..\TODO" />
|
||||
<None Include="..\..\update-smart-drivedb.in" />
|
||||
<None Include="..\..\WARNINGS" />
|
||||
<None Include="..\smartd_warning.cmd">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\..\smartd_warning.sh.in" />
|
||||
<None Include="..\smartctl_res.rc.in">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
<None Include="..\smartd_res.rc.in">
|
||||
<Filter>os_win32</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="..\..\ataprint.h" />
|
||||
<CustomBuildStep Include="..\..\cciss.h" />
|
||||
<CustomBuildStep Include="..\..\megaraid.h" />
|
||||
<CustomBuildStep Include="..\..\os_darwin.h" />
|
||||
<CustomBuildStep Include="..\..\os_freebsd.h" />
|
||||
<CustomBuildStep Include="..\..\os_generic.h" />
|
||||
<CustomBuildStep Include="..\..\os_linux.h" />
|
||||
<CustomBuildStep Include="..\..\os_netbsd.h" />
|
||||
<CustomBuildStep Include="..\..\os_openbsd.h" />
|
||||
<CustomBuildStep Include="..\..\os_os2.h" />
|
||||
<CustomBuildStep Include="..\..\os_qnxnto.h" />
|
||||
<CustomBuildStep Include="..\..\os_solaris.h" />
|
||||
<CustomBuildStep Include="..\..\scsiprint.h" />
|
||||
<CustomBuildStep Include="..\..\smartctl.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="smartctl_res.rc">
|
||||
<Filter>os_win32</Filter>
|
||||
</ResourceCompile>
|
||||
<ResourceCompile Include="smartd_res.rc">
|
||||
<Filter>os_win32</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\syslogevt.mc">
|
||||
<Filter>os_win32</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,13 +1,13 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartctl", "smartctl_vc10.vcxproj", "{3AFEDCDD-D289-4543-A91D-EFBA6C710247}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartctl", "smartctl.vcxproj", "{3AFEDCDD-D289-4543-A91D-EFBA6C710247}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartd", "smartd_vc10.vcxproj", "{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smartd", "smartd.vcxproj", "{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "syslogevt", "syslogevt_vc10.vcxproj", "{FAB7557B-86EA-405D-B49D-33AB3F4D3E33}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runcmd", "runcmd.vcxproj", "{11A4B619-D97B-499F-AF17-CF9F80BF70E8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runcmd", "runcmd_vc10.vcxproj", "{11A4B619-D97B-499F-AF17-CF9F80BF70E8}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wtssendmsg", "wtssendmsg.vcxproj", "{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -23,14 +23,14 @@ Global
|
||||
{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C0762191-C2AC-40B6-A2EB-F1658BBDC4C6}.Release|Win32.Build.0 = Release|Win32
|
||||
{FAB7557B-86EA-405D-B49D-33AB3F4D3E33}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FAB7557B-86EA-405D-B49D-33AB3F4D3E33}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FAB7557B-86EA-405D-B49D-33AB3F4D3E33}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FAB7557B-86EA-405D-B49D-33AB3F4D3E33}.Release|Win32.Build.0 = Release|Win32
|
||||
{11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{11A4B619-D97B-499F-AF17-CF9F80BF70E8}.Release|Win32.Build.0 = Release|Win32
|
||||
{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
82
os_win32/vc10/wtssendmsg.vcxproj
Normal file
82
os_win32/vc10/wtssendmsg.vcxproj
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\wtssendmsg.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0B6B7D19-07AE-41DD-B70E-2F74362A4EC0}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>wtssendmsg</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)\$(ProjectName).tmp\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CRT_NONSTDC_NO_WARNINGS;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>wtsapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CRT_NONSTDC_NO_WARNINGS;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>wtsapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2011 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2011-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
const char * wmiquery_cpp_cvsid = "$Id: wmiquery.cpp 3243 2011-01-19 20:03:47Z chrfranke $"
|
||||
const char * wmiquery_cpp_cvsid = "$Id: wmiquery.cpp 3802 2013-03-24 18:36:21Z chrfranke $"
|
||||
WMIQUERY_H_CVSID;
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ std::string wbem_object::get_str(const char * name) /*const*/
|
||||
return s;
|
||||
|
||||
VARIANT var; VariantInit(&var);
|
||||
if (m_intf->Get(com_bstr(name), 0L, &var, (CIMTYPE*)0, (long*)0) /* != WBEM_S_NO_ERROR */)
|
||||
if (m_intf->Get(com_bstr(name), 0L, &var, (CIMTYPE*)0, (LPLONG)0) /* != WBEM_S_NO_ERROR */)
|
||||
return s;
|
||||
|
||||
if (var.vt == VT_BSTR)
|
||||
|
137
os_win32/wtssendmsg.c
Normal file
137
os_win32/wtssendmsg.c
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* WTSSendMessage() command line tool
|
||||
*
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2012 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#define WINVER 0x0500
|
||||
#define _WIN32_WINNT WINVER
|
||||
|
||||
char svnid[] = "$Id: wtssendmsg.c 3714 2012-11-24 16:34:47Z chrfranke $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <wtsapi32.h>
|
||||
|
||||
|
||||
static int usage()
|
||||
{
|
||||
printf("wtssendmsg $Revision: 3714 $ - Display a message box on client desktops\n"
|
||||
"Copyright (C) 2012 Christian Franke, smartmontools.org\n\n"
|
||||
"Usage: wtssendmsg [-cas] [-v] [\"Caption\"] \"Message\"|-\n"
|
||||
" wtssendmsg -v\n\n"
|
||||
" -c Console session [default]\n"
|
||||
" -a Active sessions\n"
|
||||
" -s Connected sessions\n"
|
||||
" -v List sessions\n"
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int mode = 0, verbose = 0, status = 0, i;
|
||||
const char * message = 0, * caption = "";
|
||||
char msgbuf[1024];
|
||||
WTS_SESSION_INFOA * sessions; DWORD count;
|
||||
|
||||
for (i = 1; i < argc && argv[i][0] == '-' && argv[i][1]; i++) {
|
||||
int j;
|
||||
for (j = 1; argv[i][j]; j++)
|
||||
switch (argv[i][j]) {
|
||||
case 'c': mode = 0; break;
|
||||
case 'a': mode = 1; break;
|
||||
case 's': mode = 2; break;
|
||||
case 'v': verbose = 1; break;
|
||||
default: return usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (i < argc) {
|
||||
if (i+1 < argc)
|
||||
caption = argv[i++];
|
||||
|
||||
message = argv[i++];
|
||||
if (i < argc)
|
||||
return usage();
|
||||
|
||||
if (!strcmp(message, "-")) {
|
||||
// Read message from stdin
|
||||
i = fread(msgbuf, 1, sizeof(msgbuf)-1, stdin);
|
||||
if (i < 0) {
|
||||
perror("stdin");
|
||||
return 1;
|
||||
}
|
||||
msgbuf[i] = 0;
|
||||
message = msgbuf;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!verbose)
|
||||
return usage();
|
||||
}
|
||||
|
||||
// Get session list
|
||||
if (!WTSEnumerateSessionsA(WTS_CURRENT_SERVER_HANDLE, 0, 1, &sessions, &count)) {
|
||||
fprintf(stderr, "WTSEnumerateSessions() failed\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)count; i++) {
|
||||
|
||||
if (verbose) {
|
||||
printf("Session %d (\"%s\", State=%d)%s",
|
||||
i, sessions[i].pWinStationName, sessions[i].State,
|
||||
(!message ? "\n" : ": "));
|
||||
if (!message)
|
||||
continue; // List sessions only
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
if ( !strcmpi(sessions[i].pWinStationName, "Console")
|
||||
|| (mode >= 1 && sessions[i].State == WTSActive)
|
||||
|| (mode >= 2 && sessions[i].State == WTSConnected)) {
|
||||
|
||||
// Send Message, don't wait for OK button
|
||||
DWORD result;
|
||||
if (WTSSendMessageA(WTS_CURRENT_SERVER_HANDLE, sessions[i].SessionId,
|
||||
(char *)caption, strlen(caption),
|
||||
(char *)message, strlen(message),
|
||||
MB_OK|MB_ICONEXCLAMATION, 0 /*Timeout*/,
|
||||
&result, FALSE /*!Wait*/)) {
|
||||
if (verbose)
|
||||
printf("message sent\n");
|
||||
}
|
||||
else {
|
||||
status = 1;
|
||||
if (verbose)
|
||||
printf("WTSSendMessage() failed with error=%d\n", (int)GetLastError());
|
||||
else
|
||||
fprintf(stderr, "Session %d (\"%s\", State=%d): WTSSendMessage() failed with error=%d\n",
|
||||
i, sessions[i].pWinStationName, sessions[i].State, (int)GetLastError());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (verbose)
|
||||
printf("ignored\n");
|
||||
}
|
||||
}
|
||||
|
||||
WTSFreeMemory(sessions);
|
||||
|
||||
return status;
|
||||
}
|
@ -15,8 +15,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
|
||||
int length, reg_syntax_t syntax);
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
#ifdef _LIBC
|
||||
/* We have to keep the namespace clean. */
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
#ifndef _REGEX_H
|
||||
#define _REGEX_H 1
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
static void re_string_construct_common (const char *str, int len,
|
||||
re_string_t *pstr,
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
#ifndef _REGEX_INTERNAL_H
|
||||
#define _REGEX_INTERNAL_H 1
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA. */
|
||||
|
||||
static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
|
||||
re_string_t *input, int n);
|
||||
|
116
scsiata.cpp
116
scsiata.cpp
@ -4,7 +4,7 @@
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2006-12 Douglas Gilbert <dgilbert@interlog.com>
|
||||
* Copyright (C) 2009-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2009-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -12,8 +12,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* The code in this file is based on the SCSI to ATA Translation (SAT)
|
||||
* draft found at http://www.t10.org . The original draft used for this
|
||||
@ -62,7 +62,7 @@
|
||||
#include "dev_ata_cmd_set.h" // ata_device_with_command_set
|
||||
#include "dev_tunnelled.h" // tunnelled_device<>
|
||||
|
||||
const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 3519 2012-03-06 20:01:44Z chrfranke $";
|
||||
const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 3741 2013-01-02 17:06:54Z chrfranke $";
|
||||
|
||||
/* This is a slightly stretched SCSI sense "descriptor" format header.
|
||||
The addition is to allow the 0x70 and 0x71 response codes. The idea
|
||||
@ -92,12 +92,6 @@ struct sg_scsi_sense_hdr {
|
||||
static int sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
|
||||
struct sg_scsi_sense_hdr * sshp);
|
||||
|
||||
/* Attempt to find the first SCSI sense data descriptor that matches the
|
||||
given 'desc_type'. If found return pointer to start of sense data
|
||||
descriptor; otherwise (including fixed format sense data) returns NULL. */
|
||||
static const unsigned char * sg_scsi_sense_desc_find(const unsigned char * sensep,
|
||||
int sense_len, int desc_type);
|
||||
|
||||
#define SAT_ATA_PASSTHROUGH_12LEN 12
|
||||
#define SAT_ATA_PASSTHROUGH_16LEN 16
|
||||
|
||||
@ -147,6 +141,8 @@ sat_device::sat_device(smart_interface * intf, scsi_device * scsidev,
|
||||
hide_ata(); // Start as SCSI, switch to ATA in autodetect_open()
|
||||
else
|
||||
hide_scsi(); // ATA always
|
||||
if (strcmp(scsidev->get_dev_type(), "scsi"))
|
||||
set_info().dev_type += strprintf("+%s", scsidev->get_dev_type());
|
||||
|
||||
set_info().info_name = strprintf("%s [%sSAT]", scsidev->get_info_name(),
|
||||
(enable_auto ? "SCSI/" : ""));
|
||||
@ -232,10 +228,12 @@ sat_device::~sat_device() throw()
|
||||
|
||||
bool sat_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
|
||||
{
|
||||
if (!ata_cmd_is_ok(in,
|
||||
true, // data_out_support
|
||||
true, // multi_sector_support
|
||||
true) // ata_48bit_support
|
||||
if (!ata_cmd_is_supported(in,
|
||||
ata_device::supports_data_out |
|
||||
ata_device::supports_output_regs |
|
||||
ata_device::supports_multi_sector |
|
||||
ata_device::supports_48bit,
|
||||
"SAT")
|
||||
)
|
||||
return false;
|
||||
|
||||
@ -535,32 +533,6 @@ static int sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
|
||||
}
|
||||
|
||||
|
||||
static const unsigned char * sg_scsi_sense_desc_find(const unsigned char * sensep,
|
||||
int sense_len, int desc_type)
|
||||
{
|
||||
int add_sen_len, add_len, desc_len, k;
|
||||
const unsigned char * descp;
|
||||
|
||||
if ((sense_len < 8) || (0 == (add_sen_len = sensep[7])))
|
||||
return NULL;
|
||||
if ((sensep[0] < 0x72) || (sensep[0] > 0x73))
|
||||
return NULL;
|
||||
add_sen_len = (add_sen_len < (sense_len - 8)) ?
|
||||
add_sen_len : (sense_len - 8);
|
||||
descp = &sensep[8];
|
||||
for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) {
|
||||
descp += desc_len;
|
||||
add_len = (k < (add_sen_len - 1)) ? descp[1]: -1;
|
||||
desc_len = add_len + 2;
|
||||
if (descp[0] == desc_type)
|
||||
return descp;
|
||||
if (add_len < 0) /* short descriptor ?? */
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// Call scsi_pass_through and check sense.
|
||||
// TODO: Provide as member function of class scsi_device (?)
|
||||
static bool scsi_pass_through_and_check(scsi_device * scsidev, scsi_cmnd_io * iop,
|
||||
@ -925,7 +897,8 @@ class usbjmicron_device
|
||||
{
|
||||
public:
|
||||
usbjmicron_device(smart_interface * intf, scsi_device * scsidev,
|
||||
const char * req_type, bool ata_48bit_support, int port);
|
||||
const char * req_type, bool prolific,
|
||||
bool ata_48bit_support, int port);
|
||||
|
||||
virtual ~usbjmicron_device() throw();
|
||||
|
||||
@ -936,16 +909,19 @@ public:
|
||||
private:
|
||||
bool get_registers(unsigned short addr, unsigned char * buf, unsigned short size);
|
||||
|
||||
bool m_prolific;
|
||||
bool m_ata_48bit_support;
|
||||
int m_port;
|
||||
};
|
||||
|
||||
|
||||
usbjmicron_device::usbjmicron_device(smart_interface * intf, scsi_device * scsidev,
|
||||
const char * req_type, bool ata_48bit_support, int port)
|
||||
const char * req_type, bool prolific,
|
||||
bool ata_48bit_support, int port)
|
||||
: smart_device(intf, scsidev->get_dev_name(), "usbjmicron", req_type),
|
||||
tunnelled_device<ata_device, scsi_device>(scsidev),
|
||||
m_ata_48bit_support(ata_48bit_support), m_port(port)
|
||||
m_prolific(prolific), m_ata_48bit_support(ata_48bit_support),
|
||||
m_port(port >= 0 || !prolific ? port : 0)
|
||||
{
|
||||
set_info().info_name = strprintf("%s [USB JMicron]", scsidev->get_info_name());
|
||||
}
|
||||
@ -989,24 +965,14 @@ bool usbjmicron_device::open()
|
||||
|
||||
bool usbjmicron_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
|
||||
{
|
||||
if (!ata_cmd_is_ok(in,
|
||||
true, // data_out_support
|
||||
false, // !multi_sector_support
|
||||
m_ata_48bit_support) // limited, see below
|
||||
if (!ata_cmd_is_supported(in,
|
||||
ata_device::supports_data_out |
|
||||
ata_device::supports_smart_status |
|
||||
(m_ata_48bit_support ? ata_device::supports_48bit_hi_null : 0),
|
||||
"JMicron")
|
||||
)
|
||||
return false;
|
||||
|
||||
bool is_smart_status = ( in.in_regs.command == ATA_SMART_CMD
|
||||
&& in.in_regs.features == ATA_SMART_STATUS);
|
||||
|
||||
// Support output registers for SMART STATUS
|
||||
if (in.out_needed.is_set() && !is_smart_status)
|
||||
return set_err(ENOSYS, "ATA output registers not supported");
|
||||
|
||||
// Support 48-bit commands with zero high bytes
|
||||
if (in.in_regs.is_real_48bit_cmd())
|
||||
return set_err(ENOSYS, "48-bit ATA commands not fully supported");
|
||||
|
||||
if (m_port < 0)
|
||||
return set_err(EIO, "Unknown JMicron port");
|
||||
|
||||
@ -1016,6 +982,9 @@ bool usbjmicron_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & ou
|
||||
bool rwbit = true;
|
||||
unsigned char smart_status = 0;
|
||||
|
||||
bool is_smart_status = ( in.in_regs.command == ATA_SMART_CMD
|
||||
&& in.in_regs.features == ATA_SMART_STATUS);
|
||||
|
||||
if (is_smart_status && in.out_needed.is_set()) {
|
||||
io_hdr.dxfer_dir = DXFER_FROM_DEVICE;
|
||||
io_hdr.dxfer_len = 1;
|
||||
@ -1042,7 +1011,7 @@ bool usbjmicron_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & ou
|
||||
}
|
||||
|
||||
// Build pass through command
|
||||
unsigned char cdb[12];
|
||||
unsigned char cdb[14];
|
||||
cdb[ 0] = 0xdf;
|
||||
cdb[ 1] = (rwbit ? 0x10 : 0x00);
|
||||
cdb[ 2] = 0x00;
|
||||
@ -1055,9 +1024,12 @@ bool usbjmicron_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & ou
|
||||
cdb[ 9] = in.in_regs.lba_high;
|
||||
cdb[10] = in.in_regs.device | (m_port == 0 ? 0xa0 : 0xb0);
|
||||
cdb[11] = in.in_regs.command;
|
||||
// Prolific PL3507
|
||||
cdb[12] = 0x06;
|
||||
cdb[13] = 0x7b;
|
||||
|
||||
io_hdr.cmnd = cdb;
|
||||
io_hdr.cmnd_len = sizeof(cdb);
|
||||
io_hdr.cmnd_len = (!m_prolific ? 12 : 14);
|
||||
|
||||
scsi_device * scsidev = get_tunnel_dev();
|
||||
if (!scsi_pass_through_and_check(scsidev, &io_hdr,
|
||||
@ -1104,7 +1076,7 @@ bool usbjmicron_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & ou
|
||||
bool usbjmicron_device::get_registers(unsigned short addr,
|
||||
unsigned char * buf, unsigned short size)
|
||||
{
|
||||
unsigned char cdb[12];
|
||||
unsigned char cdb[14];
|
||||
cdb[ 0] = 0xdf;
|
||||
cdb[ 1] = 0x10;
|
||||
cdb[ 2] = 0x00;
|
||||
@ -1117,6 +1089,9 @@ bool usbjmicron_device::get_registers(unsigned short addr,
|
||||
cdb[ 9] = 0x00;
|
||||
cdb[10] = 0x00;
|
||||
cdb[11] = 0xfd;
|
||||
// Prolific PL3507
|
||||
cdb[12] = 0x06;
|
||||
cdb[13] = 0x7b;
|
||||
|
||||
scsi_cmnd_io io_hdr;
|
||||
memset(&io_hdr, 0, sizeof(io_hdr));
|
||||
@ -1125,6 +1100,7 @@ bool usbjmicron_device::get_registers(unsigned short addr,
|
||||
io_hdr.dxferp = buf;
|
||||
io_hdr.cmnd = cdb;
|
||||
io_hdr.cmnd_len = sizeof(cdb);
|
||||
io_hdr.cmnd_len = (!m_prolific ? 12 : 14);
|
||||
|
||||
scsi_device * scsidev = get_tunnel_dev();
|
||||
if (!scsi_pass_through_and_check(scsidev, &io_hdr,
|
||||
@ -1169,10 +1145,11 @@ usbsunplus_device::~usbsunplus_device() throw()
|
||||
|
||||
bool usbsunplus_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
|
||||
{
|
||||
if (!ata_cmd_is_ok(in,
|
||||
true, // data_out_support
|
||||
false, // !multi_sector_support
|
||||
true) // ata_48bit_support
|
||||
if (!ata_cmd_is_supported(in,
|
||||
ata_device::supports_data_out |
|
||||
ata_device::supports_output_regs |
|
||||
ata_device::supports_48bit,
|
||||
"Sunplus")
|
||||
)
|
||||
return false;
|
||||
|
||||
@ -1325,6 +1302,11 @@ ata_device * smart_interface::get_sat_device(const char * type, scsi_device * sc
|
||||
|
||||
else if (!strncmp(type, "usbjmicron", 10)) {
|
||||
const char * t = type + 10;
|
||||
bool prolific = false;
|
||||
if (!strncmp(t, ",p", 2)) {
|
||||
t += 2;
|
||||
prolific = true;
|
||||
}
|
||||
bool ata_48bit_support = false;
|
||||
if (!strncmp(t, ",x", 2)) {
|
||||
t += 2;
|
||||
@ -1333,10 +1315,10 @@ ata_device * smart_interface::get_sat_device(const char * type, scsi_device * sc
|
||||
int port = -1, n = -1;
|
||||
if (*t && !( (sscanf(t, ",%d%n", &port, &n) == 1
|
||||
&& n == (int)strlen(t) && 0 <= port && port <= 1))) {
|
||||
set_err(EINVAL, "Option '-d usbmicron[,x],<n>' requires <n> to be 0 or 1");
|
||||
set_err(EINVAL, "Option '-d usbjmicron[,p][,x],<n>' requires <n> to be 0 or 1");
|
||||
return 0;
|
||||
}
|
||||
return new usbjmicron_device(this, scsidev, type, ata_48bit_support, port);
|
||||
return new usbjmicron_device(this, scsidev, type, prolific, ata_48bit_support, port);
|
||||
}
|
||||
|
||||
else if (!strcmp(type, "usbsunplus")) {
|
||||
|
685
scsicmds.cpp
685
scsicmds.cpp
File diff suppressed because it is too large
Load Diff
71
scsicmds.h
71
scsicmds.h
@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
|
||||
*
|
||||
* Additional SCSI work:
|
||||
* Copyright (C) 2003-11 Douglas Gilbert <dgilbert@interlog.com>
|
||||
* Copyright (C) 2003-13 Douglas Gilbert <dgilbert@interlog.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -15,8 +15,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -32,7 +32,7 @@
|
||||
#ifndef SCSICMDS_H_
|
||||
#define SCSICMDS_H_
|
||||
|
||||
#define SCSICMDS_H_CVSID "$Id: scsicmds.h 3413 2011-09-06 21:23:00Z dpgilbert $\n"
|
||||
#define SCSICMDS_H_CVSID "$Id: scsicmds.h 3783 2013-03-02 01:51:12Z dpgilbert $\n"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -78,6 +78,9 @@
|
||||
#ifndef READ_DEFECT_10
|
||||
#define READ_DEFECT_10 0x37
|
||||
#endif
|
||||
#ifndef READ_DEFECT_12
|
||||
#define READ_DEFECT_12 0xb7
|
||||
#endif
|
||||
#ifndef START_STOP_UNIT
|
||||
#define START_STOP_UNIT 0x1b
|
||||
#endif
|
||||
@ -130,10 +133,11 @@ struct scsi_cmnd_io
|
||||
};
|
||||
|
||||
struct scsi_sense_disect {
|
||||
UINT8 error_code;
|
||||
UINT8 resp_code;
|
||||
UINT8 sense_key;
|
||||
UINT8 asc;
|
||||
UINT8 ascq;
|
||||
int progress; /* -1 -> N/A, 0-65535 -> available */
|
||||
};
|
||||
|
||||
/* Useful data from Informational Exception Control mode page (0x1c) */
|
||||
@ -240,6 +244,18 @@ Documentation, see http://www.storage.ibm.com/techsup/hddtech/prodspecs.htm */
|
||||
#define MPAGE_CONTROL_DEFAULT 2
|
||||
#define MPAGE_CONTROL_SAVED 3
|
||||
|
||||
/* SCSI Vital Product Data (VPD) pages */
|
||||
#define SCSI_VPD_SUPPORTED_VPD_PAGES 0x0
|
||||
#define SCSI_VPD_UNIT_SERIAL_NUMBER 0x80
|
||||
#define SCSI_VPD_DEVICE_IDENTIFICATION 0x83
|
||||
#define SCSI_VPD_EXTENDED_INQUIRY_DATA 0x86
|
||||
#define SCSI_VPD_ATA_INFORMATION 0x89
|
||||
#define SCSI_VPD_POWER_CONDITION 0x8a
|
||||
#define SCSI_VPD_POWER_CONSUMPTION 0x8d
|
||||
#define SCSI_VPD_BLOCK_LIMITS 0xb0
|
||||
#define SCSI_VPD_BLOCK_DEVICE_CHARACTERISTICS 0xb1
|
||||
#define SCSI_VPD_LOGICAL_BLOCK_PROVISIONING 0xb2
|
||||
|
||||
/* defines for useful SCSI Status codes */
|
||||
#define SCSI_STATUS_CHECK_CONDITION 0x2
|
||||
|
||||
@ -257,7 +273,7 @@ Documentation, see http://www.storage.ibm.com/techsup/hddtech/prodspecs.htm */
|
||||
#define SCSI_ASC_NOT_READY 0x4 /* more info in ASCQ code */
|
||||
#define SCSI_ASC_NO_MEDIUM 0x3a /* more info in ASCQ code */
|
||||
#define SCSI_ASC_UNKNOWN_OPCODE 0x20
|
||||
#define SCSI_ASC_UNKNOWN_FIELD 0x24
|
||||
#define SCSI_ASC_INVALID_FIELD 0x24
|
||||
#define SCSI_ASC_UNKNOWN_PARAM 0x26
|
||||
#define SCSI_ASC_WARNING 0xb
|
||||
#define SCSI_ASC_IMPENDING_FAILURE 0x5d
|
||||
@ -301,6 +317,27 @@ Documentation, see http://www.storage.ibm.com/techsup/hddtech/prodspecs.htm */
|
||||
|
||||
class scsi_device;
|
||||
|
||||
// Set of supported SCSI VPD pages. Constructor fetches Supported VPD pages
|
||||
// VPD page and remembers the response for later queries.
|
||||
class supported_vpd_pages
|
||||
{
|
||||
public:
|
||||
supported_vpd_pages(scsi_device * device);
|
||||
~supported_vpd_pages() { num_valid = 0; }
|
||||
|
||||
bool is_supported(int vpd_page_num) const;
|
||||
|
||||
/* Returns 0 or less for VPD pages not supported or error */
|
||||
int num_pages() const { return num_valid; }
|
||||
|
||||
private:
|
||||
int num_valid; /* 0 or less for invalid */
|
||||
unsigned char pages[256];
|
||||
};
|
||||
|
||||
extern supported_vpd_pages * supported_vpd_pages_p;
|
||||
|
||||
|
||||
// Print SCSI debug messages?
|
||||
extern unsigned char scsi_debugmode;
|
||||
|
||||
@ -354,14 +391,14 @@ int scsiReceiveDiagnostic(scsi_device * device, int pcv, int pagenum, UINT8 *pBu
|
||||
int scsiReadDefect10(scsi_device * device, int req_plist, int req_glist, int dl_format,
|
||||
UINT8 *pBuf, int bufLen);
|
||||
|
||||
int scsiReadDefect12(scsi_device * device, int req_plist, int req_glist,
|
||||
int dl_format, int addrDescIndex, UINT8 *pBuf, int bufLen);
|
||||
|
||||
int scsiReadCapacity10(scsi_device * device, unsigned int * last_lbp,
|
||||
unsigned int * lb_sizep);
|
||||
|
||||
int scsiReadCapacity16(scsi_device * device, UINT8 *pBuf, int bufLen);
|
||||
|
||||
uint64_t scsiGetSize(scsi_device * device, unsigned int * lb_sizep);
|
||||
|
||||
|
||||
/* SMART specific commands */
|
||||
int scsiCheckIE(scsi_device * device, int hasIELogPage, int hasTempLogPage, UINT8 *asc,
|
||||
UINT8 *ascq, UINT8 *currenttemp, UINT8 *triptemp);
|
||||
@ -383,7 +420,12 @@ int scsiSelfTestInProgress(scsi_device * device, int * inProgress);
|
||||
int scsiFetchControlGLTSD(scsi_device * device, int modese_len, int current);
|
||||
int scsiSetControlGLTSD(scsi_device * device, int enabled, int modese_len);
|
||||
int scsiFetchTransportProtocol(scsi_device * device, int modese_len);
|
||||
|
||||
int scsiGetRPM(scsi_device * device, int modese_len, int * form_factorp);
|
||||
int scsiGetSetCache(scsi_device * device, int modese_len, short int * wce,
|
||||
short int * rcd);
|
||||
uint64_t scsiGetSize(scsi_device * device, unsigned int * lb_sizep,
|
||||
int * lb_per_pb_expp);
|
||||
int scsiGetProtPBInfo(scsi_device * device, unsigned char * rc16_12_31p);
|
||||
|
||||
/* T10 Standard IE Additional Sense Code strings taken from t10.org */
|
||||
const char* scsiGetIEString(UINT8 asc, UINT8 ascq);
|
||||
@ -403,10 +445,18 @@ const char * scsiTapeAlertsTapeDevice(unsigned short code);
|
||||
const char * scsiTapeAlertsChangerDevice(unsigned short code);
|
||||
|
||||
const char * scsi_get_opcode_name(UINT8 opcode);
|
||||
void scsi_format_id_string(char * out, const unsigned char * in, int n);
|
||||
|
||||
void dStrHex(const char* str, int len, int no_ascii);
|
||||
inline void dStrHex(const unsigned char* str, int len, int no_ascii)
|
||||
{ dStrHex((const char *)str, len, no_ascii); }
|
||||
|
||||
/* Attempt to find the first SCSI sense data descriptor that matches the
|
||||
given 'desc_type'. If found return pointer to start of sense data
|
||||
descriptor; otherwise (including fixed format sense data) returns NULL. */
|
||||
const unsigned char * sg_scsi_sense_desc_find(const unsigned char * sensep,
|
||||
int sense_len, int desc_type);
|
||||
|
||||
|
||||
/* SCSI command transmission interface function declaration. Its
|
||||
* definition is target OS specific (see os_<OS>.c file).
|
||||
@ -422,4 +472,3 @@ inline void dStrHex(const unsigned char* str, int len, int no_ascii)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
455
scsiprint.cpp
455
scsiprint.cpp
@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
|
||||
*
|
||||
* Additional SCSI work:
|
||||
* Copyright (C) 2003-10 Douglas Gilbert <dgilbert@interlog.com>
|
||||
* Copyright (C) 2003-13 Douglas Gilbert <dgilbert@interlog.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -15,8 +15,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
#define GBUF_SIZE 65535
|
||||
|
||||
const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 3441 2011-10-12 17:22:15Z chrfranke $"
|
||||
const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 3807 2013-04-18 17:11:12Z chrfranke $"
|
||||
SCSIPRINT_H_CVSID;
|
||||
|
||||
|
||||
@ -76,7 +76,9 @@ static int gIecMPage = 1; /* N.B. assume it until we know otherwise */
|
||||
/* Remember last successful mode sense/select command */
|
||||
static int modese_len = 0;
|
||||
|
||||
static void scsiGetSupportedLogPages(scsi_device * device)
|
||||
|
||||
static void
|
||||
scsiGetSupportedLogPages(scsi_device * device)
|
||||
{
|
||||
int i, err;
|
||||
|
||||
@ -144,7 +146,8 @@ static void scsiGetSupportedLogPages(scsi_device * device)
|
||||
|
||||
/* Returns 0 if ok, -1 if can't check IE, -2 if can check and bad
|
||||
(or at least something to report). */
|
||||
static int scsiGetSmartData(scsi_device * device, bool attribs)
|
||||
static int
|
||||
scsiGetSmartData(scsi_device * device, bool attribs)
|
||||
{
|
||||
UINT8 asc;
|
||||
UINT8 ascq;
|
||||
@ -152,7 +155,6 @@ static int scsiGetSmartData(scsi_device * device, bool attribs)
|
||||
UINT8 triptemp = 0;
|
||||
const char * cp;
|
||||
int err = 0;
|
||||
|
||||
print_on();
|
||||
if (scsiCheckIE(device, gSmartLPage, gTempLPage, &asc, &ascq,
|
||||
¤ttemp, &triptemp)) {
|
||||
@ -171,8 +173,6 @@ static int scsiGetSmartData(scsi_device * device, bool attribs)
|
||||
pout("SMART Health Status: OK\n");
|
||||
|
||||
if (attribs && !gTempLPage) {
|
||||
if (currenttemp || triptemp)
|
||||
pout("\n");
|
||||
if (currenttemp) {
|
||||
if (255 != currenttemp)
|
||||
pout("Current Drive Temperature: %d C\n", currenttemp);
|
||||
@ -182,6 +182,7 @@ static int scsiGetSmartData(scsi_device * device, bool attribs)
|
||||
if (triptemp)
|
||||
pout("Drive Trip Temperature: %d C\n", triptemp);
|
||||
}
|
||||
pout("\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -190,7 +191,8 @@ static int scsiGetSmartData(scsi_device * device, bool attribs)
|
||||
// TapeAlerts fails
|
||||
static const char * const severities = "CWI";
|
||||
|
||||
static int scsiGetTapeAlertsData(scsi_device * device, int peripheral_type)
|
||||
static int
|
||||
scsiGetTapeAlertsData(scsi_device * device, int peripheral_type)
|
||||
{
|
||||
unsigned short pagelength;
|
||||
unsigned short parametercode;
|
||||
@ -223,7 +225,8 @@ static int scsiGetTapeAlertsData(scsi_device * device, int peripheral_type)
|
||||
scsiTapeAlertsTapeDevice(parametercode);
|
||||
if (*ts == *s) {
|
||||
if (!failures)
|
||||
pout("TapeAlert Errors (C=Critical, W=Warning, I=Informational):\n");
|
||||
pout("TapeAlert Errors (C=Critical, W=Warning, "
|
||||
"I=Informational):\n");
|
||||
pout("[0x%02x] %s\n", parametercode, ts);
|
||||
failures += 1;
|
||||
}
|
||||
@ -238,7 +241,8 @@ static int scsiGetTapeAlertsData(scsi_device * device, int peripheral_type)
|
||||
return failures;
|
||||
}
|
||||
|
||||
static void scsiGetStartStopData(scsi_device * device)
|
||||
static void
|
||||
scsiGetStartStopData(scsi_device * device)
|
||||
{
|
||||
UINT32 u;
|
||||
int err, len, k, extra, pc;
|
||||
@ -314,19 +318,48 @@ static void scsiGetStartStopData(scsi_device * device)
|
||||
}
|
||||
}
|
||||
|
||||
static void scsiPrintGrownDefectListLen(scsi_device * device)
|
||||
static void
|
||||
scsiPrintGrownDefectListLen(scsi_device * device)
|
||||
{
|
||||
int err, dl_format, dl_len, div;
|
||||
int err, dl_format, got_rd12, generation;
|
||||
unsigned int dl_len, div;
|
||||
|
||||
memset(gBuf, 0, 4);
|
||||
if ((err = scsiReadDefect10(device, 0 /* req_plist */, 1 /* req_glist */,
|
||||
4 /* bytes from index */, gBuf, 4))) {
|
||||
if (scsi_debugmode > 0) {
|
||||
memset(gBuf, 0, 8);
|
||||
if ((err = scsiReadDefect12(device, 0 /* req_plist */, 1 /* req_glist */,
|
||||
4 /* format: bytes from index */,
|
||||
0 /* addr desc index */, gBuf, 8))) {
|
||||
if (2 == err) { /* command not supported */
|
||||
if ((err = scsiReadDefect10(device, 0 /* req_plist */, 1 /* req_glist */,
|
||||
4 /* format: bytes from index */, gBuf, 4))) {
|
||||
if (scsi_debugmode > 0) {
|
||||
print_on();
|
||||
pout("Read defect list (10) Failed: %s\n", scsiErrString(err));
|
||||
print_off();
|
||||
}
|
||||
return;
|
||||
} else
|
||||
got_rd12 = 0;
|
||||
} else {
|
||||
if (scsi_debugmode > 0) {
|
||||
print_on();
|
||||
pout("Read defect list (12) Failed: %s\n", scsiErrString(err));
|
||||
print_off();
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else
|
||||
got_rd12 = 1;
|
||||
|
||||
if (got_rd12) {
|
||||
generation = (gBuf[2] << 8) + gBuf[3];
|
||||
if ((generation > 1) && (scsi_debugmode > 0)) {
|
||||
print_on();
|
||||
pout("Read defect list (10) Failed: %s\n", scsiErrString(err));
|
||||
pout("Read defect list (12): generation=%d\n", generation);
|
||||
print_off();
|
||||
}
|
||||
return;
|
||||
dl_len = (gBuf[4] << 24) + (gBuf[5] << 16) + (gBuf[6] << 8) + gBuf[7];
|
||||
} else {
|
||||
dl_len = (gBuf[2] << 8) + gBuf[3];
|
||||
}
|
||||
if (0x8 != (gBuf[1] & 0x18)) {
|
||||
print_on();
|
||||
@ -340,6 +373,11 @@ static void scsiPrintGrownDefectListLen(scsi_device * device)
|
||||
case 0: /* short block */
|
||||
div = 4;
|
||||
break;
|
||||
case 1: /* extended bytes from index */
|
||||
case 2: /* extended physical sector */
|
||||
/* extended = 1; # might use in future */
|
||||
div = 8;
|
||||
break;
|
||||
case 3: /* long block */
|
||||
case 4: /* bytes from index */
|
||||
case 5: /* physical sector */
|
||||
@ -351,19 +389,19 @@ static void scsiPrintGrownDefectListLen(scsi_device * device)
|
||||
print_off();
|
||||
break;
|
||||
}
|
||||
dl_len = (gBuf[2] << 8) + gBuf[3];
|
||||
if (0 == dl_len)
|
||||
pout("Elements in grown defect list: 0\n");
|
||||
pout("Elements in grown defect list: 0\n\n");
|
||||
else {
|
||||
if (0 == div)
|
||||
pout("Grown defect list length=%d bytes [unknown "
|
||||
"number of elements]\n", dl_len);
|
||||
pout("Grown defect list length=%u bytes [unknown "
|
||||
"number of elements]\n\n", dl_len);
|
||||
else
|
||||
pout("Elements in grown defect list: %d\n", dl_len / div);
|
||||
pout("Elements in grown defect list: %u\n\n", dl_len / div);
|
||||
}
|
||||
}
|
||||
|
||||
static void scsiPrintSeagateCacheLPage(scsi_device * device)
|
||||
static void
|
||||
scsiPrintSeagateCacheLPage(scsi_device * device)
|
||||
{
|
||||
int k, j, num, pl, pc, err, len;
|
||||
unsigned char * ucp;
|
||||
@ -436,9 +474,11 @@ static void scsiPrintSeagateCacheLPage(scsi_device * device)
|
||||
num -= pl;
|
||||
ucp += pl;
|
||||
}
|
||||
pout("\n");
|
||||
}
|
||||
|
||||
static void scsiPrintSeagateFactoryLPage(scsi_device * device)
|
||||
static void
|
||||
scsiPrintSeagateFactoryLPage(scsi_device * device)
|
||||
{
|
||||
int k, j, num, pl, pc, len, err, good, bad;
|
||||
unsigned char * ucp;
|
||||
@ -530,9 +570,11 @@ static void scsiPrintSeagateFactoryLPage(scsi_device * device)
|
||||
num -= pl;
|
||||
ucp += pl;
|
||||
}
|
||||
pout("\n");
|
||||
}
|
||||
|
||||
static void scsiPrintErrorCounterLog(scsi_device * device)
|
||||
static void
|
||||
scsiPrintErrorCounterLog(scsi_device * device)
|
||||
{
|
||||
struct scsiErrorCounter errCounterArr[3];
|
||||
struct scsiErrorCounter * ecp;
|
||||
@ -563,7 +605,7 @@ static void scsiPrintErrorCounterLog(scsi_device * device)
|
||||
}
|
||||
}
|
||||
if (found[0] || found[1] || found[2]) {
|
||||
pout("\nError counter log:\n");
|
||||
pout("Error counter log:\n");
|
||||
pout(" Errors Corrected by Total "
|
||||
"Correction Gigabytes Total\n");
|
||||
pout(" ECC rereads/ errors "
|
||||
@ -582,7 +624,7 @@ static void scsiPrintErrorCounterLog(scsi_device * device)
|
||||
}
|
||||
}
|
||||
else
|
||||
pout("\nError Counter logging not supported\n");
|
||||
pout("Error Counter logging not supported\n");
|
||||
if (gNonMediumELPage && (0 == scsiLogSense(device,
|
||||
NON_MEDIUM_ERROR_LPAGE, 0, gBuf, LOG_RESP_LEN, 0))) {
|
||||
scsiDecodeNonMediumErrPage(gBuf, &nme);
|
||||
@ -636,6 +678,7 @@ static void scsiPrintErrorCounterLog(scsi_device * device)
|
||||
"bytes\n", LOG_RESP_LONG_LEN, truncated);
|
||||
}
|
||||
}
|
||||
pout("\n");
|
||||
}
|
||||
|
||||
static const char * self_test_code[] = {
|
||||
@ -672,13 +715,23 @@ static const char * self_test_result[] = {
|
||||
// Returns 0 if ok else FAIL* bitmask. Note that if any of the most recent
|
||||
// 20 self tests fail (result code 3 to 7 inclusive) then FAILLOG and/or
|
||||
// FAILSMART is returned.
|
||||
static int scsiPrintSelfTest(scsi_device * device)
|
||||
static int
|
||||
scsiPrintSelfTest(scsi_device * device)
|
||||
{
|
||||
int num, k, n, res, err, durationSec;
|
||||
int noheader = 1;
|
||||
int retval = 0;
|
||||
UINT8 * ucp;
|
||||
uint64_t ull=0;
|
||||
struct scsi_sense_disect sense_info;
|
||||
|
||||
// check if test is running
|
||||
if (!scsiRequestSense(device, &sense_info) &&
|
||||
(sense_info.asc == 0x04 && sense_info.ascq == 0x09 &&
|
||||
sense_info.progress != -1)) {
|
||||
pout("Self-test execution status:\t\t%d%% of test remaining\n",
|
||||
100 - ((sense_info.progress * 100) / 65535));
|
||||
}
|
||||
|
||||
if ((err = scsiLogSense(device, SELFTEST_RESULTS_LPAGE, 0, gBuf,
|
||||
LOG_RESP_SELF_TEST_LEN, 0))) {
|
||||
@ -716,7 +769,7 @@ static int scsiPrintSelfTest(scsi_device * device)
|
||||
|
||||
// only print header if needed
|
||||
if (noheader) {
|
||||
pout("\nSMART Self-test log\n");
|
||||
pout("SMART Self-test log\n");
|
||||
pout("Num Test Status segment "
|
||||
"LifeTime LBA_first_err [SK ASC ASQ]\n");
|
||||
pout(" Description number "
|
||||
@ -808,12 +861,12 @@ static int scsiPrintSelfTest(scsi_device * device)
|
||||
if (noheader)
|
||||
pout("No self-tests have been logged\n");
|
||||
else
|
||||
pout("\n");
|
||||
if ((0 == scsiFetchExtendedSelfTestTime(device, &durationSec,
|
||||
modese_len)) && (durationSec > 0)) {
|
||||
pout("Long (extended) Self Test duration: %d seconds "
|
||||
"[%.1f minutes]\n", durationSec, durationSec / 60.0);
|
||||
}
|
||||
pout("\n");
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -845,7 +898,8 @@ static const char * reassign_status[] = {
|
||||
// Returns 0 if ok else FAIL* bitmask. Note can have a status entry
|
||||
// and up to 2048 events (although would hope to have less). May set
|
||||
// FAILLOG if serious errors detected (in the future).
|
||||
static int scsiPrintBackgroundResults(scsi_device * device)
|
||||
static int
|
||||
scsiPrintBackgroundResults(scsi_device * device)
|
||||
{
|
||||
int num, j, m, err, pc, pl, truncated;
|
||||
int noheader = 1;
|
||||
@ -888,7 +942,7 @@ static int scsiPrintBackgroundResults(scsi_device * device)
|
||||
case 0:
|
||||
if (noheader) {
|
||||
noheader = 0;
|
||||
pout("\nBackground scan results log\n");
|
||||
pout("Background scan results log\n");
|
||||
}
|
||||
pout(" Status: ");
|
||||
if ((pl < 16) || (num < 16)) {
|
||||
@ -945,6 +999,7 @@ static int scsiPrintBackgroundResults(scsi_device * device)
|
||||
if (truncated)
|
||||
pout(" >>>> log truncated, fetched %d of %d available "
|
||||
"bytes\n", LOG_RESP_LONG_LEN, truncated);
|
||||
pout("\n");
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -952,7 +1007,8 @@ static int scsiPrintBackgroundResults(scsi_device * device)
|
||||
// Returns 0 if ok else FAIL* bitmask. Note can have a status entry
|
||||
// and up to 2048 events (although would hope to have less). May set
|
||||
// FAILLOG if serious errors detected (in the future).
|
||||
static int scsiPrintSSMedia(scsi_device * device)
|
||||
static int
|
||||
scsiPrintSSMedia(scsi_device * device)
|
||||
{
|
||||
int num, err, pc, pl, truncated;
|
||||
int retval = 0;
|
||||
@ -990,14 +1046,14 @@ static int scsiPrintSSMedia(scsi_device * device)
|
||||
pl = ucp[3] + 4;
|
||||
switch (pc) {
|
||||
case 1:
|
||||
if (pl < 8) {
|
||||
if (pl < 8) {
|
||||
print_on();
|
||||
pout("Percentage used endurance indicator too short (pl=%d)\n", pl);
|
||||
print_off();
|
||||
return FAILSMART;
|
||||
}
|
||||
}
|
||||
pout("SS Media used endurance indicator: %d%%\n", ucp[7]);
|
||||
default: /* ignore other parameter codes */
|
||||
default: /* ignore other parameter codes */
|
||||
break;
|
||||
}
|
||||
num -= pl;
|
||||
@ -1006,8 +1062,8 @@ static int scsiPrintSSMedia(scsi_device * device)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void show_sas_phy_event_info(int peis, unsigned int val,
|
||||
unsigned thresh_val)
|
||||
static void
|
||||
show_sas_phy_event_info(int peis, unsigned int val, unsigned thresh_val)
|
||||
{
|
||||
unsigned int u;
|
||||
|
||||
@ -1137,7 +1193,8 @@ static void show_sas_phy_event_info(int peis, unsigned int val,
|
||||
}
|
||||
}
|
||||
|
||||
static void show_sas_port_param(unsigned char * ucp, int param_len)
|
||||
static void
|
||||
show_sas_port_param(unsigned char * ucp, int param_len)
|
||||
{
|
||||
int j, m, n, nphys, t, sz, spld_len;
|
||||
unsigned char * vcp;
|
||||
@ -1268,7 +1325,8 @@ static void show_sas_port_param(unsigned char * ucp, int param_len)
|
||||
}
|
||||
|
||||
// Returns 1 if okay, 0 if non SAS descriptors
|
||||
static int show_protocol_specific_page(unsigned char * resp, int len)
|
||||
static int
|
||||
show_protocol_specific_page(unsigned char * resp, int len)
|
||||
{
|
||||
int k, num, param_len;
|
||||
unsigned char * ucp;
|
||||
@ -1284,6 +1342,7 @@ static int show_protocol_specific_page(unsigned char * resp, int len)
|
||||
k += param_len;
|
||||
ucp += param_len;
|
||||
}
|
||||
pout("\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1294,20 +1353,21 @@ static int show_protocol_specific_page(unsigned char * resp, int len)
|
||||
// Returns 0 if ok else FAIL* bitmask. Note that if any of the most recent
|
||||
// 20 self tests fail (result code 3 to 7 inclusive) then FAILLOG and/or
|
||||
// FAILSMART is returned.
|
||||
static int scsiPrintSasPhy(scsi_device * device, int reset)
|
||||
static int
|
||||
scsiPrintSasPhy(scsi_device * device, int reset)
|
||||
{
|
||||
int num, err;
|
||||
|
||||
if ((err = scsiLogSense(device, PROTOCOL_SPECIFIC_LPAGE, 0, gBuf,
|
||||
LOG_RESP_LONG_LEN, 0))) {
|
||||
print_on();
|
||||
pout("scsiPrintSasPhy Log Sense Failed [%s]\n", scsiErrString(err));
|
||||
pout("scsiPrintSasPhy Log Sense Failed [%s]\n\n", scsiErrString(err));
|
||||
print_off();
|
||||
return FAILSMART;
|
||||
}
|
||||
if ((gBuf[0] & 0x3f) != PROTOCOL_SPECIFIC_LPAGE) {
|
||||
print_on();
|
||||
pout("Protocol specific Log Sense Failed, page mismatch\n");
|
||||
pout("Protocol specific Log Sense Failed, page mismatch\n\n");
|
||||
print_off();
|
||||
return FAILSMART;
|
||||
}
|
||||
@ -1315,7 +1375,7 @@ static int scsiPrintSasPhy(scsi_device * device, int reset)
|
||||
num = (gBuf[2] << 8) + gBuf[3];
|
||||
if (1 != show_protocol_specific_page(gBuf, num + 4)) {
|
||||
print_on();
|
||||
pout("Only support protocol specific log page on SAS devices\n");
|
||||
pout("Only support protocol specific log page on SAS devices\n\n");
|
||||
print_off();
|
||||
return FAILSMART;
|
||||
}
|
||||
@ -1323,7 +1383,7 @@ static int scsiPrintSasPhy(scsi_device * device, int reset)
|
||||
if ((err = scsiLogSelect(device, 1 /* pcr */, 0 /* sp */, 0 /* pc */,
|
||||
PROTOCOL_SPECIFIC_LPAGE, 0, NULL, 0))) {
|
||||
print_on();
|
||||
pout("scsiPrintSasPhy Log Select (reset) Failed [%s]\n",
|
||||
pout("scsiPrintSasPhy Log Select (reset) Failed [%s]\n\n",
|
||||
scsiErrString(err));
|
||||
print_off();
|
||||
return FAILSMART;
|
||||
@ -1372,15 +1432,18 @@ static const char * transport_proto_arr[] = {
|
||||
};
|
||||
|
||||
/* Returns 0 on success, 1 on general error and 2 for early, clean exit */
|
||||
static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool all)
|
||||
static int
|
||||
scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool all)
|
||||
{
|
||||
char timedatetz[DATEANDEPOCHLEN];
|
||||
struct scsi_iec_mode_page iec;
|
||||
int err, iec_err, len, req_len, avail_len;
|
||||
int err, iec_err, len, req_len, avail_len, n;
|
||||
int is_tape = 0;
|
||||
int peri_dt = 0;
|
||||
int returnval = 0;
|
||||
int transport = -1;
|
||||
int form_factor = 0;
|
||||
int protect = 0;
|
||||
|
||||
memset(gBuf, 0, 96);
|
||||
req_len = 36;
|
||||
@ -1411,11 +1474,18 @@ static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool
|
||||
print_off();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (all && (0 != strncmp((char *)&gBuf[8], "ATA", 3))) {
|
||||
pout("Vendor: %.8s\n", (char *)&gBuf[8]);
|
||||
pout("Product: %.16s\n", (char *)&gBuf[16]);
|
||||
if (gBuf[32] >= ' ')
|
||||
pout("Revision: %.4s\n", (char *)&gBuf[32]);
|
||||
char vendor[8+1], product[16+1], revision[4+1];
|
||||
scsi_format_id_string(vendor, (const unsigned char *)&gBuf[8], 8);
|
||||
scsi_format_id_string(product, (const unsigned char *)&gBuf[16], 16);
|
||||
scsi_format_id_string(revision, (const unsigned char *)&gBuf[32], 4);
|
||||
|
||||
pout("=== START OF INFORMATION SECTION ===\n");
|
||||
pout("Vendor: %.8s\n", vendor);
|
||||
pout("Product: %.16s\n", product);
|
||||
if (gBuf[32] >= ' ')
|
||||
pout("Revision: %.4s\n", revision);
|
||||
}
|
||||
|
||||
if (!*device->get_req_type()/*no type requested*/ &&
|
||||
@ -1427,18 +1497,122 @@ static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool
|
||||
if (! all)
|
||||
return 0;
|
||||
|
||||
unsigned int lb_size;
|
||||
char cap_str[64];
|
||||
char si_str[64];
|
||||
char lb_str[16];
|
||||
uint64_t capacity = scsiGetSize(device, &lb_size);
|
||||
protect = gBuf[5] & 0x1; /* from and including SPC-3 */
|
||||
|
||||
if (capacity) {
|
||||
format_with_thousands_sep(cap_str, sizeof(cap_str), capacity);
|
||||
format_capacity(si_str, sizeof(si_str), capacity);
|
||||
pout("User Capacity: %s bytes [%s]\n", cap_str, si_str);
|
||||
snprintf(lb_str, sizeof(lb_str) - 1, "%u", lb_size);
|
||||
pout("Logical block size: %s bytes\n", lb_str);
|
||||
if (! is_tape) { /* only do this for disks */
|
||||
unsigned int lb_size = 0;
|
||||
unsigned char lb_prov_resp[8];
|
||||
char cap_str[64];
|
||||
char si_str[64];
|
||||
char lb_str[16];
|
||||
int lb_per_pb_exp = 0;
|
||||
uint64_t capacity = scsiGetSize(device, &lb_size, &lb_per_pb_exp);
|
||||
|
||||
if (capacity) {
|
||||
format_with_thousands_sep(cap_str, sizeof(cap_str), capacity);
|
||||
format_capacity(si_str, sizeof(si_str), capacity);
|
||||
pout("User Capacity: %s bytes [%s]\n", cap_str, si_str);
|
||||
snprintf(lb_str, sizeof(lb_str) - 1, "%u", lb_size);
|
||||
pout("Logical block size: %s bytes\n", lb_str);
|
||||
}
|
||||
int lbpme = -1;
|
||||
int lbprz = -1;
|
||||
if (protect || lb_per_pb_exp) {
|
||||
unsigned char rc16_12[20] = {0, };
|
||||
|
||||
if (0 == scsiGetProtPBInfo(device, rc16_12)) {
|
||||
lb_per_pb_exp = rc16_12[1] & 0xf; /* just in case */
|
||||
if (lb_per_pb_exp > 0) {
|
||||
snprintf(lb_str, sizeof(lb_str) - 1, "%u",
|
||||
(lb_size * (1 << lb_per_pb_exp)));
|
||||
pout("Physical block size: %s bytes\n", lb_str);
|
||||
n = ((rc16_12[2] & 0x3f) << 8) + rc16_12[3];
|
||||
pout("Lowest aligned LBA: %d\n", n);
|
||||
}
|
||||
if (rc16_12[0] & 0x1) { /* PROT_EN set */
|
||||
int p_type = ((rc16_12[0] >> 1) & 0x7);
|
||||
|
||||
switch (p_type) {
|
||||
case 0 :
|
||||
pout("Formatted with type 1 protection\n");
|
||||
break;
|
||||
case 1 :
|
||||
pout("Formatted with type 2 protection\n");
|
||||
break;
|
||||
case 2 :
|
||||
pout("Formatted with type 3 protection\n");
|
||||
break;
|
||||
default:
|
||||
pout("Formatted with unknown protection type [%d]\n",
|
||||
p_type);
|
||||
break;
|
||||
}
|
||||
int p_i_exp = ((rc16_12[1] >> 4) & 0xf);
|
||||
|
||||
if (p_i_exp > 0)
|
||||
pout("%d protection information intervals per "
|
||||
"logical block\n", (1 << p_i_exp));
|
||||
}
|
||||
/* Pick up some LB provisioning info since its available */
|
||||
lbpme = !! (rc16_12[2] & 0x80);
|
||||
lbprz = !! (rc16_12[2] & 0x40);
|
||||
}
|
||||
}
|
||||
if (0 == scsiInquiryVpd(device, SCSI_VPD_LOGICAL_BLOCK_PROVISIONING,
|
||||
lb_prov_resp, sizeof(lb_prov_resp))) {
|
||||
int prov_type = lb_prov_resp[6] & 0x7;
|
||||
|
||||
if (-1 == lbprz)
|
||||
lbprz = !! (lb_prov_resp[5] & 0x4);
|
||||
switch (prov_type) {
|
||||
case 0:
|
||||
pout("Logical block provisioning type unreported, "
|
||||
"LBPME=%d, LBPRZ=%d\n", lbpme, lbprz);
|
||||
break;
|
||||
case 1:
|
||||
pout("LU is resource provisioned, LBPRZ=%d\n", lbprz);
|
||||
break;
|
||||
case 2:
|
||||
pout("LU is thin provisioned, LBPRZ=%d\n", lbprz);
|
||||
break;
|
||||
default:
|
||||
pout("LU provisioning type reserved [%d], LBPRZ=%d\n",
|
||||
prov_type, lbprz);
|
||||
break;
|
||||
}
|
||||
} else if (1 == lbpme)
|
||||
pout("Logical block provisioning enabled, LBPRZ=%d\n", lbprz);
|
||||
|
||||
int rpm = scsiGetRPM(device, modese_len, &form_factor);
|
||||
if (rpm > 0) {
|
||||
if (1 == rpm)
|
||||
pout("Rotation Rate: Solid State Device\n");
|
||||
else
|
||||
pout("Rotation Rate: %d rpm\n", rpm);
|
||||
}
|
||||
if (form_factor > 0) {
|
||||
const char * cp = NULL;
|
||||
|
||||
switch (form_factor) {
|
||||
case 1:
|
||||
cp = "5.25";
|
||||
break;
|
||||
case 2:
|
||||
cp = "3.5";
|
||||
break;
|
||||
case 3:
|
||||
cp = "2.5";
|
||||
break;
|
||||
case 4:
|
||||
cp = "1.8";
|
||||
break;
|
||||
case 5:
|
||||
cp = "< 1.8";
|
||||
break;
|
||||
}
|
||||
if (cp)
|
||||
pout("Form Factor: %s inches\n", cp);
|
||||
}
|
||||
}
|
||||
|
||||
/* Do this here to try and detect badly conforming devices (some USB
|
||||
@ -1455,12 +1629,13 @@ static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool
|
||||
modese_len = iec.modese_len;
|
||||
|
||||
if (! dont_print_serial_number) {
|
||||
if (0 == (err = scsiInquiryVpd(device, 0x83, gBuf, 200))) {
|
||||
char s[256];
|
||||
if (0 == (err = scsiInquiryVpd(device, SCSI_VPD_DEVICE_IDENTIFICATION,
|
||||
gBuf, 252))) {
|
||||
char s[256];
|
||||
|
||||
len = gBuf[3];
|
||||
scsi_decode_lu_dev_id(gBuf + 4, len, s, sizeof(s), &transport);
|
||||
if (strlen(s) > 0)
|
||||
scsi_decode_lu_dev_id(gBuf + 4, len, s, sizeof(s), &transport);
|
||||
if (strlen(s) > 0)
|
||||
pout("Logical Unit id: %s\n", s);
|
||||
} else if (scsi_debugmode > 0) {
|
||||
print_on();
|
||||
@ -1470,10 +1645,14 @@ static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool
|
||||
pout("Vital Product Data (VPD) INQUIRY failed [%d]\n", err);
|
||||
print_off();
|
||||
}
|
||||
if (0 == (err = scsiInquiryVpd(device, 0x80, gBuf, 64))) {
|
||||
if (0 == (err = scsiInquiryVpd(device, SCSI_VPD_UNIT_SERIAL_NUMBER,
|
||||
gBuf, 252))) {
|
||||
char serial[256];
|
||||
len = gBuf[3];
|
||||
|
||||
gBuf[4 + len] = '\0';
|
||||
pout("Serial number: %s\n", &gBuf[4]);
|
||||
scsi_format_id_string(serial, &gBuf[4], len);
|
||||
pout("Serial number: %s\n", serial);
|
||||
} else if (scsi_debugmode > 0) {
|
||||
print_on();
|
||||
if (SIMPLE_ERR_BAD_RESP == err)
|
||||
@ -1532,11 +1711,9 @@ static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool
|
||||
if (iec_err) {
|
||||
if (!is_tape) {
|
||||
print_on();
|
||||
pout("Device does not support SMART");
|
||||
pout("SMART support is: Unavailable - device lacks SMART capability.\n");
|
||||
if (scsi_debugmode > 0)
|
||||
pout(" [%s]\n", scsiErrString(iec_err));
|
||||
else
|
||||
pout("\n");
|
||||
print_off();
|
||||
}
|
||||
gIecMPage = 0;
|
||||
@ -1544,15 +1721,17 @@ static int scsiGetDriveInfo(scsi_device * device, UINT8 * peripheral_type, bool
|
||||
}
|
||||
|
||||
if (!is_tape)
|
||||
pout("Device supports SMART and is %s\n",
|
||||
pout("SMART support is: Available - device has SMART capability.\n"
|
||||
"SMART support is: %s\n",
|
||||
(scsi_IsExceptionControlEnabled(&iec)) ? "Enabled" : "Disabled");
|
||||
pout("%s\n", (scsi_IsWarningEnabled(&iec)) ?
|
||||
"Temperature Warning Enabled" :
|
||||
"Temperature Warning Disabled or Not Supported");
|
||||
"Temperature Warning: Enabled" :
|
||||
"Temperature Warning: Disabled or Not Supported");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scsiSmartEnable(scsi_device * device)
|
||||
static int
|
||||
scsiSmartEnable(scsi_device * device)
|
||||
{
|
||||
struct scsi_iec_mode_page iec;
|
||||
int err;
|
||||
@ -1588,7 +1767,8 @@ static int scsiSmartEnable(scsi_device * device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scsiSmartDisable(scsi_device * device)
|
||||
static int
|
||||
scsiSmartDisable(scsi_device * device)
|
||||
{
|
||||
struct scsi_iec_mode_page iec;
|
||||
int err;
|
||||
@ -1624,7 +1804,8 @@ static int scsiSmartDisable(scsi_device * device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void scsiPrintTemp(scsi_device * device)
|
||||
static void
|
||||
scsiPrintTemp(scsi_device * device)
|
||||
{
|
||||
UINT8 temp = 0;
|
||||
UINT8 trip = 0;
|
||||
@ -1640,37 +1821,76 @@ static void scsiPrintTemp(scsi_device * device)
|
||||
}
|
||||
if (trip)
|
||||
pout("Drive Trip Temperature: %d C\n", trip);
|
||||
if (temp || trip)
|
||||
pout("\n");
|
||||
}
|
||||
|
||||
/* Main entry point used by smartctl command. Return 0 for success */
|
||||
int scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
int
|
||||
scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
{
|
||||
int checkedSupportedLogPages = 0;
|
||||
UINT8 peripheral_type = 0;
|
||||
int returnval = 0;
|
||||
int res, durationSec;
|
||||
struct scsi_sense_disect sense_info;
|
||||
|
||||
bool any_output = options.drive_info;
|
||||
|
||||
if (supported_vpd_pages_p) {
|
||||
delete supported_vpd_pages_p;
|
||||
supported_vpd_pages_p = NULL;
|
||||
}
|
||||
supported_vpd_pages_p = new supported_vpd_pages(device);
|
||||
|
||||
res = scsiGetDriveInfo(device, &peripheral_type, options.drive_info);
|
||||
if (res) {
|
||||
if (2 == res)
|
||||
return 0;
|
||||
else
|
||||
failuretest(MANDATORY_CMD, returnval |= FAILID);
|
||||
any_output = true;
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
// Print read look-ahead status for disks
|
||||
short int wce = -1, rcd = -1;
|
||||
if (options.get_rcd || options.get_wce) {
|
||||
if (SCSI_PT_DIRECT_ACCESS == peripheral_type)
|
||||
res = scsiGetSetCache(device, modese_len, &wce, &rcd);
|
||||
else
|
||||
res = -1; // fetch for disks only
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
if (options.get_rcd) {
|
||||
pout("Read Cache is: %s\n",
|
||||
res ? "Unavailable" : // error
|
||||
rcd ? "Disabled" : "Enabled");
|
||||
}
|
||||
|
||||
if (options.get_wce) {
|
||||
pout("Writeback Cache is: %s\n",
|
||||
res ? "Unavailable" : // error
|
||||
!wce ? "Disabled" : "Enabled");
|
||||
}
|
||||
if (options.drive_info)
|
||||
pout("\n");
|
||||
|
||||
// START OF THE ENABLE/DISABLE SECTION OF THE CODE
|
||||
if ( options.smart_disable || options.smart_enable
|
||||
|| options.smart_auto_save_disable || options.smart_auto_save_enable)
|
||||
pout("=== START OF ENABLE/DISABLE COMMANDS SECTION ===\n");
|
||||
|
||||
if (options.smart_enable) {
|
||||
if (scsiSmartEnable(device))
|
||||
failuretest(MANDATORY_CMD, returnval |= FAILSMART);
|
||||
any_output = true;
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
if (options.smart_disable) {
|
||||
if (scsiSmartDisable(device))
|
||||
failuretest(MANDATORY_CMD,returnval |= FAILSMART);
|
||||
any_output = true;
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
if (options.smart_auto_save_enable) {
|
||||
@ -1678,6 +1898,38 @@ int scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
pout("Enable autosave (clear GLTSD bit) failed\n");
|
||||
failuretest(OPTIONAL_CMD,returnval |= FAILSMART);
|
||||
}
|
||||
else {
|
||||
pout("Autosave enabled (GLTSD bit set).\n");
|
||||
}
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
// Enable/Disable write cache
|
||||
if (options.set_wce && SCSI_PT_DIRECT_ACCESS == peripheral_type) {
|
||||
short int enable = wce = (options.set_wce > 0);
|
||||
rcd = -1;
|
||||
if (scsiGetSetCache(device, modese_len, &wce, &rcd)) {
|
||||
pout("Write cache %sable failed: %s\n", (enable ? "en" : "dis"),
|
||||
device->get_errmsg());
|
||||
failuretest(OPTIONAL_CMD,returnval |= FAILSMART);
|
||||
}
|
||||
else
|
||||
pout("Write cache %sabled\n", (enable ? "en" : "dis"));
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
// Enable/Disable read cache
|
||||
if (options.set_rcd && SCSI_PT_DIRECT_ACCESS == peripheral_type) {
|
||||
short int enable = (options.set_rcd > 0);
|
||||
rcd = !enable;
|
||||
wce = -1;
|
||||
if (scsiGetSetCache(device, modese_len, &wce, &rcd)) {
|
||||
pout("Read cache %sable failed: %s\n", (enable ? "en" : "dis"),
|
||||
device->get_errmsg());
|
||||
failuretest(OPTIONAL_CMD,returnval |= FAILSMART);
|
||||
}
|
||||
else
|
||||
pout("Read cache %sabled\n", (enable ? "en" : "dis"));
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
@ -1686,8 +1938,22 @@ int scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
pout("Disable autosave (set GLTSD bit) failed\n");
|
||||
failuretest(OPTIONAL_CMD,returnval |= FAILSMART);
|
||||
}
|
||||
else {
|
||||
pout("Autosave disabled (GLTSD bit cleared).\n");
|
||||
}
|
||||
any_output = true;
|
||||
}
|
||||
if ( options.smart_disable || options.smart_enable
|
||||
|| options.smart_auto_save_disable || options.smart_auto_save_enable)
|
||||
pout("\n"); // END OF THE ENABLE/DISABLE SECTION OF THE CODE
|
||||
|
||||
// START OF READ-ONLY OPTIONS APART FROM -V and -i
|
||||
if ( options.smart_check_status || options.smart_ss_media_log
|
||||
|| options.smart_vendor_attrib || options.smart_error_log
|
||||
|| options.smart_selftest_log || options.smart_vendor_attrib
|
||||
|| options.smart_background_log || options.sasphy
|
||||
)
|
||||
pout("=== START OF READ SMART DATA SECTION ===\n");
|
||||
|
||||
if (options.smart_check_status) {
|
||||
scsiGetSupportedLogPages(device);
|
||||
@ -1712,6 +1978,7 @@ int scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
}
|
||||
any_output = true;
|
||||
}
|
||||
|
||||
if (options.smart_ss_media_log) {
|
||||
if (! checkedSupportedLogPages)
|
||||
scsiGetSupportedLogPages(device);
|
||||
@ -1726,8 +1993,6 @@ int scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
if (! checkedSupportedLogPages)
|
||||
scsiGetSupportedLogPages(device);
|
||||
if (gTempLPage) {
|
||||
if (options.smart_check_status)
|
||||
pout("\n");
|
||||
scsiPrintTemp(device);
|
||||
}
|
||||
if (gStartStopLPage)
|
||||
@ -1790,6 +2055,24 @@ int scsiPrintMain(scsi_device * device, const scsi_print_options & options)
|
||||
pout("Short Foreground Self Test Successful\n");
|
||||
any_output = true;
|
||||
}
|
||||
// check if another test is running
|
||||
if (options.smart_short_selftest || options.smart_extend_selftest) {
|
||||
if (!scsiRequestSense(device, &sense_info) &&
|
||||
(sense_info.asc == 0x04 && sense_info.ascq == 0x09)) {
|
||||
if (!options.smart_selftest_force) {
|
||||
pout("Can't start self-test without aborting current test");
|
||||
if (sense_info.progress != -1) {
|
||||
pout(" (%d%% remaining)",
|
||||
100 - sense_info.progress * 100 / 65535);
|
||||
}
|
||||
pout(",\nadd '-t force' option to override, or run 'smartctl -X' "
|
||||
"to abort test.\n");
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
scsiSmartSelfTestAbort(device);
|
||||
}
|
||||
}
|
||||
if (options.smart_short_selftest) {
|
||||
if (scsiSmartShortSelfTest(device))
|
||||
return returnval | FAILSMART;
|
||||
|
17
scsiprint.h
17
scsiprint.h
@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
|
||||
*
|
||||
* Additional SCSI work:
|
||||
* Copyright (C) 2003-10 Douglas Gilbert <dgilbert@interlog.com>
|
||||
* Copyright (C) 2003-13 Douglas Gilbert <dgilbert@interlog.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -15,8 +15,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -29,7 +29,7 @@
|
||||
#ifndef SCSI_PRINT_H_
|
||||
#define SCSI_PRINT_H_
|
||||
|
||||
#define SCSIPRINT_H_CVSID "$Id: scsiprint.h 3413 2011-09-06 21:23:00Z dpgilbert $\n"
|
||||
#define SCSIPRINT_H_CVSID "$Id: scsiprint.h 3776 2013-02-17 04:25:42Z dpgilbert $\n"
|
||||
|
||||
// Options for scsiPrintMain
|
||||
struct scsi_print_options
|
||||
@ -49,9 +49,13 @@ struct scsi_print_options
|
||||
bool smart_short_selftest, smart_short_cap_selftest;
|
||||
bool smart_extend_selftest, smart_extend_cap_selftest;
|
||||
bool smart_selftest_abort;
|
||||
bool smart_selftest_force; // Ignore already running test
|
||||
|
||||
bool sasphy, sasphy_reset;
|
||||
|
||||
bool get_wce, get_rcd;
|
||||
short int set_wce, set_rcd; // disable(-1), enable(1) cache
|
||||
|
||||
scsi_print_options()
|
||||
: drive_info(false),
|
||||
smart_check_status(false),
|
||||
@ -66,7 +70,10 @@ struct scsi_print_options
|
||||
smart_short_selftest(false), smart_short_cap_selftest(false),
|
||||
smart_extend_selftest(false), smart_extend_cap_selftest(false),
|
||||
smart_selftest_abort(false),
|
||||
sasphy(false), sasphy_reset(false)
|
||||
smart_selftest_force(false),
|
||||
sasphy(false), sasphy_reset(false),
|
||||
get_wce(false), get_rcd(false),
|
||||
set_wce(0), set_rcd(0)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
618
smartctl.8.in
618
smartctl.8.in
File diff suppressed because it is too large
Load Diff
124
smartctl.cpp
124
smartctl.cpp
@ -13,8 +13,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -41,10 +40,6 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if defined(__QNXNTO__)
|
||||
#include <new> // TODO: Why is this include necessary on QNX ?
|
||||
#endif
|
||||
|
||||
#include "int64.h"
|
||||
#include "atacmds.h"
|
||||
#include "dev_interface.h"
|
||||
@ -55,7 +50,7 @@
|
||||
#include "smartctl.h"
|
||||
#include "utility.h"
|
||||
|
||||
const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 3531 2012-03-27 20:02:25Z chrfranke $"
|
||||
const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 3726 2012-12-12 20:02:48Z chrfranke $"
|
||||
CONFIG_H_CVSID SMARTCTL_H_CVSID;
|
||||
|
||||
// Globals to control printing
|
||||
@ -87,8 +82,10 @@ static void Usage()
|
||||
" Print license, copyright, and version information and exit\n\n"
|
||||
" -i, --info\n"
|
||||
" Show identity information for device\n\n"
|
||||
" --identify[=[w][nvb]]\n"
|
||||
" Show words and bits from IDENTIFY DEVICE data (ATA)\n\n"
|
||||
" -g NAME, --get=NAME\n"
|
||||
" Get device setting: all, aam, apm, lookahead, security, wcache\n\n"
|
||||
" Get device setting: all, aam, apm, lookahead, security, wcache, rcache\n\n"
|
||||
" -a, --all\n"
|
||||
" Show all SMART information for device\n\n"
|
||||
" -x, --xall\n"
|
||||
@ -124,7 +121,7 @@ static void Usage()
|
||||
" -s NAME[,VALUE], --set=NAME[,VALUE]\n"
|
||||
" Enable/disable/change device setting: aam,[N|off], apm,[N|off],\n"
|
||||
" lookahead,[on|off], security-freeze, standby,[N|off|now],\n"
|
||||
" wcache,[on|off]\n\n"
|
||||
" wcache,[on|off], rcache,[on|off]\n\n"
|
||||
);
|
||||
printf(
|
||||
"======================================= READ AND DISPLAY DATA OPTIONS =====\n\n"
|
||||
@ -146,13 +143,14 @@ static void Usage()
|
||||
" -v N,OPTION , --vendorattribute=N,OPTION (ATA)\n"
|
||||
" Set display OPTION for vendor Attribute N (see man page)\n\n"
|
||||
" -F TYPE, --firmwarebug=TYPE (ATA)\n"
|
||||
" Use firmware bug workaround: none, samsung, samsung2,\n"
|
||||
" samsung3, swapid\n\n"
|
||||
" Use firmware bug workaround:\n"
|
||||
" %s, swapid\n\n"
|
||||
" -P TYPE, --presets=TYPE (ATA)\n"
|
||||
" Drive-specific presets: use, ignore, show, showall\n\n"
|
||||
" -B [+]FILE, --drivedb=[+]FILE (ATA)\n"
|
||||
" Read and replace [add] drive database from FILE\n"
|
||||
" [default is +%s",
|
||||
get_valid_firmwarebug_args(),
|
||||
get_drivedb_path_add()
|
||||
);
|
||||
#ifdef SMARTMONTOOLS_DRIVEDBDIR
|
||||
@ -179,7 +177,7 @@ static void Usage()
|
||||
}
|
||||
|
||||
// Values for --long only options, see parse_options()
|
||||
enum { opt_scan = 1000, opt_scan_open, opt_set, opt_smart };
|
||||
enum { opt_identify = 1000, opt_scan, opt_scan_open, opt_set, opt_smart };
|
||||
|
||||
/* Returns a string containing a formatted list of the valid arguments
|
||||
to the option opt or empty on failure. Note 'v' case different */
|
||||
@ -214,18 +212,20 @@ static std::string getvalidarglist(int opt)
|
||||
return "offline, short, long, conveyance, force, vendor,N, select,M-N, "
|
||||
"pending,N, afterselect,[on|off]";
|
||||
case 'F':
|
||||
return "none, samsung, samsung2, samsung3, swapid";
|
||||
return std::string(get_valid_firmwarebug_args()) + ", swapid";
|
||||
case 'n':
|
||||
return "never, sleep, standby, idle";
|
||||
case 'f':
|
||||
return "old, brief, hex[,id|val]";
|
||||
case 'g':
|
||||
return "aam, apm, lookahead, security, wcache";
|
||||
return "aam, apm, lookahead, security, wcache, rcache";
|
||||
case opt_set:
|
||||
return "aam,[N|off], apm,[N|off], lookahead,[on|off], security-freeze, "
|
||||
"standby,[N|off|now], wcache,[on|off]";
|
||||
"standby,[N|off|now], wcache,[on|off], rcache,[on|off]";
|
||||
case 's':
|
||||
return getvalidarglist(opt_smart)+", "+getvalidarglist(opt_set);
|
||||
case opt_identify:
|
||||
return "n, wn, w, v, wv, wb";
|
||||
case 'v':
|
||||
default:
|
||||
return "";
|
||||
@ -300,6 +300,7 @@ static const char * parse_options(int argc, char** argv,
|
||||
{ "drivedb", required_argument, 0, 'B' },
|
||||
{ "format", required_argument, 0, 'f' },
|
||||
{ "get", required_argument, 0, 'g' },
|
||||
{ "identify", optional_argument, 0, opt_identify },
|
||||
{ "set", required_argument, 0, opt_set },
|
||||
{ "scan", no_argument, 0, opt_scan },
|
||||
{ "scan-open", no_argument, 0, opt_scan_open },
|
||||
@ -439,19 +440,10 @@ static const char * parse_options(int argc, char** argv,
|
||||
scsiopts.smart_ss_media_log = true;
|
||||
break;
|
||||
case 'F':
|
||||
if (!strcmp(optarg,"none")) {
|
||||
ataopts.fix_firmwarebug = FIX_NONE;
|
||||
} else if (!strcmp(optarg,"samsung")) {
|
||||
ataopts.fix_firmwarebug = FIX_SAMSUNG;
|
||||
} else if (!strcmp(optarg,"samsung2")) {
|
||||
ataopts.fix_firmwarebug = FIX_SAMSUNG2;
|
||||
} else if (!strcmp(optarg,"samsung3")) {
|
||||
ataopts.fix_firmwarebug = FIX_SAMSUNG3;
|
||||
} else if (!strcmp(optarg,"swapid")) {
|
||||
if (!strcmp(optarg, "swapid"))
|
||||
ataopts.fix_swapped_id = true;
|
||||
} else {
|
||||
else if (!parse_firmwarebug_def(optarg, ataopts.firmwarebugs))
|
||||
badarg = true;
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
ataopts.smart_general_values = true;
|
||||
@ -498,7 +490,7 @@ static const char * parse_options(int argc, char** argv,
|
||||
unsigned interval = 0; int n1 = -1, n2 = -1, len = strlen(optarg);
|
||||
if (!( sscanf(optarg,"scttempint,%u%n,p%n", &interval, &n1, &n2) == 1
|
||||
&& 0 < interval && interval <= 0xffff && (n1 == len || n2 == len))) {
|
||||
strcpy(extraerror, "Option -l scttempint,N[,p] must have positive integer N\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -l scttempint,N[,p] must have positive integer N\n");
|
||||
badarg = true;
|
||||
}
|
||||
ataopts.sct_temp_int = interval;
|
||||
@ -554,7 +546,7 @@ static const char * parse_options(int argc, char** argv,
|
||||
ataopts.sct_erc_writetime = wt;
|
||||
}
|
||||
else {
|
||||
sprintf(extraerror, "Option -l scterc,[READTIME,WRITETIME] syntax error\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -l scterc,[READTIME,WRITETIME] syntax error\n");
|
||||
badarg = true;
|
||||
}
|
||||
} else if ( !strncmp(optarg, "gplog," , sizeof("gplog," )-1)
|
||||
@ -570,14 +562,14 @@ static const char * parse_options(int argc, char** argv,
|
||||
const char * erropt = (gpl ? "gplog" : "smartlog");
|
||||
if (!( n1 == len || n2 == len
|
||||
|| (n3 == len && (sign == '+' || sign == '-')))) {
|
||||
sprintf(extraerror, "Option -l %s,ADDR[,FIRST[-LAST|+SIZE]] syntax error\n", erropt);
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -l %s,ADDR[,FIRST[-LAST|+SIZE]] syntax error\n", erropt);
|
||||
badarg = true;
|
||||
}
|
||||
else if (!( logaddr <= 0xff && page <= (gpl ? 0xffffU : 0x00ffU)
|
||||
&& 0 < nsectors
|
||||
&& (nsectors <= (gpl ? 0xffffU : 0xffU) || nsectors == ~0U)
|
||||
&& (sign != '-' || page <= nsectors) )) {
|
||||
sprintf(extraerror, "Option -l %s,ADDR[,FIRST[-LAST|+SIZE]] parameter out of range\n", erropt);
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -l %s,ADDR[,FIRST[-LAST|+SIZE]] parameter out of range\n", erropt);
|
||||
badarg = true;
|
||||
}
|
||||
else {
|
||||
@ -593,6 +585,22 @@ static const char * parse_options(int argc, char** argv,
|
||||
case 'i':
|
||||
ataopts.drive_info = scsiopts.drive_info = true;
|
||||
break;
|
||||
|
||||
case opt_identify:
|
||||
ataopts.identify_word_level = ataopts.identify_bit_level = 0;
|
||||
if (optarg) {
|
||||
for (int i = 0; optarg[i]; i++) {
|
||||
switch (optarg[i]) {
|
||||
case 'w': ataopts.identify_word_level = 1; break;
|
||||
case 'n': ataopts.identify_bit_level = -1; break;
|
||||
case 'v': ataopts.identify_bit_level = 1; break;
|
||||
case 'b': ataopts.identify_bit_level = 2; break;
|
||||
default: badarg = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
ataopts.drive_info = scsiopts.drive_info = true;
|
||||
ataopts.smart_check_status = scsiopts.smart_check_status = true;
|
||||
@ -618,11 +626,13 @@ static const char * parse_options(int argc, char** argv,
|
||||
ataopts.smart_logdir = ataopts.gp_logdir = true;
|
||||
ataopts.sct_temp_sts = ataopts.sct_temp_hist = true;
|
||||
ataopts.sct_erc_get = true;
|
||||
ataopts.devstat_all_pages = true;
|
||||
ataopts.sataphy = true;
|
||||
ataopts.get_set_used = true;
|
||||
ataopts.get_aam = ataopts.get_apm = true;
|
||||
ataopts.get_security = true;
|
||||
ataopts.get_lookahead = ataopts.get_wcache = true;
|
||||
scsiopts.get_rcd = scsiopts.get_wce = true;
|
||||
scsiopts.smart_background_log = true;
|
||||
scsiopts.smart_ss_media_log = true;
|
||||
scsiopts.sasphy = true;
|
||||
@ -680,6 +690,7 @@ static const char * parse_options(int argc, char** argv,
|
||||
ataopts.smart_selftest_type = CONVEYANCE_SELF_TEST;
|
||||
} else if (!strcmp(optarg,"force")) {
|
||||
ataopts.smart_selftest_force = true;
|
||||
scsiopts.smart_selftest_force = true;
|
||||
} else if (!strcmp(optarg,"afterselect,on")) {
|
||||
// scan remainder of disk after doing selected segment
|
||||
ataopts.smart_selective_args.scan_after_select = 2;
|
||||
@ -693,10 +704,10 @@ static const char * parse_options(int argc, char** argv,
|
||||
errno=0;
|
||||
i=(int)strtol(optarg+strlen("pending,"), &tailptr, 10);
|
||||
if (errno || *tailptr != '\0') {
|
||||
sprintf(extraerror, "Option -t pending,N requires N to be a non-negative integer\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -t pending,N requires N to be a non-negative integer\n");
|
||||
badarg = true;
|
||||
} else if (i<0 || i>65535) {
|
||||
sprintf(extraerror, "Option -t pending,N (N=%d) must have 0 <= N <= 65535\n", i);
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -t pending,N (N=%d) must have 0 <= N <= 65535\n", i);
|
||||
badarg = true;
|
||||
} else {
|
||||
ataopts.smart_selective_args.pending_time = i+1;
|
||||
@ -707,15 +718,15 @@ static const char * parse_options(int argc, char** argv,
|
||||
// parse range of LBAs to test
|
||||
uint64_t start, stop; int mode;
|
||||
if (split_selective_arg(optarg, &start, &stop, &mode)) {
|
||||
sprintf(extraerror, "Option -t select,M-N must have non-negative integer M and N\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -t select,M-N must have non-negative integer M and N\n");
|
||||
badarg = true;
|
||||
} else {
|
||||
if (ataopts.smart_selective_args.num_spans >= 5 || start > stop) {
|
||||
if (start > stop) {
|
||||
sprintf(extraerror, "ERROR: Start LBA (%"PRIu64") > ending LBA (%"PRId64") in argument \"%s\"\n",
|
||||
snprintf(extraerror, sizeof(extraerror), "ERROR: Start LBA (%"PRIu64") > ending LBA (%"PRId64") in argument \"%s\"\n",
|
||||
start, stop, optarg);
|
||||
} else {
|
||||
sprintf(extraerror,"ERROR: No more than five selective self-test spans may be"
|
||||
snprintf(extraerror, sizeof(extraerror),"ERROR: No more than five selective self-test spans may be"
|
||||
" defined\n");
|
||||
}
|
||||
badarg = true;
|
||||
@ -727,13 +738,13 @@ static const char * parse_options(int argc, char** argv,
|
||||
ataopts.smart_selftest_type = SELECTIVE_SELF_TEST;
|
||||
}
|
||||
} else if (!strncmp(optarg, "scttempint", sizeof("scstempint")-1)) {
|
||||
strcpy(extraerror, "-t scttempint is no longer supported, use -l scttempint instead\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "-t scttempint is no longer supported, use -l scttempint instead\n");
|
||||
badarg = true;
|
||||
} else if (!strncmp(optarg, "vendor,", sizeof("vendor,")-1)) {
|
||||
unsigned subcmd = ~0U; int n = -1;
|
||||
if (!( sscanf(optarg, "%*[a-z],0x%x%n", &subcmd, &n) == 1
|
||||
&& subcmd <= 0xff && n == (int)strlen(optarg))) {
|
||||
strcpy(extraerror, "Option -t vendor,0xNN syntax error\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -t vendor,0xNN syntax error\n");
|
||||
badarg = true;
|
||||
}
|
||||
else
|
||||
@ -819,6 +830,7 @@ static const char * parse_options(int argc, char** argv,
|
||||
ataopts.get_aam = ataopts.get_apm = true;
|
||||
ataopts.get_security = true;
|
||||
ataopts.get_lookahead = ataopts.get_wcache = true;
|
||||
scsiopts.get_rcd = scsiopts.get_wce = true;
|
||||
}
|
||||
else if (!strcmp(name, "aam")) {
|
||||
if (get)
|
||||
@ -828,7 +840,7 @@ static const char * parse_options(int argc, char** argv,
|
||||
else if (val <= 254)
|
||||
ataopts.set_aam = val + 1;
|
||||
else {
|
||||
sprintf(extraerror, "Option -s aam,N must have 0 <= N <= 254\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -s aam,N must have 0 <= N <= 254\n");
|
||||
badarg = true;
|
||||
}
|
||||
}
|
||||
@ -840,13 +852,14 @@ static const char * parse_options(int argc, char** argv,
|
||||
else if (1 <= val && val <= 254)
|
||||
ataopts.set_apm = val + 1;
|
||||
else {
|
||||
sprintf(extraerror, "Option -s apm,N must have 1 <= N <= 254\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -s apm,N must have 1 <= N <= 254\n");
|
||||
badarg = true;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(name, "lookahead")) {
|
||||
if (get)
|
||||
if (get) {
|
||||
ataopts.get_lookahead = true;
|
||||
}
|
||||
else if (off)
|
||||
ataopts.set_lookahead = -1;
|
||||
else if (on)
|
||||
@ -854,6 +867,16 @@ static const char * parse_options(int argc, char** argv,
|
||||
else
|
||||
badarg = true;
|
||||
}
|
||||
else if (!strcmp(name, "rcache")) {
|
||||
if (get)
|
||||
scsiopts.get_rcd = true;
|
||||
else if (off)
|
||||
scsiopts.set_rcd = -1;
|
||||
else if (on)
|
||||
scsiopts.set_rcd = 1;
|
||||
else
|
||||
badarg = true;
|
||||
}
|
||||
else if (get && !strcmp(name, "security")) {
|
||||
ataopts.get_security = true;
|
||||
}
|
||||
@ -869,17 +892,23 @@ static const char * parse_options(int argc, char** argv,
|
||||
else if (val <= 255)
|
||||
ataopts.set_standby = val + 1;
|
||||
else {
|
||||
sprintf(extraerror, "Option -s standby,N must have 0 <= N <= 255\n");
|
||||
snprintf(extraerror, sizeof(extraerror), "Option -s standby,N must have 0 <= N <= 255\n");
|
||||
badarg = true;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(name, "wcache")) {
|
||||
if (get)
|
||||
if (get) {
|
||||
ataopts.get_wcache = true;
|
||||
else if (off)
|
||||
scsiopts.get_wce = true;
|
||||
}
|
||||
else if (off) {
|
||||
ataopts.set_wcache = -1;
|
||||
else if (on)
|
||||
scsiopts.set_wce = -1;
|
||||
}
|
||||
else if (on) {
|
||||
ataopts.set_wcache = 1;
|
||||
scsiopts.set_wce = 1;
|
||||
}
|
||||
else
|
||||
badarg = true;
|
||||
}
|
||||
@ -941,7 +970,8 @@ static const char * parse_options(int argc, char** argv,
|
||||
// a clean way to do it.
|
||||
char optstr[] = { (char)optchar, 0 };
|
||||
pout("=======> INVALID ARGUMENT TO -%s: %s\n",
|
||||
(optchar == opt_set ? "-set" :
|
||||
(optchar == opt_identify ? "-identify" :
|
||||
optchar == opt_set ? "-set" :
|
||||
optchar == opt_smart ? "-smart" : optstr), optarg);
|
||||
printvalidarglistmessage(optchar);
|
||||
if (extraerror[0])
|
||||
@ -1190,7 +1220,7 @@ static int main_worker(int argc, char **argv)
|
||||
if (!strcmp(name,"-")) {
|
||||
// Parse "smartctl -r ataioctl,2 ..." output from stdin
|
||||
if (type || print_type_only) {
|
||||
pout("Smartctl: -d option is not allowed in conjunction with device name \"-\".\n");
|
||||
pout("-d option is not allowed in conjunction with device name \"-\".\n");
|
||||
UsageSummary();
|
||||
return FAILCMD;
|
||||
}
|
||||
@ -1205,7 +1235,7 @@ static int main_worker(int argc, char **argv)
|
||||
if (type)
|
||||
printvalidarglistmessage('d');
|
||||
else
|
||||
pout("Smartctl: please specify device type with the -d option.\n");
|
||||
pout("Please specify device type with the -d option.\n");
|
||||
UsageSummary();
|
||||
return FAILCMD;
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -26,7 +26,7 @@
|
||||
#ifndef SMARTCTL_H_
|
||||
#define SMARTCTL_H_
|
||||
|
||||
#define SMARTCTL_H_CVSID "$Id: smartctl.h 3196 2010-10-28 21:31:49Z chrfranke $\n"
|
||||
#define SMARTCTL_H_CVSID "$Id: smartctl.h 3727 2012-12-13 17:23:06Z samm2 $\n"
|
||||
|
||||
// Return codes (bitmask)
|
||||
|
||||
|
155
smartd.8.in
155
smartd.8.in
@ -1,21 +1,22 @@
|
||||
.ig
|
||||
Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
Copyright (C) 2004-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
|
||||
$Id: smartd.8.in 3561 2012-06-05 19:49:31Z chrfranke $
|
||||
$Id: smartd.8.in 3799 2013-03-15 17:47:25Z chrfranke $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
You should have received a copy of the GNU General Public License (for
|
||||
example COPYING); if not, write to the Free Software Foundation, Inc.,
|
||||
675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public License
|
||||
(for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
Research Center), Jack Baskin School of Engineering, University of
|
||||
California, Santa Cruz. http://ssrc.soe.ucsc.edu/
|
||||
|
||||
This code was originally developed as a Senior Thesis by Michael
|
||||
Cornwell at the Concurrent Systems Laboratory (now part of the Storage
|
||||
Systems Research Center), Jack Baskin School of Engineering,
|
||||
University of California, Santa Cruz. http://ssrc.soe.ucsc.edu/
|
||||
..
|
||||
.TH SMARTD 8 CURRENT_SVN_DATE CURRENT_SVN_VERSION CURRENT_SVN_DATE
|
||||
.SH NAME
|
||||
@ -38,13 +39,15 @@ CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
|
||||
.\"! It does not contain info specific to other platforms.]
|
||||
.\"! .PP
|
||||
.\" %ENDIF NOT OS ALL
|
||||
\fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis
|
||||
and Reporting Technology (SMART) system built into many ATA-3 and
|
||||
later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to
|
||||
monitor the reliability of the hard drive and predict drive failures,
|
||||
and to carry out different types of drive self-tests. This version of
|
||||
\fBsmartd\fP is compatible with ATA/ATAPI-7 and earlier standards (see
|
||||
\fBREFERENCES\fP below).
|
||||
\fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis and
|
||||
Reporting Technology (SMART) system built into most ATA/SATA and SCSI/SAS
|
||||
hard drives and solid-state drives.
|
||||
The purpose of SMART is to monitor the reliability of the hard drive
|
||||
and predict drive failures, and to carry out different types of drive
|
||||
self-tests.
|
||||
This version of \fBsmartd\fP is compatible with
|
||||
ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards
|
||||
(see \fBREFERENCES\fP below).
|
||||
|
||||
\fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
|
||||
(equivalent to \fBsmartctl -s on\fP) and polls these and SCSI devices
|
||||
@ -57,7 +60,7 @@ command-line option described below.
|
||||
|
||||
In addition to logging to a file, \fBsmartd\fP can also be configured
|
||||
to send email warnings if problems are detected. Depending upon the
|
||||
type of problem, you may want to run self\-tests on the disk, back up
|
||||
type of problem, you may want to run self-tests on the disk, back up
|
||||
the disk, replace the disk, or use a manufacturer\'s utility to force
|
||||
reallocation of bad or unreadable disk sectors. If disk problems are
|
||||
detected, please see the \fBsmartctl\fP manual page and the
|
||||
@ -89,11 +92,11 @@ the contents of the (faulty) configuration file, as if the \fBHUP\fP
|
||||
signal had never been received.
|
||||
|
||||
When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal
|
||||
(normally generated from a shell with CONTROL\-C) is treated in the
|
||||
(normally generated from a shell with CONTROL-C) is treated in the
|
||||
same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
|
||||
configuration file. To exit \fBsmartd\fP use CONTROL-\e
|
||||
.\" %IF OS Windows
|
||||
(Windows: CONTROL\-Break).
|
||||
(Windows: CONTROL-Break).
|
||||
.\" %ENDIF OS Windows
|
||||
|
||||
On startup, in the absence of the configuration file
|
||||
@ -104,10 +107,12 @@ devices that support SMART. The scanning is done as follows:
|
||||
Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
|
||||
devices, and \fB"/dev/sd[a-z]"\fP, \fB"/dev/sd[a-c][a-z]"\fP
|
||||
for SCSI or SATA devices.
|
||||
Disks behind RAID controllers are not included.
|
||||
.\" %ENDIF OS Linux
|
||||
.\" %IF OS FreeBSD
|
||||
.IP \fBFREEBSD:\fP 9
|
||||
Authoritative list of disk devices is obtained from SCSI (CAM) and ATA subsystems.
|
||||
Disks behind RAID controllers are not included.
|
||||
.\" %ENDIF OS FreeBSD
|
||||
.\" %IF OS NetBSD OpenBSD
|
||||
.IP \fBNETBSD/OPENBSD:\fP 9
|
||||
@ -123,17 +128,11 @@ devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
|
||||
.IP \fBDARWIN:\fP 9
|
||||
The IOService plane is scanned for ATA block storage devices.
|
||||
.\" %ENDIF OS Darwin
|
||||
.\" %IF OS Windows
|
||||
.IP \fBWINDOWS\ 9x/ME\fP: 9
|
||||
Examine all entries \fB"/dev/hd[a-d]"\fP (bitmask
|
||||
from "\\\\.\\SMARTVSD") for IDE/ATA devices.
|
||||
Examine all entries \fB"/dev/scsi[0\-9][0\-f]"\fP for SCSI devices
|
||||
on ASPI adapter 0\-9, ID 0\-15.
|
||||
.\" %ENDIF OS Windows
|
||||
.\" %IF OS Windows Cygwin
|
||||
.IP \fBWINDOWS\ NT4/2000/XP/2003/Vista/Win7/2008\fP: 9
|
||||
Examine all entries \fB"/dev/sd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
|
||||
for IDE/(S)ATA and SCSI disk devices
|
||||
.IP \fBWINDOWS\fP: 9
|
||||
Examine all entries \fB"/dev/sd[a\-z]"\fP, \fB"/dev/sd[a\-c][a\-z]"\fP
|
||||
and \fB"/dev/sdd[a\-x]"\fP ("\\\\.\\PhysicalDrive[0\-127]") for
|
||||
IDE/(S)ATA and SCSI disk devices.
|
||||
|
||||
If a 3ware 9000 controller is installed, examine all entries
|
||||
\fB"/dev/sdX,N"\fP for the first logical drive (\'unit\'
|
||||
@ -143,30 +142,24 @@ detected behind this controller. Same for a second controller if present.
|
||||
If directive \'\-d csmi\' or no \'\-d\' directive is specified,
|
||||
examine all entries \fB"/dev/csmi[0\-9],N"\fP for drives behind an Intel
|
||||
ICHxR controller with RST driver.
|
||||
|
||||
Disks behind Areca RAID controllers are not included.
|
||||
.\" %ENDIF OS Windows Cygwin
|
||||
.\" %IF OS Cygwin
|
||||
.IP \fBCYGWIN\fP: 9
|
||||
See "WINDOWS NT4/2000/XP/2003/Vista/Win7/2008" above.
|
||||
.\" %ENDIF OS Cygwin
|
||||
.\" %IF OS OS2
|
||||
.IP \fBOS/2,eComStation\fP: 9
|
||||
Use the form \fB"/dev/hd[a\-z]"\fP for IDE/ATA devices.
|
||||
.\" %ENDIF OS OS2
|
||||
.PP
|
||||
\fBsmartd\fP then monitors
|
||||
for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP
|
||||
Directive in the configuration file; see \fBCONFIGURATION FILE\fP
|
||||
below).
|
||||
Directive in the configuration file; see the \fBsmartd.conf\fP(5) man page).
|
||||
|
||||
.SH
|
||||
OPTIONS
|
||||
|
||||
.TP
|
||||
.B \-A PREFIX, \-\-attributelog=PREFIX
|
||||
[ATA only] Writes \fBsmartd\fP attribute information (normalized and raw
|
||||
attribute values) to files \'PREFIX\'\'MODEL\-SERIAL.ata.csv\'. At each
|
||||
Writes \fBsmartd\fP attribute information (normalized and raw
|
||||
attribute values) to files \'PREFIX\'\'MODEL\-SERIAL.ata.csv\' or \'PREFIX\'\'VENDOR\-MODEL\-SERIAL.scsi.csv\'. At each
|
||||
check cycle attributes are logged as a line of semicolon separated triplets
|
||||
of the form "attribute-ID;attribute-norm-value;attribute-raw-value;".
|
||||
For SCSI devices error counters and temperature recorded in the form "counter-name;counter-value;"
|
||||
Each line is led by a date string of the form "yyyy-mm-dd HH:MM:SS" (in UTC).
|
||||
|
||||
.\" %IF ENABLE_ATTRIBUTELOG
|
||||
@ -218,10 +211,10 @@ information to STDOUT rather than logging it to SYSLOG and does not
|
||||
terminal. In this mode, \fBsmartd\fP also prints more verbose
|
||||
information about what it is doing than when operating in "daemon"
|
||||
mode. In this mode, the \fBINT\fP signal (normally generated from a
|
||||
terminal with CONTROL\-C) makes \fBsmartd\fP reload its configuration
|
||||
terminal with CONTROL-C) makes \fBsmartd\fP reload its configuration
|
||||
file. Please use CONTROL-\e to exit
|
||||
.\" %IF OS Windows
|
||||
(Windows: CONTROL\-Break).
|
||||
(Windows: CONTROL-Break).
|
||||
|
||||
[Windows only] The "debug" mode can be toggled by the command
|
||||
\fBsmartd sigusr2\fP. A new console for debug output is opened when
|
||||
@ -308,18 +301,12 @@ Windows: Some \fBsyslog\fP functionality is implemented
|
||||
internally in \fBsmartd\fP as follows: If no \'\-l\' option
|
||||
(or \'\-l daemon\') is specified, messages are written to Windows
|
||||
event log or to file \fB./smartd.log\fP if event log is not available
|
||||
(Win9x/ME or access denied). By specifying other values of FACILITY,
|
||||
(access denied). By specifying other values of FACILITY,
|
||||
log output is redirected as follows:
|
||||
\'\-l local0\' to file \fB./smartd.log\fP,
|
||||
\'\-l local1\' to standard output (redirect with \'>\' to any file),
|
||||
\'\-l local2\' to standard error,
|
||||
\'\-l local[3-7]\': to file \fB./smartd[1-5].log\fP.
|
||||
|
||||
When using the event log, the enclosed utility \fBsyslogevt.exe\fP
|
||||
should be registered as an event message file to avoid error
|
||||
messages from the event viewer. Use \'\fBsyslogevt -r smartd\fP\'
|
||||
to register, \'\fBsyslogevt -u smartd\fP\' to unregister and
|
||||
\'\fBsyslogevt\fP\' for more help.
|
||||
.\" %ENDIF OS Windows
|
||||
.TP
|
||||
.B \-n, \-\-no\-fork
|
||||
@ -392,7 +379,7 @@ a list of future scheduled self tests to stdout, and then exit with zero
|
||||
exit status if all of these steps worked correctly.
|
||||
Device's SMART status is not checked.
|
||||
|
||||
This option is intended to test whether the '-s REGEX' directives in
|
||||
This option is intended to test whether the '\-s REGEX' directives in
|
||||
smartd.conf will have the desired effect. The output lists the next test
|
||||
schedules, limited to 5 tests per type and device. This is followed by a
|
||||
summary of all tests of each device within the next 90 days.
|
||||
@ -427,17 +414,19 @@ The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are
|
||||
equivalent.
|
||||
.TP
|
||||
.B \-s PREFIX, \-\-savestates=PREFIX
|
||||
[ATA only] Reads/writes \fBsmartd\fP state information from/to files
|
||||
\'PREFIX\'\'MODEL\-SERIAL.ata.state\'. This preserves SMART attributes, drive
|
||||
min and max temperatures (\-W directive), info about last sent warning email
|
||||
Reads/writes \fBsmartd\fP state information from/to files
|
||||
\'PREFIX\'\'MODEL\-SERIAL.ata.state\' or \'PREFIX\'\'VENDOR\-MODEL\-SERIAL.scsi.state\'.
|
||||
This preserves SMART attributes, drive min and max temperatures (\-W directive),
|
||||
info about last sent warning email
|
||||
(\-m directive), and the time of next check of the self-test REGEXP
|
||||
(\-s directive) across boot cycles.
|
||||
|
||||
.\" %IF ENABLE_SAVESTATES
|
||||
If this option is not specified, state information is maintained in files
|
||||
\'/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\'.
|
||||
\'/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\' for ATA devices and
|
||||
\'/usr/local/var/lib/smartmontools/smartd.VENDOR\-MODEL\-SERIAL.scsi.state\' for SCSI devices.
|
||||
To disable state files, specify this option with an empty string
|
||||
argument: \'-s ""\'.
|
||||
argument: \'\-s ""\'.
|
||||
.\" %ENDIF ENABLE_SAVESTATES
|
||||
MODEL and SERIAL are build from drive identify information, invalid
|
||||
characters are replaced by underline.
|
||||
@ -453,6 +442,22 @@ always (re)written after reading the configuration file, before rereading
|
||||
the configuration file (SIGHUP), before smartd shutdown, and after a check
|
||||
forced by SIGUSR1. After a normal check cycle, a file is only rewritten if
|
||||
an important change (which usually results in a SYSLOG output) occurred.
|
||||
.TP
|
||||
.B \-w PATH, \-\-warnexec=PATH
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE]
|
||||
Run the executable PATH instead of the default script when smartd
|
||||
needs to send warning messages. PATH must point to an executable binary
|
||||
file or script.
|
||||
The default script is
|
||||
.\" %IF NOT OS Windows
|
||||
\fB/usr/local/etc/smartd_warning.sh\fP.
|
||||
.\" %ENDIF NOT OS Windows
|
||||
.\" %IF OS ALL
|
||||
(Windows: EXEDIR/smartd_warning.cmd)
|
||||
.\" %ENDIF OS ALL
|
||||
.\" %IF OS Windows
|
||||
.\"! \fBEXEDIR/smartd_warning.cmd\fP.
|
||||
.\" %ENDIF OS Windows
|
||||
.\" %IF OS Windows
|
||||
.TP
|
||||
.B \-\-service
|
||||
@ -570,7 +575,7 @@ to read:
|
||||
...;daemon.info;... /var/adm/messages
|
||||
.fi
|
||||
Alternatively, you can use a local facility to log messages: please
|
||||
see the \fBsmartd\fP '-l' command-line option described above.
|
||||
see the \fBsmartd\fP '\-l' command-line option described above.
|
||||
|
||||
.\" %ENDIF OS Solaris
|
||||
.\" %IF OS Cygwin
|
||||
@ -587,7 +592,7 @@ The service can be started and stopped by the start-up script as usual
|
||||
.\" %ENDIF OS Cygwin
|
||||
.\" %IF OS Windows
|
||||
On Windows, the log messages are written to the event log or to a file.
|
||||
See documentation of the '-l FACILITY' option above for details.
|
||||
See documentation of the '\-l FACILITY' option above for details.
|
||||
|
||||
On Windows, the following built-in commands can be used to control
|
||||
\fBsmartd\fP, if running as a daemon:
|
||||
@ -609,22 +614,24 @@ The Windows Version of \fBsmartd\fP has buildin support for services:
|
||||
\'\fBsmartd install [options]\fP\' installs a service
|
||||
named "smartd" (display name "SmartD Service") using the command line
|
||||
\'/INSTALLPATH/smartd.exe \-\-service [options]\'.
|
||||
This also installs smartd.exe as a event message file for the Windows
|
||||
event viewer.
|
||||
|
||||
\'\fBsmartd remove\fP\' can later be used to remove the service entry
|
||||
from registry.
|
||||
\'\fBsmartd remove\fP\' can later be used to remove the service and
|
||||
event message entries from the registry.
|
||||
|
||||
Upon startup, the smartd service changes the working directory
|
||||
to its own installation path. If smartd.conf and blat.exe are stored
|
||||
in this directory, no \'-c\' option and \'-M exec\' directive is needed.
|
||||
|
||||
The debug mode (\'-d\', \'-q onecheck\') does not work if smartd is
|
||||
The debug mode (\'\-d\', \'\-q onecheck\') does not work if smartd is
|
||||
running as service.
|
||||
|
||||
The service can be controlled as usual with Windows commands \'net\'
|
||||
or \'sc\' (\'\fBnet start smartd\fP\', \'\fBnet stop smartd\fP\').
|
||||
|
||||
Pausing the service (\'\fBnet pause smartd\fP\') sets the interval between
|
||||
disk checks (\'-i N\') to infinite.
|
||||
disk checks (\'\-i N\') to infinite.
|
||||
|
||||
Continuing the paused service (\'\fBnet continue smartd\fP\') resets the
|
||||
interval and rereads the configuration file immediately (like \fBSIGHUP\fP):
|
||||
@ -671,7 +678,7 @@ Forking the daemon failed.
|
||||
Couldn\'t create PID file.
|
||||
.TP
|
||||
.B 5:
|
||||
Config file does not exist (only returned in conjunction with the \'-c\' option).
|
||||
Config file does not exist (only returned in conjunction with the \'\-c\' option).
|
||||
.TP
|
||||
.B 6:
|
||||
Config file exists, but cannot be read.
|
||||
@ -716,17 +723,21 @@ status is then 128 plus the signal number. For example if
|
||||
is killed by SIGKILL (signal 9) then the exit status is 137.
|
||||
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net
|
||||
.fi
|
||||
.SH AUTHORS
|
||||
\fBBruce Allen\fP
|
||||
.br
|
||||
University of Wisconsin \- Milwaukee Physics Department
|
||||
.br
|
||||
\fBChristian Franke\fP (Windows interface, C++ redesign, most enhancements
|
||||
since 2009)
|
||||
.br
|
||||
\fBsmartmontools\-support@lists.sourceforge.net\fP
|
||||
|
||||
.PP
|
||||
.SH CONTRIBUTORS
|
||||
The following have made large contributions to smartmontools:
|
||||
.nf
|
||||
\fBCasper Dik\fP (Solaris SCSI interface)
|
||||
\fBChristian Franke\fP (Windows interface, C++ redesign, USB support, ...)
|
||||
\fBDouglas Gilbert\fP (SCSI subsystem)
|
||||
\fBGuido Guenther\fP (Autoconf/Automake packaging)
|
||||
\fBGeoffrey Keating\fP (Darwin ATA interface)
|
||||
@ -747,7 +758,7 @@ Many other individuals have made smaller contributions and corrections.
|
||||
.fi
|
||||
This code was derived from the smartsuite package, written by Michael
|
||||
Cornwell, and from the previous UCSC smartsuite package. It extends
|
||||
these to cover ATA\-5 disks. This code was originally developed as a
|
||||
these to cover ATA-5 disks. This code was originally developed as a
|
||||
Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
|
||||
(now part of the Storage Systems Research Center), Jack Baskin School
|
||||
of Engineering, University of California, Santa
|
||||
@ -768,18 +779,18 @@ REFERENCES FOR SMART
|
||||
.fi
|
||||
An introductory article about smartmontools is \fIMonitoring Hard
|
||||
Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004,
|
||||
pages 74\-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP
|
||||
pages 74-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP
|
||||
online.
|
||||
|
||||
If you would like to understand better how SMART works, and what it
|
||||
does, a good place to start is with Sections 4.8 and 6.54 of the first
|
||||
volume of the \'AT Attachment with Packet Interface\-7\' (ATA/ATAPI\-7)
|
||||
volume of the \'AT Attachment with Packet Interface-7\' (ATA/ATAPI-7)
|
||||
specification Revision 4b. This documents the SMART functionality which the
|
||||
\fBsmartmontools\fP utilities provide access to.
|
||||
|
||||
.fi
|
||||
The functioning of SMART was originally defined by the SFF\-8035i
|
||||
revision 2 and the SFF\-8055i revision 1.4 specifications. These are
|
||||
The functioning of SMART was originally defined by the SFF-8035i
|
||||
revision 2 and the SFF-8055i revision 1.4 specifications. These are
|
||||
publications of the Small Form Factors (SFF) Committee.
|
||||
|
||||
Links to these and other documents may be found on the Links page of the
|
||||
@ -788,4 +799,4 @@ Links to these and other documents may be found on the Links page of the
|
||||
|
||||
.SH
|
||||
SVN ID OF THIS PAGE:
|
||||
$Id: smartd.8.in 3561 2012-06-05 19:49:31Z chrfranke $
|
||||
$Id: smartd.8.in 3799 2013-03-15 17:47:25Z chrfranke $
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# Home page is: http://smartmontools.sourceforge.net
|
||||
|
||||
# $Id: smartd.conf 3128 2010-07-27 13:08:31Z chrfranke $
|
||||
# $Id: smartd.conf 3651 2012-10-18 15:11:36Z samm2 $
|
||||
|
||||
# smartd will re-read the configuration file if it receives a HUP
|
||||
# signal
|
||||
@ -83,10 +83,11 @@ DEVICESCAN
|
||||
#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
|
||||
|
||||
# Monitor 2 SATA (not SAS) disks connected to a 3ware 9000 controller which
|
||||
# uses the 3w-sas driver (Linux, FreeBSD). Start long self-tests Tuesdays
|
||||
# uses the 3w-sas driver (Linux). Start long self-tests Tuesdays
|
||||
# between 1-2 and 3-4 am.
|
||||
# On FreeBSD /dev/tws0 should be used instead
|
||||
#/dev/twl0 -d 3ware,0 -a -s L/../../2/01
|
||||
#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
|
||||
#/dev/twl0 -d 3ware,1 -a -s L/../../2/03
|
||||
|
||||
# Same as above for Windows. Option '-d 3ware,N' is not necessary,
|
||||
# disk (port) number is specified in device name.
|
||||
|
333
smartd.conf.5.in
333
smartd.conf.5.in
@ -1,21 +1,22 @@
|
||||
.ig
|
||||
Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
Copyright (C) 2004-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
|
||||
$Id: smartd.conf.5.in 3561 2012-06-05 19:49:31Z chrfranke $
|
||||
$Id: smartd.conf.5.in 3741 2013-01-02 17:06:54Z chrfranke $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2, or (at your option) any later
|
||||
version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
You should have received a copy of the GNU General Public License (for
|
||||
example COPYING); if not, write to the Free Software Foundation, Inc., 675
|
||||
Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public License
|
||||
(for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
Research Center), Jack Baskin School of Engineering, University of
|
||||
California, Santa Cruz. http://ssrc.soe.ucsc.edu/
|
||||
|
||||
..
|
||||
.TH SMARTD.CONF 5 CURRENT_SVN_DATE CURRENT_SVN_VERSION CURRENT_SVN_DATE
|
||||
.SH NAME
|
||||
@ -36,9 +37,7 @@ CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
|
||||
.\"! .PP
|
||||
.\" %ENDIF NOT OS ALL
|
||||
\fB/usr/local/etc/smartd.conf\fP is the configuration file for the \fBsmartd\fP
|
||||
daemon, which monitors the Self-Monitoring, Analysis and Reporting
|
||||
Technology (SMART) system built into many ATA-3 and later ATA, IDE and
|
||||
SCSI-3 hard drives.
|
||||
daemon.
|
||||
|
||||
If the configuration file \fB/usr/local/etc/smartd.conf\fP is present,
|
||||
\fBsmartd\fP reads it at startup, before \fBfork\fP(2)ing into the
|
||||
@ -49,50 +48,16 @@ re-read the configuration file. This signal can be generated by typing
|
||||
\fB\<CONTROL-C\>\fP in the terminal window where \fBsmartd\fP is
|
||||
running.
|
||||
|
||||
.SH CONFIGURATION FILE /usr/local/etc/smartd.conf
|
||||
In the absence of a configuration file
|
||||
\fBsmartd\fP will try to open all available devices.
|
||||
.\" %IF OS Linux
|
||||
Under linux \fBsmartd\fP will try to open the 20 ATA devices
|
||||
.B /dev/hd[a-t]
|
||||
and the 26 SCSI devices
|
||||
.B /dev/sd[a-z].
|
||||
.\" %ENDIF OS Linux
|
||||
.\" %IF OS FreeBSD
|
||||
Under FreeBSD,
|
||||
\fBsmartd\fP
|
||||
will try to open all existing ATA/SATA devices (using ATA subsystem)
|
||||
.B /dev/ad[0-9]+
|
||||
and all existing SCSI/SAS/AHCI devices (using CAM subsystem).
|
||||
.\" %ENDIF OS FreeBSD
|
||||
.\" %IF OS NetBSD OpenBSD
|
||||
Under NetBSD/OpenBSD,
|
||||
\fBsmartd\fP
|
||||
will try to open all existing ATA devices (with entries in /dev)
|
||||
.B /dev/wd[0-9]+c
|
||||
and all existing SCSI devices
|
||||
.B /dev/sd[0-9]+c.
|
||||
.\" %ENDIF OS NetBSD OpenBSD
|
||||
.\" %IF OS Solaris
|
||||
Under Solaris \fBsmartd\fP will try to open all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
|
||||
devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
|
||||
.\" %ENDIF OS Solaris
|
||||
.\" %IF OS Windows
|
||||
Under Windows \fBsmartd\fP will try to open all entries \fB"/dev/hd[a-j]"\fP ("\\\\.\\PhysicalDrive[0-9]")
|
||||
for IDE/ATA devices on WinNT4/2000/XP, \fB"/dev/hd[a-d]"\fP
|
||||
(bitmask from "\\\\.\\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME,
|
||||
and \fB"/dev/scsi[0-9][0-7]"\fP (ASPI adapter 0-9, ID 0-7) for SCSI
|
||||
devices on all versions of Windows.
|
||||
.\" %ENDIF OS Windows
|
||||
.\" %IF OS Darwin
|
||||
Under Darwin, \fBsmartd\fP will open any ATA block storage device.
|
||||
.\" %ENDIF OS Darwin
|
||||
\fBsmartd\fP will try to open all available devices
|
||||
(see \fBsmartd\fP(8) man page).
|
||||
A configuration file with a single line \fB\'DEVICESCAN \-a'\fP
|
||||
would have the same effect.
|
||||
|
||||
This can be annoying if you have an ATA or SCSI device that hangs or
|
||||
misbehaves when receiving SMART commands. Even if this causes no
|
||||
problems, you may be annoyed by the string of error log messages about
|
||||
block-major devices that can\'t be found, and SCSI devices that can\'t
|
||||
be opened.
|
||||
problems, you may be annoyed by the string of error log messages about devices
|
||||
that can\'t be opened.
|
||||
|
||||
One can avoid this problem, and gain more control over the types of
|
||||
events monitored by
|
||||
@ -176,6 +141,7 @@ Section below!
|
||||
.B \ \ /dev/sda -d megaraid,0 -a -s S/../.././01
|
||||
.B \ \ /dev/sda -d megaraid,1 -a -s S/../.././02
|
||||
.B \ \ /dev/sda -d megaraid,2 -a -s S/../.././03
|
||||
.B \ \ /dev/bus/0 -d megaraid,2 -a -s S/../.././03
|
||||
.B
|
||||
.B #
|
||||
.\" %ENDIF OS Linux
|
||||
@ -202,8 +168,14 @@ Section below!
|
||||
.B # Two SATA (not SAS) disks on a 3ware 9750 controller.
|
||||
.B # Start long self-tests Sundays between midnight and
|
||||
.B # 1am and 2-3 am
|
||||
.\" %IF OS Linux
|
||||
.B \ \ /dev/twl0 -d 3ware,0 -a -s L/../../7/00
|
||||
.B \ \ /dev/twl0 -d 3ware,1 -a -s L/../../7/02
|
||||
.\" %ENDIF OS Linux
|
||||
.\" %IF OS FreeBSD
|
||||
.B \ \ /dev/tws0 -d 3ware,0 -a -s L/../../7/00
|
||||
.B \ \ /dev/tws0 -d 3ware,1 -a -s L/../../7/02
|
||||
.\" %ENDIF OS FreeBSD
|
||||
.B #
|
||||
.nf
|
||||
.B # Three SATA disks on a HighPoint RocketRAID controller.
|
||||
@ -341,7 +313,7 @@ status fails, or if new errors appear in the self-test log.
|
||||
|
||||
.B If a 3ware controller is used
|
||||
then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?,
|
||||
/dev/twa? or /dev/twl?) must be listed, along with the \'\-d 3ware,N\'
|
||||
/dev/twa?, /dev/twl? or /dev/tws?) must be listed, along with the \'\-d 3ware,N\'
|
||||
Directive (see below). The individual ATA disks hosted by the 3ware
|
||||
controller appear to \fBsmartd\fP as normal ATA devices. Hence all
|
||||
the ATA directives can be used for these disks (but see note below).
|
||||
@ -362,7 +334,7 @@ Specifies the type of the device.
|
||||
The valid arguments to this directive are:
|
||||
|
||||
.I auto
|
||||
- attempt to guess the device type from the device name or from
|
||||
\- attempt to guess the device type from the device name or from
|
||||
controller type info provided by the operating system or from
|
||||
a matching USB ID entry in the drive database.
|
||||
This is the default.
|
||||
@ -386,8 +358,7 @@ SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and
|
||||
the other 16 bytes long. The default is the 16 byte variant which can be
|
||||
overridden with either \'\-d sat,12\' or \'\-d sat,16\'.
|
||||
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE] If \'-d sat,auto\' is specified,
|
||||
device type SAT (for ATA/SATA disks) is
|
||||
If \'\-d sat,auto\' is specified, device type SAT (for ATA/SATA disks) is
|
||||
only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA ").
|
||||
Otherwise device type SCSI (for SCSI/SAS disks) is used.
|
||||
|
||||
@ -398,8 +369,8 @@ The default SCSI operation code is 0x24, but although it can be overridden
|
||||
with \'\-d usbcypress,0xN\', where N is the scsi operation code,
|
||||
you're running the risk of damage to the device or filesystems on it.
|
||||
|
||||
.I usbjmicron
|
||||
- this device type is for SATA disks that are behind a JMicron USB to
|
||||
.I usbjmicron[,p][,x][,PORT]
|
||||
\- this device type is for SATA disks that are behind a JMicron USB to
|
||||
PATA/SATA bridge. The 48-bit ATA commands (required e.g. for \'\-l xerror\',
|
||||
see below) do not work with all of these bridges and are therefore disabled by
|
||||
default. These commands can be enabled by \'\-d usbjmicron,x\'.
|
||||
@ -413,6 +384,13 @@ CAUTION: Specifying \',x\' for a device which does not support it results
|
||||
in I/O errors and may disconnect the drive. The same applies if the specified
|
||||
PORT does not exist or is not connected to a disk.
|
||||
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE]
|
||||
The Prolific PL2507/3507 USB bridges with older firmware support a pass-through
|
||||
command similar to JMicron and work with \'\-d usbjmicron,0\'.
|
||||
Newer Prolific firmware requires a modified command which can be selected by
|
||||
\'\-d usbjmicron,p\'.
|
||||
Note that this does not yet support the SMART status command.
|
||||
|
||||
.I usbsunplus
|
||||
\- this device type is for SATA disks that are behind a SunplusIT USB to SATA
|
||||
bridge.
|
||||
@ -430,6 +408,8 @@ to a MegaRAID controller. The non-negative integer N (in the range of 0 to
|
||||
This interface will also work for Dell PERC controllers.
|
||||
In log files and email messages this disk will be identified as
|
||||
megaraid_disk_XXX with XXX in the range from 000 to 127 inclusive.
|
||||
It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus
|
||||
number.
|
||||
Please see the \fBsmartctl\fP(8) man page for further details.
|
||||
|
||||
.\" %ENDIF OS Linux
|
||||
@ -460,16 +440,15 @@ Please see the \fBsmartctl\fP(8) man page for further details.
|
||||
|
||||
.I areca,N/E
|
||||
\- [FreeBSD, Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTD FEATURE] the
|
||||
device consists of one or more SATA disks connected to an Areca SAS RAID controller.
|
||||
device consists of one or more SATA or SAS disks connected to an Areca SAS RAID controller.
|
||||
The integer N (range 1 to 128) denotes the channel (slot) and E (range
|
||||
1 to 8) denotes the enclosure.
|
||||
Important: This requires upcoming Areca SAS controller firmware version 1.51 or a
|
||||
recent beta version.
|
||||
Important: This requires Areca SAS controller firmware version 1.51 or later.
|
||||
|
||||
.\" %ENDIF OS FreeBSD Linux Windows Cygwin
|
||||
.\" %IF OS FreeBSD Linux
|
||||
.I cciss,N
|
||||
\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS disks
|
||||
\- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or SATA disks
|
||||
connected to a cciss RAID controller. The non-negative integer N (in the range
|
||||
from 0 to 15 inclusive) denotes which disk on the controller is monitored.
|
||||
In log files and email messages this disk will be identified as cciss_disk_XX
|
||||
@ -490,6 +469,14 @@ to the default value 1.
|
||||
Please see the \fBsmartctl\fP(8) man page for further details.
|
||||
|
||||
.\" %ENDIF OS FreeBSD Linux
|
||||
.I ignore
|
||||
\- [NEW EXPERIMENTAL SMARTD FEATURE]
|
||||
the device specified by this configuration entry should be ignored.
|
||||
This allows to ignore specific devices which are detected by a following
|
||||
DEVICESCAN configuration line.
|
||||
It may also be used to temporary disable longer multi-line configuration entries.
|
||||
This Directive may be used in conjunction with the other \'\-d\' Directives.
|
||||
|
||||
.I removable
|
||||
\- the device or its media is removable. This indicates to
|
||||
\fBsmartd\fP
|
||||
@ -507,25 +494,25 @@ power consumption they are: \'OFF\', \'SLEEP\', \'STANDBY\', \'IDLE\',
|
||||
and \'ACTIVE\'. Typically in the OFF, SLEEP, and STANDBY modes the
|
||||
disk\'s platters are not spinning. But usually, in response to SMART
|
||||
commands issued by \fBsmartd\fP, the disk platters are spun up. So if
|
||||
this option is not used, then a disk which is in a low\-power mode may
|
||||
be spun up and put into a higher\-power mode when it is periodically
|
||||
this option is not used, then a disk which is in a low-power mode may
|
||||
be spun up and put into a higher-power mode when it is periodically
|
||||
polled by \fBsmartd\fP.
|
||||
|
||||
Note that if the disk is in SLEEP mode when \fBsmartd\fP is started,
|
||||
then it won't respond to \fBsmartd\fP commands, and so the disk won't
|
||||
be registered as a device for \fBsmartd\fP to monitor. If a disk is in
|
||||
any other low\-power mode, then the commands issued by \fBsmartd\fP to
|
||||
register the disk will probably cause it to spin\-up.
|
||||
any other low-power mode, then the commands issued by \fBsmartd\fP to
|
||||
register the disk will probably cause it to spin-up.
|
||||
|
||||
The \'\fB\-n\fP\' (nocheck) Directive specifies if \fBsmartd\fP\'s
|
||||
periodic checks should still be carried out when the device is in a
|
||||
low\-power mode. It may be used to prevent a disk from being spun\-up
|
||||
low-power mode. It may be used to prevent a disk from being spun-up
|
||||
by periodic \fBsmartd\fP polling. The allowed values of POWERMODE
|
||||
are:
|
||||
|
||||
.I never
|
||||
\- \fBsmartd\fP will poll (check) the device regardless of its power
|
||||
mode. This may cause a disk which is spun\-down to be spun\-up when
|
||||
mode. This may cause a disk which is spun-down to be spun-up when
|
||||
\fBsmartd\fP checks it. This is the default behavior if the '\-n'
|
||||
Directive is not given.
|
||||
|
||||
@ -568,12 +555,8 @@ continue if an optional SMART command fails. This is the default.
|
||||
.I permissive
|
||||
\- try to monitor the disk even if it appears to lack SMART
|
||||
capabilities. This may be required for some old disks (prior to
|
||||
ATA\-3 revision 4) that implemented SMART before the SMART standards
|
||||
were incorporated into the ATA/ATAPI Specifications. This may also be
|
||||
needed for some Maxtor disks which fail to comply with the ATA
|
||||
Specifications and don't properly indicate support for error\- or
|
||||
self\-test logging.
|
||||
|
||||
ATA-3 revision 4) that implemented SMART before the SMART standards
|
||||
were incorporated into the ATA/ATAPI Specifications.
|
||||
[Please see the \fBsmartctl \-T\fP command-line option.]
|
||||
.TP
|
||||
.B \-o VALUE
|
||||
@ -638,9 +621,9 @@ command-line option.
|
||||
options.]
|
||||
|
||||
[ATA only] Failed self-tests outdated by a newer successful extended
|
||||
self\-test are ignored. The warning email counter is reset if the
|
||||
self-test are ignored. The warning email counter is reset if the
|
||||
number of failed self tests dropped to 0. This typically happens when
|
||||
an extended self\-test is run after all bad sectors have been reallocated.
|
||||
an extended self-test is run after all bad sectors have been reallocated.
|
||||
|
||||
.I offlinests[,ns]
|
||||
\- [ATA only] report if the Offline Data Collection status has changed
|
||||
@ -686,9 +669,9 @@ not supported. For RAID configurations, this is typically set to
|
||||
[Please see the \fBsmartctl \-l scterc\fP command-line option.]
|
||||
|
||||
.TP
|
||||
.B -e NAME[,VALUE]
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE] Sets non\-SMART device settings
|
||||
when \fBsmartd\fP starts up and has no further effect.
|
||||
.B \-e NAME[,VALUE]
|
||||
Sets non-SMART device settings when \fBsmartd\fP starts up and has no
|
||||
further effect.
|
||||
[Please see the \fBsmartctl \-\-set\fP command-line option.]
|
||||
Valid arguments are:
|
||||
|
||||
@ -837,7 +820,7 @@ disk is active again.
|
||||
|
||||
Unix users: please beware that the rules for extended regular
|
||||
expressions [regex(7)] are \fBnot\fP the same as the rules for
|
||||
file\-name pattern matching by the shell [glob(7)]. \fBsmartd\fP will
|
||||
file-name pattern matching by the shell [glob(7)]. \fBsmartd\fP will
|
||||
issue harmless informational warning messages if it detects characters
|
||||
in \fBREGEXP\fP that appear to indicate that you have made this
|
||||
mistake.
|
||||
@ -903,20 +886,32 @@ sending mail, this should help you to understand and fix them. If
|
||||
you have mail problems, we recommend running \fBsmartd\fP in debug
|
||||
mode with the \'-d\' flag, using the \'-M test\' Directive described
|
||||
below.
|
||||
.\" %IF NOT OS Windows
|
||||
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE]
|
||||
If a word of the comma separated list has the form \'@plugin\', a custom
|
||||
script /usr/local/etc/smartd_warning.d/plugin is run and the word is
|
||||
removed from the list before sending mail. The string \'plugin\' may be any
|
||||
valid name except \'ALL\'.
|
||||
If \'@ALL\' is specified, all scripts in /usr/local/etc/smartd_warning.d/*
|
||||
are run instead.
|
||||
This is handled by the script /usr/local/etc/smartd_warning.sh
|
||||
(see also \'\-M exec\' below).
|
||||
.\" %ENDIF NOT OS Windows
|
||||
.\" %IF OS Windows
|
||||
|
||||
The following extension is available on Windows:
|
||||
By specifying \'\fBmsgbox\fP\' as a mail address, a warning
|
||||
"email" is displayed as a message box on the screen.
|
||||
Using both \'\fBmsgbox\fP\' and regular mail addresses is possible,
|
||||
if \'\fBmsgbox\fP\' is the first word in the comma separated list.
|
||||
With \'\fBsysmsgbox\fP\', a system modal (always on top) message box
|
||||
is used.
|
||||
|
||||
If running as a service, a service notification message box
|
||||
(always shown on current visible desktop) is used. Please note that
|
||||
service notification message boxes are no longer supported on Windows
|
||||
Vista/2008 or later.
|
||||
[Windows only] [NEW EXPERIMENTAL SMARTD FEATURE]
|
||||
If one of the following words are used as the first address in the
|
||||
comma separated list, warning messages are sent via WTSSendMessage().
|
||||
This displays message boxes on the desktops of the selected sessions.
|
||||
Address \'\fBconsole\fP\' specifies the console session only,
|
||||
\'\fBactive\fP\' specifies the console session and all active remote
|
||||
sessions, and \'\fBconnected\fP\' specifies the console session and
|
||||
all connected (active or waiting for login) remote sessions.
|
||||
This is handled by the script EXEDIR/smartd_warning.cmd which runs
|
||||
the tool EXEDIR/wtssendmsg.exe (see also \'\-M exec\' below).
|
||||
The addresses \'\fBmsgbox\fP\' and \'\fBsysmsgbox\fP\' are now
|
||||
deprecated and have the same effect as \'\fBconsole\fP\'.
|
||||
.\" %ENDIF OS Windows
|
||||
.TP
|
||||
.B \-M TYPE
|
||||
@ -968,15 +963,22 @@ in addition to the single test email!
|
||||
\fBsmartd\fP
|
||||
needs to send email. PATH must point to an executable binary file or
|
||||
script.
|
||||
.\" %IF OS Windows
|
||||
|
||||
[Windows only] The PATH may contain space characters.
|
||||
Then it must be included in double quotes.
|
||||
.\" %ENDIF OS Windows
|
||||
|
||||
By setting PATH to point to a customized script, you can make
|
||||
\fBsmartd\fP perform useful tricks when a disk problem is detected
|
||||
(beeping the console, shutting down the machine, broadcasting warnings
|
||||
to all logged-in users, etc.) But please be careful. \fBsmartd\fP
|
||||
will \fBblock\fP until the executable PATH returns, so if your
|
||||
executable hangs, then \fBsmartd\fP will also hang. Some sample
|
||||
scripts are included in
|
||||
executable hangs, then \fBsmartd\fP will also hang.
|
||||
.\" %IF NOT OS Windows
|
||||
Some sample scripts are included in
|
||||
/usr/local/share/doc/smartmontools/examplescripts/.
|
||||
.\" %ENDIF NOT OS Windows
|
||||
|
||||
The return status of the executable is recorded by \fBsmartd\fP in
|
||||
SYSLOG. The executable is not expected to write to STDOUT or
|
||||
@ -1008,6 +1010,11 @@ or \'/dev/hptrr [hpt_1/1/1]\' under FreeBSD. For Areca controllers, the
|
||||
form is \'/dev/sg2 [areca_disk_09]\' on Linux or \'/dev/arcmsr0 [areca_disk_09]\' on FreeBSD. In these cases the device string
|
||||
contains a space and is NOT quoted. So to use $SMARTD_DEVICESTRING in a
|
||||
bash script you should probably enclose it in double quotes.
|
||||
.IP \fBSMARTD_DEVICEINFO\fP 4
|
||||
is set to device identify information. It includes most of the info printed
|
||||
by \fBsmartctl \-i\fP but uses a brief single line format.
|
||||
This device info is also logged when \fBsmartd\fP starts up.
|
||||
The string contains space characters and is NOT quoted.
|
||||
.IP \fBSMARTD_FAILTYPE\fP 4
|
||||
gives the reason for the warning or message email. The possible values that
|
||||
it takes and their meanings are:
|
||||
@ -1032,7 +1039,7 @@ it takes and their meanings are:
|
||||
read and are marked to be reallocated (replaced with spare sectors).
|
||||
.nf
|
||||
.fi
|
||||
\fIOfflineUncorrectableSector\fP: during off\-line testing, or self\-testing,
|
||||
\fIOfflineUncorrectableSector\fP: during off-line testing, or self-testing,
|
||||
one or more disk sectors could not be read.
|
||||
.nf
|
||||
.fi
|
||||
@ -1061,18 +1068,32 @@ given by the argument ADD, with the commas replaced by spaces
|
||||
given, then this string will contain space characters and is NOT
|
||||
quoted, so to use it in a bash script you may want to enclose it in
|
||||
double quotes.
|
||||
.\" %IF OS Windows
|
||||
.IP \fBSMARTD_ADDRCSV\fP 4
|
||||
[Windows only] is set to a comma-separated list of the addresses from
|
||||
SMARTD_ADDRESS.
|
||||
.\" %ENDIF OS Windows
|
||||
.IP \fBSMARTD_MESSAGE\fP 4
|
||||
is set to the one sentence summary warning email message string from
|
||||
\fBsmartd\fP.
|
||||
This message string contains space characters and is NOT quoted. So to
|
||||
use $SMARTD_MESSAGE in a bash script you should probably enclose it in
|
||||
double quotes.
|
||||
.\" %IF NOT OS Windows
|
||||
.IP \fBSMARTD_FULLMESSAGE\fP 4
|
||||
is set to the contents of the entire email warning message string from
|
||||
\fBsmartd\fP.
|
||||
This message string contains space and return characters and is NOT quoted. So to
|
||||
use $SMARTD_FULLMESSAGE in a bash script you should probably enclose it in
|
||||
double quotes.
|
||||
.\" %ENDIF NOT OS Windows
|
||||
.\" %IF OS Windows
|
||||
.IP \fBSMARTD_FULLMSGFILE\fP 4
|
||||
[Windows only] is the path to a temporary file containing the full message.
|
||||
The path may contain space characters and is NOT quoted.
|
||||
The file is created by the smartd_warning.cmd script and removed when
|
||||
the mailer or command exits.
|
||||
.\" %ENDIF OS Windows
|
||||
.IP \fBSMARTD_TFIRST\fP 4
|
||||
is a text string giving the time and date at which the first problem
|
||||
of this type was reported. This text string contains space characters
|
||||
@ -1083,6 +1104,12 @@ Sun Feb 9 14:58:19 2003 CST
|
||||
.IP \fBSMARTD_TFIRSTEPOCH\fP 4
|
||||
is an integer, which is the unix epoch (number of seconds since Jan 1,
|
||||
1970) for \fBSMARTD_TFIRST\fP.
|
||||
.IP \fBSMARTD_PREVCNT\fP 4
|
||||
is an integer specifying the number of previous messages sent.
|
||||
It is set to \'0\' for the first message.
|
||||
.IP \fBSMARTD_NEXTDAYS\fP 4
|
||||
is an integer specifying the number of days until the next message will be sent.
|
||||
It it set to empty on \'\-M once\' and set to \'1\' on \'\-M daily\'.
|
||||
.RE
|
||||
.\" The following two lines are a workaround for a man2html bug. Please leave them.
|
||||
.\" They define a non-existent option; useful because man2html can't correctly reset the margins.
|
||||
@ -1107,10 +1134,10 @@ that would normally be provided to \'mail\'. Examples include:
|
||||
.fi
|
||||
|
||||
.\" %IF OS Windows
|
||||
Note that on Windows, the syntax of the \'\fBBlat\fP\' mailer is
|
||||
[Windows only] On Windows, the syntax of the \'\fBBlat\fP\' mailer is
|
||||
used:
|
||||
.nf
|
||||
- -q -subject "$SMARTD_SUBJECT" -to "$SMARTD_ADDRESS"
|
||||
- -q -subject "%SMARTD_SUBJECT%" -to %SMARTD_ADDRCSV%
|
||||
.fi
|
||||
|
||||
.\" %ENDIF OS Windows
|
||||
@ -1130,8 +1157,36 @@ will be copied to SYSLOG. The remainder of the output is then
|
||||
discarded.
|
||||
|
||||
Some EXAMPLES of scripts that can be used with the \'\-M exec\'
|
||||
Directive are given below. Some sample scripts are also included in
|
||||
Directive are given below.
|
||||
.\" %IF NOT OS Windows
|
||||
Some sample scripts are also included in
|
||||
/usr/local/share/doc/smartmontools/examplescripts/.
|
||||
.\" %ENDIF NOT OS Windows
|
||||
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE] The executable is run by the script
|
||||
.\" %IF NOT OS Windows
|
||||
/usr/local/etc/smartd_warning.sh.
|
||||
.\" %ENDIF NOT OS Windows
|
||||
.\" %IF OS ALL
|
||||
(Windows: EXEDIR/smartd_warning.cmd)
|
||||
.\" %ENDIF OS ALL
|
||||
.\" %IF OS Windows
|
||||
.\"! EXEDIR/smartd_warning.cmd.
|
||||
.\" %ENDIF OS Windows
|
||||
This script formats subject and full message based on SMARTD_MESSAGE and other
|
||||
environment variables set by \fBsmartd\fP.
|
||||
The environment variables
|
||||
.\" %IF NOT OS Windows
|
||||
SMARTD_SUBJECT and SMARTD_FULLMESSAGE
|
||||
.\" %ENDIF NOT OS Windows
|
||||
.\" %IF OS ALL
|
||||
(Windows: SMARTD_SUBJECT, SMARTD_FULLMSGFILE and SMARTD_ADDRCSV)
|
||||
.\" %ENDIF OS ALL
|
||||
.\" %IF OS Windows
|
||||
.\"! SMARTD_SUBJECT, SMARTD_FULLMSGFILE and SMARTD_ADDRCSV
|
||||
.\" %ENDIF OS Windows
|
||||
are set by the script before running the executable.
|
||||
|
||||
.TP
|
||||
.B \-f
|
||||
[ATA only] Check for \'failure\' of any Usage Attributes. If these
|
||||
@ -1193,7 +1248,7 @@ A common use of this Directive is to track the device Temperature
|
||||
|
||||
If the optional flag \'!\' is appended, a change of the Normalized
|
||||
value is considered critical. The report will be logged as LOG_CRIT
|
||||
and a warning email will be sent if \'-m\' is specified.
|
||||
and a warning email will be sent if \'\-m\' is specified.
|
||||
.TP
|
||||
.B \-R ID[!]
|
||||
[ATA only] When tracking, report whenever the \fIRaw\fP value of Attribute
|
||||
@ -1215,7 +1270,7 @@ Attributes.
|
||||
|
||||
If the optional flag \'!\' is appended, a change of the Raw
|
||||
value is considered critical. The report will be logged as
|
||||
LOG_CRIT and a warning email will be sent if \'-m\' is specified.
|
||||
LOG_CRIT and a warning email will be sent if \'\-m\' is specified.
|
||||
An example is \'-R 5!\' to warn when new sectors are reallocated.
|
||||
.TP
|
||||
.B \-C ID[+]
|
||||
@ -1271,7 +1326,7 @@ sectors dropped to 0. This typically happens when all offline uncorrectable
|
||||
sectors have been reallocated or could be read again.
|
||||
|
||||
An offline uncorrectable sector is a disk sector which was not
|
||||
readable during an off\-line scan or a self\-test. This is important
|
||||
readable during an off-line scan or a self-test. This is important
|
||||
to know, because if you have data stored in this disk sector, and you
|
||||
need to read it, the read will fail. Please see the previous \'\-C\'
|
||||
option for more details.
|
||||
@ -1283,7 +1338,7 @@ Report or Warn if the temperature is greater or equal than one of
|
||||
\fBINFO\fP or \fBCRIT\fP degrees Celsius.
|
||||
If the limit \fBCRIT\fP is reached, a message with loglevel
|
||||
\fB\'LOG_CRIT\'\fP will be logged to syslog and a warning email
|
||||
will be send if '-m' is specified. If only the limit \fBINFO\fP is
|
||||
will be send if \'\-m\' is specified. If only the limit \fBINFO\fP is
|
||||
reached, a message with loglevel \fB\'LOG_INFO\'\fP will be logged.
|
||||
|
||||
The warning email counter is reset if the temperature dropped below
|
||||
@ -1315,50 +1370,53 @@ To combine all of the above reports, use:
|
||||
.B \-W 2,40,45
|
||||
.fi
|
||||
|
||||
For ATA devices, smartd interprets Attribute 194 as Temperature Celsius
|
||||
For ATA devices, smartd interprets Attribute 194 or 190 as Temperature Celsius
|
||||
by default. This can be changed to Attribute 9 or 220 by the drive
|
||||
database or by the \'-v\' directive, see below.
|
||||
database or by the \'\-v 9,temp\' or \'\-v 220,temp\' directive.
|
||||
.TP
|
||||
.B \-F TYPE
|
||||
[ATA only] Modifies the behavior of \fBsmartd\fP to compensate for
|
||||
some known and understood device firmware bug. The arguments to this
|
||||
Directive are exclusive, so that only the final Directive given is
|
||||
used. The valid values are:
|
||||
[ATA only] Modifies the behavior of \fBsmartd\fP to compensate for some
|
||||
known and understood device firmware bug. This directive may be used
|
||||
multiple times. The valid arguments are:
|
||||
|
||||
.I none
|
||||
\- Assume that the device firmware obeys the ATA specifications. This
|
||||
is the default, unless the device has presets for \'\-F\' in the
|
||||
device database.
|
||||
drive database. Using this directive will over-ride any preset values.
|
||||
|
||||
.I nologdir
|
||||
\- Suppresses read attempts of SMART or GP Log Directory.
|
||||
Support for all standard logs is assumed without an actual check.
|
||||
Some Intel SSDs may freeze if log address 0 is read.
|
||||
|
||||
.I samsung
|
||||
\- In some Samsung disks (example: model SV4012H Firmware Version:
|
||||
RM100\-08) some of the two\- and four\-byte quantities in the SMART data
|
||||
structures are byte\-swapped (relative to the ATA specification).
|
||||
RM100-08) some of the two- and four-byte quantities in the SMART data
|
||||
structures are byte-swapped (relative to the ATA specification).
|
||||
Enabling this option tells \fBsmartd\fP to evaluate these quantities
|
||||
in byte\-reversed order. Some signs that your disk needs this option
|
||||
are (1) no self\-test log printed, even though you have run self\-tests;
|
||||
in byte-reversed order. Some signs that your disk needs this option
|
||||
are (1) no self-test log printed, even though you have run self-tests;
|
||||
(2) very large numbers of ATA errors reported in the ATA error log;
|
||||
(3) strange and impossible values for the ATA error log timestamps.
|
||||
|
||||
.I samsung2
|
||||
\- In some Samsung disks the number of ATA errors reported is byte swapped.
|
||||
Enabling this option tells \fBsmartd\fP to evaluate this quantity in
|
||||
byte\-reversed order.
|
||||
byte-reversed order.
|
||||
|
||||
.I samsung3
|
||||
\- Some Samsung disks (at least SP2514N with Firmware VF100\-37) report
|
||||
a self\-test still in progress with 0% remaining when the test was already
|
||||
\- Some Samsung disks (at least SP2514N with Firmware VF100-37) report
|
||||
a self-test still in progress with 0% remaining when the test was already
|
||||
completed. If this directive is specified, \fBsmartd\fP will not skip the
|
||||
next scheduled self\-test (see Directive \'\-s\' above) in this case.
|
||||
|
||||
Note that an explicit \'\-F\' Directive will over\-ride any preset
|
||||
values for \'\-F\' (see the \'\-P\' option below).
|
||||
next scheduled self-test (see Directive \'\-s\' above) in this case.
|
||||
|
||||
.I xerrorlba
|
||||
\- This only affects \fBsmartctl\fP.
|
||||
|
||||
[Please see the \fBsmartctl \-F\fP command-line option.]
|
||||
.TP
|
||||
.B \-v ID,FORMAT[:BYTEORDER][,NAME]
|
||||
[ATA only] Sets a vendor\-specific raw value print FORMAT, an optional
|
||||
[ATA only] Sets a vendor-specific raw value print FORMAT, an optional
|
||||
BYTEORDER and an optional NAME for Attribute ID.
|
||||
This directive may be used multiple times.
|
||||
Please see \fBsmartctl -v\fP command-line option for further details.
|
||||
@ -1444,10 +1502,7 @@ If you want more frequent information, use:
|
||||
If a non-comment entry in the configuration file is the text
|
||||
string \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP will
|
||||
ignore any remaining lines in the configuration file, and will scan
|
||||
for devices.
|
||||
|
||||
Configuration entries for devices not found by the platform\-specific
|
||||
device scanning may precede the \fBDEVICESCAN\fP entry.
|
||||
for devices (see also \fBsmartd\fP(8) man page).
|
||||
|
||||
If \fBDEVICESCAN\fP is not followed by any Directives, then smartd
|
||||
will scan for both ATA and SCSI devices, and will monitor all possible
|
||||
@ -1472,6 +1527,20 @@ will do the same, but only monitors the SMART health status of the
|
||||
devices, (rather than the default \-a, which monitors all SMART
|
||||
properties).
|
||||
|
||||
[NEW EXPERIMENTAL SMARTD FEATURE]
|
||||
Configuration entries for specific devices may precede the \fBDEVICESCAN\fP entry.
|
||||
For example
|
||||
.nf
|
||||
.B DEFAULT -m root@example.com
|
||||
.B /dev/sda -s S/../.././02
|
||||
.B /dev/sdc -d ignore
|
||||
.B DEVICESCAN -s L/../.././02
|
||||
.fi
|
||||
will scan for all devices except /dev/sda and /dev/sdc, monitor them, and run a long
|
||||
test between 2-3am every morning. Device /dev/sda will also be monitored, but
|
||||
only a short test will be run. Device /dev/sdc will be ignored.
|
||||
Warning emails will be sent for all monitored devices.
|
||||
|
||||
.TP
|
||||
.B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'
|
||||
These are two examples of shell scripts that can be used with the \'\-M
|
||||
@ -1534,17 +1603,21 @@ within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
|
||||
The remainder is flushed.
|
||||
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
\fBBruce Allen\fP smartmontools\-support@lists.sourceforge.net
|
||||
.fi
|
||||
.SH AUTHORS
|
||||
\fBBruce Allen\fP
|
||||
.br
|
||||
University of Wisconsin \- Milwaukee Physics Department
|
||||
.br
|
||||
\fBChristian Franke\fP (Windows interface, C++ redesign, most enhancements
|
||||
since 2009)
|
||||
.br
|
||||
\fBsmartmontools\-support@lists.sourceforge.net\fP
|
||||
|
||||
.PP
|
||||
.SH CONTRIBUTORS
|
||||
The following have made large contributions to smartmontools:
|
||||
.nf
|
||||
\fBCasper Dik\fP (Solaris SCSI interface)
|
||||
\fBChristian Franke\fP (Windows interface, C++ redesign, USB support, ...)
|
||||
\fBDouglas Gilbert\fP (SCSI subsystem)
|
||||
\fBGuido Guenther\fP (Autoconf/Automake packaging)
|
||||
\fBGeoffrey Keating\fP (Darwin ATA interface)
|
||||
@ -1565,7 +1638,7 @@ Many other individuals have made smaller contributions and corrections.
|
||||
.fi
|
||||
This code was derived from the smartsuite package, written by Michael
|
||||
Cornwell, and from the previous UCSC smartsuite package. It extends
|
||||
these to cover ATA\-5 disks. This code was originally developed as a
|
||||
these to cover ATA-5 disks. This code was originally developed as a
|
||||
Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
|
||||
(now part of the Storage Systems Research Center), Jack Baskin School
|
||||
of Engineering, University of California, Santa
|
||||
@ -1583,4 +1656,4 @@ SEE ALSO:
|
||||
|
||||
.SH
|
||||
SVN ID OF THIS PAGE:
|
||||
$Id: smartd.conf.5.in 3561 2012-06-05 19:49:31Z chrfranke $
|
||||
$Id: smartd.conf.5.in 3741 2013-01-02 17:06:54Z chrfranke $
|
||||
|
750
smartd.cpp
750
smartd.cpp
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
|
||||
# smartmontools init file for smartd
|
||||
# Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
# $Id: smartd.initd.in 3360 2011-06-06 19:25:36Z chrfranke $
|
||||
# $Id: smartd.initd.in 3727 2012-12-13 17:23:06Z samm2 $
|
||||
|
||||
# For RedHat and cousins:
|
||||
# chkconfig: 2345 40 40
|
||||
@ -27,8 +27,8 @@
|
||||
# Software Foundation; either version 2, or (at your option) any later
|
||||
# version.
|
||||
# You should have received a copy of the GNU General Public License (for
|
||||
# example COPYING); if not, write to the Free Software Foundation, Inc., 675
|
||||
# Mass Ave, Cambridge, MA 02139, USA.
|
||||
# example COPYING); if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
# This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
# at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
# Research Center), Jack Baskin School of Engineering, University of
|
||||
@ -227,6 +227,15 @@ elif [ -f /etc/SuSE-release ] ; then
|
||||
if test -n "$SMARTD_DRIVEDB" ; then
|
||||
smartd_opts="$smartd_opts -B $SMARTD_DRIVEDB"
|
||||
fi
|
||||
if test "$SMARTD_SAVESTATES" = "no" ; then
|
||||
smartd_opts="$smartd_opts -s \"\""
|
||||
fi
|
||||
if test "$SMARTD_ATTRLOG" = "no" ; then
|
||||
smartd_opts="$smartd_opts -A \"\""
|
||||
fi
|
||||
if test -n "$SMARTD_EXTRA_OPTS" ; then
|
||||
smartd_opts="$smartd_opts $SMARTD_EXTRA_OPTS"
|
||||
fi
|
||||
|
||||
# Shell functions sourced from /etc/rc.status:
|
||||
# rc_check check and set local and overall rc status
|
||||
@ -269,7 +278,7 @@ elif [ -f /etc/SuSE-release ] ; then
|
||||
|
||||
# We don't use startproc - we need to check for return code 17.
|
||||
if ! /sbin/checkproc $SMARTD_BIN ; then
|
||||
$SMARTD_BIN $smartd_opts
|
||||
eval $SMARTD_BIN$smartd_opts
|
||||
# Remember status and be verbose
|
||||
if test $? -ne 17 ; then
|
||||
rc_status -v
|
||||
|
209
smartd_warning.sh.in
Normal file
209
smartd_warning.sh.in
Normal file
@ -0,0 +1,209 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# smartd warning script
|
||||
#
|
||||
# Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# $Id: smartd_warning.sh.in 3809 2013-04-18 19:41:40Z chrfranke $
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Set by config.status
|
||||
PACKAGE="@PACKAGE@"
|
||||
VERSION="@VERSION@"
|
||||
prefix="@prefix@"
|
||||
sysconfdir="@sysconfdir@"
|
||||
|
||||
# Default mailer
|
||||
os_mailer="@os_mailer@"
|
||||
|
||||
# Plugin directory
|
||||
plugindir="$sysconfdir/smartd_warning.d"
|
||||
|
||||
# Parse options
|
||||
dryrun=
|
||||
case $1 in
|
||||
--dryrun) dryrun=t; shift ;;
|
||||
esac
|
||||
|
||||
if [ $# != 0 ]; then
|
||||
cat <<EOF
|
||||
smartd $VERSION warning message script
|
||||
|
||||
Usage:
|
||||
export SMARTD_MAILER='Path to external script, empty for "$os_mailer"'
|
||||
export SMARTD_ADDRESS='Space separated mail adresses, empty if none'
|
||||
export SMARTD_MESSAGE='Error Message'
|
||||
export SMARTD_FAILTYPE='Type of failure, "EMailTest" for tests'
|
||||
export SMARTD_TFIRST='Date of first message sent, empty if none'
|
||||
#export SMARTD_TFIRSTEPOCH='time_t format of above'
|
||||
export SMARTD_PREVCNT='Number of previous messages, 0 if none'
|
||||
export SMARTD_NEXTDAYS='Number of days until next message, empty if none'
|
||||
export SMARTD_DEVICEINFO='Device identify information'
|
||||
#export SMARTD_DEVICE='Device name'
|
||||
#export SMARTD_DEVICESTRING='Annotated device name'
|
||||
#export SMARTD_DEVICETYPE='Device type from -d directive, "auto" if none'
|
||||
$0 [--dryrun]
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${SMARTD_ADDRESS}${SMARTD_MAILER}" ]; then
|
||||
echo "$0: SMARTD_ADDRESS or SMARTD_MAILER must be set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get host and domain names
|
||||
for cmd in @os_hostname@ 'echo "[Unknown]"'; do
|
||||
hostname=`eval $cmd 2>/dev/null` || continue
|
||||
test -n "$hostname" || continue
|
||||
break
|
||||
done
|
||||
|
||||
dnsdomain=${hostname#*.}
|
||||
if [ "$dnsdomain" != "$hostname" ]; then
|
||||
# hostname command printed FQDN
|
||||
hostname=${hostname%%.*}
|
||||
else
|
||||
for cmd in @os_dnsdomainname@ 'echo'; do
|
||||
dnsdomain=`eval $cmd 2>/dev/null` || continue
|
||||
break
|
||||
done
|
||||
test "$dnsdomain" != "(none)" || dnsdomain=
|
||||
fi
|
||||
|
||||
for cmd in @os_nisdomainname@ 'echo'; do
|
||||
nisdomain=`eval $cmd 2>/dev/null` || continue
|
||||
break
|
||||
done
|
||||
test "$nisdomain" != "(none)" || nisdomain=
|
||||
|
||||
# Format subject
|
||||
export SMARTD_SUBJECT="SMART error (${SMARTD_FAILTYPE-[SMARTD_FAILTYPE]}) detected on host: $hostname"
|
||||
|
||||
# Format message
|
||||
fullmessage=`
|
||||
echo "This message was generated by the smartd daemon running on:"
|
||||
echo
|
||||
echo " host name: $hostname"
|
||||
echo " DNS domain: ${dnsdomain:-[Empty]}"
|
||||
test -z "$nisdomain" ||
|
||||
echo " NIS domain: $nisdomain"
|
||||
@OS_WIN32_TRUE@test -z "$USERDOMAIN" ||
|
||||
@OS_WIN32_TRUE@ echo " Win domain: $USERDOMAIN"
|
||||
echo
|
||||
echo "The following warning/error was logged by the smartd daemon:"
|
||||
echo
|
||||
echo "${SMARTD_MESSAGE-[SMARTD_MESSAGE]}"
|
||||
echo
|
||||
echo "Device info:"
|
||||
echo "${SMARTD_DEVICEINFO-[SMARTD_DEVICEINFO]}"
|
||||
echo
|
||||
echo "For details see host's SYSLOG."
|
||||
if [ "$SMARTD_FAILTYPE" != "EmailTest" ]; then
|
||||
echo
|
||||
echo "You can also use the smartctl utility for further investigation."
|
||||
test "$SMARTD_PREVCNT" = "0" ||
|
||||
echo "The original message about this issue was sent at ${SMARTD_TFIRST-[SMARTD_TFIRST]}"
|
||||
case $SMARTD_NEXTDAYS in
|
||||
'') echo "No additional messages about this problem will be sent." ;;
|
||||
1) echo "Another message will be sent in 24 hours if the problem persists." ;;
|
||||
*) echo "Another message will be sent in $SMARTD_NEXTDAYS days if the problem persists." ;;
|
||||
esac
|
||||
fi
|
||||
`
|
||||
|
||||
# Export message with trailing newline
|
||||
export SMARTD_FULLMESSAGE="$fullmessage
|
||||
"
|
||||
|
||||
# Run plugin scripts if requested
|
||||
case " $SMARTD_ADDRESS" in
|
||||
*\ @*)
|
||||
if [ -n "$dryrun" ]; then
|
||||
echo "export SMARTD_SUBJECT='$SMARTD_SUBJECT'"
|
||||
echo "export SMARTD_FULLMESSAGE='$SMARTD_FULLMESSAGE'"
|
||||
fi
|
||||
|
||||
# Run ALL scripts if requested
|
||||
case " $SMARTD_ADDRESS " in
|
||||
*\ @ALL\ *)
|
||||
for cmd in "$plugindir"/*; do
|
||||
if [ -f "$cmd" ] && [ -x "$cmd" ]; then
|
||||
if [ -n "$dryrun" ]; then
|
||||
echo "$cmd </dev/null"
|
||||
else
|
||||
"$cmd" </dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
# Run selected scripts
|
||||
addrs=$SMARTD_ADDRESS
|
||||
SMARTD_ADDRESS=
|
||||
for ad in $addrs; do
|
||||
case $ad in
|
||||
@ALL)
|
||||
;;
|
||||
@?*)
|
||||
cmd="$plugindir/${ad#@}"
|
||||
if [ -f "$cmd" ] && [ -x "$cmd" ]; then
|
||||
if [ -n "$dryrun" ]; then
|
||||
echo "$cmd </dev/null"
|
||||
else
|
||||
"$cmd" </dev/null
|
||||
fi
|
||||
elif [ ! -e "$cmd" ]; then
|
||||
echo "$cmd: Not found" >&2
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
SMARTD_ADDRESS="${SMARTD_ADDRESS:+ }$ad"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Send email to remaining addresses
|
||||
test -n "$SMARTD_ADDRESS" || exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Send mail or run command
|
||||
if [ -n "$SMARTD_ADDRESS" ]; then
|
||||
|
||||
# Send mail, use platform mailer by default
|
||||
test -n "$SMARTD_MAILER" || SMARTD_MAILER=$os_mailer
|
||||
if [ -n "$dryrun" ]; then
|
||||
echo "exec '$SMARTD_MAILER' -s '$SMARTD_SUBJECT' $SMARTD_ADDRESS <<EOF
|
||||
$fullmessage
|
||||
EOF"
|
||||
else
|
||||
exec "$SMARTD_MAILER" -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS <<EOF
|
||||
$fullmessage
|
||||
EOF
|
||||
fi
|
||||
|
||||
elif [ -n "$SMARTD_MAILER" ]; then
|
||||
|
||||
# Run command
|
||||
if [ -n "$dryrun" ]; then
|
||||
echo "export SMARTD_SUBJECT='$SMARTD_SUBJECT'"
|
||||
echo "export SMARTD_FULLMESSAGE='$SMARTD_FULLMESSAGE'"
|
||||
echo "exec '$SMARTD_MAILER' </dev/null"
|
||||
else
|
||||
unset SMARTD_ADDRESS
|
||||
exec "$SMARTD_MAILER" </dev/null
|
||||
fi
|
||||
|
||||
fi
|
59
utility.cpp
59
utility.cpp
@ -4,7 +4,7 @@
|
||||
* Home page of code is: http://smartmontools.sourceforge.net
|
||||
*
|
||||
* Copyright (C) 2002-12 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2008-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
|
||||
* Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -13,8 +13,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -53,7 +52,7 @@
|
||||
#include "atacmds.h"
|
||||
#include "dev_interface.h"
|
||||
|
||||
const char * utility_cpp_cvsid = "$Id: utility.cpp 3500 2012-01-01 18:03:36Z chrfranke $"
|
||||
const char * utility_cpp_cvsid = "$Id: utility.cpp 3739 2013-01-01 16:32:48Z chrfranke $"
|
||||
UTILITY_H_CVSID INT64_H_CVSID;
|
||||
|
||||
const char * packet_types[] = {
|
||||
@ -91,7 +90,7 @@ std::string format_version_info(const char * prog_name, bool full /*= false*/)
|
||||
"(build date "__DATE__")" // checkout without expansion of Id keywords
|
||||
#endif
|
||||
" [%s] "BUILD_INFO"\n"
|
||||
"Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net\n",
|
||||
"Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org\n",
|
||||
prog_name, smi()->get_os_version_str().c_str()
|
||||
);
|
||||
if (!full)
|
||||
@ -503,27 +502,6 @@ int split_report_arg(char *s, int *i)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// same as above but sets *i to -1 if missing , argument
|
||||
int split_report_arg2(char *s, int *i){
|
||||
char *tailptr;
|
||||
s+=6;
|
||||
|
||||
if (*s=='\0' || !isdigit((int)*s)) {
|
||||
// What's left must be integer
|
||||
*i=-1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
*i = (int) strtol(s, &tailptr, 10);
|
||||
if (errno || *tailptr != '\0') {
|
||||
*i=-1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRTOULL
|
||||
// Replacement for missing strtoull() (Linux with libc < 6, MSVC)
|
||||
// Functionality reduced to requirements of smartd and split_selective_arg().
|
||||
@ -617,6 +595,8 @@ int split_selective_arg(char *s, uint64_t *start,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
*stop = strtoull(s+1, &tailptr, 0);
|
||||
if (errno || *tailptr != '\0')
|
||||
return 1;
|
||||
@ -704,33 +684,6 @@ bool nonempty(const void * data, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// This routine converts an integer number of milliseconds into a test
|
||||
// string of the form Xd+Yh+Zm+Ts.msec. The resulting text string is
|
||||
// written to the array.
|
||||
void MsecToText(unsigned int msec, char *txt){
|
||||
unsigned int days, hours, min, sec;
|
||||
|
||||
days = msec/86400000U;
|
||||
msec -= days*86400000U;
|
||||
|
||||
hours = msec/3600000U;
|
||||
msec -= hours*3600000U;
|
||||
|
||||
min = msec/60000U;
|
||||
msec -= min*60000U;
|
||||
|
||||
sec = msec/1000U;
|
||||
msec -= sec*1000U;
|
||||
|
||||
if (days) {
|
||||
txt += sprintf(txt, "%2dd+", (int)days);
|
||||
}
|
||||
|
||||
sprintf(txt, "%02d:%02d:%02d.%03d", (int)hours, (int)min, (int)sec, (int)msec);
|
||||
return;
|
||||
}
|
||||
|
||||
// Format integer with thousands separator
|
||||
const char * format_with_thousands_sep(char * str, int strsize, uint64_t val,
|
||||
const char * thousands_sep /* = 0 */)
|
||||
|
10
utility.h
10
utility.h
@ -13,8 +13,7 @@
|
||||
* any later version.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* (for example COPYING); if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This code was originally developed as a Senior Thesis by Michael Cornwell
|
||||
* at the Concurrent Systems Laboratory (now part of the Storage Systems
|
||||
@ -26,7 +25,7 @@
|
||||
#ifndef UTILITY_H_
|
||||
#define UTILITY_H_
|
||||
|
||||
#define UTILITY_H_CVSID "$Id: utility.h 3558 2012-06-05 16:42:05Z chrfranke $"
|
||||
#define UTILITY_H_CVSID "$Id: utility.h 3719 2012-12-03 21:19:33Z chrfranke $"
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/types.h> // for regex.h (according to POSIX)
|
||||
@ -95,8 +94,6 @@ void syserror(const char *message);
|
||||
|
||||
// Function for processing -r option in smartctl and smartd
|
||||
int split_report_arg(char *s, int *i);
|
||||
// Function for processing -c option in smartctl and smartd
|
||||
int split_report_arg2(char *s, int *i);
|
||||
|
||||
// Function for processing -t selective... option in smartctl
|
||||
int split_selective_arg(char *s, uint64_t *start, uint64_t *stop, int *mode);
|
||||
@ -183,9 +180,6 @@ bool nonempty(const void * data, int size);
|
||||
// needed to fix glibc bug
|
||||
void FixGlibcTimeZoneBug();
|
||||
|
||||
// convert time in msec to a text string
|
||||
void MsecToText(unsigned int msec, char *txt);
|
||||
|
||||
// Format integer with thousands separator
|
||||
const char * format_with_thousands_sep(char * str, int strsize, uint64_t val,
|
||||
const char * thousands_sep = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user