// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Types.cs // Author(s) : Natalia Portillo // // Component : Component // // --[ Description ] ---------------------------------------------------------- // // Description // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2016 Natalia Portillo // ****************************************************************************/ namespace DiscImageChef.Decoders.PCMCIA { /// /// Basic classure of a PCMCIA tuple /// public class Tuple { public TupleCodes Code; public byte Link; public byte[] Data; } /// /// Checksum tuple /// public class ChecksumTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Offset to region to be checksummed /// public short Offset; /// /// Length of region to be checksummed /// public ushort Length; /// /// Modulo-256 sum of region /// public byte Checksum; } /// /// Indirect Access PC Card Memory /// public class IndirectTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; } /// /// Link target tuple /// public class LinkTargetTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// 'C''I''S' in ASCII /// public byte[] Tag; } /// /// 16-bit PC Card Long Link Tuple /// public class LongLinkTuple { /// /// or or /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Target address /// public uint Address; } public class ConfigurationAddress { /// /// Target address space, 0 = attribute, 1 = common /// public byte TargetAddressSpace; /// /// Target address /// public uint Address; } /// /// Multiple function link tuple /// public class MultipleFunctionLinkTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// How many functions follow /// public byte NumberFunctions; /// /// Link to more configuration registers /// public ConfigurationAddress[] Addresses; } public class NoLinkTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; } public class AlternateStringTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Array of strings. On memory they're preceded by an ISO Escape Code indicating codepage. Here they're stored as Unicode, so no need for it. /// public string[] Strings; } public class ExtendedDeviceSpeed { /// /// Another extended follows /// public bool Extended; /// /// Speed mantisa /// public byte Mantissa; /// /// Speed exponent /// public byte Exponent; } public struct DeviceInfo { /// /// Device type code /// public DeviceTypeCodes Type; /// /// Write protected /// public bool WPS; /// /// Speed code /// public DeviceSpeedCodes Speed; /// /// Extended speeds /// public ExtendedDeviceSpeed[] ExtendedSpeeds; /// /// Extended types /// public byte[] ExtendedTypes; /// /// Size in units - 1 /// public byte Units; /// /// Code to define units unit /// public byte SizeCode; } public class DeviceTuple { /// /// or /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Array of device information bytes /// public DeviceInfo[] Infos; } public struct OtherConditionInfo { /// /// True if another other condition info follows /// public bool Extended; /// /// Vcc used /// public byte VccUsed; /// /// Supports WAIT# signal /// public bool MWAIT; } public class OtherConditionTuple { /// /// or /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Array of other condition information bytes /// public OtherConditionInfo[] OtherConditionInfos; /// /// Array of device information bytes /// public DeviceInfo[] Infos; } public struct DeviceGeometry { /// /// 1 << n-1 bytes, 2 = 16-bit PC Card, 3 = CardBus PC Card /// public byte CardInterface; /// /// Erase block size in 1 << n-1 increments of wide accesses. /// If n == 4, and == 16, erase block size = 32 * 4 = 128 bytes /// public byte EraseBlockSize; /// /// Read block size in 1 << n-1 increments of wide accesses. /// If n == 4, and == 16, read block size = 32 * 4 = 128 bytes /// public byte ReadBlockSize; /// /// Write block size in 1 << n-1 increments of wide accesses. /// If n == 4, and == 16, write block size = 32 * 4 = 128 bytes /// public byte WriteBlockSize; /// /// Device partitioning in granularity of 1 << n-1 erase blocks /// If n == 4, and erase block is 128 bytes, partitions must be aligned to 32 erase block, or 4096 bytes /// public byte Partitions; /// /// Card employs a multiple of 1 << n-1 times interleaving the entire memory arrays /// public byte Interleaving; } public class DeviceGeometryTuple { /// /// or /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Array of device geometries /// public DeviceGeometry[] Geometries; } public class FunctionIdentificationTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Function code /// public FunctionCodes Function; /// /// Device contains boot ROM /// public bool ROM; /// /// Device wants to be part of power-on-self-test /// public bool POST; } public class ManufacturerIdentificationTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Manufacturer ID /// public ushort ManufacturerID; /// /// Card ID /// public ushort CardID; } public class Level1VersionTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Major version of standard compliance /// public byte MajorVersion; /// /// Minor version of standard compliance /// public byte MinorVersion; /// /// Manufacturer string /// public string Manufacturer; /// /// Product string /// public string Product; /// /// Additional information strings /// public string[] AdditionalInformation; } public class Level2VersionTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Version of this classure /// public byte StructureVersion; /// /// Level of compliance /// public byte Compliance; /// /// Address of first data byte /// public ushort Address; /// /// Vendor-specific byte /// public byte VendorSpecific1; /// /// Vendor-specific byte /// public byte VendorSpecific2; /// /// Number of copies of CIS present /// public byte CISCopies; /// /// Vendor of software that formatted the card /// public string OEM; /// /// Informational message about the card /// public string Information; } public class GeometryTuple { /// /// /// public TupleCodes Code; /// /// Link to next tuple /// public byte Link; /// /// Sectors per track /// public byte SectorsPerTrack; /// /// Tracks per cylinder /// public byte TracksPerCylinder; /// /// Cylinders /// public ushort Cylinders; } }