]> git.proxmox.com Git - mirror_smartmontools-debian.git/commitdiff
Imported Upstream version 6.4+svn4109
authorJonathan Dowland <jmtd@debian.org>
Wed, 18 Nov 2015 21:45:13 +0000 (21:45 +0000)
committerJonathan Dowland <jmtd@debian.org>
Wed, 18 Nov 2015 21:45:13 +0000 (21:45 +0000)
37 files changed:
AUTHORS
ChangeLog
INSTALL
Makefile.am
NEWS
README
WARNINGS [deleted file]
aacraid.h
atacmds.cpp
atacmds.h
ataidentify.cpp
ataprint.cpp
autogen.sh
configure.ac
do_release
drivedb.h
os_linux.cpp
os_win32.cpp
os_win32/installer.nsi
os_win32/vc10/smartctl.vcxproj
os_win32/vc10/smartctl.vcxproj.filters
os_win32/vc10/smartd.vcxproj
os_win32/vc10/smartd.vcxproj.filters
scsiata.cpp
scsicmds.cpp
scsicmds.h
scsiprint.cpp
smartctl.8.in
smartctl.cpp
smartd.8.in
smartd.conf
smartd.conf.5.in
smartd.cpp
update-smart-drivedb.8.in
update-smart-drivedb.in
utility.cpp
utility.h

diff --git a/AUTHORS b/AUTHORS
index 74af81593cc9e4ac282f6455ab5e9327c4dfdc05..748dbfaa0f93ac977a695b4c33fa76e762d4eee8 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,39 +1,40 @@
-$Id: AUTHORS 3751 2013-01-18 21:19:43Z chrfranke $
+$Id: AUTHORS 4101 2015-05-30 17:52:05Z chrfranke $
 
-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/
+Developers / Maintainers / Contributors:
 
-This package is meant to be an up-to-date replacement for the
-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>
+Raghava Aditya          <...>
+Bruce Allen             <...>
+Erik Inge Bolsø         <...>
 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>
+Casper Dik              <...>
 Christian Franke        <franke@computer.org>
-Guilhem Frézou          <guilhem.frezou@catii.fr>
+Guilhem Frézou          <...>
 Douglas Gilbert         <dgilbert@interlog.com>
 Guido Guenther          <agx@sigxcpu.org>
 Jordan Hargrave         <jordan_hargrave@dell.com>
-Joerg Hering            <hering.ruegen@gmx.de>
+Joerg Hering            <...>
 Geoff Keating           <geoffk@geoffk.org>
-Dr. David Kirkby        <drkirkby@ntlworld.com>
+Dr. David Kirkby        <...>
+Dan Lukes               <dan+smartmontools.changelog@obluda.cz>
 Kai Mäkisara            <kai.makisara@kolumbus.fi>
+Nidhi Malhotra          <nidhi.malhotra@pmcs.com>
 Eduard Martinescu       <martines@rochester.rr.com>
-Frédéric L. W. Meunier  <http://www.pervalidus.net/contact.html>
+Frédéric L. W. Meunier  <...>
 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>
+Tommy Vestermark        <tommy.vestermark@gmail.com>
+Roger Willcocks         <roger@filmlight.ltd.uk>
+Phil Williams           <...>
+Hank Wu                 <hank@areca.com.tw>
 Shengfeng Zhou          <linux@highpoint-tech.com>
 Richard Zybert          <richard.zybert@zybert.co.uk>
+
+The first smartmontools code was derived from the smartsuite package,
+written by Michael Cornwell and Andre Hedrick.
index e4da24817b203067771737c2ced79455afbbce28..d5ac441c434fa41d3964b946b4d88984797267df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,424 @@
-$Id: ChangeLog 4002 2014-10-07 11:11:49Z samm2 $
+$Id: ChangeLog 4109 2015-06-04 16:30:15Z chrfranke $
+
+2015-06-04  Christian Franke  <franke@computer.org>
+
+       smartmontools 6.4
+
+2015-06-03  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - InnoDisk iCF 9000 CompactFlash Cards
+       - SanDisk based SSDs: ReadyCache SSD
+       - Seagate Barracuda 7200.14 (AF): Apple OEM
+       - USB: Toshiba Canvio Basics (0x0480:0xa200)
+
+       ataprint.cpp: Read General Purpose Log Directory only if GPL
+       feature set is supported.  Improve support check of old logs
+       for older drives which return empty SMART Log Directory.
+
+2015-06-01  Christian Franke  <franke@computer.org>
+
+       Makefile.am, smartd.8.in: Hide initscript documentation if
+       initscriptdir is not configured.
+       smartd.conf.5.in: Remove outdated info about default shell.
+
+2015-05-30  Christian Franke  <franke@computer.org>
+
+       Fixes for aacraid patch:
+       aacraid.h: Fix _WIN32/_WIN64 checks.
+       os_win32.cpp: Clarify copyright info in GPL header.
+       Improve source code formatting.
+       Fix build on Cygwin.  Fix HKEY leak.
+       Fix member initialization order.
+       Fix info_name and dev_type parameter order.
+       Improve error handling.  Avoid unsafe sprintf().
+       Remove unused variables.  Add help text.
+       Use 0 as number of first aacraid controller as on Linux.
+
+       smartctl.8.in, smartd.conf.5.in: Update '-d aacraid' documentation.
+       AUTHORS: Add Nidhi Malhotra.
+
+2015-05-30  Nidhi Malhotra  <nidhi.malhotra@pmcs.com>
+
+       aacraid.h, os_win32.cpp:
+       Add aacraid support for Windows (ticket #496).
+
+2015-05-27  Christian Franke  <franke@computer.org>
+
+       INSTALL: Update ./configure description.
+       Remove info about old Linux kernel series.
+       Update Windows info.
+
+2015-05-19  Christian Franke  <franke@computer.org>
+
+       ataprint.cpp: Print the Additional Product Identifier (OEM Id)
+       regardless of '-q noserial' option.
+
+       smartctl.8.in, smartd.conf.5.in: Clarify '-H' option and directive.
+
+2015-05-17  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - USB: ViPowER USB3.0 Storage (0x0350:0x0038)
+       - USB: Buffalo DriveStation HD-LBU2 (0x0411:0x01ea)
+       - USB: Toshiba Stor.E Basics; (0x0480:0xa00e)
+       - USB: Toshiba Canvio Desktop (0x0480:0xd011)
+       - USB: Samsung M3 Portable USB 3.0 (0x04e8:0x61b3)
+       - USB: Iomega (0x059b:0x0575)
+       - USB: Genesys Logic GL3310 (0x05e3:0x0731)
+       - USB: Freecom HD (0x07ab:0xfcd6)
+       - USB: Apricorn SATA Wire (0x0984:0x0040)
+       - USB: WD My Passport (0x1058:0x0830)
+       - USB: WD My Book: Merge entries, add 0x1058:0x0900, 0x1058:0x1104
+       - USB: Initio (0x13fd:0x3940)
+       - USB: Super Top (0x14cd:0x6116): change to -d sat
+       - USB: JMicron (0x152d:0x2590) (ticket #550)
+       - USB: ASMedia ASM1053/1153 (0x174c:0x1[01]53)
+       - USB: Verbatim Pocket Hard Drive (0x18a5:0x0237)
+       - USB: Verbatim External Hard Drive (0x18a5:0x0400)
+       - USB: VIA VL701 (0x2109:0x0701)
+       - USB: Unknown (0x2537:0x106[68])
+       - USB: Hitachi Touro Mobile (0x4971:0x1020)
+
+2015-05-16  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Samsung SpinPoint T166: 250GB
+       - Seagate Samsung SpinPoint M8 (AF): Rename, add Apple OEM
+       - Seagate Samsung SpinPoint M9T
+       - Seagate Samsung SpinPoint M9TU (USB)
+       - Hitachi/HGST Travelstar Z5K320
+       - HGST Travelstar Z5K1000
+       - HGST Deskstar NAS: 128MB cache variants
+       - HGST Ultrastar He6
+       - Toshiba 2.5" HDD MK..51GSY
+       - Toshiba 2.5" HDD MK..61GSY[N]: -v 9,minutes
+       - Toshiba 2.5" HDD MK..61GSYB
+       - Toshiba 2.5" HDD MK..75GSX
+       - Toshiba 2.5" HDD MQ01ABB...
+       - Toshiba 2.5" HDD MQ01ABC...
+       - Toshiba 2.5" HDD MQ01ABF...
+       - Toshiba 2.5" HDD MQ01UBB... (USB 3.0)
+       - Toshiba 3.5" MD04ACA... Enterprise HDD
+       - Toshiba 3.5" DT01ABA... Desktop HDD
+       - Seagate Laptop Thin HDD: 7200 rpm variants
+       - Seagate Constellation ES.2 (SATA 6Gb/s): HP OEM
+       - Seagate Constellation.2 (SATA): HP OEM
+       - Seagate Enterprise Capacity 3.5 HDD
+       - Seagate Archive HDD
+       - Western Digital AV-GP (AF): 500MB, EURX variants
+       - Western Digital Red Pro
+       - Western Digital Purple
+
+2015-05-14  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs:
+         MX200 *00 sizes (ticket #545)
+       - Samsung based SSDs: PM851, SM841N, 850 EVO
+       - Marvell based SanDisk SSDs: Extreme Pro, Ultra II (ticket #544)
+       - Marvell based SanDisk SSDs: X110 mSATA, X300
+       - SanDisk based SSDs: pSSD (USB), U110
+       - USB: Samsung D3 Station 4TB (0x04e8:0x6125) (ticket #549)
+       - USB: Seagate Backup Plus USB 3.0 (0x0bc2:0xa003)
+       - USB: Seagate Backup Plus Desktop USB 3.0 5TB (0x0bc2:0xab31)
+       - USB: JMicron (0x152d:0x3569) (ticket #546)
+
+2015-05-10  Christian Franke  <franke@computer.org>
+
+       scsicmds.cpp, scsicmds.h: Remove unused functions
+       scsiReceiveDiagnostic() and scsiSmartIBMOfflineTest().
+       Found by cppcheck.
+
+2015-05-05  Christian Franke  <franke@computer.org>
+
+       ataprint.cpp: Print ACS-3 device statistics DSN flags.
+       Print device statistics page numbers in hex.
+       smartctl.cpp: Allow hex argument for '-l devstat,PAGE'.
+
+2015-05-02  Christian Franke  <franke@computer.org>
+
+       ataprint.cpp: Print Transport Type for PATA and PCIe.
+       Print diagnostic values if SATA version or speed is unknown.
+       smartctl.8.in, smartd.8.in: Add Volker Kuhlmann to AUTHORS section.
+
+2015-05-01  Christian Franke  <franke@computer.org>
+
+       ataidentify.cpp: ACS-3/4 updates.
+       ataprint.cpp: Add recent ACS-3/4 minor revisions.
+       Add ACS-4 log 0x0f.  Add ACS-4 device statistics values and
+       vendor specific statistics page.
+
+2015-04-28  Christian Franke  <franke@computer.org>
+
+       os_win32/installer.nsi: Fix possible loss of user PATH environment
+       variable with length greater than NSIS max string length.
+
+2015-04-26  Christian Franke  <franke@computer.org>
+
+       do_release: New Signing Key.
+       Makefile.am: Use make variables instead of autoconf variables
+       if possible.
+
+2015-04-24  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in, smartd.8.in: Rework AUTHORS section.
+       INSTALL, Makefile.am, os_win32/installer.nsi:
+       Remove WARNINGS file.
+       WARNINGS: Remove this file.
+
+2015-04-23  Christian Franke  <franke@computer.org>
+
+       configure.ac: Add '--with-systemdenvfile=auto' option as new default.
+       Remove no longer needed ENABLE_CAPABILITIES conditional.
+       Makefile.am: Silence build of smartd.service file.
+       Integrate all ENABLE_* conditionals in MAN_FILTER script.
+
+2015-04-21  Christian Franke  <franke@computer.org>
+
+       configure.ac: Print 'deprecated' warning for '--disable-drivedb',
+       '--enable-savestates', '--enable-attributelog' options.
+       Add 'yes|no' support to corresponding '--with-...' options.
+
+2015-04-19  Christian Franke  <franke@computer.org>
+
+       AUTHORS: Remove smartmontools-support list address.
+       Remove defunct mail addresses.  Update smartsuite info.
+       Add recent contributors.
+       README: Refer to AUTHORS.
+
+2015-04-18  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Add SAT autodetection based on vendor string from
+       IOCTL_STORAGE_QUERY_PROPERTY.
+       smartd.cpp: If SMART ENABLE command failed, continue if SMART is
+       already enabled.
+
+2015-04-17  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Detect SAT layer of certain Intel AHCI drivers.
+
+2015-04-15  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in, smartd.8.in, update-smart-drivedb.8.in:
+       Add REPORTING BUGS section.
+       smartctl.8.in, smartd.8.in:
+       Rename RETURN VALUE section to EXIT STATUS.
+       smartd.8.in: Remove no longer used exit status 9.
+
+2015-04-14  Christian Franke  <franke@computer.org>
+
+       autogen.sh: automake 1.15 works.
+       Print 'deprecated' warning if automake < 1.10 is used.
+
+2015-04-08  Christian Franke  <franke@computer.org>
+
+       configure.ac: Print 'deprecated' warning if autoconf 2.5x or
+       --with-docdir option is used.
+       Add comments to fix vim syntax coloring.
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in:
+       Remove EXPERIMENTAL notes for features added before 6.3.
+
+2015-03-29  Christian Franke  <franke@computer.org>
+
+       ataprint.cpp: Read only required log pages of Extended Comprehensive
+       Error log.  This adds support for logs with many pages (ticket #498).
+       atacmds.cpp, atacmds.h, smartd.cpp: Add 'page' parameter to function
+       ataReadExtErrorLog().
+
+2015-03-22  Christian Franke  <franke@computer.org>
+
+       os_linux.cpp, smartctl.8.in, smartd.8.in, smartd.conf, smartd.conf.5.in,
+       smartd.cpp: Remove old Linux IDE device names (/dev/hdX) in man pages
+       and help texts.
+
+2015-03-21  Christian Franke  <franke@computer.org>
+
+       smartd.8.in, smartd.cpp: Clarify smartd '--capabilities' option
+       (ticket #523).
+
+2015-03-20  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs: Rename, add MX200
+       - Sandforce Driven SSDs: ATP Velocity MIV, Mushkin Chronos Enhanced
+       - Indilinx Barefoot 3 based SSDs: OCZ VERTEX 460, OCZ AMD Radeon R7
+       - Intel 530 Series SSDs: mSATA variant
+       - JMicron based SSDs: ADATA SP310
+       - Plextor M3/M5/M6 Series SSDs: Rename, add M6M, M6S
+
+2015-03-13  Douglas Gilbert  <dgilbert@interlog.com>
+
+       scsiata.cpp
+       - SCSI to ATA translation: from SAT-2 and later a SAT layer may
+         return ATA registers via fixed format sense data. Change to
+         additionally accept (partial) fixed format sense. In response
+         to ticket #296 and FreeBSD Bug 191717.
+
+2015-03-10  Douglas Gilbert  <dgilbert@interlog.com>
+
+       scsicmds.cpp, scsiprint.cpp
+       - SCSI: when READ DEFECT yields sense of "... defect list not found"
+         bypass the corresponding report quietly. (ticket #343)
+
+2015-02-08  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - USB: Buffalo Drivestation Duo (0x0411:0x01ce)
+       - USB: Toshiba Canvio Basics (0x0480:0x0201, 0xa00d)
+       - USB: Toshiba Stor.E Basics (0x0480:0xa00c)
+       - USB: Toshiba Canvio ALU (0x0480:0xa100)
+       - USB: Toshiba Canvio Desktop (0x0480:0xd000)
+       - USB: Samsung S2 Portable (0x04e8:0x1f0a)
+       - USB: Samsung S3 Portable (0x04e8:0x61c8)
+       - USB: LaCie Rugged Triple Interface (0x059f:0x100c)
+       - USB: Initio (0x13fd:0x3910)
+       - USB: ASMedia (0x174c:0x5516)
+       - USB: Innostor IS611 (0x1f75:0x0611)
+
+2015-02-02  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - USB: Seagate FreeAgent XTreme (0x0bc2:0x3101)
+       - USB: Seagate Expansion Portable (0x0bc2:0x232[01])
+       - USB: Seagate Expansion External (0x0bc2:0x3321)
+       - USB: Seagate FreeAgent GoFlex (0x0bc2:0x5070, 0x50a7, 0x6121)
+       - USB: Seagate Slim Portable Drive (0x0bc2:0xab00) (ticket #517)
+       - USB: Seagate Backup Plus Slim (0x0bc2:0xab21)
+       - USB: ADATA HD650 (0x125f:0xa35a)
+       - USB: JMicron JMS567 (0x152d:0x3562) (ticket #508)
+       - USB: Innostor IS621 (0x1f75:0x0621) (ticket #517)
+
+2015-01-25  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - JMicron based SSDs: Transcend SSD340 (ticket #348)
+       - SiliconMotion based SSDs: Transcend SSD370 (ticket #468)
+
+2015-01-24  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Add Windows 10 to get_os_version_str().
+
+2015-01-01  Christian Franke  <franke@computer.org>
+
+       Happy New Year! Update copyright year in version info.
+
+2014-12-13  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - USB: SanDisk SDCZ80 Flash Drive (0x0781:0x5580)
+       - USB: WD My Passport: Merge entries, add 0x1058:0x0810
+       - USB: WD Elements Desktop: Merge entries, add 0x1058:0x107c
+       - USB: WD Elements: Merge entries
+       - USB: JMicron JMS539 (0x152d:0x0539): 2.06 and 28.03 support SAT
+         (ticket #504)
+       - USB: JMicron JMS567 (0x152d:0x0567) (ticket #504)
+       - USB: JMicron JMS566 (0x152d:0x2566)
+       - USB: Hitachi Touro (0x4971:0x1014)
+
+2014-12-13  Christian Franke  <franke@computer.org>
+
+       utility.cpp, utility.h: Remove unused functions Calloc() and
+       CheckFree().
+
+2014-12-10  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Western Digital Blue: Rename, *AZLX variant
+       - Western Digital RE4: *FBYZ variant
+       - Western Digital Green: Rename, add 5TB, 6TB
+       - Western Digital AV: Rename, add 1TB, *BUCT variant
+       - Western Digital Red: Rename, add 750GB, 5TB, 6TB
+       - Western Digital Black Mobile
+
+2014-12-08  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Hitachi Travelstar 5K500.B: *SA00 variant
+       - Hitachi/HGST Travelstar Z5K500: Hitachi variant, Apple OEM
+       - HGST Travelstar 5K1000
+       - HGST Travelstar 5K1500
+       - Hitachi Travelstar 7K500: *A360 variant
+       - Hitachi CinemaStar 5K320
+       - Hitachi Deskstar 7K1000.C: SATA 6Gb/s variants
+       - HGST Deskstar NAS
+       - Hitachi/HGST Ultrastar 7K4000: Rename, add HGST
+       - HGST MegaScale 4000
+
+2014-12-07  Christian Franke  <franke@computer.org>
+
+       os_linux.cpp: Fix fd leak in megasas_dcmd_cmd().  Found by cppcheck.
+
+2014-12-07  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Crucial/Micron MX100/M500/M510/M550/M600 Client SSDs: M600 EE variant
+       - SandForce Driven SSDs: Kingston KC300 180GB
+       - Indilinx Barefoot 3 based SSDs: OCZ Vector 150
+       - JMicron based SSDs: Kingston SSDNow V+
+       - Plextor M3/M5 (Pro) Series SSDs: M5P
+       - Samsung based SSDs: 850 PRO, SM853T Series
+
+2014-12-06  Christian Franke  <franke@computer.org>
+
+       Makefile.am: Add quotes to parameters of INSTALL commands to allow path
+       names with spaces (this is supported since automake 1.8).
+       update-smart-drivedb.in: Add quotes to SMARTCTL variable (ticket #502).
+
+2014-11-30  Christian Franke  <franke@computer.org>
+
+       drivedb.h:
+       - Crucial/Micron RealSSD m4/C400/P400: C400 *MAM variant
+       - Crucial/Micron MX100/M500/M510/M550/M600 Client SSDs: Rename,
+       add Crucial M500/M550, Micron M600
+       - SandForce Driven SSDs: ADATA SX900 (ticket #490), Mushkin Atlas
+       - Intel 311/313 Series SSDs: Rename, add 311 Series
+
+2014-11-30  Christian Franke  <franke@computer.org>
+
+       drivedb.h: USB: Prolific PL2571, PL2771, PL2775 (0x067b:0x2.7.)
+       (ticket #499).
+       smartctl.8.in, smartd.conf.5.in: Update '-d usbprolific' documentation.
+
+2014-11-29  Christian Franke  <franke@computer.org>
+
+       smartctl.8.in, smartd.8.in, smartd.conf.5.in, update-smart-drivedb.8.in:
+       Add package title to page header.  Move PACKAGE VERSION section to bottom
+       of page.  Remove SVN ID section header.
+
+2014-11-29  Tommy Vestermark  <tommy.vestermark@gmail.com>
+
+       scsiata.cpp: Add DATA OUT support for Prolific (ticket #482).
+       Add more ATA output registers.  SCT commands are now supported.
+
+2014-11-29  Christian Franke  <franke@computer.org>
+
+       os_win32.cpp: Add strnicmp() compatibility macro for newer Cygwin
+       releases.
+
+2014-11-16  Tommy Vestermark  <tommy.vestermark@gmail.com>
+
+       drivedb.h: USB: Prolific PL2773 (0x067b:0x2773) (ticket #482).
+
+2014-11-16  Christian Franke  <franke@computer.org>
+
+       Create branches RELEASE_6_[1-3]_DRIVEDB with last drivedb.h file
+       compatible with smartmontools 6.[1-3].
+
+2014-11-10  Tommy Vestermark  <tommy.vestermark@gmail.com>
+
+       scsiata.cpp: Add class usbprolific_device to support Prolific PL2773
+       USB bridges (ticket #482).
+       smartctl.8.in, smartd.conf.5.in: Document '-d usbprolific'.
+
+2014-11-09  Roger Willcocks  <roger@filmlight.ltd.uk>
+
+       os_linux.cpp: linux_aacraid_device: Fix ioctl data count
+       if dxfer_len == 0.  Return scsi sense data.  Together these
+       allow the SMART STATUS command to operate correctly.
+       Improve SRB status checks.
+       linux_ata_device: Fix very old bug in the error handling
+       of HDIO_DRIVE_TASKFILE.
 
 2014-10-07  Alex Samorukov  <samm@os2.kiev.ua>
 
diff --git a/INSTALL b/INSTALL
index 3335f63efa9eecf8da9933009a8d3aa508374e53..49a647920a6f89d278afc51c4b1a276b1efd1abf 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
 Smartmontools installation instructions
 =======================================
 
-$Id: INSTALL 3935 2014-07-05 16:28:06Z chrfranke $
+$Id: INSTALL 4094 2015-05-27 21:41:17Z chrfranke $
 
 Please also see the smartmontools home page:
 http://smartmontools.sourceforge.net/
@@ -32,49 +32,6 @@ Table of contents:
     kernel version greater than or equal to 2.2.14. So any recent
     Linux distribution should support smartmontools.
 
-    There are two parts of smartmontools that may require a patched or
-    nonstandard kernel:
-
-    (1) To get the ATA RETURN SMART STATUS command, the kernel needs
-    to support the HDIO_DRIVE_TASK ioctl().
-
-    (2) To run Selective Self-tests, the kernel needs to support the
-    HDIO_DRIVE_TASKFILE ioctl().
-
-    If your kernel does not support one or both of these ioctls, then
-    smartmontools will "mostly" work.  The things that don't work will
-    give you harmless warning messages.
-
-    For item (1) above, any 2.4 or 2.6 series kernel will provide
-    HDIO_DRIVE_TASK support.  Some 2.2.20 and later kernels also
-    provide this support IF they're properly patched and
-    configured. [Andre Hedrick's IDE patches may be found at
-    http://www.nic.funet.fi/pub/linux/kernel/people/hedrick/ide-2.2.20/
-    or are available from your local kernel.org mirror.  They are not
-    updated for 2.2.21 or later, and may contain a few bugs.].
-    If the configuration option CONFIG_IDE_TASK_IOCTL
-    exists in your 2.2.X kernel source code tree, then your 2.2.X
-    kernel will probably support this ioctl. [Note that this kernel
-    configuration option does NOT need to be enabled. Its presence
-    merely indicates that the required HDIO_DRIVE_TASK ioctl() is
-    supported.]
-
-    For item (2) above, your kernel must be configured with the kernel
-    configuration option CONFIG_IDE_TASKFILE_IO enabled.  This
-    configuration option is present in all 2.4 and 2.6 series
-    kernels. Some 2.2.20 and later kernels also provide this support
-    IF they're properly patched and configured as described above.
-
-    Please see FAQ section of the URL above for additional details.
-
-    If you are using 3ware controllers, for full functionality you
-    must either use version 1.02.00.037 or greater of the 3w-xxxx
-    driver, or patch earlier 3ware 3w-xxxx drivers.  See
-    http://smartmontools.sourceforge.net/3w-xxxx.txt
-    for the patch.  The version 1.02.00.037 3w-xxxx.c driver was
-    incorporated into kernel 2.4.23-bk2 on 3 December 2003 and into
-    kernel 2.6.0-test5-bk11 on 23 September 2003.
-
     B) FreeBSD
 
     For FreeBSD support, a 5-current kernel that includes ATAng is
@@ -106,9 +63,9 @@ Table of contents:
 
     F) Windows
 
-    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.
+    The code was tested on Windows XP SP3, 2003, Vista, Windows 7, 8, 8.1
+    and Windows 10 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.
@@ -179,7 +136,7 @@ Table of contents:
     The code was tested on eComStation 1.1, but it should work on all versions
     of OS/2.
     Innotek LibC 0.5 runtime is required.
-    Currently only ATA disks are supported, SCSI support will be added.
+    Only ATA disks are supported.
 
 [2] Installing from SVN
 =======================
@@ -210,22 +167,31 @@ Table of contents:
     make install (you may need to be root to do this)
 
     As shown (with no options to ./configure) this defaults to the
-    following set of installation directories:
+    following set of installation directories and other settings:
+
     --prefix=/usr/local
-    --sbindir=/usr/local/sbin
-    --sysconfdir=/usr/local/etc
-    --mandir=/usr/local/share/man
-    --docdir=/usr/local/share/doc/smartmontools
-    --with-exampledir=/usr/local/share/doc/smartmontools/examplescripts
-    --with-drivedbdir=/usr/local/share/smartmontools
-    --with-initscriptdir=auto
-    --with-systemdsystemunitdir=auto
-    --enable-drivedb
-    --disable-attributelog
+    --exec-prefix='${prefix}'
+    --sbindir='${exec_prefix}/sbin'
+    --sysconfdir='${prefix}/etc'
+    --localstatedir='${prefix}/var'
+    --datarootdir='${prefix}/share'
+    --datadir='${datarootdir}'
+    --mandir='${datarootdir}/man'
+    --docdir='${datarootdir}/doc/smartmontools'
     --disable-sample
-    --disable-savestates
-    --with-libcap-ng=auto
+    --with-systemdsystemunitdir=auto
+    --with-systemdenvfile=auto
+    --with-initscriptdir=auto
+    --with-exampledir='${docdir}/examplescripts'
+    --with-drivedbdir='${datadir}/smartmontools'
+    --with-smartdscriptdir='${sysconfdir}'
+    --with-smartdplugindir='${smartdscriptdir}/smartd_warning.d'
+    --without-savestates
+    --without-attributelog
+    --with-os-deps='os_linux.o dev_areca.o' (platform specific)
     --without-selinux
+    --with-libcap-ng=auto
+    --with-working-snprintf
 
     These will usually not overwrite existing "distribution" installations on
     Linux Systems since the FHS reserves this area for use by the system
@@ -415,35 +381,17 @@ To compile the Windows release with MinGW gcc on MSYS, use:
   Instead of using "make install", copy the .exe files into
   some directory in the PATH.
 
-Cross-compile statically linked 32-bit version with MinGW-w64:
+Cross-compile statically linked 32-bit and 64-bit versions with MinGW-w64:
 
   ./configure --build=$(./config.guess) \
               --host=i686-w64-mingw32 \
               LDFLAGS=-static
 
-  Tested on Cygwin and Debian Linux.
-
-Cross-compile statically linked 64-bit version with MinGW-w64:
-
   ./configure --build=$(./config.guess) \
               --host=x86_64-w64-mingw32 \
               LDFLAGS=-static
 
-  Tested on Cygwin and Debian Linux with MinGW-w64 from
-  http://mingw-w64.sourceforge.net/.
-
-Cross-compile on Cygwin with old gcc-mingw 3.x:
-
-  ./configure --build=$(./config.guess) \
-              --host=i686-pc-mingw32 \
-               CC='gcc-3 -mno-cygwin' \
-              CXX='g++-3 -mno-cygwin' \
-              CXXFLAGS='-g -O2 -Wall -W -Wno-format'
-
-Cross-compile on Debian Linux with gcc-mingw32:
-
-  ./configure --build=$(./config.guess) \
-              --host=i586-mingw32msvc
+  Tested on Cygwin, Debian and Fedora.
 
 
 To build the Windows binary distribution, use:
@@ -472,7 +420,8 @@ To create a Windows installer, use:
   download location.
 
   It is also possible to (cross-)build the installer on Linux.
-  This was successfully tested on Debian with package "nsis".
+  This was successfully tested on Debian and Fedora with package
+  "nsis".
 
 To create a combined 32-/64-bit installer, use this in 32-bit build
 directory if 64-build directory is at ../build64:
@@ -488,14 +437,6 @@ To both create and run the (interactive) installer, use:
 
   The binary distribution includes all documentation files converted
   to DOS text file format and *.html and *.txt preformatted man pages.
-  The tools unix2dos.exe (package cygutils) and zip.exe (package zip
-  or a native Win32 release of Info-ZIP, http://www.info-zip.org) are
-  necessary but may be not installed by Cygwin's default settings.
-
-  The event message file tool syslogevt.exe (see smartd man page) is
-  included in the binary distribution if message compiler (windmc)
-  and resource compiler (windres) are available. This may be disabled
-  by passing 'WINDMC=no' to configure.
 
 To prepare os_win32 directory for MS Visual Studio C++ 2010 [Express],
 use the following on MSYS or Cygwin:
@@ -506,9 +447,9 @@ use the following on MSYS or Cygwin:
 
   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.
+  for MinGW creates os_win32/vc10/{config.h,smart*.rc,svnversion.h}.
+  The configure skript must be run outside of the source directory to
+  avoid inclusion of the original config.h.
 
 
 [11] Guidelines for OS/2, eComStation
@@ -567,8 +508,8 @@ man smartd.conf
 man smartctl
 man smartd
 
-/usr/sbin/smartctl -s on -o on -S on /dev/hda (only root can do this)
-/usr/sbin/smartctl -a /dev/hda (only root can do this)
+/usr/sbin/smartctl -s on -o on -S on /dev/sda (only root can do this)
+/usr/sbin/smartctl -a /dev/sda (only root can do this)
 
 Note that the default location for the manual pages are
 /usr/share/man/man5 and /usr/share/man/man8.  If "man" doesn't find
@@ -587,22 +528,30 @@ The following files are installed if ./configure has no options:
 /usr/local/sbin/smartd                                  [Executable daemon]
 /usr/local/sbin/update-smart-drivedb                    [Drive database update script]
 /usr/local/etc/smartd.conf                              [Configuration file for smartd daemon]
-/usr/local/etc/rc.d/init.d/smartd                       [Init/Startup script for smartd]
+/usr/local/etc/smartd_warning.sh                        [Warning skript for smartd daemon]
 /usr/local/share/man/man5/smartd.conf.5                 [Manual page]
 /usr/local/share/man/man8/smartctl.8                    [Manual page]
 /usr/local/share/man/man8/smartd.8                      [Manual page]
+/usr/local/share/man/man8/update-smart-drivedb.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/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]
+/usr/local/share/doc/smartmontools/NEWS                 [Significant enhancements and fixes]
 /usr/local/share/doc/smartmontools/README               [Overview]
 /usr/local/share/doc/smartmontools/TODO                 [Things that need to be done/fixed]
-/usr/local/share/doc/smartmontools/WARNINGS             [Systems where lockups or other serious problems were reported]
 /usr/local/share/doc/smartmontools/smartd.conf          [Example configuration file for smartd]
 /usr/local/share/doc/smartmontools/examplescripts/      [Executable scripts for -M exec of smartd.conf (4 files)]
 /usr/local/share/smartmontools/drivedb.h                [Drive database]
 
+Due to checks done by '--with-systemdsystemunitdir=auto' and '--with-initscriptdir=auto',
+one of the following files may also be installed:
+
+/usr/local/lib/systemd/system/smartd.service            [Systemd service file for smartd]
+/usr/local/etc/rc.d/init.d/smartd                       [Init/Startup script for smartd]
+/usr/local/etc/init.d/smartd                            [Init/Startup script for smartd]
+/usr/local/etc/rc.d/smartd                              [Init/Startup script for smartd]
+
 If /usr/local/etc/smartd.conf exists and differs from the
 default then the default configuration file is installed as
 /usr/local/etc/smartd.conf.sample instead.
@@ -640,52 +589,23 @@ a documentation file doc/latex/refman.pdf:
 ===========================================================
 
 When you type:
-./configure [options]
-there are six particularly important variables that affect where the
-smartmontools software is installed.  The variables are listed here,
-with their default values in square brackets, and the quantities that
-they affect described following that.  This is a very wide table: please read
-it in a wide window.
-
-OPTIONS              DEFAULT                                      AFFECTS
--------              -------                                      -------
---prefix             /usr/local                                   Please see below
---sbindir            ${prefix}/sbin                               Directory for smartd/smartctl executables;
-                                                                  Contents of smartd/smartctl man pages
---docdir             ${prefix}/share/doc/smartmontools            Location of the documentation
-                                                                  (autoconf >= 2.60 only, see also --with-docdir below)
---mandir             ${prefix}/share/man                          Directory for smartctl/smartd/smartd.conf man pages
---sysconfdir         ${prefix}/etc                                Directory for smartd.conf;
-                                                                  Contents of smartd executable;
-                                                                  Contents of smartd/smartd.conf man pages;
-                                                                  Directory for rc.d/init.d/smartd init script
---with-initscriptdir           auto                               Location of init scripts
---with-systemdsystemunitdir    auto                               Location of systemd service files
---with-systemdenvfile ${sysconfdir}/sysconfig/smartmontools       Path of environment file for system service
---with-docdir         ${prefix}/share/doc/smartmontools           Location of the documentation
---with-exampledir     ${docdir}/examplescripts                    Location of example scripts
---enable-sample       --disable-sample                            Adds the string '.sample' to the names of the smartd.conf file and the smartd RC file
---with-os-deps        os_<guessed>.o                              OS dependent module(s)
---with-selinux        --without-selinux                           Enables SELinux support.  If smartmontools has to create the /dev/tw[ae] device
-                                                                  nodes for 3ware/AMCC controllers, this option ensures that the nodes are created
-                                                                  with correct SELinux file contexts.
---with-libcap-ng      --with-libcap-ng=auto                       Enables/disables libcap-ng support. If enabled and libcap-ng is
-                                                                  available, option --capabilities is added to smartd.
---disable-drivedb     --enable-drivedb                            Disables default drive database file '${drivedbdir}/drivedb.h'
---with-drivedbdir     ${prefix}/share/smartmontools               Directory for 'drivedb.h' (implies --enable-drivedb)
---with-smartdscriptdir    ${sysconfdir}                           Directory for 'smartd_warning.sh' script
---with-smartdplugindir    ${sysconfdir}/smartd_warning.d          Directory for 'smartd_warning.sh' plugin scripts
---enable-savestates   --disable-savestates                        Enables default smartd state files '${savestates}MODEL-SERIAL.ata.state'
---with-savestates     ${prefix}/var/lib/smartmontools/smartd.     Prefix for smartd state files (implies --enable-savestates)
---enable-attributelog --disable-attributelog                      Enables default smartd attribute log files
---with-attributelog   ${prefix}/var/lib/smartmontools/attrlog.    Prefix for smartd attribute log files (implies --enable-attributelog)
---with-working-snprintf    MinGW:guessed,others:yes               Function snprintf() handles output truncation as specified by C99
-
-Please note that in previous versions of smartmontools (<= 5.39) the
-default for --with-docdir was
-  ${prefix}/share/doc/smartmontools-VERSION
-This was changed to make it consistent with the default of the
-new --docdir option added in autoconf 2.60.
+./configure --help
+a description of available configure options is printed
+[with defaults in square brackets].  See also section [3] above.
+
+
+The following old configure options are deprecated and will be removed
+in a future release of smartmontools:
+
+Old option                 Replacement
+--with-docdir=DIR          --docdir=DIR (autoconf >= 2.60)
+--enable-drivedb           [no option needed]
+--disable-drivedb          --without-drivedbdir
+--enable-savestates        --with-savestates[=yes]
+--disable-savestates       [no option needed]
+--enable-attrbutelog       --with-attributelog[=yes]
+--disable-savestates       [no option needed]
+
 
 The defaults for --with-initscriptdir and --with-systemdsystemunitdir are
 guessed such that the following rules apply:
@@ -732,30 +652,6 @@ else
 --with-initscriptdir         [disabled]
 --with-systemdsystemunitdir  [disabled]
 
-This is useful for test installs in a harmless subdirectory somewhere.
-
-Here are the four possible cases for the four variables above:
-
-Case 1:
---prefix not set
---variable not set
-===> VARIABLE gets default value above
-
-Case 2:
---prefix set
---variable not set
-===> VARIABLE gets PREFIX/ prepended to default value above
-
-Case 3:
---prefix not set
---variable set
-===> VARIABLE gets value that is set
-
-Case 4:
---prefix is set
---variable is set
-===> PREFIX is IGNORED, VARIABLE gets value that is set
-
 
 Here are the differences with and without --enable-sample, assuming
 that initscript location is set and no other options specified 
index 440153711469fea1531749cd2fa44056231ffdf5..dafe35856c2cafc1b33e885b3c7795bfc3bd6298 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 #
-# $Id: Makefile.am 3957 2014-07-18 18:39:06Z chrfranke $
+# $Id: Makefile.am 4102 2015-06-01 19:25:47Z chrfranke $
 #
 
 @SET_MAKE@
@@ -78,8 +78,8 @@ smartctl_SOURCES = \
         utility.cpp \
         utility.h
 
-smartctl_LDADD = @os_deps@ @os_libs@
-smartctl_DEPENDENCIES = @os_deps@
+smartctl_LDADD = $(os_deps) $(os_libs)
+smartctl_DEPENDENCIES = $(os_deps)
 
 EXTRA_smartctl_SOURCES = \
         os_darwin.cpp \
@@ -138,8 +138,8 @@ smartd_SOURCES = \
         utility.cpp \
         utility.h
 
-smartd_LDADD = @os_deps@ @os_libs@ @CAPNG_LDADD@
-smartd_DEPENDENCIES = @os_deps@
+smartd_LDADD = $(os_deps) $(os_libs) $(CAPNG_LDADD)
+smartd_DEPENDENCIES = $(os_deps)
 
 EXTRA_smartd_SOURCES = \
         os_darwin.cpp \
@@ -255,8 +255,8 @@ endif
 all-local: $(extra_MANS)
 install-man: $(extra_MANS)
        @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(mandir)/man4
-       $(mkinstalldirs) $(DESTDIR)$(mandir)/man1m
+       $(mkinstalldirs) '$(DESTDIR)$(mandir)/man4'
+       $(mkinstalldirs) '$(DESTDIR)$(mandir)/man1m'
        for i in $(extra_MANS); do \
          if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
          else file=$$i; fi; \
@@ -264,8 +264,8 @@ install-man: $(extra_MANS)
          inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
          inst=`echo $$inst | sed -e 's/^.*\///'`; \
          inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-         echo " $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
-         $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$$ext/$$inst; \
+         echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
+         $(INSTALL_DATA) "$$file" "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
        done
 uninstall-man:
        @$(NORMAL_UNINSTALL)
@@ -276,8 +276,8 @@ uninstall-man:
          inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
          inst=`echo $$inst | sed -e 's/^.*\///'`; \
          inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-         echo " rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst"; \
-         rm -f $(DESTDIR)$(mandir)/man$$ext/$$inst; \
+         echo " rm -f '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
+         rm -f "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
        done
 else
 # For systems that adopts traditional manner
@@ -302,7 +302,6 @@ docs_DATA = \
         NEWS \
         README \
         TODO \
-        WARNINGS \
         smartd.conf
 
 examplesdir=$(exampledir)
@@ -320,7 +319,7 @@ sysconf_DATA = smartd.conf
 
 # If modified smartd.conf exists install smartd.conf.sample instead
 install-sysconfDATA: $(sysconf_DATA)
-       $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+       $(mkinstalldirs) '$(DESTDIR)$(sysconfdir)'
        @s="$(srcdir)/smartd.conf"; \
        f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
        if test -z "$(smartd_suffix)" && test -f "$$f"; then \
@@ -332,7 +331,7 @@ install-sysconfDATA: $(sysconf_DATA)
            f="$$f".sample; \
          fi; \
        fi; \
-       echo " $(INSTALL_DATA) $$s $$f"; \
+       echo " $(INSTALL_DATA) '$$s' '$$f'"; \
        $(INSTALL_DATA) "$$s" "$$f"
 
 # If smartd.conf.sample exists preserve smartd.conf
@@ -345,7 +344,7 @@ uninstall-sysconfDATA:
          echo "************************************************************"; \
          f="$$f".sample; \
        fi; \
-       echo " rm -f $$f"; \
+       echo " rm -f '$$f'"; \
        rm -f "$$f"
 
 smartdscript_SCRIPTS = smartd_warning.sh
@@ -491,10 +490,10 @@ uninstall-initdDATA-darwin:
 
 else
 
-initd_DATA = @initdfile@
+initd_DATA = $(initdfile)
 
-@initdfile@: $(srcdir)/@initdfile@.in Makefile
-       sed "s|/usr/local/sbin/|$(sbindir)/|g" $(srcdir)/@initdfile@.in > $@
+$(initdfile): $(srcdir)/$(initdfile).in Makefile
+       sed 's|/usr/local/sbin/|$(sbindir)/|g' $(srcdir)/$(initdfile).in > $@
 
 initd_install_name = smartd$(smartd_suffix)
 
@@ -502,12 +501,11 @@ initd_DATA_install = install-initdDATA-generic
 initd_DATA_uninstall = uninstall-initdDATA-generic
 
 install-initdDATA-generic: $(initd_DATA)
-       $(mkinstalldirs) $(DESTDIR)$(initddir)
-       $(INSTALL_SCRIPT) $(top_builddir)/@initdfile@ $(DESTDIR)$(initddir)/smartd$(smartd_suffix)
-
+       $(mkinstalldirs) '$(DESTDIR)$(initddir)'
+       $(INSTALL_SCRIPT) '$(top_builddir)/$(initdfile)' '$(DESTDIR)$(initddir)/smartd$(smartd_suffix)'
 
 uninstall-initdDATA-generic:
-       rm -rf $(DESTDIR)$(initddir)/$(initd_install_name)
+       rm -f '$(DESTDIR)$(initddir)/$(initd_install_name)'
 endif
 else
 
@@ -527,7 +525,8 @@ systemdsystemunit_DATA = smartd.service
 endif
 
 smartd.service: smartd.service.in Makefile
-       cat $(srcdir)/smartd.service.in | \
+       @echo '  cat $(srcdir)/smartd.service.in | $$(SMARTD_SERVICE_FILTER) > $@'
+       @cat $(srcdir)/smartd.service.in | \
        sed 's|/usr/local/sbin/smartd|$(sbindir)/smartd|' | \
        if test -n '$(systemdenvfile)'; then \
          sed 's|/usr/local/etc/sysconfig/smartmontools|$(systemdenvfile)|'; \
@@ -542,7 +541,7 @@ smartd.service: smartd.service.in Makefile
 installdirs-local:
        @for d in '$(smartdplugindir)' '$(savestatesdir)' '$(attributelogdir)'; do \
          test -n "$$d" || continue; \
-         echo "$(mkinstalldirs) $(DESTDIR)$$d"; \
+         echo " $(mkinstalldirs) '$(DESTDIR)$$d'"; \
          $(mkinstalldirs) "$(DESTDIR)$$d" || exit 1; \
        done
 
@@ -551,37 +550,12 @@ install-data-local: installdirs-local
 #
 # Build man pages
 #
-if ENABLE_CAPABILITIES
-MAN_CAPABILITIES = cat
-else
-MAN_CAPABILITIES = sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,'
-endif
-
-if ENABLE_DRIVEDB
-MAN_DRIVEDB = sed "s|/usr/local/share/smartmontools/drivedb\\.h|$(drivedbdir)/drivedb.h|g"
-else
-MAN_DRIVEDB = sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,'
-endif
-
-if ENABLE_SAVESTATES
-MAN_SAVESTATES = sed "s|/usr/local/var/lib/smartmontools/smartd\\.|$(savestates)|g"
-else
-MAN_SAVESTATES = sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,'
-endif
-
-if ENABLE_ATTRIBUTELOG
-MAN_ATTRIBUTELOG = sed "s|/usr/local/var/lib/smartmontools/attrlog\\.|$(attributelog)|g"
-else
-MAN_ATTRIBUTELOG = sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,'
-endif
-
 MAN_FILTER = \
     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' \
@@ -591,16 +565,37 @@ MAN_FILTER = \
         -e 's|\\fBmail\\fP|\\fB$(os_mailer)\\fP|g' \
         -e 's|\\'\''mail\\'\''|\\'\''$(os_mailer)\\'\''|g' \
         -e 's|/usr/bin/mail|/usr/bin/$(os_mailer)|g' \
-        -e 's|RELEASE_6_0_DRIVEDB|@DRIVEDB_BRANCH@|g' | \
+        -e 's|RELEASE_6_0_DRIVEDB|$(DRIVEDB_BRANCH)|g' | \
+    if test -n '$(drivedbdir)'; then \
+      sed 's|/usr/local/share/smartmontools/drivedb\.h|$(drivedbdir)/drivedb.h|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(initddir)'; then \
+      sed 's|/usr/local/etc/rc\.d/init\.d/|$(initddir)/|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_INITSCRIPT/,/^\.\\" %ENDIF ENABLE_INITSCRIPT/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(savestates)'; then \
+      sed 's|/usr/local/var/lib/smartmontools/smartd\.|$(savestates)|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,' ; \
+    fi | \
+    if test -n '$(attributelog)'; then \
+      sed 's|/usr/local/var/lib/smartmontools/attrlog\.|$(attributelog)|g' ; \
+    else \
+      sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,' ; \
+    fi | \
     if test -n '$(smartdplugindir)'; then \
       sed 's|/usr/local/etc/smartd_warning\.d|$(smartdplugindir)|g' ; \
     else \
       sed '/^\.\\" %IF ENABLE_SMARTDPLUGINDIR/,/^\.\\" %ENDIF ENABLE_SMARTDPLUGINDIR/ s,^,.\\"\# ,' ; \
     fi | \
-    $(MAN_ATTRIBUTELOG) | \
-    $(MAN_CAPABILITIES) | \
-    $(MAN_DRIVEDB) | \
-    $(MAN_SAVESTATES) | \
+    if test -n '$(CAPNG_LDADD)'; then \
+      cat; \
+    else \
+      sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,' ; \
+    fi | \
     if test -n '$(os_man_filter)'; then \
       sed -e 's,OS_MAN_FILTER,$(os_man_filter),g' \
           -e '/^\.\\" %IF NOT OS .*$(os_man_filter)/,/^.\\" %ENDIF NOT OS .*$(os_man_filter)/ s,^,.\\"\# ,' \
@@ -773,7 +768,6 @@ FILES_WIN32 = \
         $(docdir_win32)/NEWS.txt \
         $(docdir_win32)/README.txt \
         $(docdir_win32)/TODO.txt \
-        $(docdir_win32)/WARNINGS.txt \
         $(docdir_win32)/checksums$(win_bits).txt \
         $(docdir_win32)/smartd.conf \
         $(docdir_win32)/smartctl.8.html \
diff --git a/NEWS b/NEWS
index 03cd432a5c3d077b7730e4e434f1d2c04105ea8f..b14909b15117c26888ea9f5a6fb9243a9fd50785 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,37 @@
 smartmontools NEWS
 ------------------
-$Id: NEWS 3979 2014-08-15 11:09:41Z samm2 $
+$Id: NEWS 4109 2015-06-04 16:30:15Z chrfranke $
 
 The most up-to-date version of this file is:
 http://sourceforge.net/p/smartmontools/code/HEAD/tree/trunk/smartmontools/NEWS
 
-- darwin: '-S' command implemented, '-l devstat' should work now
+Date 2015-06-04
+Summary: smartmontools release 6.4
+-----------------------------------------------------------
+- Device type '-d usbprolific' for Prolific PL2571/277x USB bridges.
+- SAT: Support for ATA registers returned in fixed format sense data.
+- smartctl '-i' and '--identify': ATA ACS-4 and SATA 3.2 enhancements.
+- smartctl '-l xerror': Support for logs with more than 255 pages.
+- smartctl '-l devstat': Prints ACS-3 DSN flags.
+- smartctl '-l devstat': Read via SMART command if GP log is not
+  available.
+- smartctl '-l scttempsts': Prints SCT SMART STATUS (ACS-4) and
+  vendor specific SCT bytes.
+- configure option '--with-systemdenvfile=auto' as new default.
+- configure options '--disable-drivedb', '--enable-savestates'
+  and '--enable-attributelog' are deprecated.
+- Corresponding '--with-*' options are enhanced accordingly.
+- Configure option '--with-docdir' is deprecated.
+- autoconf < 2.60 and automake < 1.10 are deprecated.
+  (all of the above still work but a warning is printed if used)
+- HDD, SSD and USB additions to drive database.
+- Linux: AACRAID fixes, SMART STATUS should work now.
+- Linux: '/dev/megaraid_sas_ioctl_node' fd leak fix.
+- Darwin: '-S' command implemented, '-l devstat' should work now.
+- Cygwin: Compile fix.
+- Windows: Device type '-d aacraid' for AACRAID controllers.
+- Windows: SAT autodetection based on IOCTL_STORAGE_QUERY_PROPERTY.
+- Windows installer: Fix possible loss of user PATH environment variable.
 
 Date 2014-07-26
 Summary: smartmontools release 6.3
diff --git a/README b/README
index 02c1b741437d06850dd15498d4159f008bdd6777..48f592ec43694a0ce40064830093fbe4d5d89939 100644 (file)
--- a/README
+++ b/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 3949 2014-07-13 17:23:40Z chrfranke $
+$Id: README 4063 2015-04-19 17:34:25Z chrfranke $
 
 == HOME ==
 The home for smartmontools is located at:
@@ -19,8 +19,8 @@ You will find a mailing list for support and other questions at:
 
 
 == COPYING ==
-Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
-Copyright (C) 2004-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+Copyright (C) 2002-9 Bruce Allen
+Copyright (C) 2004-15 Christian Franke
 
 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
@@ -32,10 +32,7 @@ example COPYING).  If not, see <http://www.gnu.org/licenses/>.
 
 
 == CREDITS ==
-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/
+See AUTHORS file.
 
 
 == OVERVIEW ==
@@ -85,11 +82,8 @@ Refer to the "INSTALL" file for detailed installation instructions.
 == GETTING STARTED ==
 
 To examine SMART data from a disk, try:
-  smartctl -a /dev/hda
-for ATA disks, or
   smartctl -a /dev/sda
-for SCSI disks.  See the manual page 'man smartctl' for more
-information.
+See the manual page 'man smartctl' for more information.
 
 To start automatic monitoring of your disks with the smartd daemon,
 try:
diff --git a/WARNINGS b/WARNINGS
deleted file mode 100644 (file)
index 0cfce2a..0000000
--- a/WARNINGS
+++ /dev/null
@@ -1,4 +0,0 @@
-$Id: WARNINGS 3904 2014-06-15 14:21:15Z chrfranke $
-
-This file is no longer maintained, please see:
-http://www.smartmontools.org/wiki/Warnings
index de7527a7259d30988220234e9b410c0f186a4440..d62fbca0ca35dad41e56857b518144e1e95e3428 100644 (file)
--- a/aacraid.h
+++ b/aacraid.h
@@ -1,5 +1,6 @@
 /* aacraid.h
  * Copyright (C) 2014 Raghava Aditya <Raghava.Aditya@pmcs.com>
+ * Copyright (C) 2015 Nidhi Malhotra <Nidhi.Malhotra@pmcs.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
@@ -12,8 +13,8 @@
  */
 
 // Check windows
-#if _WIN32 || _WIN64
-#if _WIN64
+#if defined(_WIN32) || defined(_WIN64)
+#ifdef _WIN64
   #define ENVIRONMENT64
 #else
   #define ENVIRONMENT32
 #define METHOD_BUFFERED 0
 #define METHOD_NEITHER  3
 
+#if defined(_WIN32) || defined(_WIN64)
+#define FSAMPCTL_SCSI_BASE          IOCTL_SCSI_BASE
+#define ARCIOCTL_SEND_RAW_SRB       CTL_CODE(FSAMPCTL_SCSI_BASE, 2201, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define AACRAID_SAS_SIGNATURE       "ARCSAS"
+#define SRB_FLAGS_DATA_IN           0x00000040
+#define SRB_FLAGS_DATA_OUT          0x00000080
+#define SRB_FLAGS_NO_DATA_TRANSFER  0x00000000
+#else
 #define CTL_CODE(function, method) ((4<< 16) | ((function) << 2) | (method) )
 
 #define FSACTL_SEND_RAW_SRB  CTL_CODE(2067, METHOD_BUFFERED)
-
+#endif
 #define  SRB_FUNCTION_EXECUTE_SCSI 0X00
 
 #define  SRB_DataIn      0x0040
@@ -67,6 +76,45 @@ typedef struct {
   user_sgentry32   sg32[1];
   }  user_sgmap32;
 
+#if defined(_WIN32) || defined(_WIN64)
+typedef struct _SCSI_REQUEST_BLOCK {
+    USHORT Length;                  // offset 0
+    UCHAR Function;                 // offset 2
+    UCHAR SrbStatus;                // offset 3
+    UCHAR ScsiStatus;               // offset 4
+    UCHAR PathId;                   // offset 5
+    UCHAR TargetId;                 // offset 6
+    UCHAR Lun;                      // offset 7
+    UCHAR QueueTag;                 // offset 8
+    UCHAR QueueAction;              // offset 9
+    UCHAR CdbLength;                // offset a
+    UCHAR SenseInfoBufferLength;    // offset b
+    ULONG SrbFlags;                 // offset c
+    ULONG DataTransferLength;       // offset 10
+    ULONG TimeOutValue;             // offset 14
+    PVOID DataBuffer;               // offset 18
+    PVOID SenseInfoBuffer;          // offset 1c
+    struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20
+    PVOID OriginalRequest;          // offset 24
+    PVOID SrbExtension;             // offset 28
+    union {
+        ULONG InternalStatus;       // offset 2c
+        ULONG QueueSortKey;         // offset 2c
+    };
+
+#if defined(_WIN64)
+    //
+    // Force PVOID alignment of Cdb
+    //
+    ULONG Reserved;
+#endif
+
+    UCHAR Cdb[16];                  // offset 30
+} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK;
+
+#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK)
+
+#else
 typedef struct {
   uint32_t function;           //SRB_FUNCTION_EXECUTE_SCSI 0x00
   uint32_t channel;            //bus
@@ -103,3 +151,4 @@ typedef struct {
   uint32_t sense_data_size;
   uint8_t  sense_data[30];
   }  user_aac_reply;
+#endif
index 7322ae65c670e7d4d03871e0d959be02edca3647..88ec6b94f8e04a6d044385b0e38b0152182c01c7 100644 (file)
@@ -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-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-15 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>
  *
@@ -35,7 +35,7 @@
 #include "utility.h"
 #include "dev_ata_cmd_set.h" // for parsed_ata_device
 
-const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 3998 2014-10-06 15:20:25Z chrfranke $"
+const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 4048 2015-03-29 16:09:04Z chrfranke $"
                                  ATACMDS_H_CVSID;
 
 // Print ATA debug messages?
@@ -1466,9 +1466,9 @@ static void fix_exterrlog_lba(ata_smart_exterrlog * log, unsigned nsectors)
 
 // Read Extended Comprehensive Error Log
 bool ataReadExtErrorLog(ata_device * device, ata_smart_exterrlog * log,
-                        unsigned nsectors, firmwarebug_defs firmwarebugs)
+                        unsigned page, unsigned nsectors, firmwarebug_defs firmwarebugs)
 {
-  if (!ataReadLogExt(device, 0x03, 0x00, 0, log, nsectors))
+  if (!ataReadLogExt(device, 0x03, 0x00, page, log, nsectors))
     return false;
 
   check_multi_sector_sum(log, nsectors, "SMART Extended Comprehensive Error Log Structure");
index a5c71a5e64ee815fc572ed0a45236bd08b6f2302..5ac43ffc80228f601b5c6baabbe86975286cc374 100644 (file)
--- a/atacmds.h
+++ b/atacmds.h
@@ -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-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-15 Christian Franke <smartmontools-support@lists.sourceforge.net>
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 #ifndef ATACMDS_H_
 #define ATACMDS_H_
 
-#define ATACMDS_H_CVSID "$Id: atacmds.h 3998 2014-10-06 15:20:25Z chrfranke $"
+#define ATACMDS_H_CVSID "$Id: atacmds.h 4048 2015-03-29 16:09:04Z chrfranke $"
 
 #include "dev_interface.h" // ata_device
 
@@ -786,7 +786,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, firmwarebug_defs firwarebugs);
+                        unsigned page, unsigned nsectors, firmwarebug_defs firmwarebugs);
 // Read SMART Extended Self-test Log
 bool ataReadExtSelfTestLog(ata_device * device, ata_smart_extselftestlog * log,
                            unsigned nsectors);
index fb47ae1aede6a36e81b9ded4f098ff61279c99f8..0565323b3a149c681d6bd1ae5aecdaa58bebec1b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2012-15 Christian Franke
  *
  * 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
@@ -18,7 +18,7 @@
 #include "config.h"
 #include "ataidentify.h"
 
-const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 3851 2013-08-17 20:10:11Z chrfranke $"
+const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 4074 2015-05-01 16:03:50Z chrfranke $"
   ATAIDENTIFY_H_CVSID;
 
 #include "int64.h"
@@ -33,7 +33,8 @@ const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 3851 2013-08-17 20:10
 // 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
+// Tables 45 and 50 of T13/2161-D (ACS-3) Revision 5, October 28, 2013
+// Table 44 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015 (ATAPI removed)
 
 const char * const identify_descriptions[] = {
   "  0 General configuration",
@@ -42,7 +43,7 @@ const char * const identify_descriptions[] = {
     ". 14 ATAPI: Must be set to 0",
     ". 13 ATAPI: Reserved",
     ". 12:8 ATAPI: Command set: 0x05 = CD/DVD",
-    ". 7 Removable media device",
+    ". 7 Removable media device [OBS-8]",
     ". 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",
@@ -88,7 +89,8 @@ const char * const identify_descriptions[] = {
     ". 10 IORDY may be disabled",
     ". 9 LBA supported",
     ". 8 DMA supported",
-    ". 7:0 Vendor specific [RET-4]",
+    ". 7:2 Reserved", // ATA-3: Vendor specific, ATA-8: Retired
+    ". 1:0 Long Phy Sector Alignment Error reporting", // ACS-2
 
   " 50 Capabilities",
     ". 15:14 Must be set to 0x1",
@@ -116,7 +118,9 @@ const char * const identify_descriptions[] = {
     ". 14 OVERWRITE EXT supported",
     ". 13 CRYPTO SCRAMBLE EXT supported",
     ". 12 Sanitize Device feature set supported",
-    ". 11:9 Reserved",
+    ". 11 Cmds during sanitize as specified by this standard", // ACS-3
+    ". 10 SANITIZE ANTIFREEZE LOCK EXT supported", // ACS-3
+    ". 9 Reserved",
     ". 8 Bits 7:0 are valid",
     ". 7:0 Current sectors per DRQ on READ/WRITE MULTIPLE",
 
@@ -157,8 +161,8 @@ const char * const identify_descriptions[] = {
     ". 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",
+    ". 2 All write cache is non-volatile", // ACS-3
+    ". 1:0 Zoned Capabilities", // ACS-4
 
   " 70 Reserved",
   " 71-74 ATA: Reserved for IDENTIFY PACKET DEVICE",
@@ -216,7 +220,8 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 80 Major version number",
-    ". 15:11 Reserved",
+    ". 15:12 Reserved",
+    ". 11 ACS-4 supported",
     ". 10 ACS-3 supported",
     ". 9 ACS-2 supported",
     ". 8 ATA8-ACS supported",
@@ -257,7 +262,7 @@ const char * const identify_descriptions[] = {
     ". 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",
+    ". 7 Reserved for Addr Offset Resvd Area Boot [OBS-ACS-3]",
     ". 6 SET FEATURES subcommand required to spin-up",
     ". 5 PUIS feature set supported",
     ". 4 Removable Media Status Notification supported [OBS-8]",
@@ -278,7 +283,7 @@ const char * const identify_descriptions[] = {
     ". 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
+    ". 2 Media serial number supported [RES-ACS-3]",
     ". 1 SMART self-test supported",
     ". 0 SMART error logging supported",
 
@@ -309,7 +314,7 @@ const char * const identify_descriptions[] = {
     ". 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",
+    ". 7 Reserved for Addr Offset Resvd Area Boot [OBS-ACS-3]",
     ". 6 SET FEATURES subcommand required to spin-up",
     ". 5 PUIS feature set enabled",
     ". 4 Removable Media Status Notification enabled [OBS-8]",
@@ -353,9 +358,18 @@ const char * const identify_descriptions[] = {
     ". 0 Ultra DMA mode 0 supported",
 
   " 89 SECURITY ERASE UNIT time",
+    ". 15 Bits 14:8 of value are valid", // ACS-3
+    ". 14:0 SECURITY ERASE UNIT time value", // value*2 minutes
+
   " 90 ENHANCED SECURITY ERASE UNIT time",
+    ". 15 Bits 14:8 of value are valid", // ACS-3
+    ". 14:0 ENHANCED SECURITY ERASE UNIT time value", // value*2 minutes
+
   " 91 Current APM level",
-  " 92 Master password revision code",
+    ". 15:8 Reserved", // ACS-3
+    ". 7:0 Current APM level value",
+
+  " 92 Master Password Identifier", // ATA-7: Master Password Revision Code
 
   " 93 Hardware reset result (PATA)",
     ". 15:14 Must be set to 0x1",
@@ -393,7 +407,7 @@ const char * const identify_descriptions[] = {
 
   "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",
+  "112-115 Reserved", // ATA-7: Reserved for world wide name extension to 128 bits
   "116 Reserved for TLC [OBS-ACS-3]",
   "117-118 Logical sector size (DWord)",
 
@@ -459,7 +473,7 @@ const char * const identify_descriptions[] = {
     ". 15:4 Reserved",
     ". 3:0 Nominal form factor: -, 5.25, 3.5, 2.5, 1.8, <1.8",
 
-  "169 Data Set Management support",
+  "169 DATA SET MANAGEMENT command support",
     ". 15:1 Reserved",
     ". 0 Trim bit in DATA SET MANAGEMENT command supported",
 
@@ -468,7 +482,7 @@ const char * const identify_descriptions[] = {
   "176-205 Current media serial number (String)",
 
   "206 SCT Command Transport",
-    ". 15:12 Vendor Specific",
+    ". 15:12 Vendor specific",
     ". 11:8 Reserved",
     ". 7 Reserved for Serial ATA",
     ". 6 Reserved",
@@ -479,7 +493,7 @@ const char * const identify_descriptions[] = {
     ". 1 SCT Read/Write Long supported [OBS-ACS-2]",
     ". 0 SCT Command Transport supported",
 
-  "207-208 Reserved for CE-ATA",
+  "207-208 Reserved", // ATA-8: Reserved for CE-ATA
 
   "209 Alignment of logical sectors",
     ". 15:14 Must be set to 0x1",
@@ -512,8 +526,9 @@ const char * const identify_descriptions[] = {
   "221 Reserved",
 
   "222 Transport major version number",
-    ". 15:12 Transport type: 0x0 = Parallel, 0x1 = Serial",
-    ". 11:7 Reserved    | Reserved",
+    ". 15:12 Transport: 0x0 = Parallel, 0x1 = Serial, 0xe = PCIe", // PCIe: ACS-4
+    ". 11:8 Reserved    | Reserved",
+    ". 7 Reserved    | SATA 3.2",
     ". 6 Reserved    | SATA 3.1",
     ". 5 Reserved    | SATA 3.0",
     ". 4 Reserved    | SATA 2.6",
index 91dd7f7c377e9473a33c3141fcb8241a4a78e73f..33fd8b73fcc1e598aeb531f6b6f6a41339bf1e8c 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2002-11 Bruce Allen <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2008-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-11 Bruce Allen
+ * Copyright (C) 2008-15 Christian Franke
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -40,7 +40,7 @@
 #include "utility.h"
 #include "knowndrives.h"
 
-const char * ataprint_cpp_cvsid = "$Id: ataprint.cpp 3999 2014-10-06 15:57:52Z chrfranke $"
+const char * ataprint_cpp_cvsid = "$Id: ataprint.cpp 4104 2015-06-03 18:50:39Z chrfranke $"
                                   ATAPRINT_H_CVSID;
 
 
@@ -460,7 +460,7 @@ static const char * get_ata_minor_version(const ata_identify_device * drive)
   // Table 10 of X3T13/2008D (ATA-3) Revision 7b, January 27, 1997
   // Table 28 of T13/1410D (ATA/ATAPI-6) Revision 3b, February 26, 2002
   // Table 31 of T13/1699-D (ATA8-ACS) Revision 6a, September 6, 2008
-  // Table 45 of T13/BSR INCITS 529 (ACS-4) Revision 04, August 25, 2014
+  // Table 46 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015
   switch (drive->minor_rev_num) {
     case 0x0001: return "ATA-1 X3T9.2/781D prior to revision 4";
     case 0x0002: return "ATA-1 published, ANSI X3.221-1994";
@@ -511,12 +511,16 @@ static const char * get_ata_minor_version(const ata_identify_device * drive)
 
     case 0x0052: return "ATA8-ACS T13/1699-D revision 3b";
 
+    case 0x005e: return "ACS-4 T13/BSR INCITS 529 revision 5";
+
     case 0x006d: return "ACS-3 T13/2161-D revision 5";
 
     case 0x0082: return "ACS-2 published, ANSI INCITS 482-2012";
 
     case 0x0107: return "ATA8-ACS T13/1699-D revision 2d";
 
+    case 0x010a: return "ACS-3 published, ANSI INCITS 522-2014";
+
     case 0x0110: return "ACS-2 T13/2015-D revision 3";
 
     case 0x011b: return "ACS-3 T13/2161-D revision 4";
@@ -525,13 +529,22 @@ static const char * get_ata_minor_version(const ata_identify_device * drive)
   }
 }
 
-static const char * get_sata_version(const ata_identify_device * drive)
+static const char * get_pata_version(unsigned short word222, char (& buf)[32])
+{
+  switch (word222 & 0x0fff) {
+    default: snprintf(buf, sizeof(buf),
+                       "Unknown (0x%03x)", word222 & 0x0fff); return buf;
+    case 0x001:
+    case 0x003: return "ATA8-APT";
+    case 0x002: return "ATA/ATAPI-7";
+  }
+}
+
+static const char * get_sata_version(unsigned short word222, char (& buf)[32])
 {
-  unsigned short word222 = drive->words088_255[222-88];
-  if ((word222 & 0xf000) != 0x1000)
-    return 0;
   switch (find_msb(word222 & 0x0fff)) {
-    default: return "SATA >3.2";
+    default: snprintf(buf, sizeof(buf),
+                    "SATA >3.2 (0x%03x)", word222 & 0x0fff); return buf;
     case 7:  return "SATA 3.2";
     case 6:  return "SATA 3.1";
     case 5:  return "SATA 3.0";
@@ -540,7 +553,7 @@ static const char * get_sata_version(const ata_identify_device * drive)
     case 2:  return "SATA II Ext";
     case 1:  return "SATA 1.0a";
     case 0:  return "ATA8-AST";
-    case -1: return 0;
+    case -1: return "Unknown";
   }
 }
 
@@ -549,7 +562,10 @@ static const char * get_sata_speed(int level)
   if (level <= 0)
     return 0;
   switch (level) {
-    default: return ">6.0 Gb/s";
+    default: return ">6.0 Gb/s (7)";
+    case 6:  return ">6.0 Gb/s (6)";
+    case 5:  return ">6.0 Gb/s (5)";
+    case 4:  return ">6.0 Gb/s (4)";
     case 3:  return "6.0 Gb/s";
     case 2:  return "3.0 Gb/s";
     case 1:  return "1.5 Gb/s";
@@ -588,6 +604,7 @@ static void print_drive_info(const ata_identify_device * drive,
     pout("Model Family:     %s\n", dbentry->modelfamily);
 
   pout("Device Model:     %s\n", infofound(model));
+
   if (!dont_print_serial_number) {
     pout("Serial Number:    %s\n", infofound(serial));
 
@@ -595,16 +612,17 @@ static void print_drive_info(const ata_identify_device * drive,
     int naa = ata_get_wwn(drive, oui, unique_id);
     if (naa >= 0)
       pout("LU WWN Device Id: %x %06x %09" PRIx64 "\n", naa, oui, unique_id);
+  }
 
-    // Additional Product Identifier (OEM Id) string in words 170-173
-    // (e08130r1, added in ACS-2 Revision 1, December 17, 2008)
-    if (0x2020 <= drive->words088_255[170-88] && drive->words088_255[170-88] <= 0x7e7e) {
-      char add[8+1];
-      ata_format_id_string(add, (const unsigned char *)(drive->words088_255+170-88), sizeof(add)-1);
-      if (add[0])
-        pout("Add. Product Id:  %s\n", add);
-    }
+  // Additional Product Identifier (OEM Id) string in words 170-173
+  // (e08130r1, added in ACS-2 Revision 1, December 17, 2008)
+  if (0x2020 <= drive->words088_255[170-88] && drive->words088_255[170-88] <= 0x7e7e) {
+    char add[8+1];
+    ata_format_id_string(add, (const unsigned char *)(drive->words088_255+170-88), sizeof(add)-1);
+    if (add[0])
+      pout("Add. Product Id:  %s\n", add);
   }
+
   pout("Firmware Version: %s\n", infofound(firmware));
 
   if (sizes.capacity) {
@@ -678,15 +696,30 @@ static void print_drive_info(const ata_identify_device * drive,
   }
   pout("ATA Version is:   %s\n", infofound(ataver.c_str()));
 
-  // If SATA drive print SATA version and speed
-  const char * sataver = get_sata_version(drive);
-  if (sataver) {
-    const char * maxspeed = get_sata_maxspeed(drive);
-    const char * curspeed = get_sata_curspeed(drive);
-    pout("SATA Version is:  %s%s%s%s%s%s\n", sataver,
-         (maxspeed ? ", " : ""), (maxspeed ? maxspeed : ""),
-         (curspeed ? " (current: " : ""), (curspeed ? curspeed : ""),
-         (curspeed ? ")" : ""));
+  // Print Transport specific version
+  char buf[32] = "";
+  unsigned short word222 = drive->words088_255[222-88];
+  if (word222 != 0x0000 && word222 != 0xffff) switch (word222 >> 12) {
+    case 0x0: // PATA
+      pout("Transport Type:   Parallel, %s\n", get_pata_version(word222, buf));
+      break;
+    case 0x1: // SATA
+      {
+        const char * sataver = get_sata_version(word222, buf);
+        const char * maxspeed = get_sata_maxspeed(drive);
+        const char * curspeed = get_sata_curspeed(drive);
+        pout("SATA Version is:  %s%s%s%s%s%s\n", sataver,
+             (maxspeed ? ", " : ""), (maxspeed ? maxspeed : ""),
+             (curspeed ? " (current: " : ""), (curspeed ? curspeed : ""),
+             (curspeed ? ")" : ""));
+      }
+      break;
+    case 0xe: // PCIe (ACS-4)
+      pout("Transport Type:   PCIe (0x%03x)\n", word222 & 0x0fff);
+      break;
+    default:
+      pout("Transport Type:   Unknown (0x%04x)\n", word222);
+      break;
   }
 
   // print current time and date and timezone
@@ -1149,7 +1182,7 @@ static unsigned GetNumLogSectors(const ata_smart_log_directory * logdir, unsigne
 // Get name of log.
 static const char * GetLogName(unsigned logaddr)
 {
-    // Table 201 of T13/BSR INCITS 529 (ACS-4) Revision 04, August 25, 2014
+    // Table 205 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015
     // Table 112 of Serial ATA Revision 3.2, August 7, 2013
     switch (logaddr) {
       case 0x00: return "Log Directory";
@@ -1167,6 +1200,7 @@ static const char * GetLogName(unsigned logaddr)
       case 0x0c: return "Pending Defects log"; // ACS-4
       case 0x0d: return "LPS Mis-alignment log"; // ACS-2
 
+      case 0x0f: return "Sense Data for Successful NCQ Cmds log"; // ACS-4
       case 0x10: return "SATA NCQ Queued Error log";
       case 0x11: return "SATA Phy Event Counters log";
     //case 0x12: return "SATA NCQ Queue Management log"; // SATA 3.0/3.1
@@ -1205,7 +1239,7 @@ static const char * get_log_rw(unsigned logaddr)
 {
    if (   (                   logaddr <= 0x08)
        || (0x0c <= logaddr && logaddr <= 0x0d)
-       || (0x10 <= logaddr && logaddr <= 0x14)
+       || (0x0f <= logaddr && logaddr <= 0x14)
        || (0x19 == logaddr)
        || (0x20 <= logaddr && logaddr <= 0x25)
        || (0x30 == logaddr))
@@ -1335,9 +1369,8 @@ static void PrintLogPages(const char * type, const unsigned char * data,
 ///////////////////////////////////////////////////////////////////////
 // Device statistics (Log 0x04)
 
-// See Section A.5 of
-//   ATA/ATAPI Command Set - 3 (ACS-3)
-//   T13/2161-D Revision 2, February 21, 2012.
+// Section A.5 of T13/2161-D (ACS-3) Revision 5, October 28, 2013
+// Section 9.5 of T13/BSR INCITS 529 (ACS-4) Revision 08, April 28, 2015
 
 struct devstat_entry_info
 {
@@ -1353,12 +1386,15 @@ const devstat_entry_info devstat_info_0x00[] = {
 const devstat_entry_info devstat_info_0x01[] = {
   {  2, "General Statistics" },
   {  4, "Lifetime Power-On Resets" },
-  {  4, "Power-on Hours" }, // spec says no flags(?)
+  {  4, "Power-on Hours" },
   {  6, "Logical Sectors Written" },
   {  6, "Number of Write Commands" },
   {  6, "Logical Sectors Read" },
   {  6, "Number of Read Commands" },
   {  6, "Date and Time TimeStamp" }, // ACS-3
+  {  4, "Pending Error Count" }, // ACS-4
+  {  2, "Workload Utilization" }, // ACS-4
+  {  6, "Utilization Usage Rate" }, // ACS-4 (TODO: field provides 3 values)
   {  0, 0 }
 };
 
@@ -1378,6 +1414,7 @@ const devstat_entry_info devstat_info_0x03[] = {
   {  4, "Read Recovery Attempts" },
   {  4, "Number of Mechanical Start Failures" },
   {  4, "Number of Realloc. Candidate Logical Sectors" }, // ACS-3
+  {  4, "Number of High Priority Unload Events" }, // ACS-3
   {  0, 0 }
 };
 
@@ -1434,24 +1471,32 @@ const devstat_entry_info * devstat_infos[] = {
 
 const int num_devstat_infos = sizeof(devstat_infos)/sizeof(devstat_infos[0]);
 
-static void print_device_statistics_page(const unsigned char * data, int page,
-  bool & need_trailer)
+static const char * get_device_statistics_page_name(int page)
+{
+  if (page < num_devstat_infos)
+    return devstat_infos[page][0].name;
+  if (page == 0xff)
+    return "Vendor Specific Statistics"; // ACS-4
+  return "Unknown Statistics";
+}
+
+static void print_device_statistics_page(const unsigned char * data, int page)
 {
   const devstat_entry_info * info = (page < num_devstat_infos ? devstat_infos[page] : 0);
-  const char * name = (info ? info[0].name : "Unknown Statistics");
+  const char * name = get_device_statistics_page_name(page);
 
   // Check page number in header
-  static const char line[] = "  =====  =                =  == ";
+  static const char line[] = "  =====  =               =  ===  == ";
   if (!data[2]) {
-    pout("%3d%s%s (empty) ==\n", page, line, name);
+    pout("0x%02x%s%s (empty) ==\n", page, line, name);
     return;
   }
   if (data[2] != page) {
-    pout("%3d%s%s (invalid page %d in header) ==\n", page, line, name, data[2]);
+    pout("0x%02x%s%s (invalid page 0x%02x in header) ==\n", page, line, name, data[2]);
     return;
   }
 
-  pout("%3d%s%s (rev %d) ==\n", page, line, name, data[0]);
+  pout("0x%02x%s%s (rev %d) ==\n", page, line, name, data[0] | (data[1] << 8));
 
   // Print entries
   for (int i = 1, offset = 8; offset < 512-7; i++, offset+=8) {
@@ -1466,7 +1511,7 @@ static void print_device_statistics_page(const unsigned char * data, int page,
 
     // Stop if unknown entries contain garbage data due to buggy firmware
     if (!info && (data[offset+5] || data[offset+6])) {
-      pout("%3d  0x%03x  -                -  [Trailing garbage ignored]\n", page, offset);
+      pout("0x%02x  0x%03x  -               -  [Trailing garbage ignored]\n", page, offset);
       break;
     }
 
@@ -1493,15 +1538,17 @@ static void print_device_statistics_page(const unsigned char * data, int page,
       valstr[0] = '-'; valstr[1] = 0;
     }
 
-    pout("%3d  0x%03x  %d%c %15s%c %s\n",
+    pout("0x%02x  0x%03x  %d %15s  %c%c%c%c %s\n",
       page, offset,
       abs(size),
-      (flags & 0x1f ? '+' : ' '), // unknown flags
       valstr,
-      (flags & 0x20 ? '~' : ' '), // normalized flag
-      (info ? info[i].name : "Unknown"));
-    if (flags & 0x20)
-      need_trailer = true;
+      (flags & 0x20 ? 'N' : '-'), // normalized statistics
+      (flags & 0x10 ? 'D' : '-'), // supports DSN (ACS-3)
+      (flags & 0x08 ? 'C' : '-'), // monitored condition met (ACS-3)
+      (flags & 0x07 ? '+' : ' '), // reserved flags
+      (info         ? info[i].name :
+       page == 0xff ? "Vendor Specific" // ACS-4
+                    : "Unknown"        ));
   }
 }
 
@@ -1518,13 +1565,13 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
   else
     rc = ataReadSmartLog(device, 0x04, page_0, 1);
   if (!rc) {
-    pout("Read Device Statistics page 0 failed\n\n");
+    pout("Read Device Statistics page 0x00 failed\n\n");
     return false;
   }
 
   unsigned char nentries = page_0[8];
   if (!(page_0[2] == 0 && nentries > 0)) {
-    pout("Device Statistics page 0 is invalid (page=%d, nentries=%d)\n\n", page_0[2], nentries);
+    pout("Device Statistics page 0x00 is invalid (page=0x%02x, nentries=%d)\n\n", page_0[2], nentries);
     return false;
   }
 
@@ -1543,14 +1590,14 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
   // Add manually specified pages
   bool print_page_0 = false;
   for (i = 0; i < single_pages.size() || ssd_page; i++) {
-    int page = (i < single_pages.size() ? single_pages[i] : 7);
+    int page = (i < single_pages.size() ? single_pages[i] : 0x07);
     if (!page)
       print_page_0 = true;
     else if (page >= (int)nsectors)
-      pout("Device Statistics Log has only %u pages\n", nsectors);
+      pout("Device Statistics Log has only 0x%02x pages\n", nsectors);
     else
       pages.push_back(page);
-    if (page == 7)
+    if (page == 0x07)
       ssd_page = false;
   }
 
@@ -1558,11 +1605,10 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
   if (print_page_0) {
     pout("Device Statistics (%s Log 0x04) supported pages\n", 
       use_gplog ? "GP" : "SMART");
-    pout("Page Description\n");
+    pout("Page  Description\n");
     for (i = 0; i < nentries; i++) {
       int page = page_0[8+1+i];
-      pout("%3d  %s\n", page,
-        (page < num_devstat_infos ? devstat_infos[page][0].name : "Unknown Statistics"));
+      pout("0x%02x  %s\n", page, get_device_statistics_page_name(page));
     }
     pout("\n");
   }
@@ -1571,8 +1617,7 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
   if (!pages.empty()) {
     pout("Device Statistics (%s Log 0x04)\n",
       use_gplog ? "GP" : "SMART");
-    pout("Page Offset Size         Value  Description\n");
-    bool need_trailer = false;
+    pout("Page  Offset Size        Value Flags Description\n");
     int max_page = 0;
 
     if (!use_gplog)
@@ -1584,8 +1629,8 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
 
     raw_buffer pages_buf((max_page+1) * 512);
 
-     if (!use_gplog && !ataReadSmartLog(device, 0x04, pages_buf.data(), max_page+1)) {
-      pout("Read Device Statistics pages 0-%d failed\n\n", max_page);
+    if (!use_gplog && !ataReadSmartLog(device, 0x04, pages_buf.data(), max_page+1)) {
+      pout("Read Device Statistics pages 0x00-0x%02x failed\n\n", max_page);
       return false;
     }
 
@@ -1593,7 +1638,7 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
       int page = pages[i];
       if (use_gplog) {
         if (!ataReadLogExt(device, 0x04, 0, page, pages_buf.data(), 1)) {
-          pout("Read Device Statistics page %d failed\n\n", page);
+          pout("Read Device Statistics page 0x%02x failed\n\n", page);
           return false;
         }
       }
@@ -1601,12 +1646,12 @@ static bool print_device_statistics(ata_device * device, unsigned nsectors,
         continue;
 
       int offset = (use_gplog ? 0 : page * 512);
-      print_device_statistics_page(pages_buf.data() + offset, page, need_trailer);
+      print_device_statistics_page(pages_buf.data() + offset, page);
     }
 
-    if (need_trailer)
-      pout("%30s|_ ~ normalized value\n", "");
-    pout("\n");
+    pout("%32s|||_ C monitored condition met\n", "");
+    pout("%32s||__ D supports DSN\n", "");
+    pout("%32s|___ N normalized value\n\n", "");
   }
 
   return true;
@@ -1832,7 +1877,9 @@ static int PrintSmartErrorlog(const ata_smart_errorlog *data,
 }
 
 // Print SMART Extended Comprehensive Error Log (GP Log 0x03)
-static int PrintSmartExtErrorLog(const ata_smart_exterrlog * log,
+static int PrintSmartExtErrorLog(ata_device * device,
+                                 const firmwarebug_defs & firmwarebugs,
+                                 const ata_smart_exterrlog * log,
                                  unsigned nsectors, unsigned max_errors)
 {
   pout("SMART Extended Comprehensive Error Log Version: %u (%u sectors)\n",
@@ -1893,11 +1940,30 @@ static int PrintSmartExtErrorLog(const ata_smart_exterrlog * log,
        "DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,\n"
        "SS=sec, and sss=millisec. It \"wraps\" after 49.710 days.\n\n");
 
+  // Recently read log page
+  ata_smart_exterrlog log_buf;
+  unsigned log_buf_page = ~0;
+
   // Iterate through circular buffer in reverse direction
   for (unsigned i = 0, errnum = log->device_error_count;
        i < errcnt; i++, errnum--, erridx = (erridx > 0 ? erridx - 1 : nentries - 1)) {
 
-    const ata_smart_exterrlog_error_log & entry = log[erridx / 4].error_logs[erridx % 4];
+    // Read log page if needed
+    const ata_smart_exterrlog * log_p;
+    unsigned page = erridx / 4;
+    if (page == 0)
+      log_p = log;
+    else {
+      if (page != log_buf_page) {
+        memset(&log_buf, 0, sizeof(log_buf));
+        if (!ataReadExtErrorLog(device, &log_buf, page, 1, firmwarebugs))
+          break;
+        log_buf_page = page;
+      }
+      log_p = &log_buf;
+    }
+
+    const ata_smart_exterrlog_error_log & entry = log_p->error_logs[erridx % 4];
 
     // Skip unused entries
     if (!nonempty(&entry, sizeof(entry))) {
@@ -3086,7 +3152,8 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
 
   // If GP Log is supported use smart log directory for
   // error and selftest log support check.
-  if (   isGeneralPurposeLoggingCapable(&drive)
+  bool gp_log_supported = !!isGeneralPurposeLoggingCapable(&drive);
+  if (   gp_log_supported
       && (   options.smart_error_log || options.smart_selftest_log
           || options.retry_error_log || options.retry_selftest_log))
     need_smart_logdir = true;
@@ -3110,6 +3177,10 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
   if (need_gp_logdir) {
     if (firmwarebugs.is_set(BUG_NOLOGDIR))
       gplogdir = fake_logdir(&gplogdir_buf, options);
+    else if (!gp_log_supported && !is_permissive()) {
+      if (options.gp_logdir)
+        pout("General Purpose Log Directory not supported\n\n");
+    }
     else if (ataReadLogDirectory(device, &gplogdir_buf, true)) {
       pout("Read GP Log Directory failed\n\n");
       failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
@@ -3182,17 +3253,16 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
     unsigned nsectors = GetNumLogSectors(gplogdir, 0x03, true);
     if (!nsectors)
       pout("SMART Extended Comprehensive Error Log (GP Log 0x03) not supported\n\n");
-    else if (nsectors >= 256)
-      pout("SMART Extended Comprehensive Error Log size %u not supported\n\n", nsectors);
     else {
-      raw_buffer log_03_buf(nsectors * 512);
-      ata_smart_exterrlog * log_03 = (ata_smart_exterrlog *)log_03_buf.data();
-      if (!ataReadExtErrorLog(device, log_03, nsectors, firmwarebugs)) {
+      // Read only first sector to get error count and index
+      // Print function will read more sectors as needed
+      ata_smart_exterrlog log_03; memset(&log_03, 0, sizeof(log_03));
+      if (!ataReadExtErrorLog(device, &log_03, 0, 1, firmwarebugs)) {
         pout("Read SMART Extended Comprehensive Error Log failed\n\n");
         failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
       }
       else {
-        if (PrintSmartExtErrorLog(log_03, nsectors, options.smart_ext_error_log))
+        if (PrintSmartExtErrorLog(device, firmwarebugs, &log_03, nsectors, options.smart_ext_error_log))
           returnval |= FAILERR;
         ok = true;
       }
@@ -3208,9 +3278,10 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
 
   // Print SMART error log
   if (do_smart_error_log) {
-    if (!(   ( smartlogdir && GetNumLogSectors(smartlogdir, 0x01, false))
-          || (!smartlogdir && isSmartErrorLogCapable(&smartval, &drive) )
-          || is_permissive()                                             )) {
+    if (!(   GetNumLogSectors(smartlogdir, 0x01, false)
+          || (   !(smartlogdir && gp_log_supported)
+              && isSmartErrorLogCapable(&smartval, &drive))
+          || is_permissive()                               )) {
       pout("SMART Error Log not supported\n\n");
     }
     else {
@@ -3261,9 +3332,10 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
 
   // Print SMART self-test log
   if (do_smart_selftest_log) {
-    if (!(   ( smartlogdir && GetNumLogSectors(smartlogdir, 0x06, false))
-          || (!smartlogdir && isSmartTestLogCapable(&smartval, &drive)  )
-          || is_permissive()                                             )) {
+    if (!(   GetNumLogSectors(smartlogdir, 0x06, false)
+          || (   !(smartlogdir && gp_log_supported)
+              && isSmartTestLogCapable(&smartval, &drive))
+          || is_permissive()                              )) {
       pout("SMART Self-test Log not supported\n\n");
     }
     else {
index 8fe3859bf372e1fcba28e02387f8bb36794a0606..caf17449e8e87478283033b28cf0590701e372ad 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: autogen.sh 3917 2014-06-20 19:57:41Z chrfranke $
+# $Id: autogen.sh 4053 2015-04-14 20:18:50Z chrfranke $
 #
 # Generate ./configure from config.in and Makefile.in from Makefile.am.
 # This also adds files like missing,depcomp,install-sh to the source
@@ -39,20 +39,20 @@ typep()
 }
 
 test -x "$AUTOMAKE" ||
-    AUTOMAKE=`typep automake-1.14` ||
+    AUTOMAKE=`typep automake-1.15` || AUTOMAKE=`typep automake-1.14` ||
     AUTOMAKE=`typep automake-1.13` || 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` ||
 {
 echo
-echo "You must have at least GNU Automake 1.7 (up to 1.14) installed"
+echo "You must have at least GNU Automake 1.7 (up to 1.15) installed"
 echo "in order to bootstrap smartmontools from SVN. Download the"
 echo "appropriate package for your distribution, or the source tarball"
 echo "from ftp://ftp.gnu.org/gnu/automake/ ."
 echo
 echo "Also note that support for new Automake series (anything newer"
-echo "than 1.14) is only added after extensive tests. If you live in"
+echo "than 1.15) is only added after extensive tests. If you live in"
 echo "the bleeding edge, you should know what you're doing, mainly how"
 echo "to test it before the developers. Be patient."
 exit 1;
@@ -97,7 +97,7 @@ case "$ver" in
     # OK
     ;;
 
-  1.14|1.14.1)
+  1.14|1.14.1|1.15)
     # TODO: Enable 'subdir-objects' in configure.ac
     # For now, suppress 'subdir-objects' forward-incompatibility warning
     test -n "$warnings" || amwarnings="--warnings=no-unsupported"
@@ -108,6 +108,14 @@ case "$ver" in
     echo "Please report success/failure to the smartmontools-support mailing list."
 esac
 
+# Warn if Automake version is too old
+case "$ver" in
+  1.[789]|1.[789].*)
+    echo "WARNING:"
+    echo "The use of GNU Automake version $ver is deprecated.  Support for Automake"
+    echo "versions 1.7 - 1.9.x will be removed in a future release of smartmontools."
+esac
+
 # Install pkg-config macros
 # (Don't use 'aclocal -I m4 --install' to keep support for automake < 1.10)
 test -d m4 || mkdir m4 || exit 1
index e7f083f27b2e12c6c28134b47bebc287158e862c..804291f1e74f1d6c9b91d10e44eae6fed18f27c9 100644 (file)
@@ -1,14 +1,14 @@
 #
-# $Id: configure.ac 3977 2014-07-26 11:03:24Z chrfranke $
+# $Id: configure.ac 4109 2015-06-04 16:30:15Z chrfranke $
 #
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.50)
 AC_INIT(smartmontools, 6.4, smartmontools-support@lists.sourceforge.net)
 AC_CONFIG_SRCDIR(smartctl.cpp)
 
-smartmontools_cvs_tag=`echo '$Id: configure.ac 3977 2014-07-26 11:03:24Z chrfranke $'`
-smartmontools_release_date=2014-07-26
-smartmontools_release_time="09:49:11 UTC"
+smartmontools_cvs_tag=`echo '$Id: configure.ac 4109 2015-06-04 16:30:15Z chrfranke $'`
+smartmontools_release_date=2015-06-04
+smartmontools_release_time="16:29:41 UTC"
 
 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args",            [smartmontools Configure Arguments])
 AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE,   "$smartmontools_release_date",   [smartmontools Release Date])
@@ -149,16 +149,9 @@ AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
 AC_SUBST(ASFLAGS)
 
-AC_ARG_WITH(systemdenvfile,
-  [AS_HELP_STRING([--with-systemdenvfile=@<:@FILE|no@:>@],
-    [Path of systemd EnvironmentFile (implies --with-systemdsystemunitdir=yes) [SYSCONFDIR/sysconfig/smartmontools]])],
-  [systemdenvfile=; test "$withval" != "no" && systemdenvfile="$withval"; systemd_default=yes],
-  [systemdenvfile='${sysconfdir}/sysconfig/smartmontools'; systemd_default=auto])
-AC_SUBST(systemdenvfile)
-
 AC_ARG_WITH(systemdsystemunitdir,
   [AS_HELP_STRING([--with-systemdsystemunitdir@<:@=DIR|auto|yes|no@:>@], [Location of systemd service files [auto]])],
-  [], [with_systemdsystemunitdir=$systemd_default])
+  [], [with_systemdsystemunitdir=auto])
 
 systemdsystemunitdir=
 case "$with_systemdsystemunitdir" in
@@ -179,6 +172,30 @@ esac
 AC_SUBST(systemdsystemunitdir)
 AM_CONDITIONAL(INSTALL_SYSTEMDUNIT, [test -n "$systemdsystemunitdir"])
 
+AC_ARG_WITH(systemdenvfile,
+  [AS_HELP_STRING([--with-systemdenvfile@<:@=FILE|auto|yes|no@:>@], [Path of systemd EnvironmentFile [auto]])],
+  [], [with_systemdenvfile=auto])
+
+systemdenvfile=
+case "$with_systemdenvfile:$cross_compiling:$systemdsystemunitdir" in
+  auto:no:?*|yes:*:?*)
+    AC_MSG_CHECKING([for path of systemd EnvironmentFile])
+    for dir in sysconfig default; do
+      if test -d /etc/$dir; then
+        systemdenvfile='${sysconfdir}'/$dir/smartmontools
+        break
+      fi
+    done
+    AC_MSG_RESULT([${systemdenvfile:-no}])
+    case "$with_systemdenvfile:$systemdenvfile" in
+      yes:) AC_MSG_ERROR([Path of systemd EnvironmentFile not found]) ;;
+    esac ;;
+  auto:*|no:*) ;;
+  *:*:) AC_MSG_ERROR([Location of systemd service files not found]) ;;
+  *) systemdenvfile="$with_systemdenvfile"
+esac
+AC_SUBST(systemdenvfile)
+
 AC_ARG_WITH(initscriptdir,
   [AS_HELP_STRING([--with-initscriptdir@<:@=DIR|auto|yes|no@:>@], [Location of init scripts [auto]])],
   [], [with_initscriptdir=auto])
@@ -214,8 +231,9 @@ case "${host}" in
 esac
 AC_SUBST(initdfile)
 
+autoconf_25x=${docdir:-yes}
 AC_ARG_WITH(docdir,
-  [AS_HELP_STRING([--with-docdir=DIR], [Location of documentation [DATADIR/doc/smartmontools]])],
+  [AS_HELP_STRING([--with-docdir=DIR], [Deprecated (use --docdir=DIR instead)])],
   [docdir="$withval"],
   [ if test -z "$docdir"; then
       # autoconf 2.5x without '--docdir' support
@@ -229,16 +247,18 @@ AC_ARG_WITH(exampledir,
   [exampledir="$withval"], [exampledir='${docdir}/examplescripts'])
 AC_SUBST(exampledir)
 
+used_deprecated_option=no
 AC_ARG_ENABLE(drivedb,
-  [AS_HELP_STRING([--disable-drivedb], [Disables drive database file])],
-  [], [enable_drivedb=yes])
+  [AS_HELP_STRING([--disable-drivedb], [Deprecated (use --without-drivedbdir instead)])],
+  [used_deprecated_option=yes], [enable_drivedb=yes])
 
+drivedbdir=
 AC_ARG_WITH(drivedbdir,
-  [AS_HELP_STRING([--with-drivedbdir=DIR], [Location of drive database file [DATADIR/smartmontools]])],
-  [drivedbdir="$withval"; enable_drivedb=yes],
-  [drivedbdir=; test "$enable_drivedb" = "yes" && drivedbdir='${datadir}/${PACKAGE}'])
+  [AS_HELP_STRING([--with-drivedbdir=@<:@DIR|no@:>@], [Location of drive database file [DATADIR/smartmontools]])],
+  [test "$withval" != "no" && drivedbdir="$withval"],
+  [test "$enable_drivedb" != "no" && drivedbdir='${datadir}/${PACKAGE}'])
 AC_SUBST(drivedbdir)
-AM_CONDITIONAL(ENABLE_DRIVEDB, [test "$enable_drivedb" = "yes"])
+AM_CONDITIONAL(ENABLE_DRIVEDB, [test -n "$drivedbdir"])
 
 AC_ARG_WITH(smartdscriptdir,
   [AS_HELP_STRING([--with-smartdscriptdir=DIR], [Location of smartd_warning.sh script [SYSCONFDIR]])],
@@ -252,29 +272,35 @@ AC_ARG_WITH(smartdplugindir,
   [smartdplugindir='${smartdscriptdir}/smartd_warning.d'])
 AC_SUBST(smartdplugindir)
 
-AC_ARG_ENABLE(savestates, [AS_HELP_STRING([--enable-savestates], [Enables default smartd state files])])
+AC_ARG_ENABLE(savestates,
+  [AS_HELP_STRING([--enable-savestates], [Deprecated (use --with-savestates@<:@=yes@:>@ instead)])],
+  [used_deprecated_option=yes], [enable_savestates=no])
 
+savestates='${localstatedir}/lib/${PACKAGE}/smartd.'
 AC_ARG_WITH(savestates,
-  [AS_HELP_STRING([--with-savestates=PREFIX],
-    [Prefix for default smartd state files (implies --enable-savestates) [LOCALSTATEDIR/lib/smartmontools/smartd.]])],
-  [savestates="$withval"; enable_savestates="yes"],
-  [savestates=; test "$enable_savestates" = "yes" && savestates='${localstatedir}/lib/${PACKAGE}/smartd.'])
+  [AS_HELP_STRING([--with-savestates@<:@=PREFIX|yes|no@:>@],
+    [Enable default smartd state files [no] (yes=LOCALSTATEDIR/lib/smartmontools/smartd.)])],
+  [case "$withval" in yes) ;; no) savestates= ;; *) savestates="$withval" ;; esac],
+  [test "$enable_savestates" != "yes" && savestates=])
 savestatesdir="${savestates%/*}"
 AC_SUBST(savestates)
 AC_SUBST(savestatesdir)
-AM_CONDITIONAL(ENABLE_SAVESTATES, [test "$enable_savestates" = "yes"])
+AM_CONDITIONAL(ENABLE_SAVESTATES, [test -n "$savestates"])
 
-AC_ARG_ENABLE(attributelog, [AS_HELP_STRING([--enable-attributelog], [Enables default smartd attribute log files])])
+AC_ARG_ENABLE(attributelog,
+  [AS_HELP_STRING([--enable-attributelog], [Deprecated (use --with-attributelog@<:@=yes@:>@ instead)])],
+  [used_deprecated_option=yes], [enable_attributelog=no])
 
+attributelog='${localstatedir}/lib/${PACKAGE}/attrlog.'
 AC_ARG_WITH(attributelog,
-  [AS_HELP_STRING([--with-attributelog=PREFIX],
-    [Prefix for default smartd attribute log files (implies --enable-attributelog) [LOCALSTATEDIR/lib/smartmontools/attrlog.]])],
-  [attributelog="$withval"; enable_attributelog="yes"],
-  [attributelog=; test "$enable_attributelog" = "yes" && attributelog='${localstatedir}/lib/${PACKAGE}/attrlog.'])
+  [AS_HELP_STRING([--with-attributelog@<:@=PREFIX|yes|no@:>@],
+    [Enable default smartd attribute log files [no] (yes=LOCALSTATEDIR/lib/smartmontools/attrlog.)])],
+  [case "$withval" in yes) ;; no) attributelog= ;; *) attributelog="$withval" ;; esac],
+  [test "$enable_attributelog" != "yes" && attributelog=])
 attributelogdir="${attributelog%/*}"
 AC_SUBST(attributelog)
 AC_SUBST(attributelogdir)
-AM_CONDITIONAL(ENABLE_ATTRIBUTELOG, [test "$enable_attributelog" = "yes"])
+AM_CONDITIONAL(ENABLE_ATTRIBUTELOG, [test -n "$attributelog"])
 
 AC_ARG_ENABLE(sample,
   [AS_HELP_STRING([--enable-sample], [Enables appending .sample to the installed smartd rc script and configuration file])],
@@ -311,7 +337,7 @@ AC_ARG_WITH(libcap-ng,
 use_libcap_ng=no
 if test "$with_libcap_ng" != "no"; then
   AC_CHECK_LIB(cap-ng, capng_clear,
-    [AC_DEFINE(HAVE_LIBCAP_NG, 1, [Define to 1 if you have the `cap-ng' library (-lcap-ng).])
+    [AC_DEFINE(HAVE_LIBCAP_NG, 1, [Define to 1 if you have the `cap-ng' library (-lcap-ng).]) dnl `vim syntax
      CAPNG_LDADD="-lcap-ng"; use_libcap_ng=yes])
 
   if test "$use_libcap_ng" = "yes"; then
@@ -323,7 +349,6 @@ fi
 
 AC_MSG_CHECKING([whether to use libcap-ng])
 AC_SUBST(CAPNG_LDADD)
-AM_CONDITIONAL(ENABLE_CAPABILITIES, [test "$use_libcap_ng" = "yes"])
 AC_MSG_RESULT([$use_libcap_ng])
 
 # Assume broken snprintf only on Windows with MSVCRT (MinGW without ANSI stdio support)
@@ -357,11 +382,11 @@ AC_ARG_WITH(working-snprintf,
   [libc_have_working_snprintf=$withval])
 
 if test "$libc_have_working_snprintf" = "yes"; then
-  AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if the `snprintf' function is sane])
+  AC_DEFINE(HAVE_WORKING_SNPRINTF, 1, [Define to 1 if the `snprintf' function is sane.]) dnl `vim syntax
 fi
 
 if test "$prefix" = "NONE"; then
-    dnl no prefix and no mandir, so use ${prefix}/share/man as default
+    # Fix mandir default set by autoconf 2.5x
     if test "$mandir" = '${prefix}/man'; then
        AC_SUBST([mandir], ['${prefix}/share/man'])
     fi
@@ -620,3 +645,20 @@ case "$host_os" in
     ;;
 esac
 echo "-----------------------------------------------------------------------------" >&AS_MESSAGE_FD
+
+if test "$autoconf_25x" = "yes"; then
+ echo "WARNING:" >&AS_MESSAGE_FD
+ echo "Support for old autoconf 2.5x versions will be removed in a future" >&AS_MESSAGE_FD
+ echo "release of smartmontools." >&AS_MESSAGE_FD
+elif test "${with_docdir+set}" = "set"; then
+ echo "WARNING:" >&AS_MESSAGE_FD
+ echo "Option --with-docdir is deprecated and will be removed in a future" >&AS_MESSAGE_FD
+ echo "release of smartmontools.  Use --docdir instead." >&AS_MESSAGE_FD
+fi
+
+if test "$used_deprecated_option" = "yes"; then
+  echo "WARNING:" >&AS_MESSAGE_FD
+  echo "Options --disable-drivedb, --enable-savestates, --enable-attributelog are" >&AS_MESSAGE_FD
+  echo "deprecated and will be removed in a future release of smartmontools." >&AS_MESSAGE_FD
+  echo "Use --without-drivedb, --with-savestates, --with-attributelog instead." >&AS_MESSAGE_FD
+fi
index f88d4a43a497c1cb096629e239e59454926b036f..64e21dc7b360203f852ab9cbb63848f5c2148a86 100755 (executable)
@@ -1,10 +1,9 @@
 #!/bin/bash
 #
 # do a smartmontools release
-# (C) 2003-11 Bruce Allen <ballen4705@users.sourceforge.net>,
-#             Guido Guenther <agx@sigxcpu.org>
-# (C) 2006-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
-# $Id: do_release 3765 2013-02-05 17:17:13Z chrfranke $
+# (C) 2003-11 Bruce Allen, Guido Guenther
+# (C) 2006-15 Christian Franke
+# $Id: do_release 4071 2015-04-26 18:25:12Z chrfranke $
 
 # Notes on generating releases:
 # (1) update NEWS
@@ -15,8 +14,8 @@
 
 set -e
 
-# Smartmontools Signing Key (through 2014)
-KEYID=0x8F6ED8AA
+# Smartmontools Signing Key (through 2016)
+KEYID=0xC4A4903A
 
 inc_release()
 {
index 256bdc44c37e4796b2b4ac27531ca08ea2eac102..0a4336ba3ddc07178a73c9eb75cba8f40fc11408 100644 (file)
--- a/drivedb.h
+++ b/drivedb.h
@@ -4,7 +4,7 @@
  * Home page of code is: http://smartmontools.sourceforge.net
  *
  * Copyright (C) 2003-11 Philip Williams, Bruce Allen
- * Copyright (C) 2008-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-15 Christian Franke
  *
  * 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
@@ -75,7 +75,7 @@
 /*
 const drive_settings builtin_knowndrives[] = {
  */
-  { "$Id: drivedb.h 4002 2014-10-07 11:11:49Z samm2 $",
+  { "$Id: drivedb.h 4105 2015-06-03 19:32:30Z chrfranke $",
     "-", "-",
     "This is a dummy entry to hold the SVN-Id of drivedb.h",
     ""
@@ -221,8 +221,8 @@ const drive_settings builtin_knowndrives[] = {
   { "Crucial/Micron RealSSD m4/C400/P400", // Marvell 9176, fixed firmware
     "C400-MTFDDA[ACK](064|128|256|512)MAM|"
     "M4-CT(064|128|256|512)M4SSD[123]|" // tested with M4-CT512M4SSD2/0309
-    "MTFDDAK(064|128|256|512|050|100|200|400)MA[RN]-1[JKS]1AA.*", // tested with
-                                             // MTFDDAK256MAR-1K1AA/MA52
+    "MTFDDAK(064|128|256|512|050|100|200|400)MA[MNR]-1[JKS]1.*", // tested with
+       // MTFDDAK256MAR-1K1AA/MA52, MTFDDAK256MAM-1K12/08TH
     "030[9-Z]|03[1-Z].|0[4-Z]..|[1-Z]....*", // >= "0309"
     "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
@@ -270,11 +270,16 @@ const drive_settings builtin_knowndrives[] = {
     "-v 202,raw48,Perc_Rated_Life_Used "
     "-v 206,raw48,Write_Error_Rate"
   },
-  { "Crucial/Micron MX100/M500/M510/M550 Client SSDs",
+  { "Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs",
     "Crucial_CT(128|256|512)MX100SSD1|"// tested with Crucial_CT256MX100SSD1/MU01
+    "Crucial_CT(200|256|500|512|1000|1024)MX200SSD[1346]|" // tested with Crucial_CT500MX200SSD1/MU01,
+      // Crucial_CT1024MX200SSD1/MU01
+    "Crucial_CT(120|240|480|960)M500SSD1|" // tested with Crucial_CT960M500SSD1/MU03
+    "Crucial_CT(128|256|512|1024)M550SSD[13]|" // tested with Crucial_CT512M550SSD3/MU01, Crucial_CT1024M550SSD1/MU01
     "Micron_M500_MTFDDA[KTV](120|240|480|960)MAV|"// tested with Micron_M500_MTFDDAK960MAV/MU05
     "(Micron_)?M510[_-]MTFDDA[KTV](128|256)MAZ|" // tested with M510-MTFDDAK256MAZ/MU01
-    "(Micron_)?M550[_-]MTFDDA[KTV](064|128|256|512|1T0)MAY", // tested with M550-MTFDDAK256MAY/MU01
+    "(Micron_)?M550[_-]MTFDDA[KTV](064|128|256|512|1T0)MAY|" // tested with M550-MTFDDAK256MAY/MU01
+    "Micron_M600_(EE|MT)FDDA[KTV](128|256|512|1T0)MBF[25Z]?", // tested with Micron_M600_MTFDDAK1T0MBF/MU01
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
     "-v 5,raw48,Reallocate_NAND_Blk_Cnt "
@@ -332,8 +337,10 @@ const drive_settings builtin_knowndrives[] = {
       // ADATA SSD S599 256GB/3.1.0, 64GB/3.4.6
     "ADATA SP[389]00|" // tested with ADATA SP300/5.0.2d, SP800/5.0.6c,
       // ADATA SP900/5.0.6 (Premier Pro, SF-2281)
-    "ADATA SSD SP900 (64|128|256)GB-DL2|" // tested with ADATA SSD SP900 256GB-DL2/5.0.6
+    "ADATA SSD S[PX]900 (64|128|256|512)GB-DL2|" // tested with ADATA SSD SP900 256GB-DL2/5.0.6,
+      // ADATA SSD SX900 512GB-DL2/5.8.2
     "ADATA XM11 (128|256)GB|" // tested with ADATA XM11 128GB/5.0.1
+    "ATP Velocity MIV (60|120|240|480)GB|" // tested with ATP Velocity MIV 480GB/110719
     "Corsair CSSD-F(40|60|80|115|120|160|240)GBP?2.*|" // Corsair Force, tested with
       // Corsair CSSD-F40GB2/1.1, Corsair CSSD-F115GB2-A/2.1a
     "Corsair Force ((3 |LS )?SSD|GS|GT)|" // SF-2281, tested with
@@ -345,15 +352,17 @@ const drive_settings builtin_knowndrives[] = {
     "KINGSTON SE50S3(100|240|480)G|" // tested with SE50S3100G/KE1ABBF0
     "KINGSTON SH10[03]S3(90|120|240|480)G|" // HyperX (3K), SF-2281, tested with
       // SH100S3240G/320ABBF0, SH103S3120G/505ABBF0
-    "KINGSTON SKC(300S37A|380S3)(60|120|240|480)G|" // SF-2281, tested with SKC300S37A120G/KC4ABBF0,
-      // SKC380S3120G/507ABBF0
+    "KINGSTON SKC(300S37A|380S3)(60|120|180|240|480)G|" // KC300, SF-2281, tested with
+      // SKC300S37A120G/KC4ABBF0, SKC380S3120G/507ABBF0
     "KINGSTON SVP200S3(7A)?(60|90|120|240|480)G|" // V+ 200, SF-2281, tested with
       // SVP200S37A480G/502ABBF0, SVP200S390G/332ABBF0
     "KINGSTON SMS200S3(30|60|120)G|" // mSATA, SF-2241, tested with SMS200S3120G/KC3ABBF0
     "KINGSTON SMS450S3(32|64|128)G|" // mSATA, SF-2281, tested with SMS450S3128G/503ABBF0
     "KINGSTON (SV300|SKC100|SE100)S3.*G|" // other SF-2281
-    "MKNSSDCR(45|60|90|120|180|240|480)GB(-DX)?|" // Mushkin Chronos (deluxe), SF-2281,
-      // tested with MKNSSDCR120GB
+    "MKNSSDCR(45|60|90|120|180|240|480)GB(-[DM]X)?|" // Mushkin Chronos (Deluxe/Enhanced), SF-2281,
+      // tested with MKNSSDCR120GB, MKNSSDCR120GB-MX/560ABBF0
+    "MKNSSDAT(30|40|60|120|180|240|480)GB(-(DX|V))?|" // Mushkin Atlas (Deluxe/Value), mSATA, SF-2281,
+      // tested with MKNSSDAT120GB-V/540ABBF0
     "Mushkin MKNSSDCL(40|60|80|90|115|120|180|240|480)GB-DX2?|" // Mushkin Callisto deluxe,
       // SF-1200/1222, Mushkin MKNSSDCL60GB-DX/361A13F0
     "OCZ[ -](AGILITY2([ -]EX)?|COLOSSUS2|ONYX2|VERTEX(2|-LE))( [123]\\..*)?|" // SF-1200,
@@ -469,7 +478,7 @@ const drive_settings builtin_knowndrives[] = {
     "OCZ-PETROL|" // Everest 1, tested with OCZ-PETROL/3.12
     "OCZ-AGILITY4|" // Everest 2, tested with OCZ-AGILITY4/1.5.2
     "OCZ-VERTEX4", // Everest 2, tested with OCZ-VERTEX4/1.5
-    "", "", ""
+    "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 3,raw16(avg16),Spin_Up_Time "
   //"-v 4,raw48,Start_Stop_Count "
@@ -480,9 +489,10 @@ const drive_settings builtin_knowndrives[] = {
   //"-v 233,raw48,Media_Wearout_Indicator"
   },
   { "Indilinx Barefoot 3 based SSDs",
-    "OCZ-VECTOR|" // tested with OCZ-VECTOR/1.03
-    "OCZ-VERTEX450", // tested with OCZ-VERTEX450/1.0 (Barefoot 3 M10)
-    "", "", ""
+    "OCZ-VECTOR(150)?|" // tested with OCZ-VECTOR/1.03, OCZ-VECTOR150/1.2
+    "OCZ-VERTEX4[56]0|" // Barefoot 3 M10, tested with OCZ-VERTEX450/1.0, OCZ-VERTEX460/1.0
+    "Radeon R7", // Barefoot 3 M00, tested with Radeon R7/1.00
+    "", "",
     "-v 5,raw48,Runtime_Bad_Block "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
@@ -497,13 +507,13 @@ const drive_settings builtin_knowndrives[] = {
     "-v 208,raw48,Average_Erase_Count "
     "-v 210,raw48,SATA_CRC_Error_Count "
     "-v 233,raw48,Remaining_Lifetime_Perc "
-    "-v 241,raw48,Host_Writes_GiB " // M10
-    "-v 242,raw48,Host_Reads_GiB "  // M10
+    "-v 241,raw48,Host_Writes_GiB " // M00/M10
+    "-v 242,raw48,Host_Reads_GiB "  // M00/M10
     "-v 249,raw48,Total_NAND_Prog_Ct_GiB"
   },
   { "OCZ Intrepid 3000 SSDs", // tested with OCZ INTREPID 3600/1.4.3.6, 3800/1.4.3.0
     "OCZ INTREPID 3[68]00",
-    "", "", ""
+    "", "",
     "-v 5,raw48,Runtime_Bad_Block "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
@@ -559,6 +569,31 @@ const drive_settings builtin_knowndrives[] = {
     "-v 236,raw48,Unstable_Power_Count "
     "-v 240,raw48,Write_Head"
   },
+  { "InnoDisk iCF 9000 CompactFlash Cards", // tested with InnoDisk Corp. - iCF9000 1GB/140808,
+       // ..., InnoDisk Corp. - iCF9000 64GB/140808
+    "InnoDisk Corp\\. - iCF9000 (1|2|4|8|16|32|64)GB",
+    "", "",
+  //"-v 1,raw48,Raw_Read_Error_Rate "
+  //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
+  //"-v 12,raw48,Power_Cycle_Count "
+    "-v 160,raw48,Uncorrectable_Error_Cnt "
+    "-v 161,raw48,Valid_Spare_Block_Cnt "
+    "-v 162,raw48,Child_Pair_Count "
+    "-v 163,raw48,Initial_Bad_Block_Count "
+    "-v 164,raw48,Total_Erase_Count "
+    "-v 165,raw48,Max_Erase_Count "
+    "-v 166,raw48,Min_Erase_Count "
+    "-v 167,raw48,Average_Erase_Count "
+  //"-v 192,raw48,Power-Off_Retract_Count "
+  //"-v 194,tempminmax,Temperature_Celsius "
+  //"-v 195,raw48,Hardware_ECC_Recovered "
+  //"-v 196,raw16(raw16),Reallocated_Event_Count "
+  //"-v 198,raw48,Offline_Uncorrectable "
+  //"-v 199,raw48,UDMA_CRC_Error_Count "
+  //"-v 229,raw48,Flash_ID " // only in spec
+    "-v 241,raw48,Host_Writes_32MiB "
+    "-v 242,raw48,Host_Reads_32MiB"
+  },
   { "Intel X25-E SSDs",
     "SSDSA2SH(032|064)G1.* INTEL",  // G1 = first generation
     "", "",
@@ -623,8 +658,9 @@ const drive_settings builtin_knowndrives[] = {
     "-v 227,raw48,Workld_Host_Reads_Perc "
     "-v 228,raw48,Workload_Minutes"
   },
-  { "Intel 313 Series SSDs", // tested with INTEL SSDSA2VP020G3/9CV10379
-    "INTEL SSDSA2VP(020|024)G3",
+  { "Intel 311/313 Series SSDs", // tested with INTEL SSDSA2VP020G2/2CV102M5,
+      // INTEL SSDSA2VP020G3/9CV10379,
+    "INTEL SSDSA2VP(020|024)G[23]", // G3 = 313 Series
     "", "",
   //"-v 3,raw16(avg16),Spin_Up_Time "
   //"-v 4,raw48,Start_Stop_Count "
@@ -764,8 +800,9 @@ const drive_settings builtin_knowndrives[] = {
     "-v 242,raw48,Host_Reads_32MiB "
     "-v 249,raw48,NAND_Writes_1GiB"
   },
-  { "Intel 530 Series SSDs", // tested with INTEL SSDSC2BW180A4/DC12, SSDSC2BW240A4/DC12
-    "INTEL SSDSC2BW(080|120|180|240|360|480)A4",
+  { "Intel 530 Series SSDs", // tested with INTEL SSDSC2BW180A4/DC12, SSDSC2BW240A4/DC12,
+      // INTEL SSDMCEAW120A4/DC33, INTEL SSDMCEAW240A4/DC33
+    "INTEL SSD(MCEA|SC2B)W(080|120|180|240|360|480)A4", // MCEA = mSATA
     "", "",
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
     "-v 9,msec24hour32,Power_On_Hours_and_Msec "
@@ -878,77 +915,106 @@ const drive_settings builtin_knowndrives[] = {
     "-v 234,raw24/raw24:w01234,Avg/Max_Erase_Count "
     "-v 235,raw24/raw24:w01z23,Good/Sys_Block_Count"
   },
-  { "JMicron based SSDs", // JMicron JMF61x, JMF661
+  { "JMicron based SSDs", // JMicron JMF61x, JMF66x, JMF670
     "ADATA S596 Turbo|"  // tested with ADATA S596 Turbo 256GB SATA SSD (JMicron JMF616)
     "ADATA SP600|"  // tested with ADATA SP600/2.4 (JMicron JMF661)
+    "ADATA SP310|"  // Premier Pro SP310 mSATA, JMF667, tested with ADATA SP310/3.04
     "APPLE SSD TS(064|128|256|512)C|"  // Toshiba?, tested with APPLE SSD TS064C/CJAA0201
     "KINGSTON SNV425S2(64|128)GB|"  // SSDNow V Series (2. Generation, JMF618),
                                     // tested with KINGSTON SNV425S264GB/C091126a
     "KINGSTON SSDNOW 30GB|" // tested with KINGSTON SSDNOW 30GB/AJXA0202
     "KINGSTON SS100S2(8|16)G|"  // SSDNow S100 Series, tested with KINGSTON SS100S28G/D100309a
+    "KINGSTON SNVP325S2(64|128|256|512)GB|" // SSDNow V+ Series, tested with KINGSTON SNVP325S2128GB/AGYA0201
     "KINGSTON SVP?100S2B?(64|96|128|256|512)G|"  // SSDNow V100/V+100 Series,
       // tested with KINGSTON SVP100S296G/CJR10202, KINGSTON SV100S2256G/D110225a
     "KINGSTON SV200S3(64|128|256)G|" // SSDNow V200 Series, tested with KINGSTON SV200S3128G/E120506a
     "TOSHIBA THNS128GG4BBAA|"  // Toshiba / Super Talent UltraDrive DX,
                                // tested with Toshiba 128GB 2.5" SSD (built in MacBooks)
     "TOSHIBA THNSNC128GMLJ|" // tested with THNSNC128GMLJ/CJTA0202 (built in Toshiba Protege/Dynabook)
-    "TS(8|16|32|64|128|192|256|512)GSSD25S?-(MD?|S)", // Transcend IDE and SATA (JMF612), tested with
+    "TS(8|16|32|64|128|192|256|512)GSSD25S?-(MD?|S)|" // Transcend IDE and SATA, JMF612, tested with
       // TS256GSSD25S-M/101028, TS32GSSD25-M/20101227
+    "TS(32|64|128|256)G(SSD|MSA)340", // Transcend SSD340 SATA/mSATA, JMF667/670, tested with
+      // TS256GSSD340/SVN263, TS256GSSD340/SVN423b, TS256GMSA340/SVN263
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 2,raw48,Throughput_Performance "
-    "-v 3,raw48,Unknown_Attribute "
+    "-v 3,raw48,Unknown_JMF_Attribute "
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
-    "-v 7,raw48,Unknown_Attribute "
-    "-v 8,raw48,Unknown_Attribute "
+    "-v 7,raw48,Unknown_JMF_Attribute "
+    "-v 8,raw48,Unknown_JMF_Attribute "
   //"-v 9,raw24(raw8),Power_On_Hours "
-    "-v 10,raw48,Unknown_Attribute "
+    "-v 10,raw48,Unknown_JMF_Attribute "
   //"-v 12,raw48,Power_Cycle_Count "
-  //"-v 167,raw48,Unknown_Attribute "
+    "-v 167,raw48,Unknown_JMF_Attribute "
     "-v 168,raw48,SATA_Phy_Error_Count "
-  //"-v 169,raw48,Unknown_Attribute "
+    "-v 169,raw48,Unknown_JMF_Attribute "
     "-v 170,raw16,Bad_Block_Count "
     "-v 173,raw16,Erase_Count " // JMF661: different?
     "-v 175,raw48,Bad_Cluster_Table_Count "
     "-v 192,raw48,Unexpect_Power_Loss_Ct "
   //"-v 194,tempminmax,Temperature_Celsius "
   //"-v 197,raw48,Current_Pending_Sector "
-    "-v 240,raw48,Unknown_Attribute"
-  },
-  { "Plextor M3/M5 (Pro) Series SSDs", // Marvell 88SS9174 (M3, M5S), 88SS9187 (M5Pro), tested with
-      // PLEXTOR PX-128M3/1.01, PX-128M3P/1.04, PX-256M3/1.05, PX-128M5S/1.02, PX-256M5S/1.03,
-      // PX-128M5M/1.05, PX-128M5S/1.05, PX-128M5Pro/1.05, PX-512M5Pro/1.06
+    "-v 233,raw48,Unknown_JMF_Attribute " // FW SVN423b
+    "-v 234,raw48,Unknown_JMF_Attribute " // FW SVN423b
+    "-v 240,raw48,Unknown_JMF_Attribute "
+  //"-v 241,raw48,Total_LBAs_Written "    // FW SVN423b
+  //"-v 242,raw48,Total_LBAs_Read "       // FW SVN423b
+  },
+  { "Plextor M3/M5/M6 Series SSDs", // Marvell 88SS9174 (M3, M5S), 88SS9187 (M5P, M5Pro), 88SS9188 (M6M/S),
+      // tested with PLEXTOR PX-128M3/1.01, PX-128M3P/1.04, PX-256M3/1.05, PX-128M5S/1.02, PX-256M5S/1.03,
+      // PX-128M5M/1.05, PX-128M5S/1.05, PX-128M5Pro/1.05, PX-512M5Pro/1.06, PX-256M5P/1.01, PX-128M6S/1.03
       // (1.04/5 Firmware self-test log lifetime unit is bogus, possibly 1/256 hours)
-    "PLEXTOR PX-(64|128|256|512)M(3P?|5[MS]|5Pro)",
+    "PLEXTOR PX-(64|128|256|512|768)M(3P?|5[MPS]|5Pro|6[MS])",
     "", "",
   //"-v 1,raw48,Raw_Read_Error_Rate "
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
+    "-v 170,raw48,Unknown_Plextor_Attrib "  // M6S/1.03
+    "-v 171,raw48,Unknown_Plextor_Attrib "  // M6S/1.03
+    "-v 172,raw48,Unknown_Plextor_Attrib "  // M6S/1.03
+    "-v 173,raw48,Unknown_Plextor_Attrib "  // M6S/1.03
+    "-v 174,raw48,Unknown_Plextor_Attrib "  // M6S/1.03
+  //"-v 175,raw48,Program_Fail_Count_Chip " // M6S/1.03
+  //"-v 176,raw48,Erase_Fail_Count_Chip "   // M6S/1.03
   //"-v 177,raw48,Wear_Leveling_Count "
   //"-v 178,raw48,Used_Rsvd_Blk_Cnt_Chip "
+  //"-v 179,raw48,Used_Rsvd_Blk_Cnt_Tot "   // M6S/1.03
+  //"-v 180,raw48,Unused_Rsvd_Blk_Cnt_Tot " // M6S/1.03
   //"-v 181,raw48,Program_Fail_Cnt_Total "
   //"-v 182,raw48,Erase_Fail_Count_Total "
+  //"-v 183,raw48,Runtime_Bad_Block "       // M6S/1.03
+  //"-v 184,raw48,End-to-End_Error "        // M6S/1.03
   //"-v 187,raw48,Reported_Uncorrect "
+  //"-v 188,raw48,Command_Timeout "         // M6S/1.03
   //"-v 192,raw48,Power-Off_Retract_Count "
+  //"-v 195,raw48,Hardware_ECC_Recovered "  // MS6/1.03
   //"-v 196,raw16(raw16),Reallocated_Event_Count "
   //"-v 198,raw48,Offline_Uncorrectable "
   //"-v 199,raw48,UDMA_CRC_Error_Count "
   //"-v 232,raw48,Available_Reservd_Space "
+  //"-v 233,raw48,Media_Wearout_Indicator " // MS6/1.03
     "-v 241,raw48,Host_Writes_32MiB "
     "-v 242,raw48,Host_Reads_32MiB"
   },
   { "Samsung based SSDs",
     "SAMSUNG SSD PM800 .*GB|"  // SAMSUNG PM800 SSDs, tested with SAMSUNG SSD PM800 TH 64GB/VBM25D1Q
     "SAMSUNG SSD PM810 .*GB|"  // SAMSUNG PM810 (470 series) SSDs, tested with SAMSUNG SSD PM810 2.5" 128GB/AXM06D1Q
+    "SAMSUNG SSD PM851 (mSATA )?(128|256|512)GB|" // tested with SAMSUNG SSD PM851 mSATA 128GB
+    "SAMSUNG SSD SM841N (mSATA )?(128|256|512)GB|" // tested with SAMSUNG SSD SM841N mSATA 256GB
     "SAMSUNG 470 Series SSD|"  // tested with SAMSUNG 470 Series SSD 64GB/AXM09B1Q
     "SAMSUNG SSD 830 Series|"  // tested with SAMSUNG SSD 830 Series 64GB/CXM03B1Q
     "Samsung SSD 840 (PRO )?Series|" // tested with Samsung SSD 840 PRO Series 128GB/DXM04B0Q,
       // Samsung SSD 840 Series/DXT06B0Q
-    "Samsung SSD 840 EVO ([0-9]*G|1T)B( mSATA)?|"  // tested with Samsung SSD 840 EVO (120|250|500)GB/EXT0AB0Q,
-      // Samsung SSD 840 EVO (120|250)GB/EXT0BB6Q, 1TB/EXT0BB0Q, 120GB mSATA/EXT41B6Q
-    "SAMSUNG MZ7WD((120|240)HAFV|480HAGM|960HAGP)-00003", // SM843T Series, tested with
+    "Samsung SSD 8[45]0 EVO ((120|250|500)G|1T)B( mSATA)?|" // tested with Samsung SSD 840 EVO (120|250|500)GB/EXT0AB0Q,
+      // Samsung SSD 840 EVO (120|250)GB/EXT0BB6Q, 1TB/EXT0BB0Q, 120GB mSATA/EXT41B6Q,
+      // Samsung SSD 850 EVO 250GB/EMT01B6Q
+    "Samsung SSD 850 PRO ((128|256|512)G|1T)B|" // tested with Samsung SSD 850 PRO 128GB/EXM01B6Q,
+      // Samsung SSD 850 PRO 1TB/EXM01B6Q
+    "SAMSUNG MZ7WD((120|240)HAFV|480HAGM|960HAGP)-00003|" // SM843T Series, tested with
       // SAMSUNG MZ7WD120HAFV-00003/DXM85W3Q
+    "SAMSUNG MZ7GE(240HMGR|(480|960)HMHP)-00003", // SM853T Series, tested with
+      // SAMSUNG MZ7GE240HMGR-00003/EXT0303Q
     "", "",
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
   //"-v 9,raw24(raw8),Power_On_Hours "
@@ -971,60 +1037,111 @@ const drive_settings builtin_knowndrives[] = {
     "-v 199,raw48,CRC_Error_Count "
     "-v 201,raw48,Supercap_Status "
     "-v 202,raw48,Exception_Mode_Status "
-    "-v 235,raw48,POR_Recovery_Count " // 830/840 Series
-  //"-v 241,raw48,Total_LBAs_Written"
+    "-v 235,raw48,POR_Recovery_Count " // 830/840/850 Series
+  //"-v 241,raw48,Total_LBAs_Written "
+  //"-v 242,raw48,Total_LBAs_Read " // PM851, SM841N
   },
   { "Marvell based SanDisk SSDs",
     "SanDisk SD5SG2[0-9]*G1052E|" // X100 (88SS9174), tested with SanDisk SD5SG2256G1052E/10.04.01
-    "SanDisk SD6SB[12]M[0-9]*G(1022I)?|" // X110/X210 (88SS9175), tested with SanDisk SD6SB1M064G1022I/X231600,
-      // SanDisk SD6SB1M256G1022I/X231600, SanDisk SD6SB2M512G1022I/X210400
+    "SanDisk SD6S[BF][12]M[0-9]*G(1022I?)?|" // X110/X210 (88SS9175/187?), tested with SanDisk SD6SB1M064G1022I/X231600,
+      // SanDisk SD6SB1M256G1022I/X231600, SanDisk SD6SF1M128G1022/X231200, SanDisk SD6SB2M512G1022I/X210400
+    "SanDisk SD7SB6S(128|256|512)G1122|" // X300 (88SS9189?), tested with SanDisk SD7SB6S128G1122/X3310000
     "SanDisk SDSSDHP[0-9]*G|" // Ultra Plus (88SS9175), tested with SanDisk SDSSDHP128G/X23[01]6RL
-    "SanDisk SDSSDXP[0-9]*G", // Extreme II (88SS9187), tested with SanDisk SDSSDXP480G/R1311
+    "SanDisk SDSSDHII[0-9]*G|" // Ultra II (88SS9190/88SS9189), tested with SanDisk SDSSDHII120G/X31200RL
+    "SanDisk SDSSDXPS?[0-9]*G", // Extreme II/Pro (88SS9187), tested with SanDisk SDSSDXP480G/R1311,
+      // SanDisk SDSSDXPS480G/X21200RL
     "", "",
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
+    "-v 165,raw48,Total_Write/Erase_Count "
     "-v 166,raw48,Min_W/E_Cycle "
     "-v 167,raw48,Min_Bad_Block/Die "
     "-v 168,raw48,Maximum_Erase_Cycle "
     "-v 169,raw48,Total_Bad_Block "
     "-v 171,raw48,Program_Fail_Count "
     "-v 172,raw48,Erase_Fail_Count "
-    "-v 173,raw48,Avg_Write_Erase_Ct "
+    "-v 173,raw48,Avg_Write/Erase_Count "
     "-v 174,raw48,Unexpect_Power_Loss_Ct "
+  //"-v 184,raw48,End-to-End_Error "
   //"-v 187,raw48,Reported_Uncorrect "
+  //"-v 188,raw48,Command_Timeout "
   //"-v 194,tempminmax,Temperature_Celsius "
+    "-v 199,raw48,SATA_CRC_Error "
     "-v 212,raw48,SATA_PHY_Error "
-    "-v 230,raw48,Perc_Write_Erase_Count "
+    "-v 230,raw48,Perc_Write/Erase_Count "
     "-v 232,raw48,Perc_Avail_Resrvd_Space "
     "-v 233,raw48,Total_NAND_Writes_GiB "
+    "-v 234,raw48,Perc_Write/Erase_Ct_BC "
     "-v 241,raw48,Total_Writes_GiB "
     "-v 242,raw48,Total_Reads_GiB "
   //"-v 243,raw48,Unknown_Attribute "
+    "-v 244,raw48,Thermal_Throttle "
   },
   { "SanDisk based SSDs", // see also #463 for the vendor attribute description
     "SanDisk iSSD P4 [0-9]*GB|" // tested with SanDisk iSSD P4 16GB/SSD 9.14
+    "SanDisk pSSD|" // tested with SandDisk pSSD/3 (62.7 GB, SanDisk Extreme USB3.0 SDCZ80-064G-J57, 0x0781:0x5580)
     "SanDisk SDSSDP[0-9]*G|" // tested with SanDisk SDSSDP064G/1.0.0, SDSSDP128G/2.0.0
+    "SanDisk SDSSDRC032G|" // tested with SanDisk SanDisk SDSSDRC032G/3.1.0
     "SanDisk SSD i100 [0-9]*GB|" // tested with SanDisk SSD i100 8GB/11.56.04, 24GB/11.56.04
     "SanDisk SSD U100 ([0-9]*GB|SMG2)|" // tested with SanDisk SSD U100 8GB/10.56.00, 256GB/10.01.02, SMG2/10.56.04
+    "SanDisk SSD U110 (8|16|24|32|64|128)GB|" // tested with SanDisk SSD U110 32GB/U221000
     "SanDisk SD7[SU]B[23]Q(064|128|256|512)G.*", // tested with SD7SB3Q064G1122/SD7UB3Q256G1122/SD7SB3Q128G/SD7UB2Q512G1122
     "", "",
   //"-v 5,raw16(raw16),Reallocated_Sector_Ct "
   //"-v 9,raw24(raw8),Power_On_Hours "
   //"-v 12,raw48,Power_Cycle_Count "
+    "-v 165,raw48,Total_Write/Erase_Count "
     "-v 171,raw48,Program_Fail_Count "
     "-v 172,raw48,Erase_Fail_Count "
-    "-v 173,raw48,Avg_Write_Erase_Ct "
+    "-v 173,raw48,Avg_Write/Erase_Count "
     "-v 174,raw48,Unexpect_Power_Loss_Ct "
   //"-v 187,raw48,Reported_Uncorrect "
     "-v 212,raw48,SATA_PHY_Error "
-    "-v 230,raw48,Perc_Write_Erase_Count "
+    "-v 230,raw48,Perc_Write/Erase_Count "
     "-v 232,raw48,Perc_Avail_Resrvd_Space "
-    "-v 234,raw48,Perc_Write_Erase_Ct_BC "
+    "-v 234,raw48,Perc_Write/Erase_Ct_BC "
   //"-v 241,raw48,Total_LBAs_Written "
   //"-v 242,raw48,Total_LBAs_Read "
     "-v 244,raw48,Thermal_Throttle "
   },
+  { "SiliconMotion based SSDs", // SM2246EN (Transcend TS6500)
+    "TS((16|32|64|128|256|512)G|1T)(SSD|MSA)370", // Transcend SSD370 SATA/mSATA, TS6500, tested with
+      // TS32GMSA370/20140402, TS16GMSA370/20140516, TS64GSSD370/20140516, TS256GSSD370/N0815B
+    "", "",
+  //"-v 1,raw48,Raw_Read_Error_Rate "
+  //"-v 2,raw48,Throughput_Performance "
+  //"-v 9,raw24(raw8),Power_On_Hours "
+  //"-v 12,raw48,Power_Cycle_Count "
+    "-v 160,raw48,Uncorrectable_Error_Cnt "
+    "-v 161,raw48,Valid_Spare_Block_Cnt "
+    "-v 163,raw48,Initial_Bad_Block_Count "
+    "-v 164,raw48,Total_Erase_Count "
+    "-v 165,raw48,Max_Erase_Count "
+    "-v 166,raw48,Min_Erase_Count "
+    "-v 167,raw48,Average_Erase_Count "
+    "-v 168,raw48,Max_Erase_Count_of_Spec "
+    "-v 169,raw48,Remaining_Lifetime_Perc "
+  //"-v 175,raw48,Program_Fail_Count_Chip "
+  //"-v 176,raw48,Erase_Fail_Count_Chip "
+  //"-v 177,raw48,Wear_Leveling_Count "
+    "-v 178,raw48,Runtime_Invalid_Blk_Cnt "
+  //"-v 181,raw48,Program_Fail_Cnt_Total "
+  //"-v 182,raw48,Erase_Fail_Count_Total "
+  //"-v 187,raw48,Reported_Uncorrect "
+  //"-v 192,raw48,Power-Off_Retract_Count "
+  //"-v 194,tempminmax,Temperature_Celsius "
+  //"-v 195,raw48,Hardware_ECC_Recovered "
+  //"-v 196,raw16(raw16),Reallocated_Event_Count "
+  //"-v 197,raw48,Current_Pending_Sector "
+  //"-v 198,raw48,Offline_Uncorrectable "
+  //"-v 199,raw48,UDMA_CRC_Error_Count "
+    "-v 225,raw48,Host_Writes_32MiB " // FW 20140402
+  //"-v 232,raw48,Available_Reservd_Space "
+    "-v 241,raw48,Host_Writes_32MiB "
+    "-v 242,raw48,Host_Reads_32MiB "
+    "-v 245,raw48,Unkn_SiliconMotion_Attr" // FW N0815B
+  },
   { "Smart Storage Systems Xcel-10 SSDs",  // based on http://www.smartm.com/files/salesLiterature/storage/xcel10.pdf
     "SMART A25FD-(32|64|128)GI32N", // tested with SMART A25FD-128GI32N/B9F23D4K
     "",
@@ -1397,8 +1514,8 @@ const drive_settings builtin_knowndrives[] = {
     "SAMSUNG HD(250KD|(30[01]|320|40[01])L[DJ])",
     "", "", ""
   },
-  { "SAMSUNG SpinPoint T166", // tested with HD501LJ/CR100-1[01]
-    "SAMSUNG HD(080G|160H|32[01]K|403L|50[01]L)J",
+  { "SAMSUNG SpinPoint T166", // tested with HD252KJ/CM100-11, HD501LJ/CR100-1[01]
+    "SAMSUNG HD(080G|160H|252K|32[01]K|403L|50[01]L)J",
     "", "",
     "-v 197,increasing" // at least HD501LJ/CR100-11
   },
@@ -1482,9 +1599,11 @@ const drive_settings builtin_knowndrives[] = {
     "SAMSUNG HN-M(250|320|500|640|750|101)MBB",
     "", "", ""
   },
-  { "Seagate Momentus SpinPoint M8 (AF)", // tested with
-      // ST750LM022 HN-M750MBB/2AR10001, ST320LM001 HN-M320MBB/2AR10002
-    "ST(250|320|500|640|750|1000)LM0[012][124] HN-M[0-9]*MBB",
+  { "Seagate Samsung SpinPoint M8 (AF)", // tested with
+      // ST750LM022 HN-M750MBB/2AR10001, ST320LM001 HN-M320MBB/2AR10002,
+      // APPLE HDD ST500LM012/2BA30003
+    "ST(250|320|500|640|750|1000)LM0[012][124] HN-M[0-9]*MBB|"
+    "APPLE HDD ST500LM012",
     "", "", ""
   },
   { "SAMSUNG SpinPoint M8U (USB)", // tested with HN-M500XBB/2AR10001
@@ -1495,6 +1614,16 @@ const drive_settings builtin_knowndrives[] = {
     "ST(250|320|500|640|750|1000)LM0[012][3459] HN-M[0-9]*ABB",
     "", "", ""
   },
+  { "Seagate Samsung SpinPoint M9T", // tested with ST2000LM003 HN-M201RAD/2BC10003
+      // (Seagate Expansion Portable)
+    "ST(1500|2000)LM0(03|04|06|07|10) HN-M[0-9]*RAD",
+    "", "", ""
+  },
+  { "Seagate Samsung SpinPoint M9TU (USB)", // tested with ST1500LM008 HN-M151AAD/2BC10001
+       // (0x04e8:0x61b5), ST2000LM005 HN-M201AAD2BC10001 (0x04e8:0x61b4)
+    "ST(1500|2000)LM00[58] HN-M[0-9]*AAD",
+    "", "", ""
+  },
   { "SAMSUNG SpinPoint MP5", // tested with HM250HJ/2AK10001
     "SAMSUNG HM(250H|320H|500J|640J)J",
     "", "", ""
@@ -1899,12 +2028,17 @@ const drive_settings builtin_knowndrives[] = {
     "(Hitachi |HITACHI )?HT(S|E)5432(80|12|16|25|32)L9(A3(00)?|SA0[012])",
     "", "", ""
   },
-  { "Hitachi Travelstar 5K500.B",
-    "(Hitachi )?HT[ES]5450(12|16|25|32|40|50)B9A30[01]",
+  { "Hitachi/HGST Travelstar Z5K320", // tested with Hitachi HTS543232A7A384/ES2OA70K
+    "(Hitachi|HGST) HT[ES]5432(16|25|32)A7A38[145]",
     "", "", ""
   },
-  { "Hitachi/HGST Travelstar Z5K500", // tested with HGST HTS545050A7E380/GG2OAC90
-    "HGST HT[ES]5450(25|32|50)A7E38[01]",
+  { "Hitachi Travelstar 5K500.B", // tested with Hitachi HTS545050B9SA00/PB4OC60X
+    "(Hitachi )?HT[ES]5450(12|16|25|32|40|50)B9(A30[01]|SA00)",
+    "", "", ""
+  },
+  { "Hitachi/HGST Travelstar Z5K500", // tested with HGST HTS545050A7E380/GG2OAC90,
+      // Hitachi HTS545032A7E380/GGBOA7A0, APPLE HDD HTS545050A7E362/GG2AB990
+    "(Hitachi|HGST|APPLE HDD) HT[ES]5450(25|32|50)A7E3(62|8[01])",
     "", "", ""
   },
   { "Hitachi/HGST Travelstar 5K750", // tested with Hitachi HTS547575A9E384/JE4OA60A,
@@ -1912,6 +2046,19 @@ const drive_settings builtin_knowndrives[] = {
     "(Hitachi|APPLE HDD) HT[ES]5475(50|64|75)A9E38[14]",
     "", "", ""
   },
+  { "HGST Travelstar 5K1000", // tested with HGST HTS541010A9E680/JA0OA560,
+      // HGST HTS541075A9E680/JA2OA560
+    "HGST HT[ES]5410(64|75|10)A9E68[01]",
+    "", "", ""
+  },
+  { "HGST Travelstar Z5K1000", // tested with HGST HTS541010A7E630/SE0OA4A0
+    "HGST HTS5410(75|10)A7E63[015]",
+    "", "", ""
+  },
+  { "HGST Travelstar 5K1500", // tested with HGST HTS541515A9E630/KA0OA500
+    "HGST HT[ES]541515A9E63[015]",
+    "", "", ""
+  },
   { "Hitachi Travelstar 7K60",
     "(Hitachi )?HTS726060M9AT00",
     "", "", ""
@@ -1941,8 +2088,8 @@ const drive_settings builtin_knowndrives[] = {
     "(HITACHI )?HT[ES]7232(16|25|32)A7A36[145]",
     "", "", ""
   },
-  { "Hitachi Travelstar 7K500",
-    "(Hitachi )?HT[ES]7250(12|16|25|32|50)A9A36[2-5]",
+  { "Hitachi Travelstar 7K500", // tested with Hitachi HTS725050A9A360/PC4OC70D
+    "(Hitachi )?HT[ES]7250(12|16|25|32|50)A9A36[02-5]",
     "", "", ""
   },
   { "Hitachi/HGST Travelstar Z7K500", // tested with HITACHI HTS725050A7E630/GH2ZB390,
@@ -1979,6 +2126,10 @@ const drive_settings builtin_knowndrives[] = {
     "(IBM-)?IC35L(030|060|090|120|180)AVV207-[01]",
     "", "", ""
   },
+  { "Hitachi CinemaStar 5K320", // tested with Hitachi HCS5C3225SLA380/STBOA37H
+    "Hitachi HCS5C32(25|32)SLA380",
+    "", "", ""
+  },
   { "Hitachi Deskstar 5K3000", // tested with HDS5C3030ALA630/MEAOA5C0,
        // Hitachi HDS5C3020BLE630/MZ4OAAB0 (OEM, Toshiba Canvio Desktop)
     "(Hitachi )?HDS5C30(15|20|30)(ALA|BLE)63[02].*",
@@ -2032,8 +2183,9 @@ const drive_settings builtin_knowndrives[] = {
     "(Hitachi )?HDT7210((16|25)SLA380|(32|50|64|75|10)SLA360)",
     "", "", ""
   },
-  { "Hitachi Deskstar 7K1000.C", // tested with Hitachi HDS721010CLA330/JP4OA3MA
-    "(Hitachi )?HDS7210((16|25)CLA382|(32|50)CLA362|(64|75|10)CLA33[02])",
+  { "Hitachi Deskstar 7K1000.C", // tested with Hitachi HDS721010CLA330/JP4OA3MA,
+      // Hitachi HDS721025CLA682/JP1OA41A
+    "(Hitachi )?HDS7210((16|25)CLA[36]82|(32|50)CLA[36]62|(64|75|10)CLA[36]3[02])",
     "", "", ""
   },
   { "Hitachi Deskstar 7K1000.D", // tested with HDS721010DLE630/MS2OA5Q0
@@ -2056,6 +2208,11 @@ const drive_settings builtin_knowndrives[] = {
     "Hitachi HDS724040ALE640",
     "", "", ""
   },
+  { "HGST Deskstar NAS", // tested with HGST HDN724040ALE640/MJAOA5E0,
+       // HGST HDN726050ALE610/APGNT517, HGST HDN726060ALE610/APGNT517
+    "HGST HDN72(4030|4040|6050|6060)ALE6[14]0",
+    "", "", ""
+  },
   { "Hitachi Ultrastar A7K1000", // tested with
     // HUA721010KLA330      44X2459 42C0424IBM/GKAOAB4A
     "(Hitachi )?HUA7210(50|75|10)KLA330.*",
@@ -2070,8 +2227,17 @@ const drive_settings builtin_knowndrives[] = {
     "Hitachi HUA7230(20|30)ALA640",
     "", "", ""
   },
-  { "Hitachi Ultrastar 7K4000", // tested with Hitachi HUS724040ALE640/MJAOA3B0
-    "Hitachi HUS7240(20|30|40)ALE640",
+  { "Hitachi/HGST Ultrastar 7K4000", // tested with Hitachi HUS724040ALE640/MJAOA3B0,
+      // HGST HUS724040ALE640/MJAOA580, HGST HUS724020ALA640/MF6OAA70
+    "(Hitachi|HGST) HUS7240(20|30|40)AL[AE]64[01]",
+    "", "", ""
+  },
+  { "HGST Ultrastar He6", // tested with HGST HUS726060ALA640/AHGNT1E2
+    "HGST HUS726060ALA64[01]",
+    "", "", ""
+  },
+  { "HGST MegaScale 4000", // tested with HGST HMS5C4040ALE640/MPAOA580
+    "HGST HMS5C4040[AB]LE64[01]", // B = DC 4000.B
     "", "", ""
   },
   { "Toshiba 2.5\" HDD (10-20 GB)",
@@ -2098,6 +2264,12 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MK8050GACY",
     "", "", ""
   },
+  { "Toshiba 2.5\" HDD MK..51GSY", // tested with TOSHIBA MK1251GSY/LD101D
+    "TOSHIBA MK(80|12|16|25)51GSY",
+    "",
+    "",
+    "-v 9,minutes"
+  },
   { "Toshiba 2.5\" HDD MK..52GSX",
     "TOSHIBA MK(80|12|16|25|32)52GSX",
     "", "", ""
@@ -2120,8 +2292,15 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MK(75|10)59GSM",
     "", "", ""
   },
-  { "Toshiba 2.5\" HDD MK..61GSY[N]", // tested with TOSHIBA MK5061GSY/MC102E, MK5061GSYN/MH000A
+  { "Toshiba 2.5\" HDD MK..61GSY[N]", // tested with TOSHIBA MK5061GSY/MC102E, MK5061GSYN/MH000A,
+      // TOSHIBA MK2561GSYN/MH000D
     "TOSHIBA MK(16|25|32|50|64)61GSYN?",
+    "",
+    "",
+    "-v 9,minutes" // TOSHIBA MK2561GSYN/MH000D
+  },
+  { "Toshiba 2.5\" HDD MK..61GSYB", // tested with TOSHIBA MK5061GSYB/ME0A
+    "TOSHIBA MK(16|25|32|50|64)61GSYB",
     "", "", ""
   },
   { "Toshiba 2.5\" HDD MK..65GSX", // tested with TOSHIBA MK5065GSX/GJ003A, MK3265GSXN/GH012H,
@@ -2129,17 +2308,38 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MK(16|25|32|50|64)65GSX[FN]?( H)?", // "... H" = USB ?
     "", "", ""
   },
+  { "Toshiba 2.5\" HDD MK..75GSX", // tested with TOSHIBA MK7575GSX/GT001C
+    "TOSHIBA MK(32|50|64|75)75GSX",
+    "", "", ""
+  },
   { "Toshiba 2.5\" HDD MK..76GSX", // tested with TOSHIBA MK3276GSX/GS002D
     "TOSHIBA MK(16|25|32|50|64)76GSX",
     "",
     "",
     "-v 9,minutes"
   },
+  { "Toshiba 2.5\" HDD MQ01ABB...", // tested with TOSHIBA MQ01ABB200/AY000U
+    "TOSHIBA MQ01ABB(100|150|200)",
+    "", "", ""
+  },
+  { "Toshiba 2.5\" HDD MQ01ABC...", // tested with TOSHIBA MQ01ABC150/AQ001U
+    "TOSHIBA MQ01ABC(100|150|200)",
+    "", "", ""
+  },
   { "Toshiba 2.5\" HDD MQ01ABD...", // tested with TOSHIBA MQ01ABD100/AX001U
     "TOSHIBA MQ01ABD(025|032|050|064|075|100)",
     "", "", ""
   },
-  { "Toshiba 2.5\" HDD MQ01UBD... (USB 3.0)", // tested with TOSHIBA MQ01ABD100/AX001U
+  { "Toshiba 2.5\" HDD MQ01ABF...", // tested with TOSHIBA MQ01ABF050/AM001J
+    "TOSHIBA MQ01ABF(050|075|100)",
+    "", "", ""
+  },
+  { "Toshiba 2.5\" HDD MQ01UBB... (USB 3.0)", // tested with TOSHIBA MQ01UBB200/AY000U (0x0480:0xa100)
+    "TOSHIBA MQ01UBB200",
+    "", "", ""
+  },
+  { "Toshiba 2.5\" HDD MQ01UBD... (USB 3.0)", // tested with TOSHIBA MQ01UBD050/AX001U (0x0480:0xa007),
+      // TOSHIBA MQ01UBD100/AX001U (0x0480:0x0201, 0x0480:0xa200)
     "TOSHIBA MQ01UBD(050|075|100)",
     "", "", ""
   },
@@ -2151,7 +2351,15 @@ const drive_settings builtin_knowndrives[] = {
     "TOSHIBA MG03ACA[1234]00Y?",
     "", "", ""
   },
-  { "Toshiba 3.5\" HDD DT01ACA...", // tested with TOSHIBA DT01ACA100/MS2OA750,
+  { "Toshiba 3.5\" MD04ACA... Enterprise HDD", // tested with TOSHIBA MD04ACA500/FP1A
+    "TOSHIBA MD04ACA[2345]00",
+    "", "", ""
+  },
+  { "Toshiba 3.5\" DT01ABA... Desktop HDD", // tested with TOSHIBA DT01ABA300/MZ6OABB0
+    "TOSHIBA DT01ABA(100|150|200|300)",
+    "", "", ""
+  },
+  { "Toshiba 3.5\" DT01ACA... Desktop HDD", // tested with TOSHIBA DT01ACA100/MS2OA750,
       // TOSHIBA DT01ACA200/MX4OABB0, TOSHIBA DT01ACA300/MX6OABB0
     "TOSHIBA DT01ACA(025|032|050|075|100|150|200|300)",
     "", "", ""
@@ -2283,8 +2491,9 @@ const drive_settings builtin_knowndrives[] = {
     "ST(160|250|320)LT0(07|09|11|14)-.*",
     "", "", ""
   },
-  { "Seagate Laptop Thin HDD", // tested with ST500LT012-9WS142/0001SDM1
-    "ST(250|320|500)LT0(12|15|25)-.*",
+  { "Seagate Laptop Thin HDD", // tested with ST500LT012-9WS142/0001SDM1,
+      // ST500LM021-1KJ152/0002LIM1
+    "ST((250|320|500)LT0(12|15|25)|(320|500)LM0(10|21))-.*",
     "", "", ""
   },
   { "Seagate Laptop SSHD", // tested with ST500LM000-1EJ162/SM11
@@ -2459,8 +2668,9 @@ const drive_settings builtin_knowndrives[] = {
   },
   { "Seagate Barracuda 7200.14 (AF)", // different part number, tested with
       // ST1000DM003-1CH162/CC47, ST1000DM003-1CH162/CC49, ST2000DM001-1CH164/CC24,
-      // ST1000DM000-9TS15E/CC92
-    "ST(1000|1500|2000|2500|3000)DM00[0-3]-.*",
+      // ST1000DM000-9TS15E/CC92, APPLE HDD ST3000DM001/AP15 (no attr 240)
+    "ST(1000|1500|2000|2500|3000)DM00[0-3]-.*|"
+    "APPLE HDD ST3000DM001",
     "", "",
     "-v 188,raw16 -v 240,msec24hour32"
   },
@@ -2549,8 +2759,10 @@ const drive_settings builtin_knowndrives[] = {
     "ST(5|10|20)00NM0011",
     "", "", ""
   },
-  { "Seagate Constellation ES.2 (SATA 6Gb/s)", // tested with ST32000645NS/0004, ST33000650NS
-    "ST3(2000645|300065[012])NS",
+  { "Seagate Constellation ES.2 (SATA 6Gb/s)", // tested with ST32000645NS/0004, ST33000650NS,
+      // MB3000EBKAB/HPG6
+    "ST3(2000645|300065[012])NS|"
+    "MB3000EBKAB", // HP OEM
     "", "", ""
   },
   { "Seagate Constellation ES.3", // tested with ST1000NM0033-9ZM173/0001, ST4000NM0033-9ZM170/SN03
@@ -2561,14 +2773,23 @@ const drive_settings builtin_knowndrives[] = {
     "ST(1000|2000|3000)NC00[0-3](-.*)?",
     "", "", ""
   },
-  { "Seagate Constellation.2 (SATA)", // 2.5", tested with ST91000640NS/SN02
-    "ST9(25061|50062|100064)[012]NS", // *SS = SAS
+  { "Seagate Constellation.2 (SATA)", // 2.5", tested with ST91000640NS/SN02, MM1000GBKAL/HPGB
+    "ST9(25061|50062|100064)[012]NS|" // *SS = SAS
+    "MM1000GBKAL", // HP OEM
+    "", "", ""
+  },
+  { "Seagate Enterprise Capacity 3.5 HDD", // tested with ST6000NM0024-1HT17Z/SN02
+    "ST[2456]000NM0[01][248]4-.*", // *[069]4 = 4Kn
     "", "", ""
   },
   { "Seagate NAS HDD", // tested with ST2000VN000-1H3164/SC42, ST3000VN000-1H4167/SC43
     "ST[234]000VN000-.*",
     "", "", ""
   },
+  { "Seagate Archive HDD", // tested with ST8000AS0002-1NA17Z/AR13
+    "ST[568]000AS00[01][12]-.*",
+    "", "", ""
+  },
   { "Seagate Pipeline HD 5900.1",
     "ST3(160310|320[34]10|500(321|422))CS",
     "", "", ""
@@ -2723,8 +2944,9 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD((16|20|25|32|40|50|64|75)00AAKS|1602ABKS|10EALS)-.*",
     "", "", ""
   },
-  { "Western Digital Caviar Blue (SATA 6Gb/s)", // tested with WDC WD10EZEX-00RKKA0/80.00A80
-    "WDC WD((25|32|50)00AAKX|7500AALX|10EALX|10EZEX)-.*",
+  { "Western Digital Blue", // tested with WDC WD5000AZLX-00K4KA0/80.00A80,
+      // WDC WD10EZEX-00RKKA0/80.00A80, WDC WD10EZEX-75M2NA0/01.01A01
+    "WDC WD((25|32|50)00AAK|5000AZL|7500AAL|10EAL|10EZE)X-.*",
     "", "", ""
   },
   { "Western Digital RE Serial ATA",
@@ -2743,8 +2965,9 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD((25|32|50|75)02A|(75|10)02F)BYS-.*",
     "", "", ""
   },
-  { "Western Digital RE4", // tested with WDC WD2003FYYS-18W0B0/01.01D02
-    "WDC WD((((25|50)03A|1003F)BYX)|((15|20)03FYYS))-.*",
+  { "Western Digital RE4", // tested with WDC WD2003FYYS-18W0B0/01.01D02,
+      // WDC WD1003FBYZ-010FB0/01.01V03
+    "WDC WD((25|50)03ABYX|1003FBY[XZ]|(15|20)03FYYS)-.*",
     "", "", ""
   },
   { "Western Digital RE4-GP", // tested with WDC WD2002FYPS-02W3B0/04.01G01
@@ -2770,10 +2993,11 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD(((64|75|80)00AA|(10|15|20)EA|(25|30)EZ)R|20EAC)S-.*",
     "", "", ""
   },
-  { "Western Digital Caviar Green (AF, SATA 6Gb/s)", // tested with
+  { "Western Digital Green", // tested with
       // WDC WD10EZRX-00A8LB0/01.01A01, WDC WD20EZRX-00DC0B0/80.00A80,
-      // WDC WD30EZRX-00MMMB0/80.00A80, WDC WD40EZRX-00SPEB0/80.00A80
-    "WDC WD(7500AA|(10|15|20)EA|(10|20|25|30|40)EZ)RX-.*",
+      // WDC WD30EZRX-00MMMB0/80.00A80, WDC WD40EZRX-00SPEB0/80.00A80,
+      // WDC WD60EZRX-00MVLB1/80.00A80
+    "WDC WD(7500AA|(10|15|20)EA|(10|20|25|30|40|50|60)EZ)RX-.*",
     "", "", ""
   },
   { "Western Digital Caviar Black",
@@ -2798,12 +3022,13 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD((16|25|32|50|64|75)00AV[CDV]S|(10|15|20)EV[CDV]S)-.*",
     "", "", ""
   },
-  { "Western Digital AV-GP (AF)", // tested with WDC WD10EURS-630AB1/80.00A80, WDC WD10EUCX-63YZ1Y0/51.0AB52
-    "WDC WD(7500AURS|10EU[CR]X|(10|15|20|25|30)EURS)-.*",
+  { "Western Digital AV-GP (AF)", // tested with WDC WD10EURS-630AB1/80.00A80,
+      // WDC WD10EUCX-63YZ1Y0/51.0AB52, WDC WD20EURX-64HYZY0/80.00A80
+    "WDC WD(5000AUDX|7500AURS|10EUCX|(10|15|20|25|30)EUR[SX])-.*",
     "", "", ""
   },
-  { "Western Digital AV-25",
-    "WDC WD((16|25|32|50)00BUD|5000BUC)T-.*",
+  { "Western Digital AV", // tested with DC WD10JUCT-63CYNY0/01.01A01
+    "WDC WD((16|25|32|50)00BU[CD]|5000LUC|10JUC)T-.*",
     "", "", ""
   },
   { "Western Digital Raptor",
@@ -2851,9 +3076,18 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD(50|75)00BPKT-.*",
     "", "", ""
   },
-  { "Western Digital Red (AF)", // tested with WDC WD10EFRX-68JCSN0/01.01A01,
-      // WDC WD10JFCX-68N6GN0/01.01A01, WDC WD40EFRX-68WT0N0/80.00A80
-    "WDC WD(10|20|30|40)[EJ]F[CR]X-.*",
+  { "Western Digital Red", // tested with WDC WD10EFRX-68JCSN0/01.01A01,
+      // WDC WD10JFCX-68N6GN0/01.01A01, WDC WD40EFRX-68WT0N0/80.00A80,
+      // WDC WD60EFRX-68MYMN1/82.00A82
+    "WDC WD(7500BFC|10JFC|(10|20|30|40|50|60)EFR)X-.*",
+    "", "", ""
+  },
+  { "Western Digital Red Pro", // tested with WDC WD2001FFSX-68JNUN0/81.00A81
+    "WDC WD[234]001FFSX-.*",
+    "", "", ""
+  },
+  { "Western Digital Purple", // tested with WDC WD40PURX-64GVNY0/80.00A80
+    "WDC WD[123456]0PURX-.*",
     "", "", ""
   },
   { "Western Digital Blue Mobile", // tested with WDC WD5000LPVX-08V0TT2/03.01A03
@@ -2864,6 +3098,10 @@ const drive_settings builtin_knowndrives[] = {
     "WDC WD(15|20)NPV[TX]-.*",
     "", "", ""
   },
+  { "Western Digital Black Mobile", // tested with WDC WD7500BPKX-22HPJT0/01.01A01
+    "WDC WD((16|25|32)00BE|(50|75)00BP)KX-.*",
+    "", "", ""
+  },
   { "Western Digital Elements / My Passport (USB)", // tested with WDC WD5000BMVW-11AMCS0/01.01A01
     "WDC WD(25|32|40|50)00BMV[UVW]-.*",  // *W-* = USB 3.0
     "", "", ""
@@ -2927,6 +3165,13 @@ const drive_settings builtin_knowndrives[] = {
   // USB ID entries
   ////////////////////////////////////////////////////
 
+  // 0x0350 (?)
+  { "USB: ViPowER USB3.0 Storage; ",
+    "0x0350:0x0038",
+    "", // 0x1905
+    "",
+    "-d sat,12" // ATA output registers missing
+  },
   // Hewlett-Packard
   { "USB: HP Desktop HD BD07; ", // 2TB
     "0x03f0:0xbd07",
@@ -2955,6 +3200,18 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: Buffalo Drivestation Duo; ",
+    "0x0411:0x01ce",
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: Buffalo DriveStation HD-LBU2 ; Medialogic MLDU11",
+    "0x0411:0x01ea",
+    "",
+    "",
+    "-d sat"
+  },
   { "USB: Buffalo MiniStation Stealth HD-PCTU2; ",
     "0x0411:0x01d9",
     "", // 0x0108
@@ -2982,12 +3239,18 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   // Toshiba
-  { "USB: Toshiba Stor.E Slim USB 3.0; ", // 1TB, MQ01UBD100
+  { "USB: Toshiba Stor.E Slim USB 3.0; ", // TOSHIBA MQ01UBD100
     "0x0480:0x0100",
     "", // 0x0000
     "",
     "-d sat"
   },
+  { "USB: Toshiba Canvio Basics; ", // TOSHIBA MQ01UBD100
+    "0x0480:0x(0201|a200)",
+    "",
+    "",
+    "-d sat"
+  },
   { "USB: Toshiba Canvio 500GB; SunPlus",
     "0x0480:0xa004",
     "",
@@ -2995,20 +3258,20 @@ const drive_settings builtin_knowndrives[] = {
     "-d usbsunplus"
   },
   { "USB: Toshiba Canvio Basics; ",
-    "0x0480:0xa006",
-    "", // 0x0001
+    "0x0480:0xa00[6d]",
+    "", // 0x0001, 0x0407
     "",
     "-d sat"
   },
-  { "USB: Toshiba Canvio 3.0 Portable Hard Drive; ", // 1TB
+  { "USB: Toshiba Canvio 3.0 Portable Hard Drive; ", // TOSHIBA MQ01UBD050
     "0x0480:0xa007",
     "", // 0x0001
     "",
     "-d sat"
   },
-  { "USB: Toshiba Stor.E Basics; ", // 1TB
-    "0x0480:0xa009",
-    "",
+  { "USB: Toshiba Stor.E Basics; ",
+    "0x0480:0xa00[9ce]",
+    "", // 0x0000 (0xa00e)
     "",
     "-d sat"
   },
@@ -3018,9 +3281,15 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: Toshiba Canvio Desktop; ", // 2TB
-    "0x0480:0xd010",
+  { "USB: Toshiba Canvio ALU; ", // TOSHIBA MQ01UBB200
+    "0x0480:0xa100",
+    "",
     "",
+    "-d sat"
+  },
+  { "USB: Toshiba Canvio Desktop; ",
+    "0x0480:0xd0(00|10|11)",
+    "", // 0x0316 (0xd011)
     "",
     "-d sat"
   },
@@ -3060,10 +3329,10 @@ const drive_settings builtin_knowndrives[] = {
   },
   // Samsung
   { "USB: Samsung S2 Portable; JMicron",
-    "0x04e8:0x1f0[568]",
+    "0x04e8:0x1f0[568a]", // 0x1f0a: SAMSUNG HN-M101XBB
     "",
     "",
-    "-d usbjmicron"
+    "-d usbjmicron" // 0x1f0a: works also with "-d sat"
   },
   { "USB: Samsung S1 Portable; JMicron",
     "0x04e8:0x2f03",
@@ -3101,18 +3370,24 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
-  { "USB: Samsung D3 Station; ", // 3TB
-    "0x04e8:0x6124",
-    "", // 0x200
+  { "USB: Samsung D3 Station; ",
+    "0x04e8:0x612[45]", // 3TB, 4TB
+    "", // 0x200, 0x202
     "",
     "-d sat"
   },
-  { "USB: Samsung M3 Portable USB 3.0; ",
-    "0x04e8:0x61b[456]", // 4=2TB, 5=1.5TB, 6=1TB
+  { "USB: Samsung M3 Portable USB 3.0; ", // 1.5/2TB: SpinPoint M9TU
+    "0x04e8:0x61b[3456]", // 500MB, 2TB, 1.5TB, 1TB
     "", // 0x0e00
     "",
     "-d sat"
   },
+  { "USB: Samsung S3 Portable; ",
+    "0x04e8:0x61c8", // ST1000LM025 HN-M101ABB
+    "", // 0x1301
+    "",
+    "-d sat"
+  },
   // Sunplus
   { "USB: ; SunPlus",
     "0x04fc:0x0c05",
@@ -3163,9 +3438,9 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbsunplus"
   },
-  { "USB: Iomega GDHDU2; JMicron",
-    "0x059b:0x0475",
-    "", // 0x0100
+  { "USB: Iomega; JMicron",
+    "0x059b:0x0[45]75", // 0x0475: Iomega GDHDU2 (0x0100), 0x0575: LDHD-UP
+    "",
     "",
     "-d usbjmicron"
   },
@@ -3188,6 +3463,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron"
   },
+  { "USB: LaCie Rugged Triple Interface; ",
+    "0x059f:0x100c",
+    "", // 0x0001
+    "",
+    "-d sat"
+  },
   { "USB: LaCie hard disk (Neil Poulton design);",
     "0x059f:0x1018",
     "",
@@ -3262,6 +3543,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: ; Genesys Logic GL3310",
+    "0x05e3:0x0731", // Chieftec USB 3.0 2.5" case
+    "",
+    "",
+    "-d sat"
+  },
   // Micron
   { "USB: Micron USB SSD; ",
     "0x0634:0x0655",
@@ -3276,7 +3563,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron,0" // Port number is required
   },
-  { "USB: ; Prolific PL3507", // USB+IEE1394->PATA
+  { "USB: ; Prolific PL2571/2771/2773/2775", // USB->SATA, USB3->SATA,
+    "0x067b:0x(2571|277[135])",              // USB3+eSATA->SATA, USB3->2xSATA
+    "",
+    "",
+    "-d usbprolific"
+  },
+  { "USB: ; Prolific PL3507", // USB+IEEE1394->PATA
     "0x067b:0x3507",
     "", // 0x0001
     "",
@@ -3289,6 +3582,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  // SanDisk
+  { "USB: SanDisk SDCZ80 Flash Drive; Fujitsu", // ATA ID: SanDisk pSSD
+    "0x0781:0x5580",
+    "",
+    "",
+    "-d sat"
+  },
   // Freecom
   { "USB: Freecom Mobile Drive XXS; JMicron",
     "0x07ab:0xfc88",
@@ -3314,8 +3614,8 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "" // unsupported
   },
-  { "USB: Freecom HD 500GB; JMicron",
-    "0x07ab:0xfcda",
+  { "USB: Freecom HD; JMicron", // 500GB
+    "0x07ab:0xfcd[6a]",
     "",
     "",
     "-d usbjmicron"
@@ -3371,6 +3671,13 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbsunplus"
   },
+  // Apricorn
+  { "USB: Apricorn SATA Wire; ",
+    "0x0984:0x0040",
+    "",
+    "",
+    "-d sat"
+  },
   // Seagate
   { "USB: Seagate External Drive; Cypress",
     "0x0bc2:0x0503",
@@ -3391,8 +3698,8 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: Seagate Expansion Portable; ",
-    "0x0bc2:0x23(00|12)",
-    "",
+    "0x0bc2:0x23(00|12|20|21)",
+    "", // 0x0219 (0x2312)
     "",
     "-d sat"
   },
@@ -3414,8 +3721,14 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat,12"
   },
-  { "USB: Seagate Expansion External; ", // 2TB, 3TB
-    "0x0bc2:0x33(00|12|20|32)",
+  { "USB: Seagate FreeAgent XTreme; ",
+    "0x0bc2:0x3101",
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: Seagate Expansion External; ",
+    "0x0bc2:0x33(00|12|20|21|32)", // 0x3321: Expansion Desktop 4TB
     "",
     "",
     "-d sat"
@@ -3439,7 +3752,7 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   { "USB: Seagate FreeAgent GoFlex USB 3.0; ", // 2TB
-    "0x0bc2:0x5071",
+    "0x0bc2:0x507[01]",
     "",
     "",
     "-d sat"
@@ -3450,26 +3763,38 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat,12" // "-d sat" does not work (ticket #151)
   },
-  { "USB: Seagate FreeAgent GoFlex Desk USB 3.0; ", // 4TB
-    "0x0bc2:0x50a5",
+  { "USB: Seagate FreeAgent GoFlex Desk USB 3.0; ", // 2TB, 4TB
+    "0x0bc2:0x50a[57]",
     "", // 0x0100
     "",
     "-d sat"
   },
+  { "USB: Seagate FreeAgent GoFlex Pro for Mac; ",
+    "0x0bc2:0x6121",
+    "", // 0x0148
+    "",
+    "-d sat"
+  },
   { "USB: Seagate Backup Plus USB 3.0; ", // 1TB
-    "0x0bc2:0xa013",
+    "0x0bc2:0xa0[01]3",
     "", // 0x0100
     "",
     "-d sat"
   },
-  { "USB: Seagate Backup Plus Desktop USB 3.0; ", // 4TB, 3TB (8 LBA/1 PBA offset)
-    "0x0bc2:0xa0a[14]",
+  { "USB: Seagate Backup Plus Desktop USB 3.0; ",
+    "0x0bc2:0xa(0a[14]|b31)", // 4TB, 3TB (8 LBA/1 PBA offset), 5TB
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: Seagate Slim Portable Drive; ", // SRD00F1
+    "0x0bc2:0xab00",
     "",
     "",
     "-d sat"
   },
   { "USB: Seagate Backup Plus Slim USB 3.0; ", // (ticket #443)
-    "0x0bc2:0xab24",
+    "0x0bc2:0xab2[14]",
     "", // 0x0100
     "",
     "-d sat"
@@ -3559,104 +3884,32 @@ const drive_settings builtin_knowndrives[] = {
     "-d usbcypress"
   },
   { "USB: WD My Passport; ",
-    "0x1058:0x07(0[245a]|30)",
-    "",
+    "0x1058:0x0(70[245a]|730|74[0128a]|7a8|8[123]0)",
     "",
-    "-d sat"
-  },
-  { "USB: WD My Passport USB 3.0; ",
-    "0x1058:0x0(74[0128a]|7a8|820)",
-    "",
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book ES; ",
-    "0x1058:0x0906",
-    "", // 0x0012
     "",
     "-d sat"
   },
-  { "USB: WD My Book Essential; ",
-    "0x1058:0x0910",
-    "", // 0x0106
+  { "USB: WD My Book; ",
+    "0x1058:0x09(00|06|10)",
+    "", // 06=0x0012, 10=0x0106
     "",
     "-d sat"
   },
   { "USB: WD Elements Desktop; ",
-    "0x1058:0x1001",
-    "", // 0x0104
-    "",
-    "-d sat"
-  },
-  { "USB: WD Elements Desktop WDE1UBK...; ",
-    "0x1058:0x1003",
-    "", // 0x0175
-    "",
-    "-d sat"
-  },
-  { "USB: WD Elements; ",
-    "0x1058:0x10(10|48|a2)",
-    "", // 0x0105
-    "",
-    "-d sat"
-  },
-  { "USB: WD Elements Desktop; ", // 2TB
-    "0x1058:0x1021",
-    "", // 0x2002
-    "",
-    "-d sat"
-  },
-  { "USB: WD Elements SE; ", // 1TB
-    "0x1058:0x1023",
-    "",
-    "",
-    "-d sat"
-  },
-  { "USB: WD Elements SE USB 3.0; ",
-    "0x1058:0x1042",
-    "",
+    "0x1058:0x10(01|03|21|7c)",
+    "", // 01=0x0104, 03=0x0175, 21=0x2002, 7c=0x1065
     "",
     "-d sat"
   },
   { "USB: WD Elements; ",
-    "0x1058:0x10[ab]8", // a=1TB, b=2TB
-    "", // a=0x1042, b=0x1007
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book Essential; ",
-    "0x1058:0x1100",
-    "", // 0x0165
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book Office Edition; ", // 1TB
-    "0x1058:0x1101",
-    "", // 0x0165
+    "0x1058:0x10(10|23|42|48|a2|a8|b8)",
+    "", // 10=0x0105, a8=0x1042, b8=0x1007
     "",
     "-d sat"
   },
   { "USB: WD My Book; ",
-    "0x1058:0x1102",
-    "", // 0x1028
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book Studio II; ", // 2x1TB
-    "0x1058:0x1105",
-    "",
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book Essential; ",
-    "0x1058:0x1110",
-    "", // 0x1030
-    "",
-    "-d sat"
-  },
-  { "USB: WD My Book Essential USB 3.0; ", // 3TB
-    "0x1058:0x11[34]0",
-    "", // 0x1012/0x1003
+    "0x1058:0x11(00|01|02|04|05|10|30|40)",
+    "", // 00/01=0x0165, 02=0x1028, 10=0x1030, 30=0x1012, 40=0x1003
     "",
     "-d sat"
   },
@@ -3669,19 +3922,13 @@ const drive_settings builtin_knowndrives[] = {
   },
   // ADATA
   { "USB: ADATA; ",
-    "0x125f:0xa[13]1a", // 1=Classic CH11 1TB, 3=DashDrive HV620 2TB
-    "", // 0x0100
+    "0x125f:0xa(11|31|35)a", // 0xa11a: Classic CH11 1TB, 0xa31a: HV620 2TB (0x0100)
+    "", // 0xa35a: HD650 2TB (0x6503)
     "",
     "-d sat"
   },
-  { "USB: A-DATA SH93; Cypress",
-    "0x125f:0xa93a",
-    "", // 0x0150
-    "",
-    "-d usbcypress"
-  },
-  { "USB: A-DATA DashDrive; Cypress",
-    "0x125f:0xa94a",
+  { "USB: ADATA; Cypress",
+    "0x125f:0xa9[34]a", // 0xa93a: SH93 (0x0150)
     "",
     "",
     "-d usbcypress"
@@ -3741,12 +3988,18 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: ; Initio",
+    "0x13fd:0x39[14]0", // 0x3910: Seagate Expansion Portable SRD00F1 (0x0100)
+    "", // 0x3940: MS-TECH LU-275S (0x0306)
+    "",
+    "-d sat"
+  },
   // Super Top
-  { "USB: Super Top generic enclosure; Cypress",
+  { "USB: Super Top generic enclosure; ",
     "0x14cd:0x6116",
+    "", // 0x0150, older report suggests -d usbcypress
     "", // 0x0160 also reported as unsupported
-    "",
-    "-d usbcypress"
+    "-d sat"
   },
   // JMicron
   { "USB: ; JMicron JMS539", // USB2/3->SATA (old firmware)
@@ -3757,9 +4010,9 @@ const drive_settings builtin_knowndrives[] = {
   },
   { "USB: ; JMicron JMS539", // USB2/3->SATA (new firmware)
     "0x152d:0x0539",
-    "0x0205|"  //  2.05, ticket #338
-    "0x2812",  // 28.12, Mediasonic ProBox H82-SU3S2 (port multiplier)
-    "",
+    "0x020[56]|"   //  2.05, ticket #338
+    "0x28(03|12)", // 28.03, Mediasonic ProBox HF2-SU3S2 Rev 2 (port multiplier, ticket #504)
+    "",            // 28.12, Mediasonic ProBox H82-SU3S2 (port multiplier)
     "-d sat"
   },
   { "USB: ; JMicron ", // USB->SATA->4xSATA (port multiplier)
@@ -3768,6 +4021,12 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron,x"
   },
+  { "USB: ; JMicron JMS567", // USB2/3->SATA
+    "0x152d:0x0567",
+    "", // 0x0114
+    "", // 0x0205, 2.05, Mediasonic ProBox HF2-SU3S2 Rev 3 (port multiplier, ticket #504)
+    "-d sat"
+  },
   { "USB: OCZ THROTTLE OCZESATATHR8G; JMicron JMF601",
     "0x152d:0x0602",
     "",
@@ -3822,18 +4081,40 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron,x"
   },
+  { "USB: ; JMicron JMS566", // USB3->SATA
+    "0x152d:0x2566", // e.g. Chieftec CEB-7035S
+    "", // 0x0114
+    "",
+    "-d usbjmicron,x"
+  },
+  { "USB: ; JMicron",
+    "0x152d:0x2590",
+    "", // 0x0x8105 (ticket #550)
+    "",
+    "-d sat"
+  },
+  { "USB: ; JMicron JMS567", // USB2/3->SATA
+    "0x152d:0x3562",
+    "", // 0x0310, StarTech S358BU33ERM (port multiplier, ticket #508)
+    "",
+    "-d sat"
+  },
+  { "USB: ; JMicron", // USB3->SATA
+    "0x152d:0x3569",
+    "", // 0x0203
+    "",
+    "-d sat"
+  },
   // ASMedia
-  { "USB: ; ASMedia ASM1051",
-    "0x174c:0x5106", // 0x174c:0x55aa after firmware update
+  { "USB: ; ASMedia ASM1053/1153",
+    "0x174c:0x1[01]53",
     "",
     "",
     "-d sat"
   },
-  { "USB: ; ASMedia USB 3.0", // MEDION HDDrive-n-GO, LaCie Rikiki USB 3.0,
-      // Silicon Power Armor A80 (ticket #237)
-      // reported as unsupported: BYTECC T-200U3, Kingwin USB 3.0 docking station
-    "0x174c:0x55aa",
-    "", // 0x0100
+  { "USB: ; ASMedia ASM1051",
+    "0x174c:0x5106", // 0x174c:0x55aa after firmware update
+    "",
     "",
     "-d sat"
   },
@@ -3843,6 +4124,20 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d sat"
   },
+  { "USB: ; ASMedia", // Vantec NexStar USB 3.0 & SATA dual drive dock
+    "0x174c:0x5516",
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: ; ASMedia", // MEDION HDDrive-n-GO, LaCie Rikiki USB 3.0,
+      // Silicon Power Armor A80 (ticket #237)
+      // reported as unsupported: BYTECC T-200U3, Kingwin USB 3.0 docking station
+    "0x174c:0x55aa",
+    "", // 0x0100
+    "",
+    "-d sat"
+  },
   // LucidPort
   { "USB: ; LucidPORT USB300", // RaidSonic ICY BOX IB-110StU3-B, Sharkoon SATA QuickPort H3
     "0x1759:0x500[02]", // 0x5000: USB 2.0, 0x5002: USB 3.0
@@ -3863,7 +4158,7 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbsunplus"
   },
-  { "USB: Verbatim FW/USB160; Oxford OXUF934SSA-LQAG", // USB+IEE1394->SATA
+  { "USB: Verbatim FW/USB160; Oxford OXUF934SSA-LQAG", // USB+IEEE1394->SATA
     "0x18a5:0x0215",
     "", // 0x0001
     "",
@@ -3893,6 +4188,18 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron"
   },
+  { "USB: Verbatim Pocket Hard Drive; ", // 1TB USB 3.0
+    "0x18a5:0x0237",
+    "",
+    "",
+    "-d sat,12"
+  },
+  { "USB: Verbatim External Hard Drive; ", // 3TB USB 3.0
+    "0x18a5:0x0400",
+    "",
+    "",
+    "-d sat"
+  },
   // Silicon Image
   { "USB: Vantec NST-400MX-SR; Silicon Image 5744",
     "0x1a4a:0x1670",
@@ -3915,12 +4222,38 @@ const drive_settings builtin_knowndrives[] = {
     "-d sat"
   },
   // Innostor
-  { "USB: ; Innostor IS888", // Sharkoon SATA QuickDeck Pro USB 3.0
-    "0x1f75:0x0888",
+  { "USB: ; Innostor IS611", // USB3->SATA+PATA
+    "0x1f75:0x0611", // SMART access via PATA does not work
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: ; Innostor IS621", // USB3->SATA
+    "0x1f75:0x0621", // Dynex 2.5" USB 3.0 Exclosure DX-HD302513
+    "",
+    "",
+    "-d sat"
+  },
+  { "USB: ; Innostor IS888", // USB3->SATA
+    "0x1f75:0x0888", // Sharkoon SATA QuickDeck Pro USB 3.0
     "", // 0x0034
     "",
     "" // unsupported
   },
+  // VIA Labs
+  { "USB: ; VIA VL701", // USB2/3->SATA
+    "0x2109:0x0701", // Intenso 2,5" 1TB USB3
+    "", // 0x0107
+    "",
+    "-d sat" // ATA output registers missing
+  },
+  // 0x2537 (?)
+  { "USB: ; ", // USB 3.0
+    "0x2537:0x106[68]", // 0x1066: Orico 2599US3, 0x1068: Fantec ER-35U3
+    "", // 0x0100
+    "",
+    "-d sat"
+  },
   // Power Quotient International
   { "USB: PQI H560; ",
     "0x3538:0x0902",
@@ -3935,12 +4268,18 @@ const drive_settings builtin_knowndrives[] = {
     "",
     "-d usbjmicron"
   },
-  { "USB: Hitachi Touro Desk 3.0; ", // 2TB
-    "0x4971:0x1015",
+  { "USB: Hitachi Touro; ",
+    "0x4971:0x101[45]", // 14=1TB, 15=2TB
     "", // 0x0000
     "",
     "-d sat" // ATA output registers missing
   },
+  { "USB: Hitachi Touro Mobile; ", // 1TB
+    "0x4971:0x1020",
+    "",
+    "",
+    "-d sat"
+  },
   { "USB: Hitachi/SimpleTech; JMicron", // 1TB
     "0x4971:0xce17",
     "",
index 4a96a821f02393f153f586e0be3a2aa7c2109bd0..c9b58a3149ae024c3495fad91697f99ca97a604f 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2003-11 Bruce Allen <smartmontools-support@lists.sourceforge.net>
  * Copyright (C) 2003-11 Doug Gilbert <dgilbert@interlog.com>
- * Copyright (C) 2008-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-15 Christian Franke <smartmontools-support@lists.sourceforge.net>
  *
  * Original AACRaid code:
  *  Copyright (C) 2014    Raghava Aditya <raghava.aditya@pmcs.com>
@@ -99,7 +99,7 @@
 
 #define ARGUSED(x) ((void)(x))
 
-const char * os_linux_cpp_cvsid = "$Id: os_linux.cpp 3900 2014-05-01 17:08:59Z chrfranke $"
+const char * os_linux_cpp_cvsid = "$Id: os_linux.cpp 4047 2015-03-22 16:16:24Z chrfranke $"
   OS_LINUX_H_CVSID;
 extern unsigned char failuretest_permissive;
 
@@ -194,11 +194,11 @@ bool linux_smart_device::close()
 // examples for smartctl
 static const char  smartctl_examples[] =
                  "=================================================== SMARTCTL EXAMPLES =====\n\n"
-                 "  smartctl --all /dev/hda                    (Prints all SMART information)\n\n"
-                 "  smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda\n"
+                 "  smartctl --all /dev/sda                    (Prints all SMART information)\n\n"
+                 "  smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda\n"
                  "                                              (Enables SMART on first disk)\n\n"
-                 "  smartctl --test=long /dev/hda          (Executes extended disk self-test)\n\n"
-                 "  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/hda\n"
+                 "  smartctl --test=long /dev/sda          (Executes extended disk self-test)\n\n"
+                 "  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda\n"
                  "                                      (Prints Self-Test & Attribute errors)\n"
                  "  smartctl --all --device=3ware,2 /dev/sda\n"
                  "  smartctl --all --device=3ware,2 /dev/twe0\n"
@@ -378,7 +378,7 @@ int linux_ata_device::ata_command_interface(smart_command_set command, int selec
     memcpy(task+sizeof(ide_task_request_t), data, 512);
 
     if ((retval=ioctl(get_fd(), HDIO_DRIVE_TASKFILE, task))) {
-      if (retval==-EINVAL)
+      if (errno==-EINVAL)
         pout("Kernel lacks HDIO_DRIVE_TASKFILE support; compile kernel with CONFIG_IDE_TASKFILE_IO set\n");
       return -1;
     }
@@ -406,7 +406,7 @@ int linux_ata_device::ata_command_interface(smart_command_set command, int selec
     buff[5]=normal_hi;
 
     if ((retval=ioctl(get_fd(), HDIO_DRIVE_TASK, buff))) {
-      if (retval==-EINVAL) {
+      if (errno==-EINVAL) {
         pout("Error SMART Status command via HDIO_DRIVE_TASK failed");
         pout("Rebuild older linux 2.2 kernels with HDIO_DRIVE_TASK support added\n");
       }
@@ -1002,7 +1002,7 @@ bool linux_aacraid_device::scsi_pass_through(scsi_cmnd_io *iop)
     uint8_t aBuff[sizeof(user_aac_srb64) + sizeof(user_aac_reply)] = {0,};
 
     pSrb    = (user_aac_srb64*)aBuff;
-    pReply  = (user_aac_reply*)(aBuff+sizeof(user_aac_srb64));
+    pSrb->count = sizeof(user_aac_srb64) - sizeof(user_sgentry64);
 
  #elif defined(ENVIRONMENT32)
     //Create user 32 bit request
@@ -1010,8 +1010,7 @@ bool linux_aacraid_device::scsi_pass_through(scsi_cmnd_io *iop)
     uint8_t aBuff[sizeof(user_aac_srb32) + sizeof(user_aac_reply)] = {0,};
 
     pSrb    = (user_aac_srb32*)aBuff;
-    pReply  = (user_aac_reply*)(aBuff+sizeof(user_aac_srb32));
-
+    pSrb->count = sizeof(user_aac_srb32) - sizeof(user_sgentry32);
  #endif
 
   pSrb->function = SRB_FUNCTION_EXECUTE_SCSI;
@@ -1048,33 +1047,60 @@ bool linux_aacraid_device::scsi_pass_through(scsi_cmnd_io *iop)
       pSrb->sg64.sg64[0].addr64.hi32 = ((intptr_t)iop->dxferp) >> 32;
 
       pSrb->sg64.sg64[0].length = (uint32_t)iop->dxfer_len;
-      pSrb->count = sizeof(user_aac_srb64) +
-                          (sizeof(user_sgentry64)*(pSrb->sg64.count-1));
+      pSrb->count += pSrb->sg64.count * sizeof(user_sgentry64);
     #elif defined(ENVIRONMENT32)
       pSrb->sg32.count = 1;
       pSrb->sg32.sg32[0].addr32 = (intptr_t)iop->dxferp;
 
       pSrb->sg32.sg32[0].length = (uint32_t)iop->dxfer_len;
-      pSrb->count = sizeof(user_aac_srb32) +
-                          (sizeof(user_sgentry32)*(pSrb->sg32.count-1));
+      pSrb->count += pSrb->sg32.count * sizeof(user_sgentry32);
     #endif
 
   }
 
+  pReply  = (user_aac_reply*)(aBuff+pSrb->count);
+
   memcpy(pSrb->cdb,iop->cmnd,iop->cmnd_len);
 
   int rc = 0;
   errno = 0;
   rc = ioctl(get_fd(),FSACTL_SEND_RAW_SRB,pSrb);
-  if(rc!= 0 || pReply->srb_status != 0x01) {
-    if(pReply->srb_status == 0x08) {
-      return set_err(EIO, "aacraid: Device %d %d does not exist\n" ,aLun,aId );
-    }
-  return set_err((errno ? errno : EIO), "aacraid result: %d.%d = %d/%d",
-                            aLun, aId, errno,
-                            pReply->srb_status);
+
+  if (rc != 0)
+    return set_err(errno, "aacraid send_raw_srb: %d.%d = %s",
+                  aLun, aId, strerror(errno));
+
+/* see kernel aacraid.h and MSDN SCSI_REQUEST_BLOCK documentation */
+#define SRB_STATUS_SUCCESS            0x1
+#define SRB_STATUS_ERROR              0x4
+#define SRB_STATUS_NO_DEVICE         0x08
+#define SRB_STATUS_SELECTION_TIMEOUT 0x0a
+#define SRB_STATUS_AUTOSENSE_VALID   0x80
+
+  iop->scsi_status = pReply->scsi_status;
+
+  if (pReply->srb_status == (SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_ERROR)
+      && iop->scsi_status == SCSI_STATUS_CHECK_CONDITION) {
+    memcpy(iop->sensep, pReply->sense_data, pReply->sense_data_size);
+    iop->resp_sense_len = pReply->sense_data_size;
+    return true; /* request completed with sense data */
+  }
+
+  switch (pReply->srb_status & 0x3f) {
+
+    case SRB_STATUS_SUCCESS:
+      return true; /* request completed successfully */
+
+    case SRB_STATUS_NO_DEVICE:
+      return set_err(EIO, "aacraid: Device %d %d does not exist", aLun, aId);
+
+    case SRB_STATUS_SELECTION_TIMEOUT:
+      return set_err(EIO, "aacraid: Device %d %d not responding", aLun, aId);
+
+    default:
+      return set_err(EIO, "aacraid result: %d.%d = 0x%x",
+                    aLun, aId, pReply->srb_status);
   }
-  return true;
 }
 
 
@@ -2675,8 +2701,7 @@ std::string linux_smart_interface::get_app_examples(const char * appname)
 }
 
 // we are going to take advantage of the fact that Linux's devfs will only
-// have device entries for devices that exist.  So if we get the equivalent of
-// ls /dev/hd[a-t], we have all the ATA devices on the system
+// have device entries for devices that exist.
 bool linux_smart_interface::get_dev_list(smart_device_list & devlist,
   const char * pattern, bool scan_ata, bool scan_scsi,
   const char * req_type, bool autodetect)
@@ -2922,6 +2947,7 @@ linux_smart_interface::megasas_dcmd_cmd(int bus_no, uint32_t opcode, void *buf,
   }
 
   int r = ioctl(fd, MEGASAS_IOC_FIRMWARE, &ioc);
+  ::close(fd);
   if (r < 0) {
     return (r);
   }
index 2414d131be55dc0e39e6f4485c069961ef531fc7..11b73198a73bb375df0afe9d681e00b79f945144 100644 (file)
@@ -3,8 +3,13 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2004-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2012    Hank Wu <hank@areca.com.tw>
+ * Copyright (C) 2004-15 Christian Franke
+ *
+ * Original AACRaid code:
+ *  Copyright (C) 2015    Nidhi Malhotra <nidhi.malhotra@pmcs.com>
+ *
+ * Original Areca code:
+ *  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
 #endif
 
 #ifndef _WIN32
-// csmisas.h requires _WIN32 but w32api-headers no longer define it on Cygwin
+// csmisas.h and aacraid.h require _WIN32 but w32api-headers no longer define it on Cygwin
+// (aacraid.h also checks for _WIN64 which is also set on Cygwin x64)
 #define _WIN32
 #endif
 
 // CSMI support
 #include "csmisas.h"
 
+// aacraid support
+#include "aacraid.h"
+
 // Silence -Wunused-local-typedefs warning from g++ >= 4.8
 #if __GNUC__ >= 4
 #define ATTR_UNUSED __attribute__((unused))
 #define SELECT_WIN_32_64(x32, x64) (x64)
 #endif
 
-const char * os_win32_cpp_cvsid = "$Id: os_win32.cpp 3923 2014-06-25 17:10:46Z chrfranke $";
+// Cygwin does no longer provide strn?icmp() compatibility macros
+// MSVCRT does not provide strn?casecmp()
+#if defined(__CYGWIN__) && !defined(stricmp)
+#define stricmp strcasecmp
+#define strnicmp strncasecmp
+#endif
+
+const char * os_win32_cpp_cvsid = "$Id: os_win32.cpp 4098 2015-05-30 16:37:37Z chrfranke $";
 
 /////////////////////////////////////////////////////////////////////////////
 // Windows I/O-controls, some declarations are missing in the include files
@@ -306,6 +322,10 @@ ASSERT_SIZEOF(CSMI_SAS_DRIVER_INFO_BUFFER, 204);
 ASSERT_SIZEOF(CSMI_SAS_PHY_INFO_BUFFER, 2080);
 ASSERT_SIZEOF(CSMI_SAS_STP_PASSTHRU_BUFFER, 168);
 
+// aacraid struct
+
+ASSERT_SIZEOF(SCSI_REQUEST_BLOCK, SELECT_WIN_32_64(64, 88));
+
 } // extern "C"
 
 /////////////////////////////////////////////////////////////////////////////
@@ -492,6 +512,34 @@ private:
   ata_smart_values m_smart_buf;
 };
 
+/////////////////////////////////////////////////////////////////////////////
+//// PMC aacraid Support
+
+class win_aacraid_device
+:public /*implements*/ scsi_device,
+public /*extends*/ win_smart_device
+{
+public:
+  win_aacraid_device(smart_interface *intf, const char *dev_name,unsigned int ctrnum, unsigned int target, unsigned int lun);
+
+  virtual ~win_aacraid_device() throw();
+
+  virtual bool open();
+
+  virtual bool scsi_pass_through(struct scsi_cmnd_io *iop);
+
+private:
+  //Device Host number
+  int m_ctrnum;
+
+  //Channel(Lun) of the device
+  int m_lun;
+
+  //Id of the device
+  int m_target;
+};
+
+
 
 /////////////////////////////////////////////////////////////////////////////
 /// Areca RAID support
@@ -647,6 +695,7 @@ std::string win_smart_interface::get_os_version_str()
         case 0x61: w = (ws ? "win7"  : "2008r2"); break;
         case 0x62: w = (ws ? "win8"  : "2012"  ); break;
         case 0x63: w = (ws ? "win8.1": "2012r2"); break;
+        case 0x64: w = (ws ? "win10" : "w10srv"); break;
       }
     }
   }
@@ -696,7 +745,7 @@ int64_t win_smart_interface::get_timer_usec()
 
 
 // Return value for device detection functions
-enum win_dev_type { DEV_UNKNOWN = 0, DEV_ATA, DEV_SCSI, DEV_USB };
+enum win_dev_type { DEV_UNKNOWN = 0, DEV_ATA, DEV_SCSI, DEV_SAT, DEV_USB };
 
 static win_dev_type get_phy_drive_type(int drive);
 static win_dev_type get_phy_drive_type(int drive, GETVERSIONINPARAMS_EX * ata_version_ex);
@@ -828,6 +877,55 @@ smart_device * win_smart_interface::get_custom_smart_device(const char * name, c
     }
     else
       set_err(EINVAL, "Option -d areca,N/E requires device name /dev/arcmsrX");
+    return 0;
+  }
+
+  // aacraid?
+  unsigned ctrnum, lun, target;
+  n1 = -1;
+
+  if (   sscanf(type, "aacraid,%u,%u,%u%n", &ctrnum, &lun, &target, &n1) >= 3
+      && n1 == (int)strlen(type)) {
+#define aacraid_MAX_CTLR_NUM  16
+    if (ctrnum >= aacraid_MAX_CTLR_NUM) {
+      set_err(EINVAL, "aacraid: invalid host number %u", ctrnum);
+      return 0;
+    }
+
+    /*
+    1. scan from "\\\\.\\scsi[0]:" up to "\\\\.\\scsi[AACRAID_MAX_CTLR_NUM]:" and
+    2. map ARCX into "\\\\.\\scsiX"
+    */
+    memset(devpath, 0, sizeof(devpath));
+    unsigned ctlrindex = 0;
+    for (int portNum = 0; portNum < aacraid_MAX_CTLR_NUM; portNum++){
+      char subKey[63];
+      snprintf(subKey, sizeof(subKey), "HARDWARE\\DEVICEMAP\\Scsi\\Scsi Port %d", portNum);
+      HKEY hScsiKey = 0;
+      long regStatus = RegOpenKeyExA(HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hScsiKey);
+      if (regStatus == ERROR_SUCCESS){
+        char driverName[20];
+        DWORD driverNameSize = sizeof(driverName);
+        DWORD regType = 0;
+        regStatus = RegQueryValueExA(hScsiKey, "Driver", NULL, &regType, (LPBYTE) driverName, &driverNameSize);
+        if (regStatus == ERROR_SUCCESS){
+          if (regType == REG_SZ){
+            if (stricmp(driverName, "arcsas") == 0){
+              if(ctrnum == ctlrindex){
+                snprintf(devpath, sizeof(devpath), "\\\\.\\Scsi%d:", portNum);
+                return get_sat_device("sat,auto",
+                  new win_aacraid_device(this, devpath, ctrnum, target, lun));
+              }
+              ctlrindex++;
+            }
+          }
+        }
+        RegCloseKey(hScsiKey);
+      }
+    }
+
+    set_err(EINVAL, "aacraid: host %u not found", ctrnum);
+    return 0;
   }
 
   return 0;
@@ -835,7 +933,7 @@ smart_device * win_smart_interface::get_custom_smart_device(const char * name, c
 
 std::string win_smart_interface::get_valid_custom_dev_types_str()
 {
-  return "areca,N[/E]";
+  return "aacraid,H,L,ID, areca,N[/E]";
 }
 
 
@@ -856,9 +954,13 @@ smart_device * win_smart_interface::autodetect_smart_device(const char * name)
 
   if (type == DEV_ATA)
     return new win_ata_device(this, name, "");
+
   if (type == DEV_SCSI)
     return new win_scsi_device(this, name, "");
 
+  if (type == DEV_SAT)
+    return get_sat_device("sat", new win_scsi_device(this, name, ""));
+
   if (type == DEV_USB) {
     // Get USB bridge ID
     unsigned short vendor_id = 0, product_id = 0;
@@ -905,29 +1007,33 @@ bool win_smart_interface::scan_smart_devices(smart_device_list & devlist,
   }
 
   // Set valid types
-  bool ata, scsi, usb, csmi;
+  bool ata, scsi, sat, usb, csmi;
   if (!type) {
-    ata = scsi = usb = csmi = true;
+    ata = scsi = usb = sat = csmi = true;
   }
   else {
-    ata = scsi = usb = csmi = false;
+    ata = scsi = usb = sat = csmi = false;
     if (!strcmp(type, "ata"))
       ata = true;
     else if (!strcmp(type, "scsi"))
       scsi = true;
+    else if (!strcmp(type, "sat"))
+      sat = true;
     else if (!strcmp(type, "usb"))
       usb = true;
     else if (!strcmp(type, "csmi"))
       csmi = true;
     else {
-      set_err(EINVAL, "Invalid type '%s', valid arguments are: ata[,pd], scsi[,pd], usb[,pd], csmi, pd", type);
+      set_err(EINVAL,
+              "Invalid type '%s', valid arguments are: ata[,pd], scsi[,pd], sat[,pd], usb[,pd], csmi, pd",
+              type);
       return false;
     }
   }
 
   char name[20];
 
-  if (ata || scsi || usb) {
+  if (ata || scsi || sat || usb) {
     // Scan up to 128 drives and 2 3ware controllers
     const int max_raid = 2;
     bool raid_seen[max_raid] = {false, false};
@@ -977,6 +1083,13 @@ bool win_smart_interface::scan_smart_devices(smart_device_list & devlist,
           devlist.push_back( new win_scsi_device(this, name, "scsi") );
           break;
 
+        case DEV_SAT:
+          // STORAGE_QUERY_PROPERTY returned VendorId "ATA     "
+          if (!sat)
+            continue;
+          devlist.push_back( get_sat_device("sat", new win_scsi_device(this, name, "")) );
+          break;
+
         case DEV_USB:
           // STORAGE_QUERY_PROPERTY returned USB
           if (!usb)
@@ -2015,6 +2128,16 @@ static int storage_predict_failure_ioctl(HANDLE hdevice, char * data = 0)
 
 /////////////////////////////////////////////////////////////////////////////
 
+// Return true if ATA drive behind a SAT layer
+static bool is_sat(const STORAGE_DEVICE_DESCRIPTOR_DATA * data)
+{
+  if (!data->desc.VendorIdOffset)
+    return false;
+  if (strcmp(data->raw + data->desc.VendorIdOffset, "ATA     "))
+    return false;
+  return true;
+}
+
 // Return true if Intel ICHxR RAID volume
 static bool is_intel_raid_volume(const STORAGE_DEVICE_DESCRIPTOR_DATA * data)
 {
@@ -2040,22 +2163,34 @@ static win_dev_type get_controller_type(HANDLE hdevice, bool admin, GETVERSIONIN
   switch ((int)data.desc.BusType) {
     case BusTypeAta:
     case 0x0b: // BusTypeSata
+      // Certain Intel AHCI drivers (C600+/C220+) have broken
+      // IOCTL_ATA_PASS_THROUGH support and a working SAT layer
+      if (is_sat(&data))
+        return DEV_SAT;
+
       if (ata_version_ex)
         memset(ata_version_ex, 0, sizeof(*ata_version_ex));
       return DEV_ATA;
 
     case BusTypeScsi:
     case BusTypeRAID:
+      if (is_sat(&data))
+        return DEV_SAT;
+
       // Intel ICHxR RAID volume: reports SMART_GET_VERSION but does not support SMART_*
       if (is_intel_raid_volume(&data))
         return DEV_SCSI;
       // LSI/3ware RAID volume: supports SMART_*
       if (admin && smart_get_version(hdevice, ata_version_ex) >= 0)
         return DEV_ATA;
+
       return DEV_SCSI;
 
     case 0x09: // BusTypeiScsi
     case 0x0a: // BusTypeSas
+      if (is_sat(&data))
+        return DEV_SAT;
+
       return DEV_SCSI;
 
     case BusTypeUsb:
@@ -3831,6 +3966,170 @@ bool win_areca_ata_device::arcmsr_unlock()
   return true;
 }
 
+// AACRAID
+win_aacraid_device::win_aacraid_device(smart_interface * intf,
+  const char *dev_name, unsigned ctrnum, unsigned target, unsigned lun)
+: smart_device(intf, dev_name, "aacraid", "aacraid"),
+  m_ctrnum(ctrnum), m_lun(lun), m_target(target)
+{
+  set_info().info_name = strprintf("%s [aacraid_disk_%02d_%02d_%d]", dev_name, m_ctrnum, m_lun, m_target);
+  set_info().dev_type  = strprintf("aacraid,%d,%d,%d", m_ctrnum, m_lun, m_target);
+}
+
+win_aacraid_device::~win_aacraid_device() throw()
+{
+}
+
+bool win_aacraid_device::open()
+{
+  if (is_open())
+    return true;
+
+  HANDLE hFh = CreateFile( get_dev_name(),
+          GENERIC_READ|GENERIC_WRITE,
+          FILE_SHARE_READ|FILE_SHARE_WRITE,
+          NULL,
+          OPEN_EXISTING,
+          0,
+          0);
+  if (hFh == INVALID_HANDLE_VALUE)
+    return set_err(ENODEV, "Open failed, Error=%u", (unsigned)GetLastError());
+
+  set_fh(hFh);
+  return true;
+}
+
+bool win_aacraid_device::scsi_pass_through(struct scsi_cmnd_io *iop)
+{
+  int report = scsi_debugmode;
+  if (report > 0)
+  {
+    int k, j;
+    const unsigned char * ucp = iop->cmnd;
+    const char * np;
+    char buff[256];
+    const int sz = (int)sizeof(buff);
+    np = scsi_get_opcode_name(ucp[0]);
+    j  = snprintf(buff, sz, " [%s: ", np ? np : "<unknown opcode>");
+    for (k = 0; k < (int)iop->cmnd_len; ++k)
+      j += snprintf(&buff[j], (sz > j ? (sz - j) : 0), "%02x ", ucp[k]);
+    if ((report > 1) &&
+      (DXFER_TO_DEVICE == iop->dxfer_dir) && (iop->dxferp)) {
+      int trunc = (iop->dxfer_len > 256) ? 1 : 0;
+
+      j += snprintf(&buff[j], (sz > j ? (sz - j) : 0), "]\n  Outgoing "
+        "data, len=%d%s:\n", (int)iop->dxfer_len,
+        (trunc ? " [only first 256 bytes shown]" : ""));
+        dStrHex((const char *)iop->dxferp,
+        (trunc ? 256 : (int)iop->dxfer_len) , 1);
+      }
+    else
+      j += snprintf(&buff[j], (sz > j ? (sz - j) : 0), "]\n");
+      pout("buff %s\n",buff);
+  }
+
+  char ioBuffer[1000];
+  SRB_IO_CONTROL * pSrbIO = (SRB_IO_CONTROL *) ioBuffer;
+  SCSI_REQUEST_BLOCK * pScsiIO = (SCSI_REQUEST_BLOCK *) (ioBuffer + sizeof(SRB_IO_CONTROL));
+  DWORD scsiRequestBlockSize = sizeof(SCSI_REQUEST_BLOCK);
+  char *pRequestSenseIO = (char *) (ioBuffer + sizeof(SRB_IO_CONTROL) + scsiRequestBlockSize);
+  DWORD dataOffset = (sizeof(SRB_IO_CONTROL) + scsiRequestBlockSize  + 7) & 0xfffffff8;
+  char *pDataIO = (char *) (ioBuffer + dataOffset);
+  memset(pScsiIO, 0, scsiRequestBlockSize);
+  pScsiIO->Length    = (USHORT) scsiRequestBlockSize;
+  pScsiIO->Function  = SRB_FUNCTION_EXECUTE_SCSI;
+  pScsiIO->PathId    = 0;
+  pScsiIO->TargetId  = m_target;
+  pScsiIO->Lun       = m_lun;
+  pScsiIO->CdbLength = (int)iop->cmnd_len;
+  switch(iop->dxfer_dir){
+    case DXFER_NONE:
+      pScsiIO->SrbFlags = SRB_NoDataXfer;
+      break;
+    case DXFER_FROM_DEVICE:
+      pScsiIO->SrbFlags |= SRB_DataIn;
+      break;
+    case DXFER_TO_DEVICE:
+      pScsiIO->SrbFlags |= SRB_DataOut;
+      break;
+    default:
+      pout("aacraid: bad dxfer_dir\n");
+      return set_err(EINVAL, "aacraid: bad dxfer_dir\n");
+  }
+  pScsiIO->DataTransferLength = (ULONG)iop->dxfer_len;
+  pScsiIO->TimeOutValue = iop->timeout;
+  UCHAR *pCdb = (UCHAR *) pScsiIO->Cdb;
+  memcpy(pCdb, iop->cmnd, 16);
+  if (iop->max_sense_len){
+    memset(pRequestSenseIO, 0, iop->max_sense_len);
+  }
+  if (pScsiIO->SrbFlags & SRB_FLAGS_DATA_OUT){
+    memcpy(pDataIO, iop->dxferp, iop->dxfer_len);
+  }
+  else if (pScsiIO->SrbFlags & SRB_FLAGS_DATA_IN){
+    memset(pDataIO, 0, iop->dxfer_len);
+  }
+
+  DWORD bytesReturned = 0;
+  memset(pSrbIO, 0, sizeof(SRB_IO_CONTROL));
+  pSrbIO->HeaderLength = sizeof(SRB_IO_CONTROL);
+  memcpy(pSrbIO->Signature, "AACAPI", 7);
+  pSrbIO->ControlCode = ARCIOCTL_SEND_RAW_SRB;
+  pSrbIO->Length = (dataOffset + iop->dxfer_len - sizeof(SRB_IO_CONTROL) + 7) & 0xfffffff8;
+  pSrbIO->Timeout = 3*60;
+
+  if (!DeviceIoControl(
+                   get_fh(),
+                   IOCTL_SCSI_MINIPORT,
+                   ioBuffer,
+                   sizeof(SRB_IO_CONTROL) + pSrbIO->Length,
+                   ioBuffer,
+                   sizeof(SRB_IO_CONTROL) + pSrbIO->Length,
+                   &bytesReturned,
+                   NULL)
+     ) {
+    return set_err(EIO, "ARCIOCTL_SEND_RAW_SRB failed, Error=%u", (unsigned)GetLastError());
+  }
+
+  iop->scsi_status = pScsiIO->ScsiStatus;
+  if (SCSI_STATUS_CHECK_CONDITION & iop->scsi_status) {
+    int slen = sizeof(pRequestSenseIO) + 8;
+    if (slen > (int)sizeof(pRequestSenseIO))
+      slen = sizeof(pRequestSenseIO);
+    if (slen > (int)iop->max_sense_len)
+      slen = (int)iop->max_sense_len;
+    memcpy(iop->sensep, pRequestSenseIO, slen);
+    iop->resp_sense_len = slen;
+    if (report) {
+      if (report > 1) {
+        pout("  >>> Sense buffer, len=%d:\n", slen);
+        dStrHex(iop->sensep, slen , 1);
+      }
+      if ((iop->sensep[0] & 0x7f) > 0x71)
+        pout("  status=%x: [desc] sense_key=%x asc=%x ascq=%x\n",
+          iop->scsi_status, iop->sensep[1] & 0xf,
+          iop->sensep[2], iop->sensep[3]);
+      else
+        pout("  status=%x: sense_key=%x asc=%x ascq=%x\n",
+          iop->scsi_status, iop->sensep[2] & 0xf,
+          iop->sensep[12], iop->sensep[13]);
+    }
+  }
+  else {
+    iop->resp_sense_len = 0;
+  }
+
+  if (iop->dxfer_dir == DXFER_FROM_DEVICE){
+     memcpy(iop->dxferp,pDataIO, iop->dxfer_len);
+  }
+  if((iop->dxfer_dir == DXFER_FROM_DEVICE) && (report > 1)){
+    int trunc = (iop->dxfer_len > 256) ? 1 : 0;
+    pout("  Incoming data, len=%d, resid=%d%s:\n", (int)iop->dxfer_len, iop->resid,
+      (trunc ? " [only first 256 bytes shown]" : ""));
+    dStrHex((CHAR*)pDataIO, (trunc ? 256 : (int)(iop->dxfer_len)) , 1);
+  }
+  return true;
+}
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
index 23a8f5b9c5fa92213be0f56f31a61bfe813ffb22..d06e0859e242ec27299e560e8496945083549651 100644 (file)
@@ -3,7 +3,7 @@
 ;
 ; Home page of code is: http://smartmontools.sourceforge.net
 ;
-; Copyright (C) 2006-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+; Copyright (C) 2006-15 Christian Franke
 ;
 ; 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 3912 2014-06-18 19:03:30Z chrfranke $
+; $Id: installer.nsi 4072 2015-04-28 20:35:15Z chrfranke $
 ;
 
 
@@ -182,7 +182,6 @@ Section "!Documentation" DOC_SECTION
   File "${INPDIR}\doc\NEWS.txt"
   File "${INPDIR}\doc\README.txt"
   File "${INPDIR}\doc\TODO.txt"
-  File "${INPDIR}\doc\WARNINGS.txt"
 !ifdef INPDIR64
   StrCmp $X64 "" +3
     File "${INPDIR64}\doc\checksums64.txt"
@@ -444,7 +443,6 @@ Section "Uninstall"
   Delete "$INSTDIR\doc\NEWS.txt"
   Delete "$INSTDIR\doc\README.txt"
   Delete "$INSTDIR\doc\TODO.txt"
-  Delete "$INSTDIR\doc\WARNINGS.txt"
   Delete "$INSTDIR\doc\checksums*.txt"
   Delete "$INSTDIR\doc\smartctl.8.html"
   Delete "$INSTDIR\doc\smartctl.8.txt"
@@ -647,8 +645,31 @@ Function AddToPath
   Push $1
   Push $2
   Push $3
+  Push $4
 
-  ReadRegStr $1 ${Environ} "PATH"
+  ; NSIS ReadRegStr returns empty string on string overflow
+  ; Native calls are used here to check actual length of PATH
+
+  ; $4 = RegOpenKey(HKEY_CURRENT_USER, "Environment", &$3)
+  System::Call "advapi32::RegOpenKey(i 0x80000001, t'Environment', *i.r3) i.r4"
+  IntCmp $4 0 0 done done
+  ; $4 = RegQueryValueEx($3, "PATH", (DWORD*)0, (DWORD*)0, &$1, ($2=NSIS_MAX_STRLEN, &$2))
+  ; RegCloseKey($3)
+  System::Call "advapi32::RegQueryValueEx(i $3, t'PATH', i 0, i 0, t.r1, *i ${NSIS_MAX_STRLEN} r2) i.r4"
+  System::Call "advapi32::RegCloseKey(i $3)"
+
+  IntCmp $4 234 0 +4 +4 ; $4 == ERROR_MORE_DATA
+    DetailPrint "AddToPath: original length $2 > ${NSIS_MAX_STRLEN}"
+    MessageBox MB_OK "PATH not updated, original length $2 > ${NSIS_MAX_STRLEN}"
+    Goto done
+
+  IntCmp $4 0 +5 ; $4 != NO_ERROR
+    IntCmp $4 2 +3 ; $4 != ERROR_FILE_NOT_FOUND
+      DetailPrint "AddToPath: unexpected error code $4"
+      Goto done
+    StrCpy $1 ""
+
+  ; Check if already in PATH
   Push "$1;"
   Push "$0;"
   Call StrStr
@@ -660,6 +681,17 @@ Function AddToPath
   Pop $2
   StrCmp $2 "" 0 done
 
+  ; Prevent NSIS string overflow
+  StrLen $2 $0
+  StrLen $3 $1
+  IntOp $2 $2 + $3
+  IntOp $2 $2 + 2 ; $2 = strlen(dir) + strlen(PATH) + sizeof(";")
+  IntCmp $2 ${NSIS_MAX_STRLEN} +4 +4 0
+    DetailPrint "AddToPath: new length $2 > ${NSIS_MAX_STRLEN}"
+    MessageBox MB_OK "PATH not updated, new length $2 > ${NSIS_MAX_STRLEN}."
+    Goto done
+
+  ; Append dir to PATH
   DetailPrint "Add to PATH: $0"
   StrCpy $2 $1 1 -1
   StrCmp $2 ";" 0 +2
@@ -670,6 +702,7 @@ Function AddToPath
   SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
 
 done:
+  Pop $4
   Pop $3
   Pop $2
   Pop $1
index 20e0b18b448c62a82ee6932d299888ae88086f59..ea4190f44301bf5dc242930c414bf26c45371584 100644 (file)
     <ClCompile Include="..\..\utility.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\aacraid.h" />
     <ClInclude Include="..\..\ataidentify.h" />
     <ClInclude Include="..\..\dev_areca.h" />
     <ClInclude Include="config.h" />
index be8a021757afe2c2027b5122f5bff0ed5e8d8364..c7f1ab6bfce7311cfbddad1ba50553588d191856 100644 (file)
@@ -82,6 +82,7 @@
     <ClInclude Include="..\..\getopt\getopt.h">
       <Filter>getopt</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\aacraid.h" />
     <ClInclude Include="..\..\atacmdnames.h" />
     <ClInclude Include="..\..\atacmds.h" />
     <ClInclude Include="..\..\ataprint.h" />
index 75304c789b5535bcee91acec4fcb359a59ed601c..239e78b0c678da4f34c7f29b415c1f4b45141ae3 100644 (file)
     <ClCompile Include="..\..\utility.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\aacraid.h" />
     <ClInclude Include="..\..\ataidentify.h">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
index 910d8294bb577901f65a221ce600d8a57a05479e..d2663bad629729f12f8197fcdc6ac7d70d4c3267 100644 (file)
@@ -88,6 +88,7 @@
     <ClInclude Include="..\..\getopt\getopt.h">
       <Filter>getopt</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\aacraid.h" />
     <ClInclude Include="..\..\atacmdnames.h" />
     <ClInclude Include="..\..\atacmds.h" />
     <ClInclude Include="..\..\cissio_freebsd.h" />
index abcb468d80161811c68f816e43b343a1884981c9..fbe603b356ed563a60d538d12f69c7d69bbd617e 100644 (file)
@@ -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 3922 2014-06-23 19:17:18Z chrfranke $";
+const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 4041 2015-03-14 00:50:20Z dpgilbert $";
 
 /* This is a slightly stretched SCSI sense "descriptor" format header.
    The addition is to allow the 0x70 and 0x71 response codes. The idea
@@ -203,6 +203,25 @@ sat_device::~sat_device() throw()
 // des[11]: lba_high (7:0)
 // des[12]: device
 // des[13]: status
+//
+//
+// ATA registers returned via fixed format sense (allowed >= SAT-2)
+// fxs[0]: info_valid (bit 7); response_code (6:0)
+// fxs[1]: (obsolete)
+// fxs[2]: sense_key (3:0) --> recovered error (formerly 'no sense')
+// fxs[3]: information (31:24) --> ATA Error register
+// fxs[4]: information (23:16) --> ATA Status register
+// fxs[5]: information (15:8) --> ATA Device register
+// fxs[6]: information (7:0) --> ATA Count (7:0)
+// fxs[7]: additional sense length [should be >= 10]
+// fxs[8]: command specific info (31:24) --> Extend (7), count_upper_nonzero
+//         (6), lba_upper_nonzero(5), log_index (3:0)
+// fxs[9]: command specific info (23:16) --> ATA LBA (7:0)
+// fxs[10]: command specific info (15:8) --> ATA LBA (15:8)
+// fxs[11]: command specific info (7:0) --> ATA LBA (23:16)
+// fxs[12]: additional sense code (asc) --> 0x0
+// fxs[13]: additional sense code qualifier (ascq) --> 0x1d
+//          asc,ascq = 0x0,0x1d --> 'ATA pass through information available'
 
 
 
@@ -243,7 +262,7 @@ bool sat_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
     unsigned char cdb[SAT_ATA_PASSTHROUGH_16LEN];
     unsigned char sense[32];
     const unsigned char * ardp;
-    int status, ard_len, have_sense;
+    int ard_len, have_sense;
     int extend = 0;
     int ck_cond = 0;    /* set to 1 to read register(s) back */
     int protocol = 3;   /* non-data */
@@ -251,6 +270,7 @@ bool sat_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
     int byte_block = 1; /* 0 -> bytes, 1 -> 512 byte blocks */
     int t_length = 0;   /* 0 -> no data transferred */
     int passthru_size = DEF_SAT_ATA_PASSTHRU_SIZE;
+    bool sense_descriptor = true;
 
     memset(cdb, 0, sizeof(cdb));
     memset(sense, 0, sizeof(sense));
@@ -358,20 +378,23 @@ bool sat_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
     have_sense = sg_scsi_normalize_sense(io_hdr.sensep, io_hdr.resp_sense_len,
                                          &ssh);
     if (have_sense) {
-        /* look for SAT ATA Return Descriptor */
-        ardp = sg_scsi_sense_desc_find(io_hdr.sensep,
-                                       io_hdr.resp_sense_len,
-                                       ATA_RETURN_DESCRIPTOR);
-        if (ardp) {
-            ard_len = ardp[1] + 2;
-            if (ard_len < 12)
-                ard_len = 12;
-            else if (ard_len > 14)
-                ard_len = 14;
+        sense_descriptor = ssh.response_code >= 0x72;
+        if (sense_descriptor) {
+            /* look for SAT ATA Return Descriptor */
+            ardp = sg_scsi_sense_desc_find(io_hdr.sensep,
+                                           io_hdr.resp_sense_len,
+                                           ATA_RETURN_DESCRIPTOR);
+            if (ardp) {
+                ard_len = ardp[1] + 2;
+                if (ard_len < 12)
+                    ard_len = 12;
+                else if (ard_len > 14)
+                    ard_len = 14;
+            }
         }
         scsi_do_sense_disect(&io_hdr, &sinfo);
-        status = scsiSimpleSenseFilter(&sinfo);
-        if (0 != status) {
+        int status = scsiSimpleSenseFilter(&sinfo);
+        if (0 != status) {  /* other than no_sense and recovered_error */
             if (scsi_debugmode > 0) {
                 pout("sat_device::ata_pass_through: scsi error: %s\n",
                      scsiErrString(status));
@@ -408,26 +431,56 @@ bool sat_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
                     hi.lba_mid      = ardp[ 8];
                     hi.lba_high     = ardp[10];
                 }
+            } else if ((! sense_descriptor) &&
+                       (0 == ssh.asc) &&
+                       (SCSI_ASCQ_ATA_PASS_THROUGH == ssh.ascq)) {
+                /* in SAT-2 and later, ATA registers may be passed back via
+                 * fixed format sense data [ref: sat3r07 section 12.2.2.7] */
+                ata_out_regs & lo = out.out_regs;
+                lo.error        = io_hdr.sensep[ 3];
+                lo.status       = io_hdr.sensep[ 4];
+                lo.device       = io_hdr.sensep[ 5];
+                lo.sector_count = io_hdr.sensep[ 6];
+                lo.lba_low      = io_hdr.sensep[ 9];
+                lo.lba_mid      = io_hdr.sensep[10];
+                lo.lba_high     = io_hdr.sensep[11];
+                if (in.in_regs.is_48bit_cmd()) {
+                    if (0 == (0x60 & io_hdr.sensep[8])) {
+                        ata_out_regs & hi = out.out_regs.prev;
+                        hi.sector_count = 0;
+                        hi.lba_low      = 0;
+                        hi.lba_mid      = 0;
+                        hi.lba_high     = 0;
+                    } else {
+                        /* getting the "hi." values when either
+                         * count_upper_nonzero or lba_upper_nonzero are set
+                         * involves fetching the SCSI ATA PASS-THROUGH
+                         * Results log page and decoding the descriptor with
+                         * the matching log_index field. Painful. */ 
+                    }
+                }
             }
         }
-        if (ardp == NULL)
-            ck_cond = 0;       /* not the type of sense data expected */
-    }
-    if (0 == ck_cond) {
+    } else {    /* ck_cond == 0 */
         if (have_sense) {
-            if ((ssh.response_code >= 0x72) &&
-                ((SCSI_SK_NO_SENSE == ssh.sense_key) ||
+            if (((SCSI_SK_NO_SENSE == ssh.sense_key) ||
                  (SCSI_SK_RECOVERED_ERR == ssh.sense_key)) &&
                 (0 == ssh.asc) &&
                 (SCSI_ASCQ_ATA_PASS_THROUGH == ssh.ascq)) {
-                if (ardp) {
-                    if (scsi_debugmode > 0) {
+                if (scsi_debugmode > 0) {
+                    if (sense_descriptor && ardp) {
                         pout("Values from ATA Return Descriptor are:\n");
                         dStrHex((const char *)ardp, ard_len, 1);
+                    } else if (! sense_descriptor) {
+                        pout("Values from ATA fixed format sense are:\n");
+                        pout("  Error: 0x%x\n", io_hdr.sensep[3]);
+                        pout("  Status: 0x%x\n", io_hdr.sensep[4]);
+                        pout("  Device: 0x%x\n", io_hdr.sensep[5]);
+                        pout("  Count: 0x%x\n", io_hdr.sensep[6]);
                     }
-                    return set_err(EIO, "SAT command failed");
                 }
             }
+            return set_err(EIO, "SAT command failed");
         }
     }
     return true;
@@ -1118,6 +1171,148 @@ bool usbjmicron_device::get_registers(unsigned short addr,
 }
 
 
+/////////////////////////////////////////////////////////////////////////////
+
+/// Prolific USB Bridge support. (PL2773) (Probably works on PL2771 also...)
+
+class usbprolific_device
+: public tunnelled_device<
+    /*implements*/ ata_device,
+    /*by tunnelling through a*/ scsi_device
+  >
+{
+public:
+  usbprolific_device(smart_interface * intf, scsi_device * scsidev,
+                    const char * req_type);
+
+  virtual ~usbprolific_device() throw();
+
+  virtual bool ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out);
+};
+
+
+usbprolific_device::usbprolific_device(smart_interface * intf, scsi_device * scsidev,
+                                     const char * req_type)
+: smart_device(intf, scsidev->get_dev_name(), "usbprolific", req_type),
+  tunnelled_device<ata_device, scsi_device>(scsidev)
+{
+  set_info().info_name = strprintf("%s [USB Prolific]", scsidev->get_info_name());
+}
+
+usbprolific_device::~usbprolific_device() throw()
+{
+}
+
+bool usbprolific_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_48bit_hi_null |
+    ata_device::supports_output_regs |
+    ata_device::supports_smart_status,
+    "Prolific" )
+  )
+    return false;
+
+  scsi_cmnd_io io_hdr;
+  memset(&io_hdr, 0, sizeof(io_hdr));
+  unsigned char cmd_rw = 0x10;  // Read
+
+  switch (in.direction) {
+    case ata_cmd_in::no_data:
+      io_hdr.dxfer_dir = DXFER_NONE;
+      break;
+    case ata_cmd_in::data_in:
+      io_hdr.dxfer_dir = DXFER_FROM_DEVICE;
+      io_hdr.dxfer_len = in.size;
+      io_hdr.dxferp = (unsigned char *)in.buffer;
+      memset(in.buffer, 0, in.size);
+      break;
+    case ata_cmd_in::data_out:
+      io_hdr.dxfer_dir = DXFER_TO_DEVICE;
+      io_hdr.dxfer_len = in.size;
+      io_hdr.dxferp = (unsigned char *)in.buffer;
+      cmd_rw = 0x0; // Write
+      break;
+    default:
+      return set_err(EINVAL);
+  }
+
+  // Based on reverse engineering of iSmart.exe with API Monitor.
+  // Seen commands:
+  // D0  0 0  0 06 7B 0 0 0 0 0 0                 // Read Firmware info?, reads 16 bytes
+  // F4  0 0  0 06 7B                             // ??
+  // D8 15 0 D8 06 7B 0 0 0 0 1 1 4F C2 A0 B0     // SMART Enable
+  // D8 15 0 D0 06 7B 0 0 2 0 1 1 4F C2 A0 B0     // SMART Read values
+  // D8 15 0 D1 06 7B 0 0 2 0 1 1 4F C2 A0 B0     // SMART Read thresholds
+  // D8 15 0 D4 06 7B 0 0 0 0 0 1 4F C2 A0 B0     // SMART Execute self test
+  // D7  0 0  0 06 7B 0 0 0 0 0 0 0 0 0 0         // Read status registers, Reads 16 bytes of data
+  // Additional DATA OUT support based on document from Prolific
+
+  // Build pass through command
+  unsigned char cdb[16];
+  cdb[ 0] = 0xD8;         // Operation Code (D8 = Prolific ATA pass through)
+  cdb[ 1] = cmd_rw|0x5;   // Read(0x10)/Write(0x0) | NORMAL(0x5)/PREFIX(0x0)(?)
+  cdb[ 2] = 0x0;          // Reserved
+  cdb[ 3] = in.in_regs.features;        // Feature register (SMART command)
+  cdb[ 4] = 0x06;         // Check Word (VendorID magic, Prolific: 0x067B)
+  cdb[ 5] = 0x7B;         // Check Word (VendorID magic, Prolific: 0x067B)
+  cdb[ 6] = (unsigned char)(io_hdr.dxfer_len >> 24);  // Length MSB
+  cdb[ 7] = (unsigned char)(io_hdr.dxfer_len >> 16);  // Length ...
+  cdb[ 8] = (unsigned char)(io_hdr.dxfer_len >>  8);  // Length ...
+  cdb[ 9] = (unsigned char)(io_hdr.dxfer_len      );  // Length LSB
+  cdb[10] = in.in_regs.sector_count;    // Sector Count
+  cdb[11] = in.in_regs.lba_low;         // LBA Low (7:0)
+  cdb[12] = in.in_regs.lba_mid;         // LBA Mid (15:8)
+  cdb[13] = in.in_regs.lba_high;        // LBA High (23:16)
+  cdb[14] = in.in_regs.device | 0xA0;   // Device/Head
+  cdb[15] = in.in_regs.command;         // ATA Command Register (only PIO supported)
+  // Use '-r scsiioctl,1' to print CDB for debug purposes
+
+  io_hdr.cmnd = cdb;
+  io_hdr.cmnd_len = 16;
+
+  scsi_device * scsidev = get_tunnel_dev();
+  if (!scsi_pass_through_and_check(scsidev, &io_hdr,
+         "usbprolific_device::ata_pass_through: "))
+    return set_err(scsidev->get_err());
+
+  if (in.out_needed.is_set()) {
+    // Read ATA output registers
+    unsigned char regbuf[16] = {0, };
+    memset(&io_hdr, 0, sizeof(io_hdr));
+    io_hdr.dxfer_dir = DXFER_FROM_DEVICE;
+    io_hdr.dxfer_len = sizeof(regbuf);
+    io_hdr.dxferp = regbuf;
+
+    memset(cdb, 0, sizeof(cdb));
+    cdb[ 0] = 0xD7;  // Prolific read registers
+    cdb[ 4] = 0x06;  // Check Word (VendorID magic, Prolific: 0x067B)
+    cdb[ 5] = 0x7B;  // Check Word (VendorID magic, Prolific: 0x067B)
+    io_hdr.cmnd = cdb;
+    io_hdr.cmnd_len = sizeof(cdb);
+
+    if (!scsi_pass_through_and_check(scsidev, &io_hdr,
+           "usbprolific_device::scsi_pass_through (get registers): "))
+      return set_err(scsidev->get_err());
+
+    // Use '-r scsiioctl,2' to print input registers for debug purposes
+    // Example: 50 00 00 00 00 01 4f 00  c2 00 a0 da 00 b0 00 50
+    out.out_regs.status       = regbuf[0];  // Status
+    out.out_regs.error        = regbuf[1];  // Error
+    out.out_regs.sector_count = regbuf[2];  // Sector Count (7:0)
+    out.out_regs.lba_low      = regbuf[4];  // LBA Low (7:0)
+    out.out_regs.lba_mid      = regbuf[6];  // LBA Mid (7:0)
+    out.out_regs.lba_high     = regbuf[8];  // LBA High (7:0)
+    out.out_regs.device       = regbuf[10]; // Device/Head
+    //                          = regbuf[11]; // ATA Feature (7:0)
+    //                          = regbuf[13]; // ATA Command
+  }
+
+  return true;
+}
+
+
 /////////////////////////////////////////////////////////////////////////////
 
 /// SunplusIT USB Bridge support.
@@ -1328,6 +1523,10 @@ ata_device * smart_interface::get_sat_device(const char * type, scsi_device * sc
     return new usbjmicron_device(this, scsidev, type, prolific, ata_48bit_support, port);
   }
 
+  else if (!strcmp(type, "usbprolific")) {
+    return new usbprolific_device(this, scsidev, type);
+  }
+
   else if (!strcmp(type, "usbsunplus")) {
     return new usbsunplus_device(this, scsidev, type);
   }
index bb505c0c3e69dd9fd5addfaea0098f4b4e1a0294..d306d72d5e9771e5d4f331ea809c62ad116eae0d 100644 (file)
@@ -3,11 +3,11 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-8 Bruce Allen
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * Additional SCSI work:
- * Copyright (C) 2003-13 Douglas Gilbert <dgilbert@interlog.com>
+ * Copyright (C) 2003-15 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
@@ -49,7 +49,7 @@
 #include "dev_interface.h"
 #include "utility.h"
 
-const char *scsicmds_c_cvsid="$Id: scsicmds.cpp 3915 2014-06-19 18:24:57Z dpgilbert $"
+const char *scsicmds_c_cvsid="$Id: scsicmds.cpp 4081 2015-05-10 16:42:50Z chrfranke $"
   SCSICMDS_H_CVSID;
 
 // Print SCSI debug messages?
@@ -989,40 +989,6 @@ scsiSendDiagnostic(scsi_device * device, int functioncode, UINT8 *pBuf,
     return scsiSimpleSenseFilter(&sinfo);
 }
 
-/* RECEIVE DIAGNOSTIC command. Returns 0 if ok, 1 if NOT READY, 2 if
- * command not supported, 3 if field in command not supported or returns
- * negated errno. SPC-3 section 6.18 (rev 22a) */
-int
-scsiReceiveDiagnostic(scsi_device * device, int pcv, int pagenum, UINT8 *pBuf,
-                      int bufLen)
-{
-    struct scsi_cmnd_io io_hdr;
-    struct scsi_sense_disect sinfo;
-    UINT8 cdb[6];
-    UINT8 sense[32];
-
-    memset(&io_hdr, 0, sizeof(io_hdr));
-    memset(cdb, 0, sizeof(cdb));
-    io_hdr.dxfer_dir = DXFER_FROM_DEVICE;
-    io_hdr.dxfer_len = bufLen;
-    io_hdr.dxferp = pBuf;
-    cdb[0] = RECEIVE_DIAGNOSTIC;
-    cdb[1] = pcv;
-    cdb[2] = pagenum;
-    cdb[3] = (bufLen >> 8) & 0xff;
-    cdb[4] = bufLen & 0xff;
-    io_hdr.cmnd = cdb;
-    io_hdr.cmnd_len = sizeof(cdb);
-    io_hdr.sensep = sense;
-    io_hdr.max_sense_len = sizeof(sense);
-    io_hdr.timeout = SCSI_TIMEOUT_DEFAULT;
-
-    if (!device->scsi_pass_through(&io_hdr))
-      return -device->get_errno();
-    scsi_do_sense_disect(&io_hdr, &sinfo);
-    return scsiSimpleSenseFilter(&sinfo);
-}
-
 /* TEST UNIT READY command. SPC-3 section 6.33 (rev 22a) */
 static int
 _testunitready(scsi_device * device, struct scsi_sense_disect * sinfo)
@@ -1072,7 +1038,8 @@ scsiTestUnitReady(scsi_device * device)
 }
 
 /* READ DEFECT (10) command. Returns 0 if ok, 1 if NOT READY, 2 if
- * command not supported, 3 if field in command not supported or returns
+ * command not supported, 3 if field in command not supported, 101 if
+ * defect list not found (e.g. SSD may not have defect list) or returns
  * negated errno. SBC-2 section 5.12 (rev 16) */
 int
 scsiReadDefect10(scsi_device * device, int req_plist, int req_glist,
@@ -1102,11 +1069,15 @@ scsiReadDefect10(scsi_device * device, int req_plist, int req_glist,
     if (!device->scsi_pass_through(&io_hdr))
       return -device->get_errno();
     scsi_do_sense_disect(&io_hdr, &sinfo);
+    /* Look for "(Primary|Grown) defect list not found" */
+    if ((sinfo.resp_code >= 0x70) && (0x1c == sinfo.asc))
+        return 101;
     return scsiSimpleSenseFilter(&sinfo);
 }
 
 /* READ DEFECT (12) command. Returns 0 if ok, 1 if NOT READY, 2 if
- * command not supported, 3 if field in command not supported or returns
+ * command not supported, 3 if field in command not supported, 101 if
+ * defect list not found (e.g. SSD may not have defect list) or returns
  * negated errno. SBC-3 section 5.18 (rev 35; vale Mark Evans) */
 int
 scsiReadDefect12(scsi_device * device, int req_plist, int req_glist,
@@ -1142,6 +1113,9 @@ scsiReadDefect12(scsi_device * device, int req_plist, int req_glist,
     if (!device->scsi_pass_through(&io_hdr))
       return -device->get_errno();
     scsi_do_sense_disect(&io_hdr, &sinfo);
+    /* Look for "(Primary|Grown) defect list not found" */
+    if ((sinfo.resp_code >= 0x70) && (0x1c == sinfo.asc))
+        return 101;
     return scsiSimpleSenseFilter(&sinfo);
 }
 
@@ -2109,30 +2083,6 @@ scsiGetIEString(UINT8 asc, UINT8 ascq)
 }
 
 
-/* This is not documented in t10.org, page 0x80 is vendor specific */
-/* Some IBM disks do an offline read-scan when they get this command. */
-int
-scsiSmartIBMOfflineTest(scsi_device * device)
-{
-    UINT8 tBuf[256];
-    int res;
-
-    memset(tBuf, 0, sizeof(tBuf));
-    /* Build SMART Off-line Immediate Diag Header */
-    tBuf[0] = 0x80; /* Page Code */
-    tBuf[1] = 0x00; /* Reserved */
-    tBuf[2] = 0x00; /* Page Length MSB */
-    tBuf[3] = 0x04; /* Page Length LSB */
-    tBuf[4] = 0x03; /* SMART Revision */
-    tBuf[5] = 0x00; /* Reserved */
-    tBuf[6] = 0x00; /* Off-line Immediate Time MSB */
-    tBuf[7] = 0x00; /* Off-line Immediate Time LSB */
-    res = scsiSendDiagnostic(device, SCSI_DIAG_NO_SELF_TEST, tBuf, 8);
-    if (res)
-        pout("IBM offline test failed [%s]\n", scsiErrString(res));
-    return res;
-}
-
 int
 scsiSmartDefaultSelfTest(scsi_device * device)
 {
index c28e830742577148b9601a83618d03876a2dc1aa..30a5c97388f42b2bbd8d4c3202f0a2533fd272cc 100644 (file)
@@ -3,11 +3,11 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-8 Bruce Allen
  * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
  *
  * Additional SCSI work:
- * Copyright (C) 2003-13 Douglas Gilbert <dgilbert@interlog.com>
+ * Copyright (C) 2003-15 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
@@ -32,7 +32,7 @@
 #ifndef SCSICMDS_H_
 #define SCSICMDS_H_
 
-#define SCSICMDS_H_CVSID "$Id: scsicmds.h 3896 2014-04-28 04:31:25Z dpgilbert $\n"
+#define SCSICMDS_H_CVSID "$Id: scsicmds.h 4081 2015-05-10 16:42:50Z chrfranke $\n"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -385,9 +385,6 @@ int scsiRequestSense(scsi_device * device, struct scsi_sense_disect * sense_info
 
 int scsiSendDiagnostic(scsi_device * device, int functioncode, UINT8 *pBuf, int bufLen);
 
-int scsiReceiveDiagnostic(scsi_device * device, int pcv, int pagenum, UINT8 *pBuf,
-                      int bufLen);
-
 int scsiReadDefect10(scsi_device * device, int req_plist, int req_glist, int dl_format,
                      UINT8 *pBuf, int bufLen);
 
@@ -433,8 +430,6 @@ const char* scsiGetIEString(UINT8 asc, UINT8 ascq);
 int scsiGetTemp(scsi_device * device, UINT8 *currenttemp, UINT8 *triptemp);
 
 
-int scsiSmartIBMOfflineTest(scsi_device * device);
-
 int scsiSmartDefaultSelfTest(scsi_device * device);
 int scsiSmartShortSelfTest(scsi_device * device);
 int scsiSmartExtendSelfTest(scsi_device * device);
index 95568b4045b10088ee603a4ca59412abf9458e5b..5e4cb4d164d6d0a08dc27337e369db88c1cb35d3 100644 (file)
@@ -42,7 +42,7 @@
 
 #define GBUF_SIZE 65535
 
-const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 3898 2014-04-30 17:44:13Z dpgilbert $"
+const char * scsiprint_c_cvsid = "$Id: scsiprint.cpp 4040 2015-03-10 22:30:44Z dpgilbert $"
                                  SCSIPRINT_H_CVSID;
 
 
@@ -339,7 +339,9 @@ scsiPrintGrownDefectListLen(scsi_device * device)
                 return;
             } else
                 got_rd12 = 0;
-        } else {
+        } else if (101 == err)    /* Defect list not found, leave quietly */
+            return;
+        else {
             if (scsi_debugmode > 0) {
                 print_on();
                 pout("Read defect list (12) Failed: %s\n", scsiErrString(err));
index aa79757402535d354ba834426fd3ca24a95dd0a2..b9bf574a9dc410aa76146f2c8dc948664870810f 100644 (file)
@@ -1,8 +1,8 @@
 .ig
-Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
-Copyright (C) 2004-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+Copyright (C) 2002-10 Bruce Allen
+Copyright (C) 2004-15 Christian Franke
 
-$Id: smartctl.8.in 3965 2014-07-20 14:46:41Z chrfranke $
+$Id: smartctl.8.in 4099 2015-05-30 17:32:13Z 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
@@ -18,16 +18,13 @@ Research Center), Jack Baskin School of Engineering, University of
 California, Santa Cruz. http://ssrc.soe.ucsc.edu/
 
 ..
-.TH SMARTCTL 8 CURRENT_SVN_DATE CURRENT_SVN_VERSION CURRENT_SVN_DATE
+.TH SMARTCTL 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 \fBsmartctl\fP \- Control and Monitor Utility for SMART Disks
 
 .SH SYNOPSIS
 .B smartctl [options] device
 
-.SH PACKAGE VERSION
-CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
-
 .SH DESCRIPTION
 .\" %IF NOT OS ALL
 .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
@@ -55,11 +52,9 @@ option (for more information see the section on "ATA, SCSI command sets
 and SAT" below). Device paths are as follows:
 .\" %IF OS Linux
 .IP \fBLINUX\fP: 9
-Use the forms \fB"/dev/hd[a\-t]"\fP for IDE/ATA devices, and
-\fB"/dev/sd[a\-z]"\fP for SCSI devices. For SCSI Tape Drives and
-Changers with TapeAlert support use the devices \fB"/dev/nst*"\fP and
-\fB"/dev/sg*"\fP.  For SATA disks accessed with libata, use
-\fB"/dev/sd[a\-z]"\fP and append \fB"\-d ata"\fP. For disks behind
+Use the forms \fB"/dev/sd[a\-z]"\fP for ATA/SATA and SCSI/SAS devices.
+For SCSI Tape Drives and Changers with TapeAlert support use the
+devices \fB"/dev/nst*"\fP and \fB"/dev/sg*"\fP.  For disks behind
 3ware controllers you may need \fB"/dev/sd[a\-z]"\fP or
 \fB"/dev/twe[0\-9]"\fP, \fB"/dev/twa[0\-9]"\fP or \fB"/dev/twl[0\-9]"\fP: see details
 below. For disks behind HighPoint RocketRAID controllers you may need
@@ -135,8 +130,8 @@ For disks behind an Intel ICHxR controller with RST driver use
 \fB"/dev/csmi[0\-9],N"\fP where N specifies the port behind the logical
 scsi controller "\\\\.\\Scsi[0\-9]:".
 
-[NEW EXPERIMENTAL SMARTCTL FEATURE] For SATA or SAS disks behind an Areca
-controller use \fB"/dev/arcmsr[0\-9]"\fP, see \'\-d areca,N[/E]\' below.
+For SATA or SAS disks behind an Areca controller use
+\fB"/dev/arcmsr[0\-9]"\fP, see \'\-d areca,N[/E]\' below.
 
 The prefix \fB"/dev/"\fP is optional.
 .\" %ENDIF OS Windows Cygwin
@@ -266,7 +261,7 @@ which failed either now or in the past.
 
 .I silent
 \- print no output.  The only way to learn about what was found is to
-use the exit status of \fBsmartctl\fP (see RETURN VALUES below).
+use the exit status of \fBsmartctl\fP (see EXIT STATUS below).
 
 .I noserial
 \- Do not print the serial number of the device.
@@ -331,13 +326,17 @@ 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 SMARTCTL 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 usbprolific
+\- [NEW EXPERIMENTAL SMARTCTL FEATURE]
+this device type is for SATA disks that are behind a Prolific PL2571/2771/2773/2775
+USB to SATA bridge.
+
 .I usbsunplus
 \- this device type is for SATA disks that are behind a SunplusIT USB to SATA
 bridge.
@@ -372,24 +371,32 @@ For PERC2/3/4 controllers: \fBmegadevN\fP
 .br
 For PERC5/6 controllers: \fBmegaraid_sas_ioctlN\fP
 
+.\" %ENDIF OS Linux
+.\" %IF OS Linux Windows Cygwin
 .I aacraid,H,L,ID
-\- [Linux only] [NEW EXPERIMENTAL SMARTCTL FEATURE]
+\- [Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTCTL FEATURE]
 the device consists of one or more SCSI/SAS disks connected to an AacRaid controller.
 The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
 on the controller is monitored.
 Use syntax such as:
 .nf
-\fBsmartctl \-a \-d aacraid,0,0,66 /dev/sda\fP
+\fBsmartctl \-a \-d aacraid,0,0,2 /dev/sda\fP
 .fi
 .nf
-\fBsmartctl \-a \-d aacraid,0,0,66 /dev/sdb\fP
+\fBsmartctl \-a \-d aacraid,1,0,4 /dev/sdb\fP
 .fi
-The L and ID numbers of a disk can be found in /proc/scsi/scsi
 
-The following entry in /proc/devices must exist: \fBaac\fP.
+.\" %ENDIF OS Linux Windows Cygwin
+.\" %IF OS Linux
+On Linux, the following entry in /proc/devices must exist: \fBaac\fP.
 Character device nodes /dev/aacH (H=Host number) are created if required.
 
 .\" %ENDIF OS Linux
+.\" %IF OS Windows Cygwin
+On Windows, the device name parameter /dev/sdX is ignored if \'-d aacraid\'
+is specified.
+
+.\" %ENDIF OS Windows Cygwin
 .\" %IF OS FreeBSD Linux
 .I 3ware,N
 \- [FreeBSD and Linux only] the device consists of one or more ATA disks
@@ -495,7 +502,7 @@ On FreeBSD use syntax such as:
 .fi
 .\" %ENDIF OS FreeBSD
 .\" %IF OS Windows Cygwin
-[NEW EXPERIMENTAL SMARTCTL FEATURE] On Windows and Cygwin use syntax such as:
+On Windows and Cygwin use syntax such as:
 .nf
 \fBsmartctl \-a \-d areca,2 /dev/arcmsr0\fP
 .fi
@@ -526,8 +533,8 @@ later.  Lower-numbered firmware versions will give (harmless) SCSI
 error messages and no SMART information.
 
 .I areca,N/E
-\- [FreeBSD, Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTCTL FEATURE] the
-device consists of one or more SATA or SAS disks connected to an Areca SAS RAID controller.
+\- [FreeBSD, Linux, Windows and Cygwin only] the 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 Areca SAS controller firmware version 1.51 or later.
@@ -689,7 +696,7 @@ behaviour. This is does not work for SCSI devices yet.
 checks when the device is in a low-power mode. It may be used to prevent
 a disk from being spun-up by \fBsmartctl\fP. The power mode is ignored by
 default.  A nonzero exit status is returned if the device is in one of the
-specified low-power modes (see RETURN VALUES below).
+specified low-power modes (see EXIT STATUS below).
 
 Note: If this option is used it may also be necessary to specify the device
 type with the \'\-d\' option.  Otherwise the device may spin up due to
@@ -885,13 +892,11 @@ the drive.  The setting of the standby timer is not affected.
 The write cache is usually enabled by default.
 
 .I wcache[,on|off]
-\- [SCSI] [NEW EXPERIMENTAL SMARTCTL FEATURE]
-Gets/sets the \'Write Cache Enable\' (WCE) bit (if supported).
+\- [SCSI] Gets/sets the \'Write Cache Enable\' (WCE) bit (if supported).
 The write cache is usually enabled by default.
 
 .I wcreorder[,on|off]
-\- [ATA only] [NEW EXPERIMENTAL SMARTCTL FEATURE]
-Gets/sets Write Cache Reordering.
+\- [ATA only] Gets/sets Write Cache Reordering.
 If it is disabled (off), disk write scheduling is executed on a 
 first-in-first-out (FIFO) basis. If Write Cache Reordering is enabled (on),
 then disk write scheduling may be reordered by the drive. If write cache is
@@ -901,21 +906,15 @@ The state of Write Cache Reordering has no effect on either NCQ or LCQ queued
 commands.
 
 .I rcache[,on|off]
-\- [SCSI only] [NEW EXPERIMENTAL SMARTCTL FEATURE]
-Gets/sets the \'Read Cache Disable\' (RCE) bit. \'Off\' value disables read cache
-(if supported).
+\- [SCSI only] Gets/sets the \'Read Cache Disable\' (RCE) bit.
+\'Off\' value disables read cache (if supported).
 The read cache is usually enabled by default.
 
 .TP
 .B SMART READ AND DISPLAY DATA OPTIONS:
 .TP
 .B \-H, \-\-health
-Check: Ask the device to report its SMART health status or pending
-TapeAlert messages.  SMART status is based on
-information that it has gathered from online and offline
-tests, which were used to determine/update its
-SMART vendor-specific Attribute values. TapeAlert status is obtained
-by reading the TapeAlert log page.
+Prints the health status of the device or pending TapeAlert messages.
 
 If the device reports failing health status, this means
 .B either
@@ -924,6 +923,26 @@ that the device has already failed,
 that it is predicting its own failure within the next 24 hours.  If
 this happens, use the \'\-a\' option to get more information, and
 .B get your data off the disk and to someplace safe as soon as you can.
+
+[ATA] Health status is obtained by checking the (boolean) result returned
+by the SMART RETURN STATUS command.
+The return value of this ATA command may be unknown due to limitations or
+bugs in some layer (e.g. RAID controller or USB bridge firmware) between
+disk and operating system.
+In this case, \fBsmartctl\fP prints a warning and checks whether any
+Prefailure SMART Attribute value is less than or equal to its threshold
+(see \'\-A\' below).
+
+[SCSI] Health status is obtained by checking the Additional Sense Code
+(ASC) and Additional Sense Code Qualifier (ASCQ) from Informal Exceptions
+(IE) log page (if supported) and/or from SCSI sense data.
+
+[SCSI tape drive or changer] TapeAlert status is obtained by reading the
+TapeAlert log page.
+Please note that the TapeAlert log page flags are cleared for the initiator
+when the page is read.
+This means that each alert condition is reported only once by \fBsmartctl\fP
+for each initiator for each activation of the condition.
 .TP
 .B \-c, \-\-capabilities
 [ATA only] Prints only the generic SMART capabilities.  These
@@ -1791,25 +1810,25 @@ a disk can be specified by N\-\fBmax\fP.
 
 For example the commands:
 .nf
-  smartctl \-t select,10\-20 /dev/hda
-  smartctl \-t select,10+11 /dev/hda
+  smartctl \-t select,10\-20 /dev/sda
+  smartctl \-t select,10+11 /dev/sda
 .fi
 both runs a self test on one span consisting of LBAs ten to twenty
 (inclusive). The command:
 .nf
-  smartctl \-t select,100000000\-max /dev/hda
+  smartctl \-t select,100000000\-max /dev/sda
 .fi
 run a self test from LBA 100000000 up to the end of the disk.
 The \'\-t\' option can be given up to five times, to test
 up to five spans.  For example the command:
 .nf
-  smartctl \-t select,0\-100 \-t select,1000\-2000 /dev/hda
+  smartctl \-t select,0\-100 \-t select,1000\-2000 /dev/sda
 .fi
 runs a self test on two spans.  The first span consists of 101 LBAs
 and the second span consists of 1001 LBAs.  Note that the spans can
 overlap partially or completely, for example:
 .nf
-  smartctl \-t select,0\-10 \-t select,5\-15 \-t select,10\-20 /dev/hda
+  smartctl \-t select,0\-10 \-t select,5\-15 \-t select,10\-20 /dev/sda
 .fi
 The results of the selective self-test can be obtained (both during
 and after the test) by printing the SMART self-test log, using the
@@ -1836,15 +1855,15 @@ argument.
 
 For example the commands:
 .nf
-  smartctl \-t select,10\-20 /dev/hda
-  smartctl \-t select,redo /dev/hda
-  smartctl \-t select,redo+20 /dev/hda
+  smartctl \-t select,10\-20 /dev/sda
+  smartctl \-t select,redo /dev/sda
+  smartctl \-t select,redo+20 /dev/sda
 .fi
 have the same effect as:
 .nf
-  smartctl \-t select,10\-20 /dev/hda
-  smartctl \-t select,10\-20 /dev/hda
-  smartctl \-t select,10\-29 /dev/hda
+  smartctl \-t select,10\-20 /dev/sda
+  smartctl \-t select,10\-20 /dev/sda
+  smartctl \-t select,10\-29 /dev/sda
 .fi
 
 .I select,next[+SIZE]
@@ -1855,15 +1874,15 @@ optional +SIZE argument.
 
 For example the commands:
 .nf
-  smartctl \-t select,0\-999 /dev/hda
-  smartctl \-t select,next /dev/hda
-  smartctl \-t select,next+2000 /dev/hda
+  smartctl \-t select,0\-999 /dev/sda
+  smartctl \-t select,next /dev/sda
+  smartctl \-t select,next+2000 /dev/sda
 .fi
 have the same effect as:
 .nf
-  smartctl \-t select,0\-999 /dev/hda
-  smartctl \-t select,1000\-1999 /dev/hda
-  smartctl \-t select,2000\-3999 /dev/hda
+  smartctl \-t select,0\-999 /dev/sda
+  smartctl \-t select,1000\-1999 /dev/sda
+  smartctl \-t select,2000\-3999 /dev/sda
 .fi
 
 If the last test ended at the last LBA of the disk, the new range starts
@@ -1986,62 +2005,55 @@ browser.
 
 .SH EXAMPLES
 .nf
-.B smartctl \-a /dev/hda
-.fi
-Print a large amount of SMART information for drive /dev/hda which is
-typically an ATA (IDE) or SATA disk in Linux.
-.PP
-.nf
-.B smartctl \-a /dev/sdb
+.B smartctl \-a /dev/sda
 .fi
-Print a large amount of SMART information for drive /dev/sdb . This may
-be a SCSI disk or an ATA (SATA) disk.
+Print a large amount of SMART information for drive /dev/sda .
 .PP
 .nf
-.B smartctl \-s off /dev/hdd
+.B smartctl \-s off /dev/sdd
 .fi
-Disable SMART monitoring and data log collection on drive /dev/hdd .
+Disable SMART monitoring and data log collection on drive /dev/sdd .
 .PP
 .nf
-.B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/hda
+.B smartctl \-\-smart=on \-\-offlineauto=on \-\-saveauto=on /dev/sda
 .fi
-Enable SMART on drive /dev/hda, enable automatic offline
+Enable SMART on drive /dev/sda, enable automatic offline
 testing every four hours, and enable autosaving of
 SMART Attributes.  This is a good start-up line for your system\'s
 init files.  You can issue this command on a running system.
 .PP
 .nf
-.B smartctl \-t long /dev/hdc
+.B smartctl \-t long /dev/sdc
 .fi
-Begin an extended self-test of drive /dev/hdc.  You can issue this
+Begin an extended self-test of drive /dev/sdc.  You can issue this
 command on a running system.  The results can be seen in the self-test
 log visible with the \'\-l selftest\' option after it has completed.
 .PP
 .nf
-.B smartctl \-s on \-t offline /dev/hda
+.B smartctl \-s on \-t offline /dev/sda
 .fi
 Enable SMART on the disk, and begin an immediate offline test of
-drive /dev/hda.  You can issue this command on a running system.  The
+drive /dev/sda.  You can issue this command on a running system.  The
 results are only used to update the SMART Attributes, visible
 with the \'\-A\' option.  If any device errors occur, they are logged to
 the SMART error log, which can be seen with the \'\-l error\' option.
 .PP
 .nf
-.B smartctl \-A \-v 9,minutes /dev/hda
+.B smartctl \-A \-v 9,minutes /dev/sda
 .fi
 Shows the vendor Attributes, when the disk stores its power-on time
 internally in minutes rather than hours.
 .PP
 .nf
-.B smartctl \-q errorsonly \-H \-l selftest /dev/hda
+.B smartctl \-q errorsonly \-H \-l selftest /dev/sda
 .fi
 Produces output only if the device returns failing SMART status,
 or if some of the logged self-tests ended with errors.
 .PP
 .nf
-.B smartctl \-q silent \-a /dev/hda
+.B smartctl \-q silent \-a /dev/sda
 .fi
-Examine all SMART data for device /dev/hda, but produce no
+Examine all SMART data for device /dev/sda, but produce no
 printed output.  You must use the exit status (the
 .B $?
 shell variable) to learn if any Attributes are out of bound, if the
@@ -2100,7 +2112,7 @@ Start a short self-test on the (S)ATA disk connected to second pmport on the
 first channel of the first HighPoint RocketRAID controller card.
 .PP
 .nf
-.B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/hda
+.B smartctl \-t select,10\-100 \-t select,30\-300 \-t afterselect,on \-t pending,45 /dev/sda
 .fi
 Run a selective self-test on LBAs 10 to 100 and 30 to 300.  After the
 these LBAs have been tested, read-scan the remainder of the disk.  If the disk is
@@ -2113,13 +2125,13 @@ device is restored.
 Examine all SMART data for the first SCSI disk connected to a cciss
 RAID controller card.
 
-.SH RETURN VALUES
-The return values of \fBsmartctl\fP are defined by a bitmask.  If all
-is well with the disk, the return value (exit status) of
+.SH EXIT STATUS
+The exit statuses of \fBsmartctl\fP are defined by a bitmask.
+If all is well with the disk, the exit status (return value) of
 \fBsmartctl\fP is 0 (all bits turned off).  If a problem occurs, or an
 error, potential error, or fault is detected, then a non-zero status
-is returned.  In this case, the eight different bits in the return
-value have the following meanings for ATA disks; some of these values
+is returned.  In this case, the eight different bits in the exit status
+have the following meanings for ATA disks; some of these values
 may also be returned for SCSI disks.
 .TP
 .B Bit 0:
@@ -2188,61 +2200,33 @@ drive database (see \'\-B\' option).
 optional local drive database (see \'\-B\' option).
 
 .\" %ENDIF NOT OS Windows
-.SH NOTES
-The TapeAlert log page flags are cleared for the initiator when the
-page is read. This means that each alert condition is reported only
-once by \fBsmartctl\fP for each initiator for each activation of the
-condition.
-
 .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
-
-The following have made large contributions to smartmontools:
-.br
-\fBCasper Dik\fP (Solaris SCSI interface)
-.br
-\fBDouglas Gilbert\fP (SCSI subsystem)
-.br
-\fBGuido Guenther\fP (Autoconf/Automake packaging)
-.br
-\fBGeoffrey Keating\fP (Darwin ATA interface)
+\fBBruce Allen\fP (project initiator),
 .br
-\fBEduard Martinescu\fP (FreeBSD interface)
+\fBChristian Franke\fP (project manager, Windows port and all sort of things),
 .br
-\fBFr\['e]d\['e]ric L. W. Meunier\fP (Web site and Mailing list)
+\fBDouglas Gilbert\fP (SCSI subsystem),
 .br
-\fBGabriele Pohl\fP (Web site and Wiki, conversion from CVS to SVN)
+\fBVolker Kuhlmann\fP (moderator of support and database mailing list),
 .br
-\fBKeiji Sawada\fP (Solaris ATA interface)
+\fBGabriele Pohl\fP (wiki & development team support),
 .br
-\fBManfred Schwarb\fP (Drive database)
-.br
-\fBSergey Svishchev\fP (NetBSD interface)
-.br
-\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
-.br
-\fBPhil Williams\fP (User interface and drive database)
+\fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki).
+
+Many other individuals have made contributions and corrections,
+see AUTHORS, ChangeLog and repository files.
+
+The first smartmontools code was derived from the smartsuite package,
+written by Michael Cornwell and Andre Hedrick.
+
+.SH REPORTING BUGS
+To submit a bug report, create a ticket in smartmontools wiki:
 .br
-\fBYuri Dario\fP (OS/2, eComStation interface)
+<\fBhttp://www.smartmontools.org/\fP>.
 .br
-\fBShengfeng Zhou\fP (Linux/FreeBSD HighPoint RocketRAID interface)
+Alternatively send the info to the smartmontools support mailing list:
 .br
-Many other individuals have made smaller contributions and corrections.
-
-The first smartmontools code was derived from the smartsuite package,
-written by Michael Cornwell, and from the previous UCSC smartsuite package.
-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. \fBhttp://ssrc.soe.ucsc.edu/\fP .
+<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>.
 
 .SH SEE ALSO
 \fBsmartd\fP(8), \fBupdate-smart-drivedb\fP(8).
@@ -2269,5 +2253,7 @@ publications of the Small Form Factors (SFF) Committee.
 Links to these and other documents may be found on the Links page of the
 \fBsmartmontools\fP Wiki at \fBhttp://www.smartmontools.org/wiki/Links\fP .
 
-.SH SVN ID OF THIS PAGE
-$Id: smartctl.8.in 3965 2014-07-20 14:46:41Z chrfranke $
+.SH PACKAGE VERSION
+CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
+.br
+$Id: smartctl.8.in 4099 2015-05-30 17:32:13Z chrfranke $
index bbaec43859f8f5d9bcb0ccb0b3acbc250d37fa90..53ee298bfb589dcc48a1b96e859c80d6f3daf5cb 100644 (file)
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2002-11 Bruce Allen <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2008-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-11 Bruce Allen
+ * Copyright (C) 2008-15 Christian Franke
  * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -51,7 +51,7 @@
 #include "smartctl.h"
 #include "utility.h"
 
-const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 3936 2014-07-05 17:16:23Z chrfranke $"
+const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 4080 2015-05-05 20:31:22Z chrfranke $"
   CONFIG_H_CVSID SMARTCTL_H_CVSID;
 
 // Globals to control printing
@@ -503,10 +503,14 @@ static const char * parse_options(int argc, char** argv,
         sscanf(optarg, "devstat%n,%u%n", &n1, &val, &n2);
         if (n1 == len)
           ataopts.devstat_all_pages = true;
-        else if (n2 == len && val <= 255)
-          ataopts.devstat_pages.push_back(val);
-        else
-          badarg = true;
+        else {
+            if (n2 != len) // retry with hex
+              sscanf(optarg, "devstat,0x%x%n", &val, &n2);
+            if (n2 == len && val <= 0xff)
+              ataopts.devstat_pages.push_back(val);
+            else
+              badarg = true;
+        }
 
       } else if (!strncmp(optarg, "xerror", sizeof("xerror")-1)) {
         int n1 = -1, n2 = -1, len = strlen(optarg);
index c6f1568e3257bd2171d5b4323ff04f8be0fbadbe..8dd7ef4abe2cb085b67c2ad9c4c74916923a9b10 100644 (file)
@@ -1,8 +1,8 @@
 .ig
-Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
-Copyright (C) 2004-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+Copyright (C) 2002-10 Bruce Allen
+Copyright (C) 2004-15 Christian Franke
 
-$Id: smartd.8.in 3965 2014-07-20 14:46:41Z chrfranke $
+$Id: smartd.8.in 4102 2015-06-01 19:25:47Z 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
@@ -18,16 +18,13 @@ 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
+.TH SMARTD 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 \fBsmartd\fP \- SMART Disk Monitoring Daemon
 
 .SH SYNOPSIS
 .B smartd [options]
 
-.SH PACKAGE VERSION
-CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
-
 .SH DESCRIPTION
 .\" %IF NOT OS ALL
 .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
@@ -101,7 +98,7 @@ devices that support SMART.  The scanning is done as follows:
 .IP \fBLINUX:\fP 9
 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.
+for ATA/SATA or SCSI/SAS devices.
 Disks behind RAID controllers are not included.
 .\" %ENDIF OS Linux
 .\" %IF OS FreeBSD
@@ -186,13 +183,14 @@ can be used to verify the existence of the default configuration file.
 By using \'\-\' for FILE, the configuration is read from standard
 input. This is useful for commands like:
 .nf
-.B echo /dev/hdb \-m user@home \-M test | smartd \-c \- \-q onecheck
+.B echo /dev/sdb \-m user@home \-M test | smartd \-c \- \-q onecheck
 .fi
 to perform quick and simple checks without a configuration file.
 .\" %IF ENABLE_CAPABILITIES
 .TP
 .B \-C, \-\-capabilities
-Use \fBcapabilities\fP(7).
+[Linux only] Use libcap-ng to drop unneeded Linux process \fBcapabilities\fP(7).
+The following capabilities are kept: CAP_SYS_ADMIN, CAP_SYS_RAWIO, CAP_MKNOD.
 
 Warning: Mail notification does not work when used.
 .\" %ENDIF ENABLE_CAPABILITIES
@@ -283,7 +281,7 @@ log output is redirected as follows:
 .TP
 .B \-n, \-\-no\-fork
 Do not fork into background; this is useful when executed from modern
-init methods like initng, minit or supervise.
+init methods like initng, minit, supervise or systemd.
 .\" %IF OS Cygwin
 
 On Cygwin, this allows running \fBsmartd\fP as service via cygrunsrv,
@@ -416,7 +414,6 @@ 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.
@@ -464,6 +461,7 @@ once. The exit status (the shell
 variable) will be zero if all went well, and nonzero if no devices
 were detected or some other problem was encountered.
 
+.\" %IF ENABLE_INITSCRIPT
 Note that \fBsmartmontools\fP provides a start-up script in
 \fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and
 stopping the daemon via the normal init interface.  Using this script,
@@ -476,6 +474,7 @@ and stop it by using the command:
 .B /usr/local/etc/rc.d/init.d/smartd stop
 .fi
 
+.\" %ENDIF ENABLE_INITSCRIPT
 .SH CONFIGURATION
 The syntax of the \fBsmartd.conf\fP(5) file is discussed separately.
 
@@ -489,7 +488,7 @@ or
 .B \'\-u\'
 Directives. For example:
 .nf
-.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
+.B \'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
 .fi
 Note that in this message, the value given is the \'Normalized\' not the \'Raw\' 
 Attribute value (the disk temperature in this case is about 22
@@ -500,7 +499,7 @@ and
 Directives modify this behavior, so that the information is printed
 with the Raw values as well, for example:
 .nf
-.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
+.B \'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
 .fi
 Here the Raw values are the actual disk temperatures in Celsius.  The
 way in which the Raw values are printed, and the names under which the
@@ -518,7 +517,7 @@ will make log entries at loglevel
 .B LOG_CRIT
 if a SMART Attribute has failed, for example:
 .nf
-.B \'Device: /dev/hdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
+.B \'Device: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
 .fi
  This loglevel is used for reporting enabled by the
 .B \'\-H\', \-f\', \'\-l\ selftest\',
@@ -549,14 +548,17 @@ see the \fBsmartd\fP '\-l' command-line option described above.
 .\" %ENDIF OS Solaris
 .\" %IF OS Cygwin
 The Cygwin Version of \fBsmartd\fP can be run as a service via the
-cygrunsrv tool. The start-up script provides Cygwin-specific commands
-to install and remove the service:
+cygrunsrv tool.
+.\" %IF ENABLE_INITSCRIPT
+The start-up script provides Cygwin-specific commands to install and
+remove the service:
 .nf
 .B /usr/local/etc/rc.d/init.d/smartd install [options]
 .B /usr/local/etc/rc.d/init.d/smartd remove
 .fi
 The service can be started and stopped by the start-up script as usual
 (see \fBEXAMPLES\fP above).
+.\" %ENDIF ENABLE_INITSCRIPT
 
 .\" %ENDIF OS Cygwin
 .\" %IF OS Windows
@@ -624,10 +626,8 @@ set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the
 time-zone is set using the \'\fBTZ\fP\' variable (or a file that it
 points to).
 
-.SH RETURN VALUES
-The return value (exit status) of 
-\fBsmartd\fP
-can have the following values:
+.SH EXIT STATUS
+The exit status (return value) of \fBsmartd\fP can have the following values:
 .TP
 .B 0:
 Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT).
@@ -654,16 +654,11 @@ Config file exists, but cannot be read.
 \fBsmartd\fP
 ran out of memory during startup.
 .TP
-.B 9:
-A compile time constant of\fB smartd\fP was too small.  This can be caused by an
-excessive number of disks, or by lines in \fB /usr/local/etc/smartd.conf\fP that are too long.
-Please report this problem to \fB smartmontools-support@lists.sourceforge.net\fP.
-.TP
 .B 10:
 An inconsistency was found in \fBsmartd\fP\'s internal data
 structures. This should never happen.  It must be due to either a
 coding or compiler bug.  \fIPlease\fP report such failures to
-smartmontools-support@lists.sourceforge.net.
+smartmontools developers, see REPORTING BUGS below.
 .TP
 .B 16:
 A device explicitly listed in
@@ -718,52 +713,32 @@ optional local drive database (see \'\-B\' option).
 
 .\" %ENDIF NOT OS Windows
 .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
-
-The following have made large contributions to smartmontools:
-.br
-\fBCasper Dik\fP (Solaris SCSI interface)
-.br
-\fBDouglas Gilbert\fP (SCSI subsystem)
-.br
-\fBGuido Guenther\fP (Autoconf/Automake packaging)
+\fBBruce Allen\fP (project initiator),
 .br
-\fBGeoffrey Keating\fP (Darwin ATA interface)
+\fBChristian Franke\fP (project manager, Windows port and all sort of things),
 .br
-\fBEduard Martinescu\fP (FreeBSD interface)
+\fBDouglas Gilbert\fP (SCSI subsystem),
 .br
-\fBFr\['e]d\['e]ric L. W. Meunier\fP (Web site and Mailing list)
+\fBVolker Kuhlmann\fP (moderator of support and database mailing list),
 .br
-\fBGabriele Pohl\fP (Web site and Wiki, conversion from CVS to SVN)
+\fBGabriele Pohl\fP (wiki & development team support),
 .br
-\fBKeiji Sawada\fP (Solaris ATA interface)
-.br
-\fBManfred Schwarb\fP (Drive database)
-.br
-\fBSergey Svishchev\fP (NetBSD interface)
-.br
-\fBDavid Snyder and Sergey Svishchev\fP (OpenBSD interface)
+\fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki).
+
+Many other individuals have made contributions and corrections,
+see AUTHORS, ChangeLog and repository files.
+
+The first smartmontools code was derived from the smartsuite package,
+written by Michael Cornwell and Andre Hedrick.
+
+.SH REPORTING BUGS
+To submit a bug report, create a ticket in smartmontools wiki:
 .br
-\fBPhil Williams\fP (User interface and drive database)
+<\fBhttp://www.smartmontools.org/\fP>.
 .br
-\fBShengfeng Zhou\fP (Linux/FreeBSD HighPoint RocketRAID interface)
+Alternatively send the info to the smartmontools support mailing list:
 .br
-Many other individuals have made smaller contributions and corrections.
-
-The first smartmontools code was derived from the smartsuite package,
-written by Michael Cornwell, and from the previous UCSC smartsuite package.
-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. \fBhttp://ssrc.soe.ucsc.edu/\fP .
+<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>.
 
 .SH SEE ALSO
 \fBsmartd.conf\fP(5), \fBsmartctl\fP(8), \fBupdate-smart-drivedb\fP(8).
@@ -790,5 +765,7 @@ publications of the Small Form Factors (SFF) Committee.
 Links to these and other documents may be found on the Links page of the
 \fBsmartmontools\fP Wiki at \fBhttp://www.smartmontools.org/wiki/Links\fP .
 
-.SH SVN ID OF THIS PAGE
-$Id: smartd.8.in 3965 2014-07-20 14:46:41Z chrfranke $
+.SH PACKAGE VERSION
+CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
+.br
+$Id: smartd.8.in 4102 2015-06-01 19:25:47Z chrfranke $
index 5ef85b1bae0157361fdd2b19fbc47217e9c3c1b9..40fa10ec9855ae262fc15c31586da6f14bc134af 100644 (file)
@@ -2,7 +2,7 @@
 
 # Home page is: http://smartmontools.sourceforge.net
 
-# $Id: smartd.conf 3651 2012-10-18 15:11:36Z samm2 $
+# $Id: smartd.conf 4047 2015-03-22 16:16:24Z chrfranke $
 
 # smartd will re-read the configuration file if it receives a HUP
 # signal
@@ -33,21 +33,21 @@ DEVICESCAN
 # and min/max temperatures.
 #DEVICESCAN -I 194 -I 231 -I 9 -W 5
 
-# First (primary) ATA/IDE hard disk.  Monitor all attributes, enable
+# First ATA/SATA or SCSI/SAS disk.  Monitor all attributes, enable
 # automatic online data collection, automatic Attribute autosave, and
 # start a short self-test every day between 2-3am, and a long self test
 # Saturdays between 3-4am.
-#/dev/hda -a -o on -S on -s (S/../.././02|L/../../6/03)
+#/dev/sda -a -o on -S on -s (S/../.././02|L/../../6/03)
 
 # Monitor SMART status, ATA Error Log, Self-test log, and track
 # changes in all attributes except for attribute 194
-#/dev/hdb -H -l error -l selftest -t -I 194 
+#/dev/sdb -H -l error -l selftest -t -I 194
 
 # Monitor all attributes except normalized Temperature (usually 194),
 # but track Temperature changes >= 4 Celsius, report Temperatures
 # >= 45 Celsius and changes in Raw value of Reallocated_Sector_Ct (5).
 # Send mail on SMART failures or when Temperature is >= 55 Celsius.
-#/dev/hdc -a -I 194 -W 4,45,55 -R 5 -m admin@example.com
+#/dev/sdc -a -I 194 -W 4,45,55 -R 5 -m admin@example.com
 
 # An ATA disk may appear as a SCSI device to the OS. If a SCSI to
 # ATA Translation (SAT) layer is between the OS and the device then
@@ -57,7 +57,7 @@ DEVICESCAN
 
 # A very silent check.  Only report SMART health status if it fails
 # But send an email in this case
-#/dev/hdc -H -C 0 -U 0 -m admin@example.com
+#/dev/sdc -H -C 0 -U 0 -m admin@example.com
 
 # First two SCSI disks.  This will monitor everything that smartd can
 # monitor.  Start extended self-tests Wednesdays between 6-7pm and
@@ -141,5 +141,5 @@ DEVICESCAN
 # All but -d, -m and -M Directives are only implemented for ATA devices
 #
 # If the test string DEVICESCAN is the first uncommented text
-# then smartd will scan for devices /dev/hd[a-l] and /dev/sd[a-z]
+# then smartd will scan for devices.
 # DEVICESCAN may be followed by any desired Directives.
index 0acec7d17f62176b866289a1296067e317c345e8..21b031fc4467c5af0de29b5ffc680e435f9324dc 100644 (file)
@@ -1,8 +1,8 @@
 .ig
-Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
-Copyright (C) 2004-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+Copyright (C) 2002-10 Bruce Allen
+Copyright (C) 2004-15 Christian Franke
 
-$Id: smartd.conf.5.in 3965 2014-07-20 14:46:41Z chrfranke $
+$Id: smartd.conf.5.in 4103 2015-06-01 19:51:18Z 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
@@ -18,13 +18,10 @@ 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
+.TH SMARTD.CONF 5 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 \fBsmartd.conf\fP \- SMART Disk Monitoring Daemon Configuration File\fP
 
-.SH PACKAGE VERSION
-CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
-
 .SH DESCRIPTION
 .\" %IF NOT OS ALL
 .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools.
@@ -90,27 +87,17 @@ Section below!
 .nf
 .B ################################################
 .B # This is an example smartd startup config file
-.B # /usr/local/etc/smartd.conf for monitoring three
-.B # ATA disks, three SCSI disks, six ATA disks
-.B # behind two 3ware controllers, three SATA disks
-.B # directly connected to the HighPoint Rocket-
-.B # RAID controller, two SATA disks connected to
-.B # the HighPoint RocketRAID controller via a pmport
-.B # device, four SATA disks connected to an Areca
-.B # RAID controller, and one SATA disk.
+.B # /usr/local/etc/smartd.conf
 .B #
-.B # First ATA disk on two different interfaces. On
-.B # the second disk, start a long self-test every
+.B # On the second disk, start a long self-test every
 .B # Sunday between 3 and 4 am.
 .B #
-.B \ \ /dev/hda -a -m admin@example.com,root@localhost 
-.B \ \ /dev/hdc -a -I 194 -I 5 -i 12 -s L/../../7/03
+.B \ \ /dev/sda -a -m admin@example.com,root@localhost
+.B \ \ /dev/sdb -a -I 194 -I 5 -i 12 -s L/../../7/03
 .B #
-.B # SCSI disks.  Send a TEST warning email to admin on
-.B # startup.
+.B # Send a TEST warning email to admin on startup.
 .B #
-.B \ \ /dev/sda
-.B \ \ /dev/sdb -m admin@example.com -M test
+.B \ \ /dev/sdc -m admin@example.com -M test
 .B #
 .B # Strange device.  It\'s SCSI. Start a scheduled
 .B # long self test between 5 and 6 am Monday/Thursday
@@ -220,7 +207,7 @@ Section below!
 .B # and Usage Attributes, apart from Attributes
 .B # 9, 194, and 231, and shows  continued lines:
 .B #
-.B \ \ /dev/hdd\ -l\ error\ \e
+.B \ \ /dev/sdd\ -l\ error\ \e
 .B \ \ \ \ \ \ \ \ \ \ \ -l\ selftest\ \e
 .B \ \ \ \ \ \ \ \ \ \ \ -t\ \e\ \ \ \ \ \ # Attributes not tracked:
 .B \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \e\ \ # temperature
@@ -369,13 +356,17 @@ 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 usbprolific
+\- [NEW EXPERIMENTAL SMARTD FEATURE]
+this device type is for SATA disks that are behind a Prolific PL2571/2771/2773/2775
+USB to SATA bridge.
+
 .I usbsunplus
 \- this device type is for SATA disks that are behind a SunplusIT USB to SATA
 bridge.
@@ -397,15 +388,17 @@ 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
+.\" %IF OS Linux Windows Cygwin
 .I aacraid,H,L,ID
-\- [Linux only] [NEW EXPERIMENTAL SMARTD FEATURE]
+\- [Linux, Windows and Cygwin only] [NEW EXPERIMENTAL SMARTD FEATURE]
 the device consists of one or more SCSI/SAS disks connected to an AacRaid controller.
 The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk
 on the controller is monitored.
 In log files and email messages this disk will be identified as aacraid_disk_HH_LL_ID.
 Please see the \fBsmartctl\fP(8) man page for further details.
 
-.\" %ENDIF OS Linux
+.\" %ENDIF OS Linux Windows Cygwin
 .\" %IF OS FreeBSD Linux
 .I 3ware,N
 \- [FreeBSD and Linux only] the device consists of one or more ATA disks
@@ -432,8 +425,8 @@ areca_disk_XX with XX in the range from 01 to 24 inclusive.
 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 or SAS disks connected to an Areca SAS RAID controller.
+\- [FreeBSD, Linux, Windows and Cygwin only] the 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 Areca SAS controller firmware version 1.51 or later.
@@ -463,8 +456,7 @@ 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.
+\- 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.
@@ -574,8 +566,9 @@ Directive are \fIon\fP and \fIoff\fP.  Also affects SCSI devices.
 [Please see the \fBsmartctl \-S\fP command-line option.]
 .TP
 .B \-H
-[ATA only] Check the SMART health status of the disk.  If any Prefailure
-Attributes are less than or equal to their threshold values, then disk
+[ATA only] Check the health status of the disk with the SMART RETURN
+STATUS command.
+If this command reports a failing health status, then disk
 failure is predicted in less than 24 hours, and a message at loglevel
 .B \'LOG_CRIT\'
 will be logged to syslog.  [Please see the
@@ -868,7 +861,6 @@ below.
 .\" %IF ENABLE_SMARTDPLUGINDIR
 .\" %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
@@ -881,9 +873,8 @@ This is handled by the script /usr/local/etc/smartd_warning.sh
 .\" %ENDIF ENABLE_SMARTDPLUGINDIR
 .\" %IF OS Windows
 
-[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().
+[Windows only] 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
@@ -978,7 +969,7 @@ exported by \fBsmartd\fP are:
 is set to the argument of \-M exec, if present or else to \'mail\'
 (examples: /usr/local/bin/mail, mail).
 .IP \fBSMARTD_DEVICE\fP 4
-is set to the device path (examples: /dev/hda, /dev/sdb).
+is set to the device path (example: /dev/sda).
 .IP \fBSMARTD_DEVICETYPE\fP 4
 is set to the device type specified by \'-d\' directive or
 \'auto\' if none.
@@ -1082,10 +1073,6 @@ It it set to empty on \'\-M once\' and set to \'1\' on \'\-M daily\'.
 .\" They define a non-existent option; useful because man2html can't correctly reset the margins.
 .TP
 .B \&
-The shell which is used to run PATH is system-dependent. For vanilla
-Linux/glibc it\'s bash. For other systems, the man page for
-\fBpopen\fP(3) should say what shell is used.
-
 If the \'\-m ADD\' Directive is given with a normal address argument,
 then the executable pointed to by PATH will be run in a shell with
 STDIN receiving the body of the email message, and with the same
@@ -1130,7 +1117,7 @@ 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
+The executable is run by the script
 .\" %IF NOT OS Windows
 /usr/local/etc/smartd_warning.sh.
 .\" %ENDIF NOT OS Windows
@@ -1493,7 +1480,6 @@ 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
@@ -1581,5 +1567,7 @@ full path of this file.
 \fBsmartd\fP(8), \fBsmartctl\fP(8),
 \fBmail\fP(1), \fBregex\fP(7).
 
-.SH SVN ID OF THIS PAGE
-$Id: smartd.conf.5.in 3965 2014-07-20 14:46:41Z chrfranke $
+.SH PACKAGE VERSION
+CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
+.br
+$Id: smartd.conf.5.in 4103 2015-06-01 19:51:18Z chrfranke $
index 7013e60f9c294b3d2213a62734543788448bef56..98c8ca4d00d5178504f893919654cddce7765be7 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2002-11 Bruce Allen <smartmontools-support@lists.sourceforge.net>
  * Copyright (C) 2000    Michael Cornwell <cornwell@acm.org>
  * Copyright (C) 2008    Oliver Bock <brevilo@users.sourceforge.net>
- * Copyright (C) 2008-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-15 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
@@ -106,7 +106,7 @@ typedef int pid_t;
 extern "C" int getdomainname(char *, int); // no declaration in header files!
 #endif
 
-const char * smartd_cpp_cvsid = "$Id: smartd.cpp 3948 2014-07-13 16:53:30Z chrfranke $"
+const char * smartd_cpp_cvsid = "$Id: smartd.cpp 4059 2015-04-18 17:01:31Z chrfranke $"
   CONFIG_H_CVSID;
 
 // smartd exit codes
@@ -1507,7 +1507,7 @@ static void Usage()
   PrintOut(LOG_INFO,"        [default is %s]\n\n", configfile);
 #ifdef HAVE_LIBCAP_NG
   PrintOut(LOG_INFO,"  -C, --capabilities\n");
-  PrintOut(LOG_INFO,"        Use capabilities.\n"
+  PrintOut(LOG_INFO,"        Drop unneeded Linux process capabilities.\n"
                     "        Warning: Mail notification does not work when used.\n\n");
 #endif
   PrintOut(LOG_INFO,"  -d, --debug\n");
@@ -1591,7 +1591,7 @@ static int read_ata_error_count(ata_device * device, const char * name,
   }
   else {
     ata_smart_exterrlog logx;
-    if (!ataReadExtErrorLog(device, &logx, 1 /*first sector only*/, firmwarebugs)) {
+    if (!ataReadExtErrorLog(device, &logx, 0, 1 /*first sector only*/, firmwarebugs)) {
       PrintOut(LOG_INFO,"Device: %s, Read Extended Comprehensive SMART Error Log failed\n",name);
       return -1;
     }
@@ -1849,8 +1849,12 @@ static int ATADeviceScan(dev_config & cfg, dev_state & state, ata_device * atade
   if (ataEnableSmart(atadev)) {
     // Enable SMART command has failed
     PrintOut(LOG_INFO,"Device: %s, could not enable SMART capability\n",name);
-    CloseDevice(atadev, name);
-    return 2; 
+
+    if (ataIsSmartEnabled(&drive) <= 0) {
+      CloseDevice(atadev, name);
+      return 2;
+    }
+    PrintOut(LOG_INFO, "Device: %s, proceeding since SMART is already enabled\n", name);
   }
   
   // disable device attribute autosave...
@@ -4789,7 +4793,7 @@ static int ReadOrMakeConfigEntries(dev_config_vector & conf_entries, smart_devic
       PrintOut(LOG_CRIT,"In the system's table of devices NO devices found to scan\n");
   } 
   else
-    PrintOut(LOG_CRIT,"Configuration file %s parsed but has no entries (like /dev/hda)\n",configfile);
+    PrintOut(LOG_CRIT, "Configuration file %s parsed but has no entries\n", configfile);
   
   return conf_entries.size();
 }
index 24e6afc1c1b8be82c006dc431c60b7f7f6d4bf75..092791ed9dc9a594a5d45d1452f3e7713e86974d 100644 (file)
@@ -1,8 +1,8 @@
 .ig
 Copyright (C) 2013 Hannes von Haugwitz <hannes@vonhaugwitz.com>
-Copyright (C) 2014 Christian Franke <smartmontools-support@lists.sourceforge.net>
+Copyright (C) 2014-15 Christian Franke <smartmontools-support@lists.sourceforge.net>
 
-$Id: update-smart-drivedb.8.in 3961 2014-07-19 16:44:10Z chrfranke $
+$Id: update-smart-drivedb.8.in 4054 2015-04-15 19:04:49Z 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
@@ -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/>.
 
 ..
-.TH UPDATE-SMART-DRIVEDB 8 CURRENT_SVN_DATE CURRENT_SVN_VERSION CURRENT_SVN_DATE
+.TH UPDATE-SMART-DRIVEDB 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools"
 .SH NAME
 update-smart-drivedb \- update smartmontools drive database
 
@@ -22,9 +22,6 @@ update-smart-drivedb \- update smartmontools drive database
 .RB [ -v ]
 .RI [ DESTFILE ]
 
-.SH PACKAGE VERSION
-CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
-
 .SH "DESCRIPTION"
 .B update-smart-drivedb
 updates
@@ -88,17 +85,25 @@ new drive database rejected due to syntax errors.
 .B /usr/local/share/smartmontools/drivedb.h.lastcheck
 empty file created if downloaded file was identical.
 
-.SH "SEE ALSO"
-.BR smartctl (8),
-.BR smartd (8).
-
 .SH AUTHORS
-\fBChristian Franke\fP
-.br
-\fBsmartmontools\-support@lists.sourceforge.net\fP
+\fBChristian Franke\fP.
 .br
 This manual page was originally written by
 .BR "Hannes von Haugwitz <hannes@vonhaugwitz.com>" .
 
-.SH SVN ID OF THIS PAGE
-$Id: update-smart-drivedb.8.in 3961 2014-07-19 16:44:10Z chrfranke $
+.SH REPORTING BUGS
+To submit a bug report, create a ticket in smartmontools wiki:
+.br
+<\fBhttp://www.smartmontools.org/\fP>.
+.br
+Alternatively send the info to the smartmontools support mailing list:
+.br
+<\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>.
+
+.SH SEE ALSO
+\fBsmartctl\fP(8), \fBsmartd\fP(8).
+
+.SH PACKAGE VERSION
+CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV
+.br
+$Id: update-smart-drivedb.8.in 4054 2015-04-15 19:04:49Z chrfranke $
index 1bd6395b67b7c4c700cf43e09fff897e94760197..1b53a52c6521c99cff60cc6c0b73b4c0f5ff4c19 100644 (file)
@@ -2,7 +2,7 @@
 #
 # smartmontools drive database update script
 #
-# Copyright (C) 2010-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+# Copyright (C) 2010-14 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,7 +12,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: update-smart-drivedb.in 3814 2013-06-04 19:38:25Z chrfranke $
+# $Id: update-smart-drivedb.in 4019 2014-12-06 20:12:50Z chrfranke $
 #
 
 set -e
@@ -122,7 +122,7 @@ chmod 0644 "$DEST.new"
 
 # Check syntax
 rm -f "$DEST.error"
-if $SMARTCTL -B "$DEST.new" -P showall >/dev/null; then :; else
+if "$SMARTCTL" -B "$DEST.new" -P showall >/dev/null; then :; else
   mv "$DEST.new" "$DEST.error"
   echo "$DEST.error: rejected by $SMARTCTL, probably no longer compatible" >&2
   exit 1
index 09a4f1f1bb45c86afe9c0b1b37113e0533df4354..ee6aadb2f4695b5b416c79d8f60bc5662ae1a53d 100644 (file)
@@ -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-14 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-15 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
@@ -52,7 +52,7 @@
 #include "atacmds.h"
 #include "dev_interface.h"
 
-const char * utility_cpp_cvsid = "$Id: utility.cpp 3937 2014-07-05 17:51:21Z chrfranke $"
+const char * utility_cpp_cvsid = "$Id: utility.cpp 4031 2015-01-01 10:47:48Z chrfranke $"
                                  UTILITY_H_CVSID INT64_H_CVSID;
 
 const char * packet_types[] = {
@@ -90,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-14, Bruce Allen, Christian Franke, www.smartmontools.org\n",
+    "Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org\n",
     prog_name, smi()->get_os_version_str().c_str()
   );
   if (!full)
@@ -651,35 +651,15 @@ int64_t bytes = 0;
 // Helps debugging.  If the second argument is non-negative, then
 // decrement bytes by that amount.  Else decrement bytes by (one plus)
 // length of null terminated string.
-void *FreeNonZero1(void *address, int size, int line, const char* file){
+void *FreeNonZero(void *address, int size, int /*line*/, const char* /*file*/){
   if (address) {
     if (size<0)
       bytes-=1+strlen((char*)address);
     else
       bytes-=size;
-    return CheckFree1(address, line, file);
-  }
-  return NULL;
-}
-
-// To help with memory checking.  Use when it is known that address is
-// NOT null.
-void *CheckFree1(void *address, int /*whatline*/, const char* /*file*/){
-  if (address){
     free(address);
-    return NULL;
   }
-  throw std::runtime_error("Internal error in CheckFree()");
-}
-
-// A custom version of calloc() that tracks memory use
-void *Calloc(size_t nmemb, size_t size) { 
-  void *ptr=calloc(nmemb, size);
-  
-  if (ptr)
-    bytes+=nmemb*size;
-
-  return ptr;
+  return NULL;
 }
 
 // A custom version of strdup() that keeps track of how much memory is
index b172029d03436e4eaadf48d47114925e08386acc..346e0f33297a9c321d8a66e9168e7d8fc87df534 100644 (file)
--- a/utility.h
+++ b/utility.h
@@ -25,7 +25,7 @@
 #ifndef UTILITY_H_
 #define UTILITY_H_
 
-#define UTILITY_H_CVSID "$Id: utility.h 3936 2014-07-05 17:16:23Z chrfranke $"
+#define UTILITY_H_CVSID "$Id: utility.h 4028 2014-12-13 14:59:48Z chrfranke $"
 
 #include <time.h>
 #include <sys/types.h> // for regex.h (according to POSIX)
@@ -98,18 +98,6 @@ int split_report_arg(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);
 
-
-// Guess device type (ata or scsi) based on device name 
-// Guessing will now use Controller Type defines below
-
-// Moved to C++ interface
-//int guess_device_type(const char * dev_name);
-
-// Create and return the list of devices to probe automatically
-// if the DEVICESCAN option is in the smartd config file
-// Moved to C++ interface
-//int make_device_names (char ***devlist, const char* name);
-
 // Replacement for exit(status)
 // (exit is not compatible with C++ destructors)
 #define EXIT(status) { throw (int)(status); }
@@ -117,31 +105,14 @@ int split_selective_arg(char *s, uint64_t *start, uint64_t *stop, int *mode);
 
 #ifdef OLD_INTERFACE
 
-// replacement for calloc() that tracks memory usage
-void *Calloc(size_t nmemb, size_t size);
-
 // Utility function to free memory
-void *FreeNonZero1(void* address, int size, int whatline, const char* file);
-
-// Typesafe version of above
-template <class T>
-inline T * FreeNonZero(T * address, int size, int whatline, const char* file)
-  { return (T *)FreeNonZero1((void *)address, size, whatline, file); }
+void *FreeNonZero(void* address, int size, int whatline, const char* file);
 
 // A custom version of strdup() that keeps track of how much memory is
 // being allocated. If mustexist is set, it also throws an error if we
 // try to duplicate a NULL string.
 char *CustomStrDup(const char *ptr, int mustexist, int whatline, const char* file);
 
-// To help with memory checking.  Use when it is known that address is
-// NOT null.
-void *CheckFree1(void *address, int whatline, const char* file);
-
-// Typesafe version of above
-template <class T>
-inline T * CheckFree(T * address, int whatline, const char* file)
-  { return (T *)CheckFree1((void *)address, whatline, file); }
-
 #endif // OLD_INTERFACE
 
 // Compile time check of byte ordering
@@ -163,17 +134,6 @@ void check_config();
 // the ATA standard for packet devices to define the device type.
 const char *packetdevicetype(int type);
 
-// Moved to C++ interface
-//int deviceopen(const char *pathname, char *type);
-
-//int deviceclose(int fd);
-
-// Optional functions of os_*.c
-#ifdef HAVE_GET_OS_VERSION_STR
-// Return build host and OS version as static string
-//const char * get_os_version_str(void);
-#endif
-
 // returns true if any of the n bytes are nonzero, else zero.
 bool nonempty(const void * data, int size);