Hello community,
here is the log from the commit of package hdparm
checked in at Mon Jun 12 02:07:23 CEST 2006.
--------
--- hdparm/hdparm.changes 2006-05-22 20:47:31.000000000 +0200
+++ hdparm/hdparm.changes 2006-06-12 02:06:17.000000000 +0200
@@ -1,0 +2,8 @@
+Mon Jun 12 01:35:33 CEST 2006 - ro@suse.de
+
+- update to version 6.6
+ - manpage updates / corrections.
+ - fixed bug in -C code.
+ - major updates to bring -I information up to current specs.
+
+-------------------------------------------------------------------
Old:
----
hdparm-6.3.tar.bz2
New:
----
hdparm-6.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hdparm.spec ++++++
--- /var/tmp/diff_new_pack.mRSR2i/_old 2006-06-12 02:07:18.000000000 +0200
+++ /var/tmp/diff_new_pack.mRSR2i/_new 2006-06-12 02:07:18.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package hdparm (Version 6.3)
+# spec file for package hdparm (Version 6.6)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -16,8 +16,8 @@
PreReq: %insserv_prereq %fillup_prereq coreutils
Provides: base:/sbin/hdparm
Autoreqprov: on
-Version: 6.3
-Release: 13
+Version: 6.6
+Release: 1
Summary: A Program to Get and Set Hard Disk Parameters
Source: hdparm-%{version}.tar.bz2
Source1: 56-idedma.rules
@@ -102,6 +102,11 @@
/var/adm/fillup-templates/sysconfig.ide
%changelog -n hdparm
+* Mon Jun 12 2006 - ro@suse.de
+- update to version 6.6
+- manpage updates / corrections.
+- fixed bug in -C code.
+- major updates to bring -I information up to current specs.
* Mon May 22 2006 - schwab@suse.de
- Don't strip binaries.
* Wed Jan 25 2006 - mls@suse.de
++++++ hdparm-6.3.tar.bz2 -> hdparm-6.6.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-6.3/Changelog new/hdparm-6.6/Changelog
--- old/hdparm-6.3/Changelog 2005-10-18 22:20:33.000000000 +0200
+++ new/hdparm-6.6/Changelog 2006-03-08 04:16:19.000000000 +0100
@@ -1,3 +1,14 @@
+hdparm-6.6
+ - fix build for Redhat/Fedora systems.
+ - disable security commands when building on Redhat/Fedora,
+ as they lack the required data structures in the system headers.
+hdparm-6.5
+ - fix -I bugs from version 6.4.
+hdparm-6.4
+ - Makefile updates from Mikkel Krautz.
+ - manpage updates / corrections.
+ - fixed bug in -C code.
+ - major updates to bring -I information up to current specs.
hdparm-6.3
- added reporting of ATA revision numbers > 7
hdparm-6.2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-6.3/Makefile new/hdparm-6.6/Makefile
--- old/hdparm-6.3/Makefile 2005-07-15 04:21:40.000000000 +0200
+++ new/hdparm-6.6/Makefile 2005-10-29 23:43:23.000000000 +0200
@@ -4,11 +4,11 @@
DESTDIR =
binprefix = /
-manprefix = /usr
+manprefix = /usr/
exec_prefix = $(binprefix)
-sbindir = $(exec_prefix)/sbin
-mandir = $(manprefix)/share/man
-oldmandir = $(manprefix)/man
+sbindir = $(exec_prefix)sbin
+mandir = $(manprefix)share/man
+oldmandir = $(manprefix)man
ifndef CC
CC = gcc
@@ -19,6 +19,7 @@
LDFLAGS = -s
INSTALL = install
INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_DIR = $(INSTALL) -m 755 -d
INSTALL_PROGRAM = $(INSTALL)
all: hdparm
@@ -27,6 +28,10 @@
$(CC) $(LDFLAGS) -o hdparm hdparm.o identify.o
install: all hdparm.8
+ if [ ! -z $(DESTDIR) ]; then $(INSTALL_DIR) $(DESTDIR) ; fi
+ if [ ! -z $(DESTDIR)$(sbindir) ]; then $(INSTALL_DIR) $(DESTDIR)$(sbindir) ; fi
+ if [ ! -z $(DESTDIR)$(mandir) ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir) ; fi
+ if [ ! -z $(DESTDIR)$(mandir)/man8/ ]; then $(INSTALL_DIR) $(DESTDIR)$(mandir)/man8/ ; fi
if [ -f $(DESTDIR)$(sbindir)/hdparm ]; then rm -f $(DESTDIR)$(sbindir)/hdparm ; fi
if [ -f $(DESTDIR)$(mandir)/man8/hdparm.8 ]; then rm -f $(DESTDIR)$(mandir)/man8/hdparm.8 ;\
elif [ -f $(DESTDIR)$(oldmandir)/man8/hdparm.8 ]; then rm -f $(DESTDIR)$(oldmandir)/man8/hdparm.8 ; fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-6.3/hdparm.8 new/hdparm-6.6/hdparm.8
--- old/hdparm-6.3/hdparm.8 2005-10-18 22:21:13.000000000 +0200
+++ new/hdparm-6.6/hdparm.8 2006-03-08 04:15:50.000000000 +0100
@@ -1,4 +1,4 @@
-.TH HDPARM 8 "October 2005" "Version 6.3"
+.TH HDPARM 8 "March 2006" "Version 6.6"
.SH NAME
hdparm \- get/set hard disk parameters
@@ -94,6 +94,15 @@
for which DMA does not make much of a difference, or may even slow
things down (on really messed up hardware!). Your mileage may vary.
.TP
+.I --direct
+Use the kernel O_DIRECT flag when performing a
+.I -t
+timing test. This bypasses the page cache, causing the reads
+to go directly from the drive into hdparm's buffers, using so-called
+"raw" I/O. In many cases, this can produce results that appear
+much faster than the usual page cache method, giving a better indication
+of raw device and driver performance.
+.TP
.I -D
Enable/disable the on-drive defect management feature,
whereby the drive firmware tries to automatically manage
@@ -144,7 +153,7 @@
.I -i
flag.
.TP
-.I -Istdin
+.I --Istdin
This is a special "no seatbelts" variation on the
.B -I
option,
@@ -154,17 +163,17 @@
.I exactly
the same as that found in the /proc/ide/*/hd*/identify "files",
or that produced by the
-.B -Istdout
+.B --Istdout
option described below.
This variation is designed for use with collected "libraries" of drive
identification information, and can also be used on ATAPI
drives which may give media errors with the standard mechanism.
.TP
-.I -Istdout
+.I --Istdout
This option simply dumps the identify data in hex to stdout,
in a format similar to that from /proc/, and suitable for
later use with the
-.I -Istdin
+.I --Istdin
option.
.TP
.I -k
@@ -569,22 +578,10 @@
.PP
PIO data out security commands by Leonard den Ottolander
<leonard den ottolander nl>, 2005.
-Parts by Benjamin Benz .
+Parts by Benjamin Benz and others.
.SH SEE ALSO
-.B AT Attachment Interface for Disk Drives,
-ANSI ASC X3T9.2 working draft, revision 4a, April 19, 1993.
-.PP
-.B AT Attachment Interface with Extensions (ATA-2),
-ANSI ASC X3T9.2 working draft, revision 2f, July 26, 1994.
-.PP
-.B AT Attachment with Packet Interface - 5 (ATA/ATAPI-5),
-T13-1321D working draft, revision 3, February 29, 2000.
-.PP
-.B AT Attachment with Packet Interface - 6 (ATA/ATAPI-6),
-T13-1410D working draft, revision 3b, February 26, 2002.
-.PP
-.B Western Digital Enhanced IDE Implementation Guide,
-by Western Digital Corporation, revision 5.0, November 10, 1993.
+.B http://www.t13.org/
+Technical Committee T13 ATA Attachment.
.PP
-.B Enhanced Disk Drive Specification,
-by Phoenix Technologies Ltd., version 1.0, January 25, 1994.
+.B http://www.serialata.org/
+Serial ATA International Organization.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-6.3/hdparm.c new/hdparm-6.6/hdparm.c
--- old/hdparm-6.3/hdparm.c 2005-10-18 22:18:09.000000000 +0200
+++ new/hdparm-6.6/hdparm.c 2006-03-08 04:15:31.000000000 +0100
@@ -20,12 +20,13 @@
#include
#include
#include
+//#include
#include "hdparm.h"
extern const char *minor_str[];
-#define VERSION "v6.3"
+#define VERSION "v6.6"
#undef DO_FLUSHCACHE /* under construction: force cache flush on -W0 */
@@ -84,6 +85,8 @@
static unsigned long set_seagate = 0, get_seagate = 0;
static unsigned long set_standbynow = 0, get_standbynow = 0;
static unsigned long set_sleepnow = 0, get_sleepnow = 0;
+
+#ifdef IDE_DRIVE_TASK_NO_DATA
static unsigned long set_freeze = 0;
static unsigned long security_master = 1, security_mode = 0;
static unsigned long enhanced_erase = 0;
@@ -100,6 +103,8 @@
static unsigned int security_command = WIN_SECURITY_UNLOCK;
static char security_password[33];
+#endif // IDE_DRIVE_TASK_NO_DATA
+
static unsigned long get_powermode = 0;
static unsigned long set_apmmode = 0, get_apmmode= 0, apmmode = 0;
#endif
@@ -968,7 +973,7 @@
&& ioctl(fd, HDIO_DRIVE_CMD, &args2))
perror(" HDIO_DRIVE_CMD(sleep) failed");
}
-#ifdef WIN_SECURITY_FREEZE_LOCK
+#if defined(WIN_SECURITY_FREEZE_LOCK) && defined(IDE_DRIVE_TASK_NO_DATA)
if (set_security) {
#ifndef TASKFILE_OUT
#define TASKFILE_OUT 4
@@ -1088,7 +1093,7 @@
if (ioctl(fd, HDIO_DRIVE_CMD, &args))
perror(" HDIO_DRIVE_CMD(freeze) failed");
}
-#endif /* WIN_SECURITY_FREEZE_LOCK */
+#endif // defined(WIN_SECURITY_FREEZE_LOCK) && defined(IDE_DRIVE_TASK_NO_DATA)
if (set_seagate) {
unsigned char args[4] = {0xfb,0,0,0};
if (get_seagate)
@@ -1232,7 +1237,7 @@
unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0};
const char *state;
if (ioctl(fd, HDIO_DRIVE_CMD, &args)
- && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
+ && (args[0] == WIN_CHECKPOWERMODE2) /* try again with 0x98 */
&& ioctl(fd, HDIO_DRIVE_CMD, &args)) {
if (errno != EIO || args[0] != 0 || args[1] != 0)
state = "unknown";
@@ -1274,7 +1279,7 @@
}
if (get_IDentity) {
__u16 *id;
- unsigned char args[4+512] = {WIN_IDENTIFY,0,0,1,};
+ unsigned char args[4+512] = {WIN_IDENTIFY,0,0,1,}; // FIXME?
unsigned i;
if (ioctl(fd, HDIO_DRIVE_CMD, &args)) {
args[0] = WIN_PIDENTIFY;
@@ -1456,14 +1461,16 @@
" -Z disable Seagate auto-powersaving mode\n"
" -z re-read partition table\n"
#endif
-#ifdef WIN_SECURITY_FREEZE_LOCK
+#if defined(WIN_SECURITY_FREEZE_LOCK) && defined(IDE_DRIVE_TASK_NO_DATA)
" --security-help display help for ATA security commands\n"
+#else
+ " (ATA security commands were unavailable at build time)\n"
#endif
"\n");
exit(ret);
}
-#ifdef WIN_SECURITY_FREEZE_LOCK
+#if defined(WIN_SECURITY_FREEZE_LOCK) && defined(IDE_DRIVE_TASK_NO_DATA)
static void security_help (void)
{
printf("\n"
@@ -1943,7 +1950,7 @@
case 'h':
usage_error(0);
break;
-#ifdef WIN_SECURITY_FREEZE_LOCK
+#if defined(WIN_SECURITY_FREEZE_LOCK) && defined(IDE_DRIVE_TASK_NO_DATA)
case '-':
p1 = p; //Save Switch-String
while (isgraph(*p))
@@ -1998,7 +2005,7 @@
usage_error(1);
}
break;
-#endif
+#endif // defined(WIN_SECURITY_FREEZE_LOCK) && defined(IDE_DRIVE_TASK_NO_DATA)
default:
usage_error(1);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-6.3/hdparm.lsm new/hdparm-6.6/hdparm.lsm
--- old/hdparm-6.3/hdparm.lsm 2005-10-18 22:20:03.000000000 +0200
+++ new/hdparm-6.6/hdparm.lsm 2006-03-08 04:18:03.000000000 +0100
@@ -1,8 +1,11 @@
Begin4
Title: hdparm
-Version: 6.3
-Entered-date: 2005-10-18
+Version: 6.6
+Entered-date: 2006-03-07
Description: hdparm - get/set hard disk parameters for Linux IDE drives.
+ v6.6 fix build on Redhat/Fedora
+ v6.5 fix -I bugs introduced in v6.4
+ v6.4 major update for -I, bug fix for -C
v6.3 report ATA revisions > 7
v6.2 major rework of ATA Security Commands
v6.1 bug fix for BLKGETSIZE
@@ -47,8 +50,9 @@
Keywords: ide eide ata atapi performance kernel cd cdrom disk device driver
Author: mlord@pobox.com (Mark Lord)
Maintained-by: mlord@pobox.com (Mark Lord)
-Primary-site: http://www.ibiblio.org/pub/Linux/system/hardware
- 44K hdparm-6.3.tar.gz
+Primary-site: http://sourceforge.net/projects/hdparm/
+Alternate-site: http://www.ibiblio.org/pub/Linux/system/hardware
+ 46K hdparm-6.6.tar.gz
1K hdparm.lsm
Platforms: Linux, kernels 2.2 through 2.6
Copying-policy: BSD License
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hdparm-6.3/identify.c new/hdparm-6.6/identify.c
--- old/hdparm-6.3/identify.c 2005-10-18 22:14:35.000000000 +0200
+++ new/hdparm-6.6/identify.c 2006-03-01 02:17:28.000000000 +0100
@@ -65,6 +65,10 @@
#define CDR_MAJOR 73 /* CD ROM: major version number */
#define CDR_MINOR 74 /* CD ROM: minor version number */
#define QUEUE_DEPTH 75 /* queue depth */
+#define SATA_CAP_0 76 /* Serial ATA Capabilities */
+#define SATA_RESERVED_77 77 /* reserved for future Serial ATA definition */
+#define SATA_SUPP_0 78 /* Serial ATA features supported */
+#define SATA_EN_0 79 /* Serial ATA features enabled */
#define MAJOR 80 /* major version number */
#define MINOR 81 /* minor version number */
#define CMDS_SUPP_0 82 /* command/feature set(s) supported */
@@ -86,6 +90,8 @@
#define LBA_MID 101 /* bits are used, but addr 103 */
#define LBA_48_MSB 102 /* has been reserved for LBA in */
#define LBA_64_MSB 103 /* the future. */
+#define CMDS_SUPP_3 119
+#define CMDS_EN_3 120
#define RM_STAT 127 /* removable media status notification feature set support */
#define SECU_STATUS 128 /* security status */
#define CFA_PWR_MODE 160 /* CFA power mode 1 */
@@ -93,6 +99,8 @@
#define LENGTH_MEDIA 20 /* 20 words (40 bytes or characters)*/
#define START_MANUF 196 /* media manufacturer I.D. */
#define LENGTH_MANUF 10 /* 10 words (20 bytes or characters) */
+#define TRANSPORT_MAJOR 222 /* PATA vs. SATA etc.. */
+#define TRANSPORT_MINOR 223 /* minor revision number */
#define INTEGRITY 255 /* integrity word */
/* bit definitions within the words */
@@ -231,8 +239,8 @@
/* NOVAL_0 or NOVAL_1 means device does not report version */
/* word 81: minor version number */
-#define MINOR_MAX 0x1f
-const char *minor_str[] = { /* word 81 value: */
+#define MINOR_MAX 0x22
+const char *minor_str[MINOR_MAX+2] = { /* word 81 value: */
"Unspecified", /* 0x0000 */
"ATA-1 X3T9.2 781D prior to revision 4", /* 0x0001 */
"ATA-1 published, ANSI X3.221-1994", /* 0x0002 */
@@ -251,22 +259,26 @@
"ATA/ATAPI-4 X3T13 1153D revision 7", /* 0x000f */
"ATA/ATAPI-4 T13 1153D revision 18", /* 0x0010 */
"ATA/ATAPI-4 T13 1153D revision 15", /* 0x0011 */
- "ATA/ATAPI-4 published, ANSI NCITS 317-1998", /* 0x0012 */
+ "ATA/ATAPI-4 published, ANSI INCITS 317-1998", /* 0x0012 */
"ATA/ATAPI-5 T13 1321D revision 3",
"ATA/ATAPI-4 T13 1153D revision 14", /* 0x0014 */
"ATA/ATAPI-5 T13 1321D revision 1", /* 0x0015 */
- "ATA/ATAPI-5 published, ANSI NCITS 340-2000", /* 0x0016 */
+ "ATA/ATAPI-5 published, ANSI INCITS 340-2000", /* 0x0016 */
"ATA/ATAPI-4 T13 1153D revision 17", /* 0x0017 */
"ATA/ATAPI-6 T13 1410D revision 0", /* 0x0018 */
"ATA/ATAPI-6 T13 1410D revision 3a", /* 0x0019 */
- "Reserved", /* 0x001a */
+ "ATA/ATAPI-7 T13 1532D revision 1", /* 0x001a */
"ATA/ATAPI-6 T13 1410D revision 2", /* 0x001b */
"ATA/ATAPI-6 T13 1410D revision 1", /* 0x001c */
- "Reserved" /* 0x001d */
- "Reserved" /* 0x001e */
- "Reserved" /* 0x001f-0xfffe*/
+ "ATA/ATAPI-7 published, ANSI INCITS 397-2005", /* 0x001d */
+ "ATA/ATAPI-7 T13 1532D revision 0", /* 0x001e */
+ "Reserved" /* 0x001f */
+ "Reserved" /* 0x0020 */
+ "ATA/ATAPI-7 T13 1532D revision 4a", /* 0x0021 */
+ "ATA/ATAPI-6 published, ANSI INCITS 361-2002", /* 0x0022 */
+ "Reserved" /* 0x0023-0xfffe*/
};
-const char actual_ver[] = {
+const char actual_ver[MINOR_MAX+2] = {
/* word 81 value: */
0, /* 0x0000 WARNING: */
1, /* 0x0001 WARNING: */
@@ -294,74 +306,137 @@
4, /* 0x0017 WARNING: */
6, /* 0x0018 WARNING: */
6, /* 0x0019 WARNING: */
- 0, /* 0x001a WARNING: */
+ 7, /* 0x001a WARNING: */
6, /* 0x001b WARNING: */
6, /* 0x001c WARNING: */
- 0, /* 0x001d WARNING: */
- 0, /* 0x001e WARNING: */
- 0 /* 0x001f-0xfffe */
+ 7, /* 0x001d WARNING: */
+ 7, /* 0x001e WARNING: */
+ 0, /* 0x001f WARNING: */
+ 0, /* 0x0020 WARNING: */
+ 7, /* 0x0021 WARNING: */
+ 6, /* 0x0022 WARNING: */
+ 0 /* 0x0023-0xfffe */
};
/* words 82-84: cmds/feats supported */
#define CMDS_W82 0x77ff /* word 82: defined command locations*/
#define CMDS_W83 0x3fff /* word 83: defined command locations*/
-#define CMDS_W84 0x002f /* word 83: defined command locations*/
+#define CMDS_W84 0x27ff /* word 84: defined command locations*/
#define SUPPORT_48_BIT 0x0400
#define NUM_CMD_FEAT_STR 48
-const char *cmd_feat_str[] = {
- "", /* word 82 bit 15: obsolete */
- "NOP cmd", /* word 82 bit 14 */
- "READ BUFFER cmd", /* word 82 bit 13 */
- "WRITE BUFFER cmd", /* word 82 bit 12 */
- "", /* word 82 bit 11: obsolete */
- "Host Protected Area feature set", /* word 82 bit 10 */
- "DEVICE RESET cmd", /* word 82 bit 9 */
- "SERVICE interrupt", /* word 82 bit 8 */
- "Release interrupt", /* word 82 bit 7 */
- "Look-ahead", /* word 82 bit 6 */
- "Write cache", /* word 82 bit 5 */
- "PACKET command feature set", /* word 82 bit 4 */
- "Power Management feature set", /* word 82 bit 3 */
- "Removable Media feature set", /* word 82 bit 2 */
- "Security Mode feature set", /* word 82 bit 1 */
- "SMART feature set", /* word 82 bit 0 */
- /* --------------*/
- "", /* word 83 bit 15: !valid bit */
- "", /* word 83 bit 14: valid bit */
- "FLUSH CACHE EXT command", /* word 83 bit 13 */
- "Mandatory FLUSH CACHE command ", /* word 83 bit 12 */
- "Device Configuration Overlay feature set ",
- "48-bit Address feature set ", /* word 83 bit 10 */
- "Automatic Acoustic Management feature set ",
- "SET MAX security extension", /* word 83 bit 8 */
- "Address Offset Reserved Area Boot", /* word 83 bit 7 */
- "SET FEATURES subcommand required to spinup after power up",
- "Power-Up In Standby feature set", /* word 83 bit 5 */
- "Removable Media Status Notification feature set",
- "Advanced Power Management feature set",/* word 83 bit 3 */
- "CFA feature set", /* word 83 bit 2 */
- "READ/WRITE DMA QUEUED", /* word 83 bit 1 */
- "DOWNLOAD MICROCODE cmd", /* word 83 bit 0 */
- /* --------------*/
- "", /* word 84 bit 15: !valid bit */
- "", /* word 84 bit 14: valid bit */
- "", /* word 84 bit 13: reserved */
- "", /* word 84 bit 12: reserved */
- "", /* word 84 bit 11: reserved */
- "", /* word 84 bit 10: reserved */
- "", /* word 84 bit 9: reserved */
- "", /* word 84 bit 8: reserved */
- "", /* word 84 bit 7: reserved */
- "", /* word 84 bit 6: reserved */
- "General Purpose Logging feature set", /* word 84 bit 5 */
- "", /* word 84 bit 4: reserved */
- "Media Card Pass Through Command feature set ",
- "Media serial number ", /* word 84 bit 2 */
- "SMART self-test ", /* word 84 bit 1 */
- "SMART error logging " /* word 84 bit 0 */
+static const char unknown[8] = "obsolete";
+//static const char unknown[8] = "unknown";
+#define unknown "unknown-"
+
+static const char *feat_0_str[16] = {
+ "obsolete 82[15]", /* word 82 bit 15: obsolete */
+ "NOP cmd", /* word 82 bit 14 */
+ "READ_BUFFER command", /* word 82 bit 13 */
+ "WRITE_BUFFER command", /* word 82 bit 12 */
+ "WRITE_VERIFY command", /* word 82 bit 11: obsolete */
+ "Host Protected Area feature set", /* word 82 bit 10 */
+ "DEVICE_RESET command", /* word 82 bit 9 */
+ "SERVICE interrupt", /* word 82 bit 8 */
+ "Release interrupt", /* word 82 bit 7 */
+ "Look-ahead", /* word 82 bit 6 */
+ "Write cache", /* word 82 bit 5 */
+ "PACKET command feature set", /* word 82 bit 4 */
+ "Power Management feature set", /* word 82 bit 3 */
+ "Removable Media feature set", /* word 82 bit 2 */
+ "Security Mode feature set", /* word 82 bit 1 */
+ "SMART feature set" /* word 82 bit 0 */
+};
+static const char *feat_1_str[16] = {
+ NULL, /* word 83 bit 15: !valid bit */
+ NULL, /* word 83 bit 14: valid bit */
+ "FLUSH_CACHE_EXT", /* word 83 bit 13 */
+ "Mandatory FLUSH_CACHE", /* word 83 bit 12 */
+ "Device Configuration Overlay feature set", /* word 83 bit 11 */
+ "48-bit Address feature set", /* word 83 bit 10 */
+ "Automatic Acoustic Management feature set", /* word 83 bit 9 */
+ "SET_MAX security extension", /* word 83 bit 8 */
+ "Address Offset Reserved Area Boot", /* word 83 bit 7 */
+ "SET_FEATURES required to spinup after power up",/* word 83 bit 6 */
+ "Power-Up In Standby feature set", /* word 83 bit 5 */
+ "Removable Media Status Notification feature set",/* word 83 bit 4 */
+ "Advanced Power Management feature set", /* word 83 bit 3 */
+ "CFA feature set", /* word 83 bit 2 */
+ "READ/WRITE_DMA_QUEUED", /* word 83 bit 1 */
+ "DOWNLOAD_MICROCODE" /* word 83 bit 0 */
+};
+static const char *feat_2_str[16] = {
+ NULL, /* word 84 bit 15: !valid bit */
+ NULL, /* word 84 bit 14: valid bit */
+ "IDLE_IMMEDIATE with UNLOAD", /* word 84 bit 13 */
+ "unknown 84[12]", /* word 84 bit 12 */
+ "unknown 84[11]", /* word 84 bit 11 */
+ "URG for WRITE_STREAM[_DMA]_EXT", /* word 84 bit 10 */
+ "URG for READ_STREAM[_DMA]_EXT", /* word 84 bit 9 */
+ "64-bit World wide name", /* word 84 bit 8 */
+ "WRITE_DMA_QUEUED_FUA_EXT", /* word 84 bit 7 */
+ "WRITE_{DMA|MULTIPLE}_FUA_EXT", /* word 84 bit 6 */
+ "General Purpose Logging feature set", /* word 84 bit 5 */
+ "Media Card Pass-Through", /* word 84 bit 4 */
+ "Media Card Pass Through Command feature set", /* word 84 bit 3 */
+ "Media serial number", /* word 84 bit 2 */
+ "SMART self-test", /* word 84 bit 1 */
+ "SMART error logging" /* word 84 bit 0 */
+};
+static const char *feat_3_str[16] = {
+ NULL, /* word 119 bit 15: !valid bit */
+ NULL, /* word 119 bit 14: valid bit */
+ "unknown 119[13]", /* word 119 bit 13 */
+ "unknown 119[12]", /* word 119 bit 12 */
+ "unknown 119[11]", /* word 119 bit 11 */
+ "unknown 119[10]", /* word 119 bit 10 */
+ "unknown 119[9]", /* word 119 bit 9 */
+ "unknown 119[8]", /* word 119 bit 8 */
+ "unknown 119[7]", /* word 119 bit 7 */
+ "unknown 119[6]", /* word 119 bit 6 */
+ "unknown 119[5]", /* word 119 bit 5 */
+ "Segmented DOWNLOAD_MICROCODE", /* word 119 bit 4 */
+ "{READ,WRITE}_DMA_EXT_GPL commands", /* word 119 bit 3 */
+ "WRITE_UNCORRECTABLE command", /* word 119 bit 2 */
+ "Write-Read-Verify feature set", /* word 119 bit 1 */
+ "unknown 119[0]" /* word 119 bit 0: reserved for DT2014 */
+};
+static const char *cap_sata0_str[16] = {
+ "unknown 76[15]", /* word 76 bit 15 */
+ "unknown 76[14]", /* word 76 bit 14 */
+ "unknown 76[13]", /* word 76 bit 13 */
+ "unknown 76[12]", /* word 76 bit 12 */
+ "unknown 76[11]", /* word 76 bit 11 */
+ "Phy event counters", /* word 76 bit 10 */
+ "Host-initiated interface power management", /* word 76 bit 9 */
+ "Native Command Queueing (NCQ)", /* word 76 bit 8 */
+ "unknown 76[7]", /* word 76 bit 7 */
+ "unknown 76[6]", /* word 76 bit 6 */
+ "unknown 76[5]", /* word 76 bit 5 */
+ "unknown 76[4]", /* word 76 bit 4 */
+ "unknown 76[3]", /* word 76 bit 3 */
+ "SATA-II signaling speed (3.0Gb/s)", /* word 76 bit 2 */
+ "SATA-I signaling speed (1.5Gb/s)", /* word 76 bit 1 */
+ "unknown 76[0]" /* word 76 bit 0 */
+};
+static const char *feat_sata0_str[16] = {
+ "unknown 78[15]", /* word 78 bit 15 */
+ "unknown 78[14]", /* word 78 bit 14 */
+ "unknown 78[13]", /* word 78 bit 13 */
+ "unknown 78[12]", /* word 78 bit 12 */
+ "unknown 78[11]", /* word 78 bit 11 */
+ "unknown 78[10]", /* word 78 bit 10 */
+ "unknown 78[9]", /* word 78 bit 9 */
+ "unknown 78[8]", /* word 78 bit 8 */
+ "unknown 78[7]", /* word 78 bit 7 */
+ "Software settings preservation", /* word 78 bit 6 */
+ "unknown 78[5]", /* word 78 bit 5 */
+ "In-order data delivery", /* word 78 bit 4 */
+ "Device-initiated interface power management", /* word 78 bit 3 */
+ "DMA Setup Auto-Activate optimization", /* word 78 bit 2 */
+ "Non-Zero buffer offsets in DMA Setup FIS", /* word 78 bit 1 */
+ "unknown 78[0]" /* word 78 bit 0 */
};
-
/* words 85-87: cmds/feats enabled */
/* use cmd_feat_str[] to display what commands and features have
@@ -411,6 +486,78 @@
__u8 mode_loop(__u16 mode_sup, __u16 mode_sel, int cc, __u8 *have_mode);
void print_ascii(__u16 *p, __u8 length);
+// Given a known-supported ATA major revision,
+// return the lowest possible supported ATA revision.
+// Each new revision seems to (sometimes) obsolete one
+// of the bits corresponding to an older revision.
+static __u16 min_ata_std (__u16 major)
+{
+ if (major <= 4) // up to ata4, no obsolete bits
+ return 1;
+ if (major == 5) // ata5 obsoleted the ata1 bit
+ return 2;
+ if (major <= 7) // ata6,7 obsoleted the ata2 bit
+ return 3;
+ return 4; // ata8 obsoleted the ata3 bit
+}
+
+static void print_features (__u16 supported, __u16 enabled, const char *names[])
+{
+ int i;
+ for (i = 0; i < 16; ++i) {
+ __u16 mask = 1 << i;
+ if ((supported & mask) && names[15 - i])
+ printf("\t %c\t%s\n", (enabled & mask) ? '*' : ' ', names[15 - i]);
+ }
+}
+
+static int print_transport_type(__u16 major, __u16 minor)
+{
+ unsigned int ttype, subtype, transport = 0;
+
+ if (major == 0x0000 || major == 0xffff)
+ return transport;
+ printf("Transport: ");
+ ttype = major >> 12;
+ subtype = major & 0xfff;
+ transport = ttype;
+ switch (ttype) {
+ case 0:
+ printf("Parallel");
+ if (subtype & 1)
+ printf(", ATA8-APT");
+ break;
+ case 1:
+ printf("Serial");
+ if (subtype & 0xf) {
+ if (subtype & 1)
+ printf(", ATA8-AST");
+ if (subtype & 2)
+ printf(", SATA 1.0a");
+ if (subtype & 4)
+ printf(", SATA II Extensions");
+ if (subtype & 8)
+ printf(", SATA Rev 2.5");
+ }
+ break;
+ default:
+ printf("0x%04x", major);
+ break;
+ }
+ if (minor != 0x0000 && minor != 0xffff) {
+ printf("; Revision: ");
+ switch (minor) {
+ case 0x21:
+ printf("ATA8-AST T13 Project D1697 Revision 0b");
+ break;
+ default:
+ printf("0x%04x", minor);
+ }
+ }
+ putchar('\n');
+ return transport;
+}
+
/* our main() routine: */
void identify (__u16 *id_supplied, const char *devname)
{
@@ -424,6 +571,7 @@
__u8 chksum = 0;
__u32 ll, mm, nn;
__u64 bb, bbbig; /* (:) */
+ int transport;
if (id_supplied) {
memcpy(val, id_supplied, sizeof(val));
@@ -455,6 +603,7 @@
/* check if we recognise the device type */
printf("\n");
+
if(!(val[GEN_CONFIG] & NOT_ATA)) {
dev = ATA_DEV;
printf("ATA device, with ");
@@ -515,37 +664,44 @@
print_ascii(&val[START_MANUF], LENGTH_MANUF);
}
+ transport = print_transport_type(val[TRANSPORT_MAJOR], val[TRANSPORT_MINOR]);
+
/* major & minor standards version number (Note: these words were not
* defined until ATA-3 & the CDROM std uses different words.) */
printf("Standards:");
if(eqpt != CDROM) {
- if(val[MINOR] && (val[MINOR] <= MINOR_MAX)){
- if(like_std < 3) like_std = 3;
+ //printf("major=%04x minor=%04x\n", val[MAJOR], val[MINOR]);
+ if(val[MINOR] && (val[MINOR] <= MINOR_MAX)) {
+ if(like_std < 3)
+ like_std = 3;
std = actual_ver[val[MINOR]];
- if(std) {
- printf("\n\tUsed: ");
- printf("%s ",minor_str[val[MINOR]]);
- }
+ if (std)
+ printf("\n\tUsed: %s ",minor_str[val[MINOR]]);
+ } else if (val[MINOR] == 0x107) {
+ std = 8;
+ printf("\n\tUsed: %s ", "ATA8-ACS revision 2d");
}
/* looks like when they up-issue the std, they obsolete one;
- * thus, only the newest 4 issues need be supported. (That's
- * what "kk" and "min_std" are all about.) */
- if(val[MAJOR] && (val[MAJOR] !=NOVAL_1)) {
+ * thus, only the newest 4 issues need be supported.
+ * (That's what "kk" and "min_std" are all about) */
+ if(val[MAJOR] && (val[MAJOR] != NOVAL_1)) {
printf("\n\tSupported: ");
jj = val[MAJOR] << 1;
- kk = like_std >4 ? like_std-4: 0;
- for(ii = 14; (ii >0)&&(ii>kk); ii--) {
+ kk = min_ata_std(like_std);
+ for(ii = 14; ii > kk; ii--) {
if(jj & 0x8000) {
printf("%u ", ii);
- if(like_std < ii) {
+ if (ii > like_std) {
like_std = ii;
- kk = like_std >4 ? like_std-4: 0;
+ kk = min_ata_std(like_std);
}
- if(min_std > ii) min_std = ii;
+ if (min_std > ii)
+ min_std = ii;
}
jj <<= 1;
}
- if(like_std < 3) like_std = 3;
+ if(like_std < 3)
+ like_std = 3;
}
/* Figure out what standard the device is using if it hasn't told
* us. If we know the std, check if the device is using any of
@@ -592,7 +748,7 @@
kk = 1;
printf("\n\tUsed: ATAPI for CD-ROMs, SFF-8020i, r2.5");
}
- if(val[CDR_MAJOR] && (val[CDR_MAJOR] !=NOVAL_1)) {
+ if(val[CDR_MAJOR] && (val[CDR_MAJOR] != NOVAL_1)) {
kk = 1;
printf("\n\tSupported: CD-ROM ATAPI");
jj = val[CDR_MAJOR] >> 1;
@@ -609,7 +765,8 @@
like_std = 2;
}
- if(min_std == 0xffff) min_std = like_std > 4 ? like_std - 3 : 1;
+ if(min_std == 0xffff)
+ min_std = like_std > 4 ? like_std - 3 : 1;
printf("Configuration:\n");
/* more info from the general configuration word */
@@ -728,8 +885,18 @@
jj = 1;
}
if((eqpt != CDROM) && (like_std > 3)) {
- printf("\tQueue depth: %u",(val[QUEUE_DEPTH] & DEPTH_BITS)+1);
- jj = 1;
+ int has_queuing = 0;
+ if (transport == 1 || (val[SATA_CAP_0] && val[SATA_CAP_0] != 0xffff)) {
+ if (val[SATA_CAP_0] & 0x0100)
+ has_queuing = 1; // SATA NCQ
+ }
+ if ((val[CMDS_SUPP_1] & VALID) == VALID_VAL && val[CMDS_SUPP_1] & 2) {
+ has_queuing = 1; // TCQ
+ }
+ if (has_queuing) {
+ printf("\tQueue depth: %u",(val[QUEUE_DEPTH] & DEPTH_BITS)+1);
+ jj = 1;
+ }
}
if(jj) printf("\n");
if(dev == ATA_DEV) {
@@ -857,28 +1024,25 @@
if((val[CMDS_SUPP_1] & VALID) == VALID_VAL){
printf("Commands/features:\n\tEnabled\tSupported:\n");
- jj = val[CMDS_SUPP_0];
- kk = val[CMDS_EN_0];
- for(ii = 0; ii < NUM_CMD_FEAT_STR; ii++) {
- if((jj & 0x8000) && (*cmd_feat_str[ii] != '\0')) {
- if(kk & 0x8000) printf("\t *");
- else printf("\t");
- printf("\t%s\n",cmd_feat_str[ii]);
- }
- jj <<=1; kk<<=1;
- if(ii%16 == 15) {
- jj = val[CMDS_SUPP_0+1+(ii/16)];
- kk = val[CMDS_EN_0+1+(ii/16)];
- }
- if(ii == 31) {
- if((val[CMDS_SUPP_2] & VALID) != VALID_VAL) ii +=16;
- }
- }
+ print_features(val[CMDS_SUPP_0] & 0x7fff, val[CMDS_EN_0], feat_0_str);
+ if( (val[CMDS_SUPP_1] & VALID) == VALID_VAL)
+ print_features(val[CMDS_SUPP_1] & 0x3fff, val[CMDS_EN_1], feat_1_str);
+ if( (val[CMDS_SUPP_2] & VALID) == VALID_VAL
+ && (val[CMDS_EN_2] & VALID) == VALID_VAL)
+ print_features(val[CMDS_SUPP_2] & 0x3fff, val[CMDS_EN_2], feat_2_str);
+ if( (val[CMDS_SUPP_1] & VALID) == VALID_VAL
+ && (val[CMDS_EN_1] & 0x8000) == 0x8000
+ && (val[CMDS_SUPP_3] & VALID) == VALID_VAL
+ && (val[CMDS_EN_3] & VALID) == VALID_VAL)
+ print_features(val[CMDS_SUPP_3] & 0x3fff, val[CMDS_EN_3], feat_3_str);
+ if (transport == 1 || (val[SATA_CAP_0] && val[SATA_CAP_0] != 0xffff))
+ print_features(val[SATA_CAP_0], val[SATA_CAP_0], cap_sata0_str);
+ if (transport == 1 || (val[SATA_SUPP_0] && val[SATA_SUPP_0] != 0xffff))
+ print_features(val[SATA_SUPP_0], val[SATA_EN_0], feat_sata0_str);
}
if((val[RM_STAT] & RM_STAT_BITS) == RM_STAT_SUP)
printf("\tRemovable Media Status Notification feature set supported\n");
-
-
+
/* security */
if((eqpt != CDROM) && (like_std > 3) &&
(val[SECU_STATUS] || val[ERASE_TIME] || val[ENH_ERASE_TIME])) {
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit-help@opensuse.org