"""
geometry.py     - Device Geometry Data Structure
"""

from ctypes import Structure, c_uint8, c_uint16, c_uint32
# pylint: disable=locally-disabled, too-few-public-methods


class LBAF(Structure):
    """LBA format"""
    _pack_ = 1
    _fields_ = [
        ('GBL', c_uint8),   # 0 Group bit length
        ('PBL', c_uint8),   # PU bit length
        ('CBL', c_uint8),   # Chunk bit length
        ('BBL', c_uint8),   # Logical block bit length
        ('RSV0', c_uint32),
    ]


class Geometry(Structure):
    """Device Geometry Data Structure"""
    _pack_ = 1
    _fields_ = [
        ('MJR', c_uint8),           # Major Version Number
        ('MNR', c_uint8),           # Minor Version Number
        ('RSV0', c_uint8 * 6),      # Number of configuration groups
        ('LBAF', LBAF),             # LBA Format
        ('MCCAP', c_uint32),        # Media and Controller Capabilities
        ('RSV1', c_uint8 * 12),     # Current device operating mode
        ('WIT', c_uint8),           # Wear-level Index Delta Threshold
        ('RSV2', c_uint8 * 31),
        ('NUM_GRP', c_uint16),      # Number of Groups
        ('NUM_PU', c_uint16),       # Number of parallel units per group
        ('NUM_CHK', c_uint32),      # Number of chunks per parallel unit
        ('CLBA', c_uint32),         # Chunk Size
        ('RSV3', c_uint8 * 52),     # Description of the 4th group
        ('WS_MIN', c_uint32),       # Minimum Write Size
        ('WS_OPT', c_uint32),       # Optimal Write Size
        ('MW_CUNITS', c_uint32),    # Cache Minimum Write Size Units
        ('MAXOC', c_uint32),        # Maximum Open Chunks
        ('MAXOCPU', c_uint32),      # Maximum Open Chunks per PU
        ('RSV4', c_uint8 * 44),
        ('TRDT', c_uint32),         # tRD Typical
        ('TRDM', c_uint32),         # tRD Max
        ('TWRT', c_uint32),         # tWR Typical
        ('TWRM', c_uint32),         # tWR Max
        ('TCRST', c_uint32),        # tCRS Typical
        ('TCRSM', c_uint32),        # tCRS Max
        ('RSV5', c_uint8 * 40),
        ('RSV6', c_uint8 * 2816),
        ('VS', c_uint8 * 1024),     # Vendor Specific
    ]

"""
geometry.py     - Device Geometry Data Structure
"""

from ctypes import Structure, c_uint8, c_uint16, c_uint32
# pylint: disable=locally-disabled, too-few-public-methods


class LBAF(Structure):
    """LBA format"""
    _pack_ = 1
    _fields_ = [
        ('GBL', c_uint8),   # 0 Group bit length
        ('PBL', c_uint8),   # PU bit length
        ('CBL', c_uint8),   # Chunk bit length
        ('BBL', c_uint8),   # Logical block bit length
        ('RSV0', c_uint32),
    ]


class Geometry(Structure):
    """Device Geometry Data Structure"""
    _pack_ = 1
    _fields_ = [
        ('MJR', c_uint8),           # Major Version Number
        ('MNR', c_uint8),           # Minor Version Number
        ('RSV0', c_uint8 * 6),      # Number of configuration groups
        ('LBAF', LBAF),             # LBA Format
        ('MCCAP', c_uint32),        # Media and Controller Capabilities
        ('RSV1', c_uint8 * 12),     # Current device operating mode
        ('WIT', c_uint8),           # Wear-level Index Delta Threshold
        ('RSV2', c_uint8 * 31),
        ('NUM_GRP', c_uint16),      # Number of Groups
        ('NUM_PU', c_uint16),       # Number of parallel units per group
        ('NUM_CHK', c_uint32),      # Number of chunks per parallel unit
        ('CLBA', c_uint32),         # Chunk Size
        ('RSV3', c_uint8 * 52),     # Description of the 4th group
        ('WS_MIN', c_uint32),       # Minimum Write Size
        ('WS_OPT', c_uint32),       # Optimal Write Size
        ('MW_CUNITS', c_uint32),    # Cache Minimum Write Size Units
        ('MAXOC', c_uint32),        # Maximum Open Chunks
        ('MAXOCPU', c_uint32),      # Maximum Open Chunks per PU
        ('RSV4', c_uint8 * 44),
        ('TRDT', c_uint32),         # tRD Typical
        ('TRDM', c_uint32),         # tRD Max
        ('TWRT', c_uint32),         # tWR Typical
        ('TWRM', c_uint32),         # tWR Max
        ('TCRST', c_uint32),        # tCRS Typical
        ('TCRSM', c_uint32),        # tCRS Max
        ('RSV5', c_uint8 * 40),
        ('RSV6', c_uint8 * 2816),
        ('VS', c_uint8 * 1024),     # Vendor Specific
    ]

geometry.py     - Device Geometry Data Structure # pylint: disable=locally-disabled, too-few-public-methods LBA format # 0 Group bit length # PU bit length # Chunk bit length # Logical block bit length Device Geometry Data Structure # Major Version Number # Minor Version Number # Number of configuration groups # LBA Format # Media and Controller Capabilities # Current device operating mode # Wear-level Index Delta Threshold # Number of Groups # Number of parallel units per group # Number of chunks per parallel unit # Chunk Size # Description of the 4th group # Minimum Write Size # Optimal Write Size # Cache Minimum Write Size Units # Maximum Open Chunks # Maximum Open Chunks per PU # tRD Typical # tRD Max # tWR Typical # tWR Max # tCRS Typical # tCRS Max # Vendor Specific