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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <macos/scsi.h>
|
|
|
|
|
2005-11-21 21:56:13 +00:00
|
|
|
typedef struct {
|
|
|
|
int target;
|
|
|
|
unsigned int sector_size;
|
2005-11-22 00:53:48 +00:00
|
|
|
unsigned long capacity;
|
2005-11-21 21:56:13 +00:00
|
|
|
} scsi_device_t;
|
|
|
|
|
2007-03-22 17:00:50 +00:00
|
|
|
extern int scsi_command(int target, unsigned char* cdb, int count, TIB_t* tib);
|
|
|
|
extern int scsi_INQUIRY(int target, void* buffer, size_t count);
|
2005-11-17 06:44:44 +00:00
|
|
|
extern int scsi_READ(int target, unsigned long offset, unsigned short nb_blocks,
|
2007-03-22 17:00:50 +00:00
|
|
|
void *buffer, int buffer_size);
|
|
|
|
extern int scsi_READ_CAPACITY(int target, void *buffer, size_t count);
|
2006-11-01 17:46:06 +00:00
|
|
|
extern int scsi_TEST_UNIT_READY(int target);
|
2007-03-22 17:00:50 +00:00
|
|
|
extern int scsi_REQUEST_SENSE(int target, void* buffer, size_t count);
|
2005-11-17 06:44:44 +00:00
|
|
|
|
2005-11-21 21:56:13 +00:00
|
|
|
extern scsi_device_t *scsi_open(int target);
|
|
|
|
extern int scsi_read_sector(scsi_device_t *device, off_t offset, void* buffer, size_t size);
|
|
|
|
extern int scsi_close(scsi_device_t *device);
|
2005-11-23 22:35:19 +00:00
|
|
|
extern int scsi_get_blocksize(scsi_device_t *device);
|