123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #ifndef __BLACKSASI_CONFIG_H__
- #define __BLACKSASI_CONFIG_H__
- #include <SdFat.h>
- #include "sdios.h"
- #include "blacksasi.h"
- typedef enum
- {
- S2S_CFG_QUIRKS_NONE = 0,
- S2S_CFG_QUIRKS_APPLE = 1,
- S2S_CFG_QUIRKS_OMTI = 2,
- S2S_CFG_QUIRKS_XEBEC = 4,
- S2S_CFG_QUIRKS_VMS = 8,
- S2S_CFG_QUIRKS_X68000 = 16,
- } S2S_CFG_QUIRKS;
- struct SCSI_INQUIRY_DATA
- {
- union
- {
- struct {
- // bitfields are in REVERSE order for ARM
- // byte 0
- byte peripheral_device_type:5;
- byte peripheral_qualifier:3;
- // byte 1
- byte reserved_byte2:7;
- byte rmb:1;
- // byte 2
- byte ansi_version:3;
- byte always_zero_byte3:5;
- // byte 3
- byte response_format:4;
- byte reserved_byte4:2;
- byte tiop:1;
- byte always_zero_byte4:1;
- // byte 4
- byte additional_length;
- // byte 5-6
- byte reserved_byte5;
- byte reserved_byte6;
- // byte 7
- byte sync:1;
- byte always_zero_byte7_more:4;
- byte always_zero_byte7:3;
- // byte 8-15
- char vendor[8];
- // byte 16-31
- char product[16];
- // byte 32-35
- char revision[4];
- // byte 36
- byte release;
- // 37-46
- char revision_date[10];
- };
- // raw bytes
- byte raw[64];
- };
- };
- // HDD image
- typedef __attribute__((aligned(4))) struct _SCSI_DEVICE
- {
- FsFile *m_file; // File object
- uint64_t m_fileSize; // File size
- uint16_t m_blocksize; // SCSI BLOCK size
- uint16_t m_rawblocksize; // OPTICAL raw sector size
- uint8_t m_type; // SCSI device type
- uint32_t m_blockcount; // blockcount
- bool m_raw; // Raw disk
- SCSI_INQUIRY_DATA *inquiry_block; // SCSI information
- uint8_t m_senseKey; // Sense key
- uint16_t m_additional_sense_code; // ASC/ASCQ
- bool m_mode2; // MODE2 CDROM
- uint8_t m_sector_offset; // optical sector offset for missing sync header
- uint16_t m_quirks;
- } SCSI_DEVICE;
- uint32 readSCSIDeviceConfig(SCSI_DEVICE *dev);
- uint32 readHWVersion();
- #endif // __BLACKSASI_CONFIG_H__
|