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

@@ -65,5 +65,62 @@ namespace DiscImageChef.Devices.Linux
public uint duration; /* [o] */
public SgInfo info; /* [o] */
}
[StructLayout(LayoutKind.Sequential)]
struct mmc_ioc_cmd
{
/// <summary>
/// Implies direction of data. true = write, false = read
/// </summary>
public bool write_flag;
/// <summary>
/// Application-specific command. true = precede with CMD55
/// </summary>
public bool is_ascmd;
public uint opcode;
public uint arg;
/// <summary>
/// CMD response
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public uint[] response;
public MmcFlags flags;
public uint blksz;
public uint blocks;
/// <summary>
/// Sleep at least <see cref="postsleep_min_us"/> useconds, and at most
/// <see cref="postsleep_max_us"/> useconds *after* issuing command.Needed for
/// some read commands for which cards have no other way of indicating
/// they're ready for the next command (i.e. there is no equivalent of
/// a "busy" indicator for read operations).
/// </summary>
public uint postsleep_min_us;
/// <summary>
/// Sleep at least <see cref="postsleep_min_us"/> useconds, and at most
/// <see cref="postsleep_max_us"/> useconds *after* issuing command.Needed for
/// some read commands for which cards have no other way of indicating
/// they're ready for the next command (i.e. there is no equivalent of
/// a "busy" indicator for read operations).
/// </summary>
public uint postsleep_max_us;
/// <summary>
/// Override driver-computed timeouts.
/// </summary>
public uint data_timeout_ns;
/// <summary>
/// Override driver-computed timeouts.
/// </summary>
public uint cmd_timeout_ms;
/// <summary>
/// For 64-bit machines <see cref="data_ptr"/> , wants to
/// be 8-byte aligned.Make sure this struct is the same size when
/// built for 32-bit.
/// </summary>
public uint __pad;
/// <summary>
/// DAT buffer
/// </summary>
public ulong data_ptr;
}
}