mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-30 06:31:43 +00:00
add REQUEST_SENSE
This commit is contained in:
parent
5eb95f1419
commit
1153cd593a
@ -11,7 +11,7 @@ LIBRARY = libscsi.a
|
||||
|
||||
SOURCES = scsi_read_sector.c scsi_command.c scsi_INQUIRY.c scsi_READ.c \
|
||||
scsi_open.c scsi_close.c scsi_READ_CAPACITY.c scsi_get_blocksize.c \
|
||||
scsi_TEST_UNIT_READY.c scsi_INQUIRY.c
|
||||
scsi_TEST_UNIT_READY.c scsi_INQUIRY.c scsi_REQUEST_SENSE.c
|
||||
|
||||
HEADERS = libscsi.h
|
||||
|
||||
|
36
libscsi/scsi_REQUEST_SENSE.c
Normal file
36
libscsi/scsi_REQUEST_SENSE.c
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
*
|
||||
* (c) 2004-2006 Laurent Vivier <Laurent@lvivier.info>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <scsi/scsi.h>
|
||||
|
||||
#include <macos/types.h>
|
||||
#include <macos/errors.h>
|
||||
|
||||
#include "libscsi.h"
|
||||
|
||||
int scsi_REQUEST_SENSE(int target, char *buffer, size_t count)
|
||||
{
|
||||
char cdb[6];
|
||||
TIB_t tib[2];
|
||||
|
||||
cdb[0] = REQUEST_SENSE;
|
||||
cdb[1] = 0;
|
||||
cdb[2] = 0;
|
||||
cdb[3] = 0;
|
||||
cdb[4] = count;
|
||||
cdb[5] = 0;
|
||||
|
||||
tib[0].opcode = op_no_inc;
|
||||
tib[0].param1 = (int)buffer;
|
||||
tib[0].param2 = count;
|
||||
tib[1].opcode = op_stop;
|
||||
tib[1].param1 = 0;
|
||||
tib[1].param2 = 0;
|
||||
|
||||
return scsi_command(target, cdb, 6, tib);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user