2005-11-17 06:44:44 +00:00
|
|
|
/*
|
|
|
|
*
|
2006-09-15 14:55:39 +00:00
|
|
|
* (c) 2004, 2005 Laurent Vivier <Laurent@lvivier.info>
|
2005-11-17 06:44:44 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-09-03 17:51:12 +00:00
|
|
|
#include <sys/types.h>
|
2005-11-17 06:44:44 +00:00
|
|
|
#include <scsi/scsi.h>
|
|
|
|
|
|
|
|
#include <macos/types.h>
|
|
|
|
#include <macos/errors.h>
|
|
|
|
|
|
|
|
#include "libscsi.h"
|
|
|
|
|
2007-03-22 17:00:50 +00:00
|
|
|
int scsi_READ_CAPACITY(int target, void *buffer, size_t count)
|
2005-11-17 06:44:44 +00:00
|
|
|
{
|
2007-03-22 17:00:50 +00:00
|
|
|
unsigned char cdb[10];
|
2005-11-17 06:44:44 +00:00
|
|
|
TIB_t tib[2];
|
|
|
|
|
|
|
|
cdb[0] = READ_CAPACITY;
|
|
|
|
cdb[1] = 0;
|
|
|
|
cdb[2] = 0;
|
|
|
|
cdb[3] = 0;
|
|
|
|
cdb[4] = 0;
|
|
|
|
cdb[5] = 0;
|
|
|
|
cdb[6] = 0;
|
|
|
|
cdb[7] = 0;
|
2005-11-22 00:53:48 +00:00
|
|
|
cdb[8] = 0;
|
|
|
|
cdb[9] = 0;
|
2005-11-17 06:44:44 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2005-11-22 00:53:48 +00:00
|
|
|
return scsi_command(target, cdb, 10, tib);
|
2005-11-17 06:44:44 +00:00
|
|
|
}
|