FF_RegisterBlkDevice()

From FullFAT

Jump to: navigation, search


Registers a block device driver, as specified by the FF_WRITE_BLOCKS and FF_READ_BLOCKS driver model description.

Contents

Prototype

FF_ERROR FF_RegisterBlkDevice(FF_IOMAN *pIoman, FF_T_UINT16 BlkSize, FF_WRITE_BLOCKS fnWriteBlocks, FF_READ_BLOCKS fnReadBlocks, void *pParam);

Parameters

pIoman

Pointer to an FF_IOMAN object, as returned from the FF_CreateIOMAN() function.

BlkSize

The blocksize of the device driver being registered. This should match that of the FF_IOMAN object given. I.e. the BlkSize given to FF_CreateIOMAN() should be the same.

fnWriteBlocks

A pointer to a block write function, as defined by the FF_WRITE_BLOCKS specification.

fnReadBlocks

A pointer to a block read function, as defined by the FF_READ_BLOCKS specification.

pParam

A pointer (or item of size (sizeof(void *)) casted to void *) to anything that the provided Read and Write functions may require, if any.

When FullFAT calls the FF_WRITE_BLOCKS or FF_READ_BLOCKS functions this pointer or value is passed as a parameter.

Return Value

Returns FF_ERR_NONE on success.

All errors are negative, and can be passed to the FF_GetErrMessage() function to get a meaningful string describing the error.

Possible Error Codes

See Also

Back to API

Personal tools