Remove 'scsiata.h'.

git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@2861 4ea69e1a-61f1-4043-bf83-b5c94c648137
pull/1/merge
chrfranke 13 years ago
parent 9db1ecebb3
commit 9153c8c6c8
  1. 3
      smartmontools/CHANGELOG
  2. 1
      smartmontools/Doxyfile
  3. 2
      smartmontools/Makefile.am
  4. 3
      smartmontools/atacmds.cpp
  5. 4
      smartmontools/os_win32/smartctl_vc8.vcproj
  6. 4
      smartmontools/os_win32/smartd_vc8.vcproj
  7. 49
      smartmontools/scsiata.cpp
  8. 79
      smartmontools/scsiata.h
  9. 5
      smartmontools/scsiprint.cpp
  10. 1
      smartmontools/smartd.cpp

@ -42,6 +42,9 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Remove 'scsiata.h'. The 'scsiata.cpp' module now implements
parts of 'dev_interface.h'.
[CF] smartctl: Don't report an attribute as failed if threshold is 0.
[CF] Print only one warning on checksum errors in multi sector log.

@ -84,7 +84,6 @@ INPUT =
INPUT_ENCODING = UTF-8
FILE_PATTERNS = dev*.h \
dev*.cpp \
scsiata.h \
scsiata.cpp
RECURSIVE = NO
EXCLUDE =

@ -39,7 +39,6 @@ smartd_SOURCES = smartd.cpp \
scsicmds.cpp \
scsicmds.h \
scsiata.cpp \
scsiata.h \
utility.cpp \
utility.h
@ -109,7 +108,6 @@ smartctl_SOURCES= smartctl.cpp \
scsicmds.cpp \
scsicmds.h \
scsiata.cpp \
scsiata.h \
scsiprint.cpp \
scsiprint.h \
utility.cpp \

@ -33,13 +33,10 @@
#include "config.h"
#include "int64.h"
#include "atacmds.h"
#include "scsiata.h"
#include "extern.h"
#include "utility.h"
#include "dev_ata_cmd_set.h" // for parsed_ata_device
#include <algorithm> // std::sort
const char * atacmds_cpp_cvsid = "$Id$"
ATACMDS_H_CVSID;

@ -945,10 +945,6 @@
RelativePath="..\scsiata.cpp"
>
</File>
<File
RelativePath="..\scsiata.h"
>
</File>
<File
RelativePath="..\scsicmds.cpp"
>

@ -865,10 +865,6 @@
RelativePath="..\scsiata.cpp"
>
</File>
<File
RelativePath="..\scsiata.h"
>
</File>
<File
RelativePath="..\scsicmds.cpp"
>

@ -44,22 +44,57 @@
#include "int64.h"
#include "extern.h"
#include "scsicmds.h"
#include "scsiata.h"
#include "atacmds.h" // ataReadHDIdentity()
#include "utility.h"
#include "dev_interface.h"
#include "dev_ata_cmd_set.h" // ata_device_with_command_set
#include "dev_tunnelled.h" // tunnelled_device<>
const char * scsiata_cpp_cvsid = "$Id$"
SCSIATA_H_CVSID;
const char * scsiata_cpp_cvsid = "$Id$";
/* for passing global control variables */
extern smartmonctrl *con;
/* This is a slightly stretched SCSI sense "descriptor" format header.
The addition is to allow the 0x70 and 0x71 response codes. The idea
is to place the salient data of both "fixed" and "descriptor" sense
format into one structure to ease application processing.
The original sense buffer should be kept around for those cases
in which more information is required (e.g. the LBA of a MEDIUM ERROR). */
struct sg_scsi_sense_hdr {
unsigned char response_code; /* permit: 0x0, 0x70, 0x71, 0x72, 0x73 */
unsigned char sense_key;
unsigned char asc;
unsigned char ascq;
unsigned char byte4;
unsigned char byte5;
unsigned char byte6;
unsigned char additional_length;
};
/* Maps the salient data from a sense buffer which is in either fixed or
descriptor format into a structure mimicking a descriptor format
header (i.e. the first 8 bytes of sense descriptor format).
If zero response code returns 0. Otherwise returns 1 and if 'sshp' is
non-NULL then zero all fields and then set the appropriate fields in
that structure. sshp::additional_length is always 0 for response
codes 0x70 and 0x71 (fixed format). */
static int sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
struct sg_scsi_sense_hdr * sshp);
/* Attempt to find the first SCSI sense data descriptor that matches the
given 'desc_type'. If found return pointer to start of sense data
descriptor; otherwise (including fixed format sense data) returns NULL. */
static const unsigned char * sg_scsi_sense_desc_find(const unsigned char * sensep,
int sense_len, int desc_type);
#define SAT_ATA_PASSTHROUGH_12LEN 12
#define SAT_ATA_PASSTHROUGH_16LEN 16
#define DEF_SAT_ATA_PASSTHRU_SIZE 16
#define ATA_RETURN_DESCRIPTOR 9
namespace sat { // no need to publish anything, name provided for Doxygen
/// SAT support.
@ -397,8 +432,8 @@ static bool has_sat_pass_through(ata_device * dev, bool packet_interface = false
/* Next two functions are borrowed from sg_lib.c in the sg3_utils
package. Same copyrght owner, same license as this file. */
int sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
struct sg_scsi_sense_hdr * sshp)
static int sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
struct sg_scsi_sense_hdr * sshp)
{
if (sshp)
memset(sshp, 0, sizeof(struct sg_scsi_sense_hdr));
@ -432,8 +467,8 @@ int sg_scsi_normalize_sense(const unsigned char * sensep, int sb_len,
}
const unsigned char * sg_scsi_sense_desc_find(const unsigned char * sensep,
int sense_len, int desc_type)
static const unsigned char * sg_scsi_sense_desc_find(const unsigned char * sensep,
int sense_len, int desc_type)
{
int add_sen_len, add_len, desc_len, k;
const unsigned char * descp;

@ -1,79 +0,0 @@
/*
* scsiata.h
*
* Home page of code is: http://smartmontools.sourceforge.net
*
* Copyright (C) 2006-8 Douglas Gilbert <dougg@torque.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* You should have received a copy of the GNU General Public License
* (for example COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef SCSIATA_H_
#define SCSIATA_H_
#define SCSIATA_H_CVSID "$Id: scsiata.h,v 1.6 2008/07/25 21:16:00 chrfranke Exp $\n"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "atacmds.h"
#define SAT_ATA_PASSTHROUGH_12LEN 12
#define SAT_ATA_PASSTHROUGH_16LEN 16
// Moved to C++ interface
//extern int sat_command_interface(int device, smart_command_set command,
// int select, char *data);
//extern int has_sat_pass_through(int device, int packet_interface);
/* This is a slightly stretched SCSI sense "descriptor" format header.
The addition is to allow the 0x70 and 0x71 response codes. The idea
is to place the salient data of both "fixed" and "descriptor" sense
format into one structure to ease application processing.
The original sense buffer should be kept around for those cases
in which more information is required (e.g. the LBA of a MEDIUM ERROR). */
struct sg_scsi_sense_hdr {
unsigned char response_code; /* permit: 0x0, 0x70, 0x71, 0x72, 0x73 */
unsigned char sense_key;
unsigned char asc;
unsigned char ascq;
unsigned char byte4;
unsigned char byte5;
unsigned char byte6;
unsigned char additional_length;
};
/* Maps the salient data from a sense buffer which is in either fixed or
descriptor format into a structure mimicking a descriptor format
header (i.e. the first 8 bytes of sense descriptor format).
If zero response code returns 0. Otherwise returns 1 and if 'sshp' is
non-NULL then zero all fields and then set the appropriate fields in
that structure. sshp::additional_length is always 0 for response
codes 0x70 and 0x71 (fixed format). */
extern int sg_scsi_normalize_sense(const unsigned char * sensep,
int sense_len,
struct sg_scsi_sense_hdr * sshp);
/* Attempt to find the first SCSI sense data descriptor that matches the
given 'desc_type'. If found return pointer to start of sense data
descriptor; otherwise (including fixed format sense data) returns NULL. */
extern const unsigned char * sg_scsi_sense_desc_find(
const unsigned char * sensep, int sense_len, int desc_type);
// Moved to C++ interface
//extern int usbcypress_command_interface(int device, smart_command_set command,
// int select, char *data);
#endif

@ -40,12 +40,11 @@
#include "scsiprint.h"
#include "smartctl.h"
#include "utility.h"
#include "scsiata.h"
#define GBUF_SIZE 65535
const char* scsiprint_c_cvsid="$Id: scsiprint.cpp,v 1.130 2009/06/24 04:10:10 dpgilbert Exp $"
CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSICMDS_H_CVSID SCSIPRINT_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
const char * scsiprint_c_cvsid = "$Id$"
SCSIPRINT_H_CVSID;
// control block which points to external global control variables
extern smartmonctrl *con;

@ -84,7 +84,6 @@ extern "C" int __stdcall FreeConsole(void);
#include "extern.h"
#include "knowndrives.h"
#include "scsicmds.h"
#include "scsiata.h"
#include "utility.h"
// This is for solaris, where signal() resets the handler to SIG_DFL

Loading…
Cancel
Save