2017-12-16 20:02:16 +00:00
|
|
|
//
|
|
|
|
|
// Created by claunia on 16/12/17.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#ifndef DISCIMAGECHEF_DEVICE_REPORT_SCSI_MODE_H
|
|
|
|
|
#define DISCIMAGECHEF_DEVICE_REPORT_SCSI_MODE_H
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2017-12-18 18:28:33 +00:00
|
|
|
uint8_t Density;
|
2017-12-16 20:02:16 +00:00
|
|
|
uint64_t Blocks;
|
|
|
|
|
uint32_t BlockLength;
|
|
|
|
|
} BlockDescriptor;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2017-12-18 18:28:33 +00:00
|
|
|
uint8_t MediumType;
|
|
|
|
|
int WriteProtected;
|
2017-12-16 20:02:16 +00:00
|
|
|
BlockDescriptor BlockDescriptors[4096];
|
2017-12-18 18:28:33 +00:00
|
|
|
int descriptorsLength;
|
|
|
|
|
uint8_t Speed;
|
|
|
|
|
uint8_t BufferedMode;
|
|
|
|
|
int EBC;
|
|
|
|
|
int DPOFUA;
|
|
|
|
|
int decoded;
|
2017-12-16 20:02:16 +00:00
|
|
|
} ModeHeader;
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2017-12-18 18:28:33 +00:00
|
|
|
ModeHeader Header;
|
2017-12-16 20:02:16 +00:00
|
|
|
unsigned char *Pages[256][256];
|
2017-12-18 18:28:33 +00:00
|
|
|
size_t pageSizes[256][256];
|
|
|
|
|
int decoded;
|
2017-12-16 20:02:16 +00:00
|
|
|
} DecodedMode;
|
|
|
|
|
|
2017-12-18 18:28:33 +00:00
|
|
|
ModeHeader *DecodeModeHeader6(unsigned char *modeResponse, uint8_t deviceType);
|
|
|
|
|
|
|
|
|
|
ModeHeader *DecodeModeHeader10(unsigned char *modeResponse, uint8_t deviceType);
|
|
|
|
|
|
|
|
|
|
DecodedMode *DecodeMode6(unsigned char *modeResponse, uint8_t deviceType);
|
|
|
|
|
|
|
|
|
|
DecodedMode *DecodeMode10(unsigned char *modeResponse, uint8_t deviceType);
|
|
|
|
|
|
2017-12-16 20:02:16 +00:00
|
|
|
#endif //DISCIMAGECHEF_DEVICE_REPORT_SCSI_MODE_H
|