mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 11:14:35 +00:00
Genera refactor and cleanup.
This commit is contained in:
13
README.md
13
README.md
@@ -1,19 +1,22 @@
|
||||
Aaru Remote
|
||||
====================
|
||||
|
||||
The Aaru Remote is a slim miniature application designed to receive device commands from a remote [Aaru](https://github.com/aaru-dps/Aaru)
|
||||
The Aaru Remote is a slim miniature application designed to receive device commands from a
|
||||
remote [Aaru](https://github.com/aaru-dps/Aaru)
|
||||
instance, sends it to a local device, and returns the data to the instance.
|
||||
|
||||
The main motivation for this is the desire to update Aaru to the latest and greatest features of .NET and C#.
|
||||
This creates a problem, as some people have old devices that do not work in modern Linux distributions.
|
||||
|
||||
This remote will be supported in older versions of Linux, and will in future versions be supported in FreeBSD, Windows, and possibly
|
||||
This remote will be supported in older versions of Linux, and will in future versions be supported in FreeBSD, Windows,
|
||||
and possibly
|
||||
network-enabled game consoles (like PSP, Wii, etc).
|
||||
|
||||
While some people will suggest porting the whole Aaru to C or C++, that won't happen, and for the only situation that
|
||||
would be needed (accessing devices where C# does not run) this slim is more than enough.
|
||||
|
||||
The usage is very simple, just run the remote and it will listen for a connection over TCP/IP in port 6666, and print you
|
||||
The usage is very simple, just run the remote and it will listen for a connection over TCP/IP in port 6666, and print
|
||||
you
|
||||
the available IPs. Running as non-root user only works with some SCSI devices, so better run as root.
|
||||
|
||||
On the other side, you can use the Aaru with the *remote* command and one of those IP addresses to test the
|
||||
@@ -25,8 +28,9 @@ All commands that support devices are supported, with a URI with the following s
|
||||
|
||||
Feature matrix
|
||||
==============
|
||||
|
||||
| | Minimum OS<sup>*1</sup> | SCSI | CHS ATA | 28-bit LBA ATA | 48-bit LBA ATA | Secure Digital | MultiMediaCard | USB | FireWire | PCMCIA | Special<sup>*2</sup> |
|
||||
|------------|-----------------------|---------------|---------------|---------------|---------------|--------------|--------------|--------------------|--------------------|----------------|-------|
|
||||
|--------------|-------------------------|-----------------|-----------------|-----------------|-----------------|----------------|----------------|----------------------|----------------------|------------------|----------------------|
|
||||
| FreeBSD | 12 | Yes | Yes | Yes | Yes | Not yet | Not yet | Not yet<sup>*4</sup> | Not yet<sup>*4</sup> | No<sup>*5</sup> | |
|
||||
| Linux | 2.6 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes<sup>*6</sup> | |
|
||||
| Nintendo Wii | 4.3 | No<sup>*3</sup> | No<sup>*3</sup> | No<sup>*3</sup> | No<sup>*3</sup> | Not yet | Not yet | Not yet | No<sup>*3</sup> | No<sup>*3</sup> | Not yet |
|
||||
@@ -41,6 +45,7 @@ Feature matrix
|
||||
|
||||
TODO
|
||||
====
|
||||
|
||||
- More buffer overflow guards
|
||||
- Support PSP
|
||||
- Support Wii
|
||||
|
||||
@@ -32,26 +32,22 @@ static u_int32_t AtaProtocolToCamFlags(uint8_t protocol)
|
||||
case AARUREMOTE_ATA_PROTOCOL_HARD_RESET:
|
||||
case AARUREMOTE_ATA_PROTOCOL_NO_DATA:
|
||||
case AARUREMOTE_ATA_PROTOCOL_SOFT_RESET:
|
||||
case AARUREMOTE_ATA_PROTOCOL_RETURN_RESPONSE: return CAM_DIR_NONE;
|
||||
case AARUREMOTE_ATA_PROTOCOL_RETURN_RESPONSE:
|
||||
return CAM_DIR_NONE;
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN: return CAM_DIR_IN;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
return CAM_DIR_IN;
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_OUT:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT: return CAM_DIR_OUT;
|
||||
default: return 0;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT:
|
||||
return CAM_DIR_OUT;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t SendAtaChsCommand(void* device_ctx,
|
||||
AtaRegistersChs registers,
|
||||
AtaErrorRegistersChs* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaChsCommand(void *device_ctx, AtaRegistersChs registers, AtaErrorRegistersChs *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
*duration = 0;
|
||||
@@ -86,8 +82,12 @@ int32_t SendAtaChsCommand(void* device_ctx,
|
||||
case AARUREMOTE_ATA_PROTOCOL_DMA:
|
||||
case AARUREMOTE_ATA_PROTOCOL_DMA_QUEUED:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT: camccb->ataio.cmd.flags |= CAM_ATAIO_DMA; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_FPDMA: camccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT:
|
||||
camccb->ataio.cmd.flags |= CAM_ATAIO_DMA;
|
||||
break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_FPDMA:
|
||||
camccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA;
|
||||
break;
|
||||
}
|
||||
|
||||
camccb->ataio.cmd.command = registers.command;
|
||||
@@ -142,17 +142,9 @@ int32_t SendAtaChsCommand(void* device_ctx,
|
||||
return error;
|
||||
}
|
||||
|
||||
int32_t SendAtaLba28Command(void* device_ctx,
|
||||
AtaRegistersLba28 registers,
|
||||
AtaErrorRegistersLba28* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaLba28Command(void *device_ctx, AtaRegistersLba28 registers, AtaErrorRegistersLba28 *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
*duration = 0;
|
||||
@@ -187,8 +179,12 @@ int32_t SendAtaLba28Command(void* device_ctx,
|
||||
case AARUREMOTE_ATA_PROTOCOL_DMA:
|
||||
case AARUREMOTE_ATA_PROTOCOL_DMA_QUEUED:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT: camccb->ataio.cmd.flags |= CAM_ATAIO_DMA; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_FPDMA: camccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT:
|
||||
camccb->ataio.cmd.flags |= CAM_ATAIO_DMA;
|
||||
break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_FPDMA:
|
||||
camccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA;
|
||||
break;
|
||||
}
|
||||
|
||||
camccb->ataio.cmd.command = registers.command;
|
||||
@@ -243,17 +239,9 @@ int32_t SendAtaLba28Command(void* device_ctx,
|
||||
return error;
|
||||
}
|
||||
|
||||
int32_t SendAtaLba48Command(void* device_ctx,
|
||||
AtaRegistersLba48 registers,
|
||||
AtaErrorRegistersLba48* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaLba48Command(void *device_ctx, AtaRegistersLba48 registers, AtaErrorRegistersLba48 *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
*duration = 0;
|
||||
@@ -290,8 +278,12 @@ int32_t SendAtaLba48Command(void* device_ctx,
|
||||
case AARUREMOTE_ATA_PROTOCOL_DMA:
|
||||
case AARUREMOTE_ATA_PROTOCOL_DMA_QUEUED:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT: camccb->ataio.cmd.flags |= CAM_ATAIO_DMA; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_FPDMA: camccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT:
|
||||
camccb->ataio.cmd.flags |= CAM_ATAIO_DMA;
|
||||
break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_FPDMA:
|
||||
camccb->ataio.cmd.flags |= CAM_ATAIO_FPDMA;
|
||||
break;
|
||||
}
|
||||
|
||||
camccb->ataio.cmd.command = registers.command;
|
||||
|
||||
@@ -86,15 +86,25 @@ int32_t GetDeviceType(void* device_ctx)
|
||||
switch(camccb->cgd.protocol)
|
||||
{
|
||||
case PROTO_ATA:
|
||||
case PROTO_SATAPM: device_type = AARUREMOTE_DEVICE_TYPE_ATA; break;
|
||||
case PROTO_ATAPI: device_type = AARUREMOTE_DEVICE_TYPE_ATAPI; break;
|
||||
case PROTO_SCSI: device_type = AARUREMOTE_DEVICE_TYPE_SCSI; break;
|
||||
case PROTO_NVME: device_type = AARUREMOTE_DEVICE_TYPE_NVME; break;
|
||||
case PROTO_SATAPM:
|
||||
device_type = AARUREMOTE_DEVICE_TYPE_ATA;
|
||||
break;
|
||||
case PROTO_ATAPI:
|
||||
device_type = AARUREMOTE_DEVICE_TYPE_ATAPI;
|
||||
break;
|
||||
case PROTO_SCSI:
|
||||
device_type = AARUREMOTE_DEVICE_TYPE_SCSI;
|
||||
break;
|
||||
case PROTO_NVME:
|
||||
device_type = AARUREMOTE_DEVICE_TYPE_NVME;
|
||||
break;
|
||||
case PROTO_MMCSD:
|
||||
// TODO: MMC vs SD
|
||||
device_type = AARUREMOTE_DEVICE_TYPE_MMC;
|
||||
break;
|
||||
default: device_type = AARUREMOTE_DEVICE_TYPE_UNKNOWN; break;
|
||||
default:
|
||||
device_type = AARUREMOTE_DEVICE_TYPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
cam_freeccb(camccb);
|
||||
|
||||
@@ -19,11 +19,7 @@
|
||||
|
||||
#include "../aaruremote.h"
|
||||
|
||||
uint8_t GetFireWireData(void* device_ctx,
|
||||
uint32_t* id_model,
|
||||
uint32_t* id_vendor,
|
||||
uint64_t* guid,
|
||||
char* vendor,
|
||||
uint8_t GetFireWireData(void *device_ctx, uint32_t *id_model, uint32_t *id_vendor, uint64_t *guid, char *vendor,
|
||||
char *model)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -110,7 +110,8 @@ DeviceInfoList* ListDevices()
|
||||
|
||||
strncpy(list_next->this.serial, (const char *)camccb->cgd.ident_data.serial, 20);
|
||||
|
||||
if(strncmp(camdev->sim_name, "ahcich", 6) == 0) strncpy(list_next->this.bus, "SATA", 5);
|
||||
if(strncmp(camdev->sim_name, "ahcich", 6) == 0)
|
||||
strncpy(list_next->this.bus, "SATA", 5);
|
||||
else
|
||||
strncpy(list_next->this.bus, "ATA", 4);
|
||||
|
||||
|
||||
@@ -25,16 +25,8 @@
|
||||
#include "../aaruremote.h"
|
||||
#include "freebsd.h"
|
||||
|
||||
int32_t SendScsiCommand(void* device_ctx,
|
||||
char* cdb,
|
||||
char* buffer,
|
||||
char** sense_buffer,
|
||||
uint32_t timeout,
|
||||
int32_t direction,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t cdb_len,
|
||||
uint32_t* buf_len,
|
||||
int32_t SendScsiCommand(void *device_ctx, char *cdb, char *buffer, char **sense_buffer, uint32_t timeout,
|
||||
int32_t direction, uint32_t *duration, uint32_t *sense, uint32_t cdb_len, uint32_t *buf_len,
|
||||
uint32_t *sense_len)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
@@ -52,10 +44,18 @@ int32_t SendScsiCommand(void* device_ctx,
|
||||
|
||||
switch(direction)
|
||||
{
|
||||
case AARUREMOTE_SCSI_DIRECTION_NONE: flags = CAM_DIR_NONE; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_OUT: flags = CAM_DIR_OUT; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_IN: flags = CAM_DIR_IN; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_INOUT: flags = CAM_DIR_BOTH; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_NONE:
|
||||
flags = CAM_DIR_NONE;
|
||||
break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_OUT:
|
||||
flags = CAM_DIR_OUT;
|
||||
break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_IN:
|
||||
flags = CAM_DIR_IN;
|
||||
break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_INOUT:
|
||||
flags = CAM_DIR_BOTH;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!ctx) return -1;
|
||||
@@ -81,7 +81,8 @@ int32_t SendScsiCommand(void* device_ctx,
|
||||
camccb->csio.cdb_len = cdb_len;
|
||||
camccb->csio.tag_action = 0x20;
|
||||
|
||||
if(cdb_len <= CAM_MAX_CDBLEN) memcpy(camccb->csio.cdb_io.cdb_bytes, cdb, cdb_len);
|
||||
if(cdb_len <= CAM_MAX_CDBLEN)
|
||||
memcpy(camccb->csio.cdb_io.cdb_bytes, cdb, cdb_len);
|
||||
else
|
||||
{
|
||||
camccb->csio.cdb_io.cdb_ptr = (u_int8_t *)cdb;
|
||||
@@ -127,8 +128,7 @@ int32_t SendScsiCommand(void* device_ctx,
|
||||
*sense = (camccb->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR;
|
||||
*sense_buffer = malloc(camccb->csio.sense_len - camccb->csio.sense_resid);
|
||||
(*sense_buffer)[0] = camccb->csio.sense_data.error_code;
|
||||
memcpy((*sense_buffer) + 1,
|
||||
camccb->csio.sense_data.sense_buf,
|
||||
memcpy((*sense_buffer) + 1, camccb->csio.sense_data.sense_buf,
|
||||
(camccb->csio.sense_len - camccb->csio.sense_resid) - 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,41 +19,20 @@
|
||||
|
||||
#include "../aaruremote.h"
|
||||
|
||||
int32_t SendSdhciCommand(void* device_ctx,
|
||||
uint8_t command,
|
||||
uint8_t write,
|
||||
uint8_t application,
|
||||
uint32_t flags,
|
||||
uint32_t argument,
|
||||
uint32_t block_size,
|
||||
uint32_t blocks,
|
||||
char* buffer,
|
||||
uint32_t buf_len,
|
||||
uint32_t timeout,
|
||||
uint32_t* response,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense)
|
||||
int32_t SendSdhciCommand(void *device_ctx, uint8_t command, uint8_t write, uint8_t application, uint32_t flags,
|
||||
uint32_t argument, uint32_t block_size, uint32_t blocks, char *buffer, uint32_t buf_len,
|
||||
uint32_t timeout, uint32_t *response, uint32_t *duration, uint32_t *sense)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t GetSdhciRegisters(void* device_ctx,
|
||||
char** csd,
|
||||
char** cid,
|
||||
char** ocr,
|
||||
char** scr,
|
||||
uint32_t* csd_len,
|
||||
uint32_t* cid_len,
|
||||
uint32_t* ocr_len,
|
||||
uint32_t* scr_len)
|
||||
int32_t GetSdhciRegisters(void *device_ctx, char **csd, char **cid, char **ocr, char **scr, uint32_t *csd_len,
|
||||
uint32_t *cid_len, uint32_t *ocr_len, uint32_t *scr_len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SendMultiSdhciCommand(void* device_ctx,
|
||||
uint64_t count,
|
||||
MmcSingleCommand commands[],
|
||||
uint32_t* duration,
|
||||
int32_t SendMultiSdhciCommand(void *device_ctx, uint64_t count, MmcSingleCommand commands[], uint32_t *duration,
|
||||
uint32_t *sense)
|
||||
{
|
||||
return -1;
|
||||
|
||||
@@ -19,14 +19,8 @@
|
||||
|
||||
#include "../aaruremote.h"
|
||||
|
||||
uint8_t GetUsbData(void* device_ctx,
|
||||
uint16_t* desc_len,
|
||||
char* descriptors,
|
||||
uint16_t* id_vendor,
|
||||
uint16_t* id_product,
|
||||
char* manufacturer,
|
||||
char* product,
|
||||
char* serial)
|
||||
uint8_t GetUsbData(void *device_ctx, uint16_t *desc_len, char *descriptors, uint16_t *id_vendor, uint16_t *id_product,
|
||||
char *manufacturer, char *product, char *serial)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
117
linux/ata.c
117
linux/ata.c
@@ -29,26 +29,22 @@ int32_t AtaProtocolToScsiDirection(uint8_t protocol)
|
||||
case AARUREMOTE_ATA_PROTOCOL_HARD_RESET:
|
||||
case AARUREMOTE_ATA_PROTOCOL_NO_DATA:
|
||||
case AARUREMOTE_ATA_PROTOCOL_SOFT_RESET:
|
||||
case AARUREMOTE_ATA_PROTOCOL_RETURN_RESPONSE: return AARUREMOTE_SCSI_DIRECTION_NONE;
|
||||
case AARUREMOTE_ATA_PROTOCOL_RETURN_RESPONSE:
|
||||
return AARUREMOTE_SCSI_DIRECTION_NONE;
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN: return AARUREMOTE_SCSI_DIRECTION_IN;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
return AARUREMOTE_SCSI_DIRECTION_IN;
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_OUT:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT: return AARUREMOTE_SCSI_DIRECTION_OUT;
|
||||
default: return AARUREMOTE_SCSI_DIRECTION_UNSPECIFIED;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_OUT:
|
||||
return AARUREMOTE_SCSI_DIRECTION_OUT;
|
||||
default:
|
||||
return AARUREMOTE_SCSI_DIRECTION_UNSPECIFIED;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t SendAtaChsCommand(void* device_ctx,
|
||||
AtaRegistersChs registers,
|
||||
AtaErrorRegistersChs* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaChsCommand(void *device_ctx, AtaRegistersChs registers, AtaErrorRegistersChs *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
*duration = 0;
|
||||
*sense = 0;
|
||||
@@ -68,8 +64,12 @@ int32_t SendAtaChsCommand(void* device_ctx,
|
||||
switch(protocol)
|
||||
{
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN: cdb[2] = 0x08; break;
|
||||
default: cdb[2] = 0x00; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
cdb[2] = 0x08;
|
||||
break;
|
||||
default:
|
||||
cdb[2] = 0x00;
|
||||
break;
|
||||
}
|
||||
|
||||
if(transfer_blocks) cdb[2] |= 0x04;
|
||||
@@ -85,17 +85,8 @@ int32_t SendAtaChsCommand(void* device_ctx,
|
||||
cdb[13] = registers.device_head;
|
||||
cdb[14] = registers.command;
|
||||
|
||||
int error = SendScsiCommand(ctx,
|
||||
(char*)cdb,
|
||||
buffer,
|
||||
&sense_buf,
|
||||
timeout,
|
||||
AtaProtocolToScsiDirection(protocol),
|
||||
duration,
|
||||
sense,
|
||||
16,
|
||||
buf_len,
|
||||
&sense_len);
|
||||
int error = SendScsiCommand(ctx, (char *)cdb, buffer, &sense_buf, timeout, AtaProtocolToScsiDirection(protocol),
|
||||
duration, sense, 16, buf_len, &sense_len);
|
||||
|
||||
if(sense_len < 22 || (sense_buf[8] != 0x09 && sense_buf[9] != 0x0C)) return error;
|
||||
|
||||
@@ -113,17 +104,9 @@ int32_t SendAtaChsCommand(void* device_ctx,
|
||||
return error;
|
||||
}
|
||||
|
||||
int32_t SendAtaLba28Command(void* device_ctx,
|
||||
AtaRegistersLba28 registers,
|
||||
AtaErrorRegistersLba28* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaLba28Command(void *device_ctx, AtaRegistersLba28 registers, AtaErrorRegistersLba28 *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
*duration = 0;
|
||||
*sense = 0;
|
||||
@@ -143,8 +126,12 @@ int32_t SendAtaLba28Command(void* device_ctx,
|
||||
switch(protocol)
|
||||
{
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN: cdb[2] = 0x08; break;
|
||||
default: cdb[2] = 0x00; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
cdb[2] = 0x08;
|
||||
break;
|
||||
default:
|
||||
cdb[2] = 0x00;
|
||||
break;
|
||||
}
|
||||
|
||||
if(transfer_blocks) cdb[2] |= 0x04;
|
||||
@@ -162,17 +149,8 @@ int32_t SendAtaLba28Command(void* device_ctx,
|
||||
cdb[13] = registers.device_head;
|
||||
cdb[14] = registers.command;
|
||||
|
||||
int error = SendScsiCommand(ctx,
|
||||
(char*)cdb,
|
||||
buffer,
|
||||
&sense_buf,
|
||||
timeout,
|
||||
AtaProtocolToScsiDirection(protocol),
|
||||
duration,
|
||||
sense,
|
||||
16,
|
||||
buf_len,
|
||||
&sense_len);
|
||||
int error = SendScsiCommand(ctx, (char *)cdb, buffer, &sense_buf, timeout, AtaProtocolToScsiDirection(protocol),
|
||||
duration, sense, 16, buf_len, &sense_len);
|
||||
|
||||
if(sense_len < 22 || (sense_buf[8] != 0x09 && sense_buf[9] != 0x0C)) return error;
|
||||
|
||||
@@ -190,17 +168,9 @@ int32_t SendAtaLba28Command(void* device_ctx,
|
||||
return error;
|
||||
}
|
||||
|
||||
int32_t SendAtaLba48Command(void* device_ctx,
|
||||
AtaRegistersLba48 registers,
|
||||
AtaErrorRegistersLba48* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaLba48Command(void *device_ctx, AtaRegistersLba48 registers, AtaErrorRegistersLba48 *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
*duration = 0;
|
||||
*sense = 0;
|
||||
@@ -221,8 +191,12 @@ int32_t SendAtaLba48Command(void* device_ctx,
|
||||
switch(protocol)
|
||||
{
|
||||
case AARUREMOTE_ATA_PROTOCOL_PIO_IN:
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN: cdb[2] = 0x08; break;
|
||||
default: cdb[2] = 0x00; break;
|
||||
case AARUREMOTE_ATA_PROTOCOL_UDMA_IN:
|
||||
cdb[2] = 0x08;
|
||||
break;
|
||||
default:
|
||||
cdb[2] = 0x00;
|
||||
break;
|
||||
}
|
||||
|
||||
if(transfer_blocks) cdb[2] |= 0x04;
|
||||
@@ -245,17 +219,8 @@ int32_t SendAtaLba48Command(void* device_ctx,
|
||||
cdb[13] = registers.device_head;
|
||||
cdb[14] = registers.command;
|
||||
|
||||
int error = SendScsiCommand(ctx,
|
||||
(char*)cdb,
|
||||
buffer,
|
||||
&sense_buf,
|
||||
timeout,
|
||||
AtaProtocolToScsiDirection(protocol),
|
||||
duration,
|
||||
sense,
|
||||
16,
|
||||
buf_len,
|
||||
&sense_len);
|
||||
int error = SendScsiCommand(ctx, (char *)cdb, buffer, &sense_buf, timeout, AtaProtocolToScsiDirection(protocol),
|
||||
duration, sense, 16, buf_len, &sense_len);
|
||||
|
||||
if(sense_len < 22 || (sense_buf[8] != 0x09 && sense_buf[9] != 0x0C)) return error;
|
||||
|
||||
|
||||
@@ -24,11 +24,7 @@
|
||||
#include "../aaruremote.h"
|
||||
#include "linux.h"
|
||||
|
||||
uint8_t GetFireWireData(void* device_ctx,
|
||||
uint32_t* id_model,
|
||||
uint32_t* id_vendor,
|
||||
uint64_t* guid,
|
||||
char* vendor,
|
||||
uint8_t GetFireWireData(void *device_ctx, uint32_t *id_model, uint32_t *id_vendor, uint64_t *guid, char *vendor,
|
||||
char *model)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
|
||||
@@ -144,11 +144,19 @@ DeviceInfoList* ListDevices()
|
||||
|
||||
switch(GetDeviceType(&tmp_ctx))
|
||||
{
|
||||
case AARUREMOTE_DEVICE_TYPE_ATA: strncpy(list_next->this.bus, "ATA", 256); break;
|
||||
case AARUREMOTE_DEVICE_TYPE_ATAPI: strncpy(list_next->this.bus, "ATAPI", 256); break;
|
||||
case AARUREMOTE_DEVICE_TYPE_ATA:
|
||||
strncpy(list_next->this.bus, "ATA", 256);
|
||||
break;
|
||||
case AARUREMOTE_DEVICE_TYPE_ATAPI:
|
||||
strncpy(list_next->this.bus, "ATAPI", 256);
|
||||
break;
|
||||
case AARUREMOTE_DEVICE_TYPE_MMC:
|
||||
case AARUREMOTE_DEVICE_TYPE_SECURE_DIGITAL: strncpy(list_next->this.bus, "MMC/SD", 256); break;
|
||||
case AARUREMOTE_DEVICE_TYPE_NVME: strncpy(list_next->this.bus, "NVMe", 256); break;
|
||||
case AARUREMOTE_DEVICE_TYPE_SECURE_DIGITAL:
|
||||
strncpy(list_next->this.bus, "MMC/SD", 256);
|
||||
break;
|
||||
case AARUREMOTE_DEVICE_TYPE_NVME:
|
||||
strncpy(list_next->this.bus, "NVMe", 256);
|
||||
break;
|
||||
case AARUREMOTE_DEVICE_TYPE_SCSI:
|
||||
tmp_string = malloc(1024);
|
||||
memset((void*)tmp_string, 0, 1024);
|
||||
@@ -188,7 +196,8 @@ DeviceInfoList* ListDevices()
|
||||
|
||||
if(ret > 0)
|
||||
{
|
||||
if(strncmp(line_str, "sbp2", 4) == 0) strncpy(list_next->this.bus, "FireWire", 256);
|
||||
if(strncmp(line_str, "sbp2", 4) == 0)
|
||||
strncpy(list_next->this.bus, "FireWire", 256);
|
||||
else if(strncmp(line_str, "usb-storage", 11) == 0)
|
||||
strncpy(list_next->this.bus, "USB", 256);
|
||||
else
|
||||
@@ -212,7 +221,9 @@ DeviceInfoList* ListDevices()
|
||||
|
||||
free((void*)tmp_string);
|
||||
break;
|
||||
default: memset(&list_next->this.bus, 0, 256); break;
|
||||
default:
|
||||
memset(&list_next->this.bus, 0, 256);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -237,7 +248,8 @@ DeviceInfoList* ListDevices()
|
||||
strncpy(list_next->this.vendor, line_str, 256);
|
||||
for(i = 255; i >= 0; i--)
|
||||
{
|
||||
if(list_next->this.vendor[i] == 0) continue;
|
||||
if(list_next->this.vendor[i] == 0)
|
||||
continue;
|
||||
|
||||
else if(list_next->this.vendor[i] == 0x0A || list_next->this.vendor[i] == 0x0D ||
|
||||
list_next->this.vendor[i] == ' ')
|
||||
@@ -251,10 +263,7 @@ DeviceInfoList* ListDevices()
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
else if(strncmp(dirent->d_name, "loop", 4) == 0)
|
||||
{
|
||||
strncpy(list_next->this.vendor, "Linux", 256);
|
||||
}
|
||||
else if(strncmp(dirent->d_name, "loop", 4) == 0) { strncpy(list_next->this.vendor, "Linux", 256); }
|
||||
free((void *)tmp_string);
|
||||
|
||||
tmp_string = malloc(1024);
|
||||
@@ -278,7 +287,8 @@ DeviceInfoList* ListDevices()
|
||||
strncpy(list_next->this.model, line_str, 256);
|
||||
for(i = 255; i >= 0; i--)
|
||||
{
|
||||
if(list_next->this.model[i] == 0) continue;
|
||||
if(list_next->this.model[i] == 0)
|
||||
continue;
|
||||
|
||||
else if(list_next->this.model[i] == 0x0A || list_next->this.model[i] == 0x0D ||
|
||||
list_next->this.model[i] == ' ')
|
||||
@@ -292,10 +302,7 @@ DeviceInfoList* ListDevices()
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
else if(strncmp(dirent->d_name, "loop", 4) == 0)
|
||||
{
|
||||
strncpy(list_next->this.model, "Linux", 256);
|
||||
}
|
||||
else if(strncmp(dirent->d_name, "loop", 4) == 0) { strncpy(list_next->this.model, "Linux", 256); }
|
||||
free((void *)tmp_string);
|
||||
|
||||
tmp_string = malloc(1024);
|
||||
@@ -318,7 +325,8 @@ DeviceInfoList* ListDevices()
|
||||
strncpy(list_next->this.serial, line_str, 256);
|
||||
for(i = 255; i >= 0; i--)
|
||||
{
|
||||
if(list_next->this.serial[i] == 0) continue;
|
||||
if(list_next->this.serial[i] == 0)
|
||||
continue;
|
||||
|
||||
else if(list_next->this.serial[i] == 0x0A || list_next->this.serial[i] == 0x0D ||
|
||||
list_next->this.serial[i] == ' ')
|
||||
@@ -358,7 +366,8 @@ DeviceInfoList* ListDevices()
|
||||
// TODO: Get better device type from sysfs paths
|
||||
if(strlen(list_next->this.bus) == 0)
|
||||
{
|
||||
if(strncmp(dirent->d_name, "loop", 4) == 0) strncpy(list_next->this.bus, "loop", 4);
|
||||
if(strncmp(dirent->d_name, "loop", 4) == 0)
|
||||
strncpy(list_next->this.bus, "loop", 4);
|
||||
else if(strncmp(dirent->d_name, "nvme", 4) == 0)
|
||||
strncpy(list_next->this.bus, "NVMe", 4);
|
||||
else if(strncmp(dirent->d_name, "mmc", 3) == 0)
|
||||
|
||||
@@ -55,6 +55,7 @@ struct mmc_ioc_cmd
|
||||
/* DAT buffer */
|
||||
uint64_t data_ptr;
|
||||
};
|
||||
|
||||
#define mmc_ioc_cmd_set_data(ic, ptr) ic.data_ptr = (__u64)(unsigned long)ptr
|
||||
|
||||
/**
|
||||
|
||||
28
linux/scsi.c
28
linux/scsi.c
@@ -24,16 +24,8 @@
|
||||
#include "../aaruremote.h"
|
||||
#include "linux.h"
|
||||
|
||||
int32_t SendScsiCommand(void* device_ctx,
|
||||
char* cdb,
|
||||
char* buffer,
|
||||
char** sense_buffer,
|
||||
uint32_t timeout,
|
||||
int32_t direction,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t cdb_len,
|
||||
uint32_t* buf_len,
|
||||
int32_t SendScsiCommand(void *device_ctx, char *cdb, char *buffer, char **sense_buffer, uint32_t timeout,
|
||||
int32_t direction, uint32_t *duration, uint32_t *sense, uint32_t cdb_len, uint32_t *buf_len,
|
||||
uint32_t *sense_len)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
@@ -50,12 +42,20 @@ int32_t SendScsiCommand(void* device_ctx,
|
||||
|
||||
switch(direction)
|
||||
{
|
||||
case AARUREMOTE_SCSI_DIRECTION_IN: dir = SG_DXFER_FROM_DEV; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_OUT: dir = SG_DXFER_TO_DEV; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_IN:
|
||||
dir = SG_DXFER_FROM_DEV;
|
||||
break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_OUT:
|
||||
dir = SG_DXFER_TO_DEV;
|
||||
break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_INOUT:
|
||||
case AARUREMOTE_SCSI_DIRECTION_UNSPECIFIED: dir = SG_DXFER_TO_FROM_DEV; break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_UNSPECIFIED:
|
||||
dir = SG_DXFER_TO_FROM_DEV;
|
||||
break;
|
||||
case AARUREMOTE_SCSI_DIRECTION_NONE:
|
||||
default: dir = SG_DXFER_NONE; break;
|
||||
default:
|
||||
dir = SG_DXFER_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
hdr.interface_id = 'S';
|
||||
|
||||
@@ -27,20 +27,9 @@
|
||||
#include "linux.h"
|
||||
#include "mmc/ioctl.h"
|
||||
|
||||
int32_t SendSdhciCommand(void* device_ctx,
|
||||
uint8_t command,
|
||||
uint8_t write,
|
||||
uint8_t application,
|
||||
uint32_t flags,
|
||||
uint32_t argument,
|
||||
uint32_t block_size,
|
||||
uint32_t blocks,
|
||||
char* buffer,
|
||||
uint32_t buf_len,
|
||||
uint32_t timeout,
|
||||
uint32_t* response,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense)
|
||||
int32_t SendSdhciCommand(void *device_ctx, uint8_t command, uint8_t write, uint8_t application, uint32_t flags,
|
||||
uint32_t argument, uint32_t block_size, uint32_t blocks, char *buffer, uint32_t buf_len,
|
||||
uint32_t timeout, uint32_t *response, uint32_t *duration, uint32_t *sense)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
struct mmc_ioc_cmd mmc_ioc_cmd;
|
||||
@@ -79,15 +68,8 @@ int32_t SendSdhciCommand(void* device_ctx,
|
||||
return error;
|
||||
}
|
||||
|
||||
int32_t GetSdhciRegisters(void* device_ctx,
|
||||
char** csd,
|
||||
char** cid,
|
||||
char** ocr,
|
||||
char** scr,
|
||||
uint32_t* csd_len,
|
||||
uint32_t* cid_len,
|
||||
uint32_t* ocr_len,
|
||||
uint32_t* scr_len)
|
||||
int32_t GetSdhciRegisters(void *device_ctx, char **csd, char **cid, char **ocr, char **scr, uint32_t *csd_len,
|
||||
uint32_t *cid_len, uint32_t *ocr_len, uint32_t *scr_len)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
char *tmp_string;
|
||||
@@ -237,10 +219,7 @@ int32_t GetSdhciRegisters(void* device_ctx,
|
||||
return csd_len != 0 || cid_len != 0 || scr_len != 0 || ocr_len != 0;
|
||||
}
|
||||
|
||||
int32_t SendMultiSdhciCommand(void* device_ctx,
|
||||
uint64_t count,
|
||||
MmcSingleCommand commands[],
|
||||
uint32_t* duration,
|
||||
int32_t SendMultiSdhciCommand(void *device_ctx, uint64_t count, MmcSingleCommand commands[], uint32_t *duration,
|
||||
uint32_t *sense)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
|
||||
10
linux/usb.c
10
linux/usb.c
@@ -24,14 +24,8 @@
|
||||
#include "../aaruremote.h"
|
||||
#include "linux.h"
|
||||
|
||||
uint8_t GetUsbData(void* device_ctx,
|
||||
uint16_t* desc_len,
|
||||
char* descriptors,
|
||||
uint16_t* id_vendor,
|
||||
uint16_t* id_product,
|
||||
char* manufacturer,
|
||||
char* product,
|
||||
char* serial)
|
||||
uint8_t GetUsbData(void *device_ctx, uint16_t *desc_len, char *descriptors, uint16_t *id_vendor, uint16_t *id_product,
|
||||
char *manufacturer, char *product, char *serial)
|
||||
{
|
||||
DeviceContext *ctx = device_ctx;
|
||||
char *dev_path;
|
||||
|
||||
@@ -40,6 +40,7 @@ int PrintNetworkAddresses()
|
||||
}
|
||||
|
||||
char *PrintIpv4Address(struct in_addr addr) { return inet_ntoa(addr); }
|
||||
|
||||
void *NetSocket(uint32_t domain, uint32_t type, uint32_t protocol)
|
||||
{
|
||||
NetworkContext *ctx;
|
||||
|
||||
@@ -25,45 +25,25 @@ void DeviceClose(void* device_ctx) {}
|
||||
|
||||
int32_t GetDeviceType(void *device_ctx) { return AARUREMOTE_DEVICE_TYPE_UNKNOWN; }
|
||||
|
||||
int32_t GetSdhciRegisters(void* device_ctx,
|
||||
char** csd,
|
||||
char** cid,
|
||||
char** ocr,
|
||||
char** scr,
|
||||
uint32_t* csd_len,
|
||||
uint32_t* cid_len,
|
||||
uint32_t* ocr_len,
|
||||
uint32_t* scr_len)
|
||||
int32_t GetSdhciRegisters(void *device_ctx, char **csd, char **cid, char **ocr, char **scr, uint32_t *csd_len,
|
||||
uint32_t *cid_len, uint32_t *ocr_len, uint32_t *scr_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t SendSdhciCommand(void* device_ctx,
|
||||
uint8_t command,
|
||||
uint8_t write,
|
||||
uint8_t application,
|
||||
uint32_t flags,
|
||||
uint32_t argument,
|
||||
uint32_t block_size,
|
||||
uint32_t blocks,
|
||||
char* buffer,
|
||||
uint32_t buf_len,
|
||||
uint32_t timeout,
|
||||
uint32_t* response,
|
||||
uint32_t* duration,
|
||||
int32_t SendSdhciCommand(void *device_ctx, uint8_t command, uint8_t write, uint8_t application, uint32_t flags,
|
||||
uint32_t argument, uint32_t block_size, uint32_t blocks, char *buffer, uint32_t buf_len,
|
||||
uint32_t timeout, uint32_t *response, uint32_t *duration, uint32_t *sense)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SendMultiSdhciCommand(void *device_ctx, uint64_t count, MmcSingleCommand commands[], uint32_t *duration,
|
||||
uint32_t *sense)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SendMultiSdhciCommand(void* device_ctx,
|
||||
uint64_t count,
|
||||
MmcSingleCommand commands[],
|
||||
uint32_t* duration,
|
||||
uint32_t* sense)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
int32_t ReOpen(void *device_ctx, uint32_t *closeFailed)
|
||||
{
|
||||
*closeFailed = 1;
|
||||
|
||||
@@ -17,56 +17,28 @@
|
||||
|
||||
#include "../aaruremote.h"
|
||||
|
||||
int32_t SendAtaChsCommand(void* device_ctx,
|
||||
AtaRegistersChs registers,
|
||||
AtaErrorRegistersChs* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaChsCommand(void *device_ctx, AtaRegistersChs registers, AtaErrorRegistersChs *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SendAtaLba28Command(void* device_ctx,
|
||||
AtaRegistersLba28 registers,
|
||||
AtaErrorRegistersLba28* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaLba28Command(void *device_ctx, AtaRegistersLba28 registers, AtaErrorRegistersLba28 *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SendAtaLba48Command(void* device_ctx,
|
||||
AtaRegistersLba48 registers,
|
||||
AtaErrorRegistersLba48* error_registers,
|
||||
uint8_t protocol,
|
||||
uint8_t transfer_register,
|
||||
char* buffer,
|
||||
uint32_t timeout,
|
||||
uint8_t transfer_blocks,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t* buf_len)
|
||||
int32_t SendAtaLba48Command(void *device_ctx, AtaRegistersLba48 registers, AtaErrorRegistersLba48 *error_registers,
|
||||
uint8_t protocol, uint8_t transfer_register, char *buffer, uint32_t timeout,
|
||||
uint8_t transfer_blocks, uint32_t *duration, uint32_t *sense, uint32_t *buf_len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint8_t GetFireWireData(void* device_ctx,
|
||||
uint32_t* id_model,
|
||||
uint32_t* id_vendor,
|
||||
uint64_t* guid,
|
||||
char* vendor,
|
||||
uint8_t GetFireWireData(void *device_ctx, uint32_t *id_model, uint32_t *id_vendor, uint64_t *guid, char *vendor,
|
||||
char *model)
|
||||
{
|
||||
return 0;
|
||||
@@ -74,29 +46,15 @@ uint8_t GetFireWireData(void* device_ctx,
|
||||
|
||||
uint8_t GetPcmciaData(void *device_ctx, uint16_t *cis_len, char *cis) { return 0; }
|
||||
|
||||
int32_t SendScsiCommand(void* device_ctx,
|
||||
char* cdb,
|
||||
char* buffer,
|
||||
char** sense_buffer,
|
||||
uint32_t timeout,
|
||||
int32_t direction,
|
||||
uint32_t* duration,
|
||||
uint32_t* sense,
|
||||
uint32_t cdb_len,
|
||||
uint32_t* buf_len,
|
||||
int32_t SendScsiCommand(void *device_ctx, char *cdb, char *buffer, char **sense_buffer, uint32_t timeout,
|
||||
int32_t direction, uint32_t *duration, uint32_t *sense, uint32_t cdb_len, uint32_t *buf_len,
|
||||
uint32_t *sense_len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint8_t GetUsbData(void* device_ctx,
|
||||
uint16_t* desc_len,
|
||||
char* descriptors,
|
||||
uint16_t* id_vendor,
|
||||
uint16_t* id_product,
|
||||
char* manufacturer,
|
||||
char* product,
|
||||
char* serial)
|
||||
uint8_t GetUsbData(void *device_ctx, uint16_t *desc_len, char *descriptors, uint16_t *id_vendor, uint16_t *id_product,
|
||||
char *manufacturer, char *product, char *serial)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user