// ufs.h
typedef struct {
UCHAR bLength;
UCHAR bDescriptorIDN;
UCHAR bMediaTechnology;
UCHAR Reserved1;
UCHAR qTotalRawDeviceCapacity[8];
UCHAR bMaxNumberLU;
UCHAR dSegmentSize[4];
UCHAR bAllocationUnitSize;
UCHAR bMinAddrBlockSize;
UCHAR bOptimalReadBlockSize;
UCHAR bOptimalWriteBlockSize;
UCHAR bMaxInBufferSize;
UCHAR bMaxOutBufferSize;
UCHAR bRPMB_ReadWriteSize;
UCHAR bDynamicCapacityResourcePolicy;
UCHAR bDataOrdering;
UCHAR bMaxContexIDNumber;
UCHAR bSysDataTagUnitSize;
UCHAR bSysDataTagResSize;
UCHAR bSupportedSecRTypes;
UCHAR wSupportedMemoryTypes[2];
UCHAR dSystemCodeMaxNAllocU[4];
UCHAR wSystemCodeCapAdjFac[2];
UCHAR dNonPersistMaxNAllocU[4];
UCHAR wNonPersistCapAdjFac[2];
UCHAR dEnhanced1MaxNAllocU[4];
UCHAR wEnhanced1CapAdjFac[2];
UCHAR dEnhanced2MaxNAllocU[4];
UCHAR wEnhanced2CapAdjFac[2];
UCHAR dEnhanced3MaxNAllocU[4];
UCHAR wEnhanced3CapAdjFac[2];
UCHAR dEnhanced4MaxNAllocU[4];
UCHAR wEnhanced4CapAdjFac[2];
UCHAR dOptimalLogicalBlockSize[4];
UCHAR bHPBRegionSize;
UCHAR bHPBNumberLU;
UCHAR bHPBSubRegionSize;
USHORT wDeviceMaxActiveHPBRegions;
UCHAR Reserved2[2];
UCHAR dWriteBoosterBufferMaxNAllocUnits[4];
UCHAR bDeviceMaxWriteBoosterLUs;
UCHAR bWriteBoosterBufferCapAdjFac;
UCHAR bSupportedWriteBoosterBufferUserSpaceReductionTypes;
UCHAR bSupportedWriteBoosterBufferTypes;
} UFS_GEOMETRY_DESCRIPTOR, *PUFS_GEOMETRY_DESCRIPTOR;
View the official Windows Driver Kit DDI referenceNo description available.
UFS_GEOMETRY_DESCRIPTOR describes a device's geometric parameters.
bLengthSpecifies the length of the descriptor.
bDescriptorIDNSpecifies the type of the descriptor. This descriptor will have a value of UFS_DESC_GEOMETRY_IDN.
bMediaTechnologyReserved for future use.
Reserved1Reserved for future use.
qTotalRawDeviceCapacity[8]Specifies the total raw device capacity. Expressed in units of 512 bytes.
bMaxNumberLUSpecifies the maximum number of logical unit(s) supported by the UFS (Universal Flash Storage). Contains one of the following values:
| Value | Description |
|---|---|
| 0x00 | 8 logical units. |
| 0x01 | 32 logical units. |
| Other Values | Reserved for future use. |
dSegmentSize[4]Specifies the segment size of the device in units of 512 bytes.
bAllocationUnitSizeSpecifies the allocation unit size in number of segments.
bMinAddrBlockSizeSpecifies the minimum addressable block size in units of 512 bytes. The minimum size is 4 KB or a value of 0x08.
bOptimalReadBlockSizeSpecifies the optimal read block size in units of 512 bytes.
bOptimalWriteBlockSizeSpecifies the optimal write block size in units of 512 bytes. bOptimalWriteBlockSize is equal to or greater than bMinAddrBlockSize.
bMaxInBufferSizeSpecifies the max size of the data-in buffer in units of 512 bytes. The minium size is 4 KB or a value of 0x08.
bMaxOutBufferSizeSpecifies the max size of the data-out buffer in units of 512 bytes. The minium size is 4 KB or a value of 0x08.
bRPMB_ReadWriteSizeSpecifies the maximum number of Replay Protected Memory Block (RPMB) frames allowed in Security Protocol In and Security Protocol Out. Each frame is 256-bytes.
bDynamicCapacityResourcePolicySpecifies a device's spare blocks resource management policy. Contains one of the following values:
| Value | Description |
|---|---|
| 0x00 | Spare blocks resource management policy is per logical unit. |
| 0x01 | Spare blocks resource management policy is per memory type. |
bDataOrderingSpecifies if a device supports out-of-order data transfer. Contains one of the following values:
| Value | Description |
|---|---|
| 0x00 | Out-of-order data transfer is not supported. |
| 0x01 | Out-of-order data transfer is supported. |
| All other values | Reserved for future use. |
bMaxContexIDNumberSpecifies the max number of contexts supported by a device. This number must be greater than 5.
bSysDataTagUnitSizeSpecifies the system data tag unit size.
bSysDataTagResSizeSpecifies the maximum size in bytes allocated by the device to handle system data.
bSupportedSecRTypesSpecifies the supported Secure Removal types. The first 3 bits of the variable are flags that represent different supported Secure Removal types.
| Bit | Description |
|---|---|
| 0 | Information removed with an erase of the physical memory. |
| 1 | Information removed by overwriting the addressed locations with a single character followed by an erase. |
| 2 | Information removed by overwriting the addressed locations with a character, its complement, then a random character. |
| 3 | Information removed using a vendor-defined mechanism. |
| 4-7 | Reserved for future use. |
wSupportedMemoryTypes[2]Specifies the supported memory types in a bitmap.
| Bit | Description |
|---|---|
| 0 | A normal memory type is supported. |
| 1 | A system code memory type is supported. |
| 2 | A non-persistent memory type is supported. |
| 3 | Enhanced memory type 1 is supported. |
| 4 | Enhanced memory type 2 is supported. |
| 5 | Enhanced memory type 3 is supported. |
| 6 | Enhanced memory type 4 is supported. |
| 7-14 | Reserved for future use. |
| 15 | A RPMB memory type is supported. |
dSystemCodeMaxNAllocU[4]Specifies the maximum number of allocation units for the System Code for a device.
wSystemCodeCapAdjFac[2]Species the Capacity Adjustment Factor for the System Code memory type.
dNonPersistMaxNAllocU[4]Species the maximum number of Allocation Units for a non-persistent memory type.
wNonPersistCapAdjFac[2]Specifies the capacity adjustment factor for the non-persistent memory type.
dEnhanced1MaxNAllocU[4]Specifies the max number of Allocation Units for the enhanced memory type 1.
wEnhanced1CapAdjFac[2]Specifies the Capacity Adjustment Factor for the enhanced memory type 1.
dEnhanced2MaxNAllocU[4]Specifies the max number of Allocation Units for the enhanced memory type 2.
wEnhanced2CapAdjFac[2]Specifies the Capacity Adjustment Factor for the enhanced memory type 2.
dEnhanced3MaxNAllocU[4]Specifies the max number of Allocation Units for the enhanced memory type 3.
wEnhanced3CapAdjFac[2]Specifies the Capacity Adjustment Factor for the enhanced memory type 3.
dEnhanced4MaxNAllocU[4]Specifies the max number of Allocation Units for the enhanced memory type 4.
wEnhanced4CapAdjFac[2]Specifies the Capacity Adjustment Factor for the enhanced memory type 4.
dOptimalLogicalBlockSize[4]Specifies the optimal logical block size.
bHPBRegionSizeSpecifies the size of the HPB region.
bHPBNumberLUSpecifies the maximum number of logical units in which HPB can be enabled.
bHPBSubRegionSizeSpecifies the size of the HPB subregion. The bHPBSubRegionSize can't exceed bHPBRegionSize.
wDeviceMaxActiveHPBRegionsSpecifies the mximum number of active HPB regions supported by the device.
Reserved2[2]Reserved for future use.
dWriteBoosterBufferMaxNAllocUnits[4]Specifies the total WriteBooster buffer size supported by the device. The sum of WriteBooster buffer sizes for all LUs is less than or equal to the value indicated by dWriteBoosterBufferMaxNAllocUnits.
bDeviceMaxWriteBoosterLUsSpecifies the maximum number of supported WriteBooster buffers.
bWriteBoosterBufferCapAdjFacSpecifies the capacity adjustment factor for the WriteBooster buffer memory type. This value provides the LBA space reduction multiplication factor when WriteBooster Buffer is configured in user space reduction mode. Therefore, this parameter applies only if bWriteBoosterBufferPreserveUserSpaceEn is 0x00.
bSupportedWriteBoosterBufferUserSpaceReductionTypesSpecifies the supportability of user space reduction mode and preserve user space mode.
bSupportedWriteBoosterBufferTypesSpecifies the supportability of WriteBooster buffer type.
If the size of the data transferred exceeds the number of frames bRPMB_ReadWriteSize, it will be done in multiple Security commands.
The Capacity Adjustment Factor value for a normal memory type is equal to one.