class NdmDriver
Defined at line 47 of file ../../src/storage/lib/ftl/ftln/ndm-driver.h
Encapsulates the lower layer TargetFtl-Ndm driver.
Public Methods
const char * Init ()
Performs driver initialization. Returns an error string, or nullptr on
success.
const char * Attach (const Volume * ftl_volume)
Creates a new volume. Note that multiple volumes are not supported.
|ftl_volume| (if provided) will be notified with the volume details.
Returns an error string, or nullptr on success.
bool Detach ()
Destroy the volume created with Attach(). Returns true on success.
int NandRead (uint32_t start_page, uint32_t page_count, void * page_buffer, void * oob_buffer)
Reads |page_count| pages starting at |start_page|, placing the results on
|page_buffer| and |oob_buffer|. Either pointer can be nullptr if that
part is not desired.
Returns kNdmOk, kNdmUncorrectableEcc, kNdmFatalError or kNdmUnsafeEcc.
int NandWrite (uint32_t start_page, uint32_t page_count, const void * page_buffer, const void * oob_buffer)
Writes |page_count| pages starting at |start_page|, using the data from
|page_buffer| and |oob_buffer|.
Returns kNdmOk, kNdmError or kNdmFatalError. kNdmError triggers marking
the block as bad.
int NandErase (uint32_t page_num)
Erases the block containing |page_num|.
Returns kNdmOk or kNdmError. kNdmError triggers marking the block as bad.
int IsBadBlock (uint32_t page_num)
Returns whether the block containing |page_num| was factory-marked as bad.
Returns kTrue, kFalse or kNdmError.
bool IsEmptyPage (uint32_t page_num, const uint8_t * data, const uint8_t * spare)
Returns whether a given page is empty or not. |data| and |spare| store
the contents of the page.
uint32_t PageSize ()
Returns the number of bytes in a page.
uint8_t SpareSize ()
Returns the number of bytes available for spare data storage.
bool IncompletePageWrite (uint8_t * spare)
Looks at the spare buffer to try to determine if the write may
have been incomplete. Return true if it appears to have been incomplete.
void ~NdmDriver ()
Defined at line 49 of file ../../src/storage/lib/ftl/ftln/ndm-driver.h