Skip to main content
Version: 1.13

API Management Commands

SEFLibraryInit

struct SEFStatus SEFLibraryInit(void)

Initializes the SEF Library, enumerates the SEF Units present, and returns the number of units found. Every successful call to SEFLibraryInit() must be balanced with a call to SEFLibraryCleanup().

See Also: SEFLibraryCleanup()

Return value of SEFLibraryInit

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFLibraryInit

Error ValueDescription
0The info member returns the number of units

SEFGetHandle

SEFHandle SEFGetHandle(uint16_t index)

Returns a handle to the SEF Unit at the specified index (zero based)

Parameters of SEFGetHandle

TypeNameDirectionDescription
uint16_tindexInIndex of the SEF Unit

Return value of SEFGetHandle

TypeDescription
SEFHandleHandle to the SEF Unit

SEFLibraryCleanup

struct SEFStatus SEFLibraryCleanup(void)

Performs cleanup of the SEF Library and releases resources. Every successful call to SEFLibraryInit() must be balanced with a call to SEFLibraryCleanup(). Note: When the returned status error and info fields are zero, all open handles are closed, invalidated and are unusable.

See Also: SEFLibraryInit()

Return value of SEFLibraryCleanup

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFLibraryCleanup

Error ValueDescription
0The info field is the library's reference count.
-ENODEVThe SEF Library was not initialized
-EWOULDBLOCKThis function cannot be called on a callback thread

SEFGetInformation

const struct SEFInfo* SEFGetInformation(SEFHandle sefHandle)

Gets device information. Returns ADU size(s), number of channels, number of dies, and other associated information. Dynamic values are refreshed just before the structure is returned.

Parameters of SEFGetInformation

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit

Return value of SEFGetInformation

TypeDescription
const struct SEFInfo *SEFInfo struct or NULL if sefHandle is NULL.

SEFListVirtualDevices

struct SEFStatus SEFListVirtualDevices(SEFHandle sefHandle, struct SEFVirtualDeviceList *list, int bufferSize)

Returns a list of the defined Virtual Devices. When list is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete list. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the list structure.

Parameters of SEFListVirtualDevices

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFVirtualDeviceList*listOutBuffer for storing list of Virtual Devices
intbufferSizeInBuffer size

Return value of SEFListVirtualDevices

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFListVirtualDevices

Error ValueDescription
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFListQoSDomains

struct SEFStatus SEFListQoSDomains(SEFHandle sefHandle, struct SEFQoSDomainList *list, int bufferSize)

Returns a list of the defined QoS Domains. When list is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete list. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the list structure.

Parameters of SEFListQoSDomains

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFQoSDomainList*listOutBuffer for storing list of QoS Domains
intbufferSizeInBuffer size

Return value of SEFListQoSDomains

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFListQoSDomains

Error ValueDescription
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetUserAddressMeta

static uint32_t SEFGetUserAddressMeta(struct SEFUserAddress userAddress)

Parameters of SEFGetUserAddressMeta

TypeNameDirectionDescription
struct SEFUserAddressuserAddressInUser address to be parsed

Return value of SEFGetUserAddressMeta

TypeDescription
uint32_tReturns meta value from a user address

SEFGetUserAddressLba

static uint64_t SEFGetUserAddressLba(struct SEFUserAddress userAddress)

Parameters of SEFGetUserAddressLba

TypeNameDirectionDescription
struct SEFUserAddressuserAddressInUser address to be parsed

Return value of SEFGetUserAddressLba

TypeDescription
uint64_tReturns LBA value from a user address

SEFParseUserAddress

static void SEFParseUserAddress(struct SEFUserAddress userAddress, uint64_t *lba, uint32_t *meta)

Return LBA and meta values from a user address.

Parameters of SEFParseUserAddress

TypeNameDirectionDescription
struct SEFUserAddressuserAddressInUser address to be parsed
uint64_t *lbaOutLba parsed from the user address
uint32_t *metaOutMeta parsed from the user address

SEFCreateUserAddress

static struct SEFUserAddress SEFCreateUserAddress(uint64_t lba, uint32_t meta)

Creates a user address from lba and meta values.

Parameters of SEFCreateUserAddress

TypeNameDirectionDescription
uint64_tlbaInlba to be used to generate user address (40 bits)
uint32_tmetaInmeta to be used to generate user address (24 bits)

Return value of SEFCreateUserAddress

TypeDescription
struct SEFUserAddressReturns the user address created from lba and meta values

SEFCreateVirtualDevices

struct SEFStatus SEFCreateVirtualDevices(SEFHandle sefHandle, uint16_t numVirtualDevices, struct SEFVirtualDeviceConfig *const virtualDeviceConfigs[])

Creates the Virtual Devices and allocates physical resources. Configuring the virtual devices for a SEF Unit is only done during pre-production. Once the flash of a SEF Unit has been written to, it is not possible to change the Virtual Device configuration. Configuration is accomplished by supplying a array of pointers to virtualDeviceConfigs. Each Virtual Device being configured will have a single array entry. Each of those entries contains a list of die IDs that will define a specific Virtual Device. The superBlockDies in the config must be 0 or evenly divide into the number of dies specified by the die list. Valid die IDs start at 0 and are less than the total number of dies in a SEF Unit. The total number of dies is equal to SEFInfo::numBanks SEFInfo::numChannels. The die ID of a die at channel CH, bank BNK, is equal to CH + BNKSEFInfo::numChannels. The die IDs in the dieList in a virtual device configuration must be in ascending order. A die ID can only be used in at most one Virtual Device configuration. If a die is not included in any Virtual Device configuration, it will be lost capacity that can never be used.

See Also: SEFGetInformation()

Parameters of SEFCreateVirtualDevices

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
uint16_tnumVirtualDevicesInNumber of entries in virtualDeviceConfigs
const struct SEFVirtualDeviceConfig[]*virtualDeviceConfigsInPointers to configurations describing how to create the virtual devices

Return value of SEFCreateVirtualDevices

TypeDescription
struct SEFStatusStatus and info summarizing result. Returns 0 on success and negative value on error.

Return values of SEFCreateVirtualDevices

Error ValueDescription
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-EACCESYou don't have the needed permission to perform this operation

SEFSetNumberOfPSLCSuperBlocks

struct SEFStatus SEFSetNumberOfPSLCSuperBlocks(SEFVDHandle vdHandle, uint32_t numPSLCSuperBlocks)

Sets the number of pSLC super blocks. This defines the number of regular super blocks which are transformed to use as pSLC super blocks. Because it applies to all the dies in the Virtual Device, the value must be a multiple of the ratio of the number of dies in the Virtual Device to the number of configured dies per super block. Once super blocks have been allocated from the Virtual Device, it may not be possible to modify the number of pSLC super blocks and the call will fail with -ENOSPC.

Parameters of SEFSetNumberOfPSLCSuperBlocks

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the SEF Unit
uint32_tnumPSLCSuperBlocksInThe number of pSLC super blocks to set

Return values of SEFSetNumberOfPSLCSuperBlocks

Error ValueDescription
0The number of pSLC super blocks has been set
-ENODEVThe SEF Handle is not valid
-ENOSPCNo space is available for pSLC super blocks
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid.

SEFGetVirtualDeviceUsage

struct SEFStatus SEFGetVirtualDeviceUsage(SEFVDHandle vdHandle, struct SEFVirtualDeviceUsage *usage)

Returns Virtual Device usage.

Parameters of SEFGetVirtualDeviceUsage

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the Virtual Device
struct SEFVirtualDeviceUsage*usageOutBuffer for storing VD usage

Return value of SEFGetVirtualDeviceUsage

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetVirtualDeviceUsage

Error ValueDescription
-ENODEVThe Virtual Device Handle is not valid
-EPERMThe Virtual Device Handle is not open

SEFGetDieList

struct SEFStatus SEFGetDieList(SEFHandle sefHandle, struct SEFVirtualDeviceID virtualDeviceID, struct SEFDieList *list, int bufferSize)

Returns Virtual Device die list. When list is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete list. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the list structure.

Parameters of SEFGetDieList

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFVirtualDeviceIDvirtualDeviceIDInVirtual Device ID
struct SEFDieList*listOutBuffer for storing VD information
intbufferSizeInBuffer size

Return value of SEFGetDieList

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetDieList

Error ValueDescription
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetVirtualDeviceInformation

struct SEFStatus SEFGetVirtualDeviceInformation(SEFHandle sefHandle, struct SEFVirtualDeviceID virtualDeviceID, struct SEFVirtualDeviceInfo *info, int bufferSize)

Returns Virtual Device information. When info is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete set of information. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the info structure.

Parameters of SEFGetVirtualDeviceInformation

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFVirtualDeviceIDvirtualDeviceIDInVirtual Device ID
struct SEFVirtualDeviceInfo*infoOutBuffer for storing VD information
intbufferSizeInBuffer size

Return value of SEFGetVirtualDeviceInformation

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetVirtualDeviceInformation

Error ValueDescription
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFSetVirtualDeviceSuspendConfig

struct SEFStatus SEFSetVirtualDeviceSuspendConfig(SEFVDHandle vdHandle, const struct SEFVirtualDeviceSuspendConfig *config)

Sets the suspend configuration for a Virtual Device.

Parameters of SEFSetVirtualDeviceSuspendConfig

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the SEF Unit
const struct SEFVirtualDeviceSuspendConfig*configInSuspend configuration to set

Return values of SEFSetVirtualDeviceSuspendConfig

Error ValueDescription
0The suspend configuration has been set
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid.

SEFCreateQoSDomain

struct SEFStatus SEFCreateQoSDomain(SEFVDHandle vdHandle, struct SEFQoSDomainID QoSDomainID, uint64_t flashCapacity, uint64_t pSLCFlashCapacity, int ADUindex, enum SEFAPIIdentifier api, enum SEFDefectManagementMethod defectStrategy, enum SEFErrorRecoveryMode recovery, const char *encryptionKey, uint16_t numPlacementIDs, uint16_t maxOpenSuperBlocks, uint8_t defaultReadQueue, struct SEFWeights weights)

Attempts to create a QoS Domain in the specified Virtual Device. Returns an error when the target Virtual Device doesn’t have enough flash memory space. The actual flash capacity reserved in the Virtual Device is typically larger than what was requested by flashCapacity.

See Also: SEFGetInformation()

Parameters of SEFCreateQoSDomain

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the Virtual Device
struct SEFQoSDomainIDQoSDomainIDInQoS Domain ID. Unique across all QoS Domains
uint64_tflashCapacityInNumber of required/reserved ADUs
uint64_tpSLCFlashCapacityInNumber of required/reserved pSLC adus
intADUindexInIndex into the ADUSize[] array in SEFInfo returned by SEFGetInformation() to select the data and metadata sizes of an ADU.
enum SEFAPIIdentifierapiInSpecifies the API Identifier for this QoS Domain
enum SEFDefectManagementMethoddefectStrategyInSpecifies the defect management strategy for the QoS Domain
enum SEFErrorRecoveryModerecoveryInSpecifies the recovery mode for this QoS Domain
const char *encryptionKeyInNULL for disabled.
uint16_tnumPlacementIDsInThe maximum number of Placement IDs that can be placed on the QoS Domain.
uint16_tmaxOpenSuperBlocksInThe maximum number super blocks that can be open in a QoS Domain. If less than numPlacementIDs it will be set to numPlacementIDs+2. This affects resource/memory usage in the device.
uint8_tdefaultReadQueueInThe default read queue assignment, 0 through numReadQueues-1 defined for the Virtual Device.
struct SEFWeightsweightsInWeight values for each type of write I/O operations.

Return value of SEFCreateQoSDomain

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFCreateQoSDomain

Error ValueDescription
-ENODEVThe Virtual Device Handle is not valid
-EPERMThe Virtual Device Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-ENOMEMThe library was unable to allocate needed structures. status.info is set to the type of capacity that caused the failure (kForWrite or kForPSLCWrite)

SEFSetQoSDomainCapacity

struct SEFStatus SEFSetQoSDomainCapacity(SEFVDHandle vdHandle, struct SEFQoSDomainID QoSDomainID, enum SEFSuperBlockType type, uint64_t flashCapacity, uint64_t flashQuota)

Resets the capacity of a QoS Domain. Sets a new capacity and quota for the QoS Domain. When the flashQuota is less the flashCapacity or the used flashedCapacity, it will be set to the larger of the two.

Parameters of SEFSetQoSDomainCapacity

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the Virtual Device
struct SEFQoSDomainIDQoSDomainIDInQoS Domain ID
enum SEFSuperBlockTypetypeInType of super block
uint64_tflashCapacityInNumber of required/reserved ADUs for the specified type of super block
uint64_tflashQuotaInNumber of ADUs that can be allocated for the specified type of super block

Return value of SEFSetQoSDomainCapacity

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFSetQoSDomainCapacity

Error ValueDescription
-ENODEVThe Virtual Device Handle is not valid
-EPERMThe Virtual Device Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-ENOSPCThe Virtual Device does not have enough space

SEFSetRootPointer

struct SEFStatus SEFSetRootPointer(SEFQoSHandle qosHandle, int index, struct SEFFlashAddress value)

Sets the value of a QoSDomain root pointer. A root pointer may be set to any value. Root pointer values are read back using SEFGetQoSDomainInformation(). When a root pointer is set to a flash address that is valid for the QoS Domain it's stored in, the ADU it points to can be read by SEFReadWithPhysicalAddress() using a flash address of just the root pointer index as the ADU oftset with zeros for the QoS DomainId and super block index.

See Also: SEFReadWithPhysicalAddress()

Parameters of SEFSetRootPointer

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
intindexInThe index of the root pointer
struct SEFFlashAddressvalueInValue of the pointer

Return value of SEFSetRootPointer

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFSetRootPointer

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid

SEFSetReadDeadline

struct SEFStatus SEFSetReadDeadline(SEFQoSHandle qosHandle, enum SEFDeadlineType deadline)

Sets target QoS Domain's read deadline policy.

See Also: struct SEFVirtualDeviceInfo

Parameters of SEFSetReadDeadline

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
enum SEFDeadlineTypedeadlineInDeadline type for this QoS Domain

Return value of SEFSetReadDeadline

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFSetReadDeadline

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open

SEFGetSuperBlockList

struct SEFStatus SEFGetSuperBlockList(SEFQoSHandle qosHandle, struct SEFSuperBlockList *list, int bufferSize)

Returns a list of super blocks assigned to the QoS Domain. When list is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete list. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the list structure.

Parameters of SEFGetSuperBlockList

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFSuperBlockList*listOutList of super block records
intbufferSizeInBuffer size

Return value of SEFGetSuperBlockList

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetSuperBlockList

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetQoSDomainInformation

struct SEFStatus SEFGetQoSDomainInformation(SEFHandle sefHandle, struct SEFQoSDomainID QoSDomainID, struct SEFQoSDomainInfo *info)

Returns QoS Domain information, including the list of super blocks assigned to the QoS Domain.

Parameters of SEFGetQoSDomainInformation

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFQoSDomainIDQoSDomainIDInQoS Domain ID
struct SEFQoSDomainInfo*infoOutBuffer for storing QoS Domain information

Return value of SEFGetQoSDomainInformation

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetQoSDomainInformation

Error ValueDescription
-ENODEVThe SEF handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0SEFQoSDomainInfo was successfully returned.

SEFGetReuseList

struct SEFStatus SEFGetReuseList(SEFQoSHandle qosHandle, struct SEFWearInfo *info, int bufferSize)

Returns list of super blocks to process for wear-leveling. Used in support of the implementation of a host-specified wear leveling policy. The SEF Unit has a built in wear-leveling mechanism. It returns closed blocks in the order they should be released if subject to the host-specified wear leveling policy. When info is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete set of information. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the info structure.

Parameters of SEFGetReuseList

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFWearInfo*infoOutBuffer for storing information of blocks to process
intbufferSizeInBuffer size

Return value of SEFGetReuseList

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetReuseList

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetRefreshList

struct SEFStatus SEFGetRefreshList(SEFQoSHandle qosHandle, struct SEFRefreshInfo *info, int bufferSize)

Returns a list of blocks that have encountered ECC corrections. These blocks subsequently need to be re-written, or else data loss may occur. This call should be part of a periodic background check to guard against data loss. When info is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete set of information. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the info structure.

Parameters of SEFGetRefreshList

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFRefreshInfo*infoOutBuffer for storing information of blocks to process
intbufferSizeInBuffer size

Return value of SEFGetRefreshList

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetRefreshList

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetCheckList

struct SEFStatus SEFGetCheckList(SEFQoSHandle qosHandle, struct SEFCheckInfo *info, int bufferSize)

Returns a list of blocks that have encountered conditions that need to be checked. In the event that this command indicates that blocks need to be checked, a subsequent patrol command (SEFCheckSuperBlock) should be issued in response. Detailed error statistics will be returned as part of the patrol, and appropriate corrective actions can be based on the returned information. When info is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete set of information. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the info structure.

See Also: SEFCheckSuperBlock()

Parameters of SEFGetCheckList

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFCheckInfo*infoOutBuffer for storing information of blocks to process
intbufferSizeInBuffer size

Return value of SEFGetCheckList

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetCheckList

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetUserAddressList

struct SEFStatus SEFGetUserAddressList(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress, struct SEFUserAddressList *list, int bufferSize)

Returns the user address list in terms of its underlying super blocks. Used as part of an FTL reconstruction activity. This can happen in the event of, for example, ungraceful shutdown. This mechanism can also be used to build custom diagnostic tools. This command is not needed during normal operation. ADUs that have not been written return a user address equal to SEFUserAddressIgnore. When list is NULL or insufficiently sized or bufferSize is 0, status.info returns the minimum buffer size for the complete list. The data that fits in an insufficiently sized buffer is valid but incomplete. The buffer must be at least the size of the list structure.

Parameters of SEFGetUserAddressList

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFFlashAddressflashAddressInFlash address of the super block
struct SEFUserAddressList*listOutBuffer for storing list of user addresses
intbufferSizeInBuffer size

Return value of SEFGetUserAddressList

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetUserAddressList

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
0info field returns the minimum buffer size if the buffer is insufficient or NULL; otherwise, 0

SEFGetSuperBlockInfo

struct SEFStatus SEFGetSuperBlockInfo(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress, int getDefectMap, struct SEFSuperBlockInfo *info)

Returns information corresponding to the super block.

Parameters of SEFGetSuperBlockInfo

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFFlashAddressflashAddressInFlash address of the super block
intgetDefectMapInWhen non-zero populates the defectBitmap member of SEFSuperBlockInfo. See SEFSuperBlockInfo for information on the size of defectBitmap
struct SEFSuperBlockInfo*infoOutBuffer for storing super block information

Return value of SEFGetSuperBlockInfo

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFGetSuperBlockInfo

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid

SEFCheckSuperBlock

struct SEFStatus SEFCheckSuperBlock(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress)

This is a read patrol operation which is used in conjunction with SEFGetCheckList and the kRequirePatrol QoS Notification. Patrol reads don't use the scheduling queues and are issued as soon as possible. Any actions required by the result of the patrol will generate the appropriate QoS Notification.

See Also: SEFGetCheckList()

Parameters of SEFCheckSuperBlock

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFFlashAddressflashAddressInFlash address of the super block to be checked

Return value of SEFCheckSuperBlock

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFCheckSuperBlock

Error ValueDescription
0The super block is checked
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid

SEFDeleteVirtualDevices

struct SEFStatus SEFDeleteVirtualDevices(SEFHandle sefHandle)

Deletes the Virtual Devices and allocated physical resources. Deleting virtual devices for a SEF Unit can only be done during pre-production. Once the flash of a SEF Unit has been written to, it is not possible to delete the Virtual Device configuration.

Parameters of SEFDeleteVirtualDevices

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit

Return value of SEFDeleteVirtualDevices

TypeDescription
struct SEFStatusStatus and info summarizing result. Returns 0 on success and negative value on error.

Return values of SEFDeleteVirtualDevices

Error ValueDescription
-ENODEVThe SEF Handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-EACCESYou don't have the needed permission to perform this operation
-ENOTEMPTYAt least one QoS Domain exists
-EBUSYThe Virtual Device is in use and not all the handles are closed

SEFDeleteQoSDomain

struct SEFStatus SEFDeleteQoSDomain(SEFHandle sefHandle, struct SEFQoSDomainID QoSDomainID)

Deletes the target QoS Domain. The QoS Domain must be in the closed state before issuing this command. After closing the target QoS Domain, its assigned super blocks are returned to the Virtual Device's free pool.

Parameters of SEFDeleteQoSDomain

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFQoSDomainIDQoSDomainIDInQoS Domain ID

Return value of SEFDeleteQoSDomain

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFDeleteQoSDomain

Error ValueDescription
-ENODEVThe SEF handle is not valid
-EINVALThe QoS Domain ID is not valid
-EACCESYou don't have the needed permission to perform this operation
-EBUSYThe QoS Domain is in use and not all the handles are closed

SEFResetEncryptionKey

struct SEFStatus SEFResetEncryptionKey(SEFVDHandle vdHandle, struct SEFQoSDomainID QoSDomainID)

Resets the encryption key for a QoS Domain.

Parameters of SEFResetEncryptionKey

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the Virtual Drive
struct SEFQoSDomainIDQoSDomainIDInQoS Domain ID

Return value of SEFResetEncryptionKey

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFResetEncryptionKey

Error ValueDescription
-ENODEVThe Virtual Device handle is not valid
-EPERMThe Virtual Device handle is not open
-EINVALThe QoS Domain Id is not valid

SEFOpenVirtualDevice

struct SEFStatus SEFOpenVirtualDevice(SEFHandle sefHandle, struct SEFVirtualDeviceID virtualDeviceID, void(*notifyFunc)(void *, struct SEFVDNotification), void *context, SEFVDHandle *vdHandle)

Opens the target Virtual Device. Since Virtual Devices are persistent, this provides the mechanism for opening a preexisting Virtual Device to resume I/O after reboot. This function needs to be called in order to receive notifications about the Virtual Device, such as in the event that a reduced capacity notification is issued.

Parameters of SEFOpenVirtualDevice

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFVirtualDeviceIDvirtualDeviceIDInVirtual Device ID
void()(void , struct SEFVDNotification)notifyFuncInCallback to be executed upon event generation
void *contextInA void* pointer passed to the async event notification function (used to pass user context information)
SEFVDHandle *vdHandleInHandle to the Virtual Drive

Return value of SEFOpenVirtualDevice

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFOpenVirtualDevice

Error ValueDescription
-ENODEVThe SEF handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-EACCESYou don't have the needed permission to perform this operation
-ENOMEMThe library was unable to allocate needed structures
-EALREADYThe Virtual Device is already open

SEFCloseVirtualDevice

struct SEFStatus SEFCloseVirtualDevice(SEFVDHandle vdHandle)

Closes an open Virtual Device and shuts down associated event notification.

Parameters of SEFCloseVirtualDevice

TypeNameDirectionDescription
SEFVDHandlevdHandleInHandle to the Virtual Device

Return value of SEFCloseVirtualDevice

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFCloseVirtualDevice

Error ValueDescription
-ENODEVThe Virtual Device handle is not valid
-EPERMThe Virtual Device Handle is not open
-EWOULDBLOCKThis function cannot be called on a callback thread

SEFOpenQoSDomain

struct SEFStatus SEFOpenQoSDomain(SEFHandle sefHandle, struct SEFQoSDomainID QoSDomainID, void(*notifyFunc)(void *, struct SEFQoSNotification), void *context, const void *encryptionKey, SEFQoSHandle *qosHandle)

Opens a previously created QoS Domain. Since QoS Domains are persistent, this provides the mechanism for opening a preexisting QoS Domain to resume I/O after reboot. This function also provides a channel to receive notifications regarding this QoS Domain.

Parameters of SEFOpenQoSDomain

TypeNameDirectionDescription
SEFHandlesefHandleInHandle to the SEF Unit
struct SEFQoSDomainIDQoSDomainIDInQoS Domain ID
void()(void , struct SEFQoSNotification)notifyFuncInCallback to be executed during event generation
void *contextInA void* pointer passed to the async event notification function (used to pass user context information)
const void *encryptionKeyInIn a multitenant environment, different tenants will write to separate QoS domains. Provides for individualized encryption keys on a per-domain basis
SEFQoSHandle *qosHandleOutHandle to the QoS Domain

Return value of SEFOpenQoSDomain

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFOpenQoSDomain

Error ValueDescription
-ENODEVThe SEF handle is not valid
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-EACCESYou don't have the needed permission to perform this operation
-ENOMEMThe library was unable to allocate needed structures
-EALREADYThe QoS Domain is already open

SEFCloseQoSDomain

struct SEFStatus SEFCloseQoSDomain(SEFQoSHandle qosHandle)

Closes an open QoS Domain. This will close any open super blocks associated with this domain. All outstanding kSuperBlockChangeState events will be delivered before this function returns. A QoS Domain must be in the closed state to be deleted.

Parameters of SEFCloseQoSDomain

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain

Return value of SEFCloseQoSDomain

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFCloseQoSDomain

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EWOULDBLOCKThis function cannot be called on a callback thread

SEFGetQoSHandleProperty

struct SEFProperty SEFGetQoSHandleProperty(SEFQoSHandle qos, enum SEFPropertyID propID)

This function gets a property given a SEFQoSHandle.

Parameters of SEFGetQoSHandleProperty

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
enum SEFPropertyIDpropIDInThe Property ID requested

Return value of SEFGetQoSHandleProperty

TypeDescription
struct SEFPropertyReturns the property stored given the property ID; If an unknown property ID is passed in, the returned type of the property will be kSefPropertyTypeNull. If kSefPropertyPrivateData is not set, the returned type of the property will be kSefPropertyTypeNull.

SEFSetQoSHandleProperty

struct SEFStatus SEFSetQoSHandleProperty(SEFQoSHandle qos, enum SEFPropertyID propID, struct SEFProperty value)

This function sets a property given a SEFQoSHandle. The only settable property is kSefPropertyPrivateData.

Parameters of SEFSetQoSHandleProperty

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
enum SEFPropertyIDpropIDInThe Property ID being stored
struct SEFPropertyvalueInThe value of the property being stored

Return value of SEFSetQoSHandleProperty

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFSetQoSHandleProperty

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid

SEFParseFlashAddress

struct SEFStatus SEFParseFlashAddress(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress, struct SEFQoSDomainID *QoSDomainID, uint32_t *blockNumber, uint32_t *ADUOffset)

This function is used to extract info needed by FTL from an opaque flash address. The QoS Domain ID of the passed in qosHandle does not have to match the QoS Domain ID of the passed in flash address. No validation is performed and the address is parsed as if it came from the QoS Domain of the passed in qosHandle. When they differ, it's up to the client to ensure the two different QoS Domain IDs are compatible. That is, the virtual devices they live in have the same value for superBlockDies.

Parameters of SEFParseFlashAddress

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to a QoS Domain to interpret/parse the flash address. May be NULL if only the QoSDomainID is being returned.
struct SEFFlashAddressflashAddressInThe opaque address to be parsed
struct SEFQoSDomainID*QoSDomainIDOutA pointer to where to return the QoS Domain ID. A null pointer indicates that the QoS Domain ID is not to be returned
uint32_t *blockNumberOutA pointer to where to return the block number. A null pointer indicates that the block number is not to be returned
uint32_t *ADUOffsetOutA pointer to where to return the ADU Offset. A null pointer indicates that the ADU Offset is not to be returned

Return value of SEFParseFlashAddress

TypeDescription
struct SEFStatusStatus and info summarizing result.

SEFCreateFlashAddress

struct SEFFlashAddress SEFCreateFlashAddress(SEFQoSHandle qosHandle, struct SEFQoSDomainID QoSDomainID, uint32_t blockNumber, uint32_t ADUOffset)

This function is used to create an opaque flash address. A generated flash address may be rejected by the device if it specifies an illegal ADUOffset, a super block number not owned by the QoSDomainID, or a QoSDomainID that has not been opened by the caller.

Parameters of SEFCreateFlashAddress

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle of a QoS Domain to create a flash address for.
struct SEFQoSDomainIDQoSDomainIDInThe desired QoS Domain ID. It is not validated against the QoS Domain ID of the qosHandle.
uint32_tblockNumberInThe desired super block number.
uint32_tADUOffsetInThe desired ADU Offset.

Return value of SEFCreateFlashAddress

TypeDescription
struct SEFFlashAddressThe generated flash address or the NULL flashAddress if the qosHandle is invalid.

SEFReleaseSuperBlock

struct SEFStatus SEFReleaseSuperBlock(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress)

Releases the specific super block to the free pool owned by the Virtual Device to which the specified QoS Domain belongs. The target super block must have been assigned by a previous call to SEFAllocateSuperBlock() or as part of SEFWriteWithoutPhysicalAddress(). The super block may be in an open or closed state.

Parameters of SEFReleaseSuperBlock

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain of the super block
struct SEFFlashAddressflashAddressInFlash address of the super block to release

Return value of SEFReleaseSuperBlock

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFReleaseSuperBlock

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EFAULTThe Flash Address is not valid

SEFAllocateSuperBlock

struct SEFStatus SEFAllocateSuperBlock(SEFQoSHandle qosHandle, struct SEFFlashAddress *flashAddress, enum SEFSuperBlockType type, const struct SEFAllocateOverrides *overrides)

Allocates a super block that will be assigned to the specified QoS Domain and returns the flash address of this super block. The returned super block will be in the open state. These super blocks in turn can be used as part of the parameter set for the SEFNamlessCopy and SEFWriteWithoutPhysicalAddress functions. When allocating a super block, The SEF Unit intelligently selects a location in a manner designed to optimize the lifetime of flash memory and will return the flash address that was selected. Note that each open super block will allocate a write buffer and therefore consume memory, so there is a tradeoff in the number of open super blocks and the amount of memory consumed. It's required that the total ADUs in the QoS Domain be less than its flash quota and its Virtual Device have an available super block. The ADUs in use by a QoS Domain can be known by summing the writableADUs of each super block in the QoS Domain.

See Also: SEFGetQoSDomainInformation()

Parameters of SEFAllocateSuperBlock

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFFlashAddress*flashAddressOutThe flash address of the allocated block
enum SEFSuperBlockTypetypeInkForWrite or kForPSLCWrite
const struct SEFAllocateOverrides*overridesInOverrides to scheduler parameters; pointer can be null for none required.

Return value of SEFAllocateSuperBlock

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFAllocateSuperBlock

Error ValueDescription
0The info member contains number of ADUs in allocated super block
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid
-ENOSPCThe QoS Domain is out of space

SEFFlushSuperBlock

struct SEFStatus SEFFlushSuperBlock(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress, uint32_t *distanceToEndOfSuperBlock)

Flushes the target super block. This command causes all written data for the super block that is still in the write buffer and not persisted to flash memory to be persisted to flash memory. The device will automatically append data if necessary to finish programming of all pending user data writes. This command will not return until all the data is persistent and all kAddressUpdate change notifications generated by the flush have been processed. When a flush causes a super block to have no more writable ADUs, the super block will be closed and a QoS Domain notification of the close will be sent.

Parameters of SEFFlushSuperBlock

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain of the super block
struct SEFFlashAddressflashAddressInFlash address of the super block to be flushed.
uint32_t *distanceToEndOfSuperBlockOutIndicates remaining size in ADU after this flush operation. May be NULL.

Return value of SEFFlushSuperBlock

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFFlushSuperBlock

Error ValueDescription
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EINVALThe function parameter is not valid; info returns the parameter index that is not valid

SEFCloseSuperBlock

struct SEFStatus SEFCloseSuperBlock(SEFQoSHandle qosHandle, struct SEFFlashAddress flashAddress)

Closes the target super block. If there is remaining unwritten space in the super block, that space will be padded with dummy data. This can be used by the FTL as a means of closing a super block without invoking a Write command. This command will not return until all the data is persistent and all kAddressUpdate change notifications generated by the close have been processed ensuring that all addresses have either transitioned from tentative to permanent or have been updated.

Parameters of SEFCloseSuperBlock

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain of the super block
struct SEFFlashAddressflashAddressInFlash address of the super block to move to Closed state by filling data

Return value of SEFCloseSuperBlock

TypeDescription
struct SEFStatusStatus and info summarizing result.

Return values of SEFCloseSuperBlock

Error ValueDescription
0The super block is was closed or was already closed
-ENODEVThe QoS Domain handle is not valid
-EPERMThe QoS Domain Handle is not open
-EFAULTThe Flash Address is not valid

SEFReleaseSuperBlockAsync

void SEFReleaseSuperBlockAsync(SEFQoSHandle qosHandle, struct SEFReleaseSuperBlockIOCB *iocb)

This function is the asynchronous version of SEFReleaseSuperBlock().

See Also: SEFReleaseSuperBlock()

Parameters of SEFReleaseSuperBlockAsync

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFReleaseSuperBlockIOCB*iocbIn/OutFor asynchronous response from SEF Library Unused fields should be set to 0.

SEFAllocateSuperBlockAsync

void SEFAllocateSuperBlockAsync(SEFQoSHandle qosHandle, struct SEFAllocateSuperBlockIOCB *iocb)

This function is the asynchronous version of SEFAllocateSuperBlock().

See Also: SEFAllocateSuperBlock()

Parameters of SEFAllocateSuperBlockAsync

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFAllocateSuperBlockIOCB*iocbIn/OutFor asynchronous response from SEF Library Unused fields should be set to 0.

SEFCloseSuperBlockAsync

void SEFCloseSuperBlockAsync(SEFQoSHandle qosHandle, struct SEFCloseSuperBlockIOCB *iocb)

This function is the asynchronous version of SEFCloseSuperBlock(). kSuperBlockStateChanged will have been sent before the completion routine is called and the iocb is marked as done.

See Also: SEFCloseSuperBlock()

Parameters of SEFCloseSuperBlockAsync

TypeNameDirectionDescription
SEFQoSHandleqosHandleInHandle to the QoS Domain
struct SEFCloseSuperBlockIOCB*iocbIn/OutFor asynchronous response from SEF Library