mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
Add packets for SCSI, ATA and SDHCI commands.
This commit is contained in:
184
dicmote.h
184
dicmote.h
@@ -29,6 +29,16 @@
|
|||||||
#define DICMOTE_PACKET_TYPE_COMMAND_LIST_DEVICES 2
|
#define DICMOTE_PACKET_TYPE_COMMAND_LIST_DEVICES 2
|
||||||
#define DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES 3
|
#define DICMOTE_PACKET_TYPE_RESPONSE_LIST_DEVICES 3
|
||||||
#define DICMOTE_PACKET_TYPE_COMMAND_OPEN_DEVICE 4
|
#define DICMOTE_PACKET_TYPE_COMMAND_OPEN_DEVICE 4
|
||||||
|
#define DICMOTE_PACKET_TYPE_COMMAND_SCSI 5
|
||||||
|
#define DICMOTE_PACKET_TYPE_RESPONSE_SCSI 6
|
||||||
|
#define DICMOTE_PACKET_TYPE_COMMAND_ATA_CHS 7
|
||||||
|
#define DICMOTE_PACKET_TYPE_RESPONSE_ATA_CHS 8
|
||||||
|
#define DICMOTE_PACKET_TYPE_COMMAND_ATA_LBA28 9
|
||||||
|
#define DICMOTE_PACKET_TYPE_RESPONSE_ATA_LBA28 10
|
||||||
|
#define DICMOTE_PACKET_TYPE_COMMAND_ATA_LBA48 11
|
||||||
|
#define DICMOTE_PACKET_TYPE_RESPONSE_ATA_LBA48 12
|
||||||
|
#define DICMOTE_PACKET_TYPE_COMMAND_SDHCI 13
|
||||||
|
#define DICMOTE_PACKET_TYPE_RESPONSE_SDHCI 14
|
||||||
#define DICMOTE_PROTOCOL_MAX 1
|
#define DICMOTE_PROTOCOL_MAX 1
|
||||||
#define DICMOTE_PACKET_NOP_REASON_OOO 0
|
#define DICMOTE_PACKET_NOP_REASON_OOO 0
|
||||||
#define DICMOTE_PACKET_NOP_REASON_NOT_IMPLEMENTED 1
|
#define DICMOTE_PACKET_NOP_REASON_NOT_IMPLEMENTED 1
|
||||||
@@ -103,6 +113,180 @@ typedef struct
|
|||||||
char device_path[1024];
|
char device_path[1024];
|
||||||
} DicPacketCmdOpen;
|
} DicPacketCmdOpen;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t cdb_len;
|
||||||
|
uint32_t buf_len;
|
||||||
|
int32_t direction;
|
||||||
|
uint32_t timeout;
|
||||||
|
} DicPacketCmdScsi;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t sense_len;
|
||||||
|
uint32_t buf_len;
|
||||||
|
uint32_t duration;
|
||||||
|
uint32_t sense;
|
||||||
|
uint32_t errno;
|
||||||
|
} DicPacketResScsi;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t Feature;
|
||||||
|
uint8_t SectorCount;
|
||||||
|
uint8_t Sector;
|
||||||
|
uint8_t CylinderLow;
|
||||||
|
uint8_t CylinderHigh;
|
||||||
|
uint8_t DeviceHead;
|
||||||
|
uint8_t Command;
|
||||||
|
} AtaRegistersChs;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t Status;
|
||||||
|
uint8_t Error;
|
||||||
|
uint8_t SectorCount;
|
||||||
|
uint8_t Sector;
|
||||||
|
uint8_t CylinderLow;
|
||||||
|
uint8_t CylinderHigh;
|
||||||
|
uint8_t DeviceHead;
|
||||||
|
} AtaErrorRegistersChs;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
AtaRegistersChs registers;
|
||||||
|
uint8_t protocol;
|
||||||
|
uint8_t transferRegister;
|
||||||
|
uint8_t transferBlocks;
|
||||||
|
uint8_t spare;
|
||||||
|
uint32_t timeout;
|
||||||
|
} DicPacketCmdAtaChs;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
AtaErrorRegistersChs registers;
|
||||||
|
uint32_t duration;
|
||||||
|
uint32_t sense;
|
||||||
|
uint32_t errno;
|
||||||
|
} DicPacketResAtaChs;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t Feature;
|
||||||
|
uint8_t SectorCount;
|
||||||
|
uint8_t LbaLow;
|
||||||
|
uint8_t LbaMid;
|
||||||
|
uint8_t LbaHigh;
|
||||||
|
uint8_t DeviceHead;
|
||||||
|
uint8_t Command;
|
||||||
|
} AtaRegistersLba28;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t Status;
|
||||||
|
uint8_t Error;
|
||||||
|
uint8_t SectorCount;
|
||||||
|
uint8_t LbaLow;
|
||||||
|
uint8_t LbaMid;
|
||||||
|
uint8_t LbaHigh;
|
||||||
|
uint8_t DeviceHead;
|
||||||
|
} AtaErrorRegistersLba28;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
AtaRegistersLba28 registers;
|
||||||
|
uint8_t protocol;
|
||||||
|
uint8_t transferRegister;
|
||||||
|
uint8_t transferBlocks;
|
||||||
|
uint8_t spare;
|
||||||
|
uint32_t timeout;
|
||||||
|
} DicPacketCmdAtaLba28;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
AtaErrorRegistersLba28 registers;
|
||||||
|
uint32_t duration;
|
||||||
|
uint32_t sense;
|
||||||
|
uint32_t errno;
|
||||||
|
} DicPacketResAtaLba28;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint16_t Feature;
|
||||||
|
uint16_t SectorCount;
|
||||||
|
uint16_t LbaLow;
|
||||||
|
uint16_t LbaMid;
|
||||||
|
uint16_t LbaHigh;
|
||||||
|
uint8_t DeviceHead;
|
||||||
|
uint8_t Command;
|
||||||
|
} AtaRegistersLba48;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t Status;
|
||||||
|
uint8_t Error;
|
||||||
|
uint16_t SectorCount;
|
||||||
|
uint16_t LbaLow;
|
||||||
|
uint16_t LbaMid;
|
||||||
|
uint16_t LbaHigh;
|
||||||
|
uint8_t DeviceHead;
|
||||||
|
} AtaErrorRegistersLba48;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
AtaRegistersLba48 registers;
|
||||||
|
uint8_t protocol;
|
||||||
|
uint8_t transferRegister;
|
||||||
|
uint8_t transferBlocks;
|
||||||
|
uint8_t spare;
|
||||||
|
uint32_t timeout;
|
||||||
|
} DicPacketCmdAtaLba48;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
AtaErrorRegistersLba48 registers;
|
||||||
|
uint32_t duration;
|
||||||
|
uint32_t sense;
|
||||||
|
uint32_t errno;
|
||||||
|
} DicPacketResAtaLba48;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint8_t command;
|
||||||
|
uint8_t write;
|
||||||
|
uint8_t application;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t argument;
|
||||||
|
uint32_t block_size;
|
||||||
|
uint32_t blocks;
|
||||||
|
uint32_t buf_len;
|
||||||
|
uint32_t timeout;
|
||||||
|
} DicPacketCmdSdhci;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DicPacketHeader hdr;
|
||||||
|
uint32_t buf_len;
|
||||||
|
uint32_t response[4];
|
||||||
|
uint32_t duration;
|
||||||
|
uint32_t sense;
|
||||||
|
uint32_t errno;
|
||||||
|
} DicPacketResSdhci;
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
DeviceInfoList* ListDevices();
|
DeviceInfoList* ListDevices();
|
||||||
|
|||||||
Reference in New Issue
Block a user