Skip to content
Snippets Groups Projects
Commit e71b679f authored by dpgilbert's avatar dpgilbert
Browse files

add has_sat_pass_through() check function

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2212 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 58807212
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@
#include "scsiata.h"
#include "utility.h"
const char *scsiata_c_cvsid="$Id: scsiata.c,v 1.5 2006/06/13 14:38:50 dpgilbert Exp $"
const char *scsiata_c_cvsid="$Id: scsiata.c,v 1.6 2006/07/01 21:30:04 dpgilbert Exp $"
CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSICMDS_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID;
/* for passing global control variables */
......@@ -373,6 +373,21 @@ int sat_command_interface(int device, smart_command_set command, int select,
return 0;
}
/* Attempt an IDENTIFY DEVICE ATA command via SATL when packet_interface
is 0 otherwise attempt IDENTIFY PACKET DEVICE. If successful
return 1, else 0 */
int has_sat_pass_through(int device, int packet_interface)
{
char data[512];
smart_command_set command;
command = packet_interface ? PIDENTIFY : IDENTIFY;
if (0 == sat_command_interface(device, command, 0, data))
return 1;
else
return 0;
}
/* 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,
......
......@@ -45,7 +45,7 @@
#include "scsiata.h"
#include "utility.h"
const char *scsiata_c_cvsid="$Id: scsiata.cpp,v 1.5 2006/06/13 14:38:50 dpgilbert Exp $"
const char *scsiata_c_cvsid="$Id: scsiata.cpp,v 1.6 2006/07/01 21:30:04 dpgilbert Exp $"
CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSICMDS_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID;
/* for passing global control variables */
......@@ -373,6 +373,21 @@ int sat_command_interface(int device, smart_command_set command, int select,
return 0;
}
/* Attempt an IDENTIFY DEVICE ATA command via SATL when packet_interface
is 0 otherwise attempt IDENTIFY PACKET DEVICE. If successful
return 1, else 0 */
int has_sat_pass_through(int device, int packet_interface)
{
char data[512];
smart_command_set command;
command = packet_interface ? PIDENTIFY : IDENTIFY;
if (0 == sat_command_interface(device, command, 0, data))
return 1;
else
return 0;
}
/* 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,
......
......@@ -20,7 +20,7 @@
#ifndef SCSIATA_H_
#define SCSIATA_H_
#define SCSIATA_H_CVSID "$Id: scsiata.h,v 1.1 2006/06/08 03:09:30 dpgilbert Exp $\n"
#define SCSIATA_H_CVSID "$Id: scsiata.h,v 1.2 2006/07/01 21:29:31 dpgilbert Exp $\n"
#include <stdio.h>
#include <stdlib.h>
......@@ -35,6 +35,11 @@
extern int sat_command_interface(int device, smart_command_set command,
int select, char *data);
/* Attempt an IDENTIFY DEVICE ATA command via SATL when packet_interface
is 0 otherwise attempt IDENTIFY PACKET DEVICE. If successful
return 1, else 0 */
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment