Add MMC/SecureDigital device support. Not yet used because of

a bad implementation of SEND_CSD and SEND_CID commands (TODO).
This commit is contained in:
2016-10-22 22:58:01 +01:00
parent 8b9d678893
commit 0c9dfaa11f
24 changed files with 3607 additions and 3 deletions

View File

@@ -90,6 +90,41 @@ namespace DiscImageChef.Devices
type = DeviceType.Unknown;
scsiType = Decoders.SCSI.PeripheralDeviceTypes.UnknownDevice;
// TODO: This is getting error -110 in Linux. Apparently I should set device to standby, request CID/CSD, put device to transition. However I can't get it right now.
/*
try
{
byte[] csdBuf;
byte[] scrBuf;
uint[] mmcResponse;
double mmcDuration;
bool mmcSense = ReadCID(out csdBuf, out mmcResponse, 0, out mmcDuration);
if(!mmcSense)
{
mmcSense = ReadSCR(out scrBuf, out mmcResponse, 0, out mmcDuration);
if(!mmcSense)
type = DeviceType.SecureDigital;
else
type = DeviceType.MMC;
manufacturer = "To be filled manufacturer";
model = "To be filled model";
revision = "To be filled revision";
serial = "To be filled serial";
scsiType = Decoders.SCSI.PeripheralDeviceTypes.DirectAccess;
removable = false;
return;
}
else
System.Console.WriteLine("Error {0}: {1}", error, lastError);
}
catch(NotImplementedException) { }
catch(InvalidOperationException) { }
*/
AtaErrorRegistersCHS errorRegisters;
byte[] ataBuf;
@@ -288,7 +323,6 @@ namespace DiscImageChef.Devices
pcmcia = false;
#endregion PCMCIA
if(!scsiSense)
{
Decoders.SCSI.Inquiry.SCSIInquiry? Inquiry = Decoders.SCSI.Inquiry.Decode(inqBuf);