Main Page | Modules | Namespace List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

Mass Storage Device Management

contains support for IO device access and usage More...

Data Structures

struct  T_DEVICE_INFO
 device info structure to specify transfer parameters More...

MSD Error Constants

#define ERR_MSD_UNKNOWN   ERR_GENERIC - 10
 unknown device
#define ERR_DUPLICATE_MSD   ERR_GENERIC - 20
 device name already registered
#define ERR_MSD_LIMIT   ERR_GENERIC - 30
 limit of manegable devices reached
#define ERR_MSD_NOT_INITIALIZED   ERR_GENERIC - 40
 device manager is not initialized
#define ERR_MSD_HANDLES_ACTIVE   ERR_GENERIC - 50
 tried to deregister device - but still handles active

Defines

#define MAX_NOF_MSD   10
 defined constant to specify the maximum allowed number of managed io devices

Typedefs

typedef signed long(* T_FN_MSD_BLOCK_READ )(void *pa_pDevHandle, unsigned long pa_nBlockAddr, unsigned long pa_nBlockCount, unsigned char *pa_pcData)
typedef signed long(* T_FN_MSD_BLOCK_WRITE )(void *pa_pDevHandle, unsigned long pa_nBlockAddr, unsigned long pa_nBlockCount, unsigned char *pa_pcData)
typedef T_ERROR_CODE(* T_FN_MSD_INFO )(void *pa_pDevHandle, T_DEVICE_INFO *pa_pDeviceInfo)
typedef unsigned long T_MSD_HANDLE
 typedef for handles to managed devices

Functions

void msd_initManager (void)
 have to be called to initialize the manager
void msd_cleanUpManager (void)
 have to be called to clean up resources allocated by the manager
T_ERROR_CODE msd_register (void *pa_pDevHandle, const char *pa_acName, unsigned int pa_nPartition, T_FN_MSD_BLOCK_READ pa_fnRead, T_FN_MSD_BLOCK_WRITE pa_fnWrite, T_FN_MSD_INFO pa_fnInfo)
T_ERROR_CODE msd_deregister (const char *pa_acName)
T_MSD_HANDLE msd_getHandle (const char *pa_acName)
signed long msd_blockRead (T_MSD_HANDLE pa_hMsd, unsigned long pa_nBlockAddr, unsigned long pa_nBlockCount, unsigned char *pa_pcData)
signed long msd_blockWrite (T_MSD_HANDLE pa_hMsd, unsigned long pa_nBlockAddr, unsigned long pa_nBlockCount, unsigned char *pa_pcData)
T_ERROR_CODE msd_info (T_MSD_HANDLE pa_hMsd, T_DEVICE_INFO *pa_pstDeviceInfo)

Detailed Description

contains support for IO device access and usage

the msd manegement does not only support mass storage devices, but also character based IO devices. therefor some of parameters/function can have different meanings depending on the target devcie. in this case character based device - functionality is qualified with the term "on char-devices:".


Define Documentation

#define ERR_DUPLICATE_MSD   ERR_GENERIC - 20
 

device name already registered

#define ERR_MSD_HANDLES_ACTIVE   ERR_GENERIC - 50
 

tried to deregister device - but still handles active

#define ERR_MSD_LIMIT   ERR_GENERIC - 30
 

limit of manegable devices reached

#define ERR_MSD_NOT_INITIALIZED   ERR_GENERIC - 40
 

device manager is not initialized

#define ERR_MSD_UNKNOWN   ERR_GENERIC - 10
 

unknown device

#define MAX_NOF_MSD   10
 

defined constant to specify the maximum allowed number of managed io devices


Typedef Documentation

typedef signed long(* T_FN_MSD_BLOCK_READ)(void *pa_pDevHandle, unsigned long pa_nBlockAddr, unsigned long pa_nBlockCount, unsigned char *pa_pcData)
 

typedef signed long(* T_FN_MSD_BLOCK_WRITE)(void *pa_pDevHandle, unsigned long pa_nBlockAddr, unsigned long pa_nBlockCount, unsigned char *pa_pcData)
 

typedef T_ERROR_CODE(* T_FN_MSD_INFO)(void *pa_pDevHandle, T_DEVICE_INFO *pa_pDeviceInfo)
 

typedef unsigned long T_MSD_HANDLE
 

typedef for handles to managed devices


Function Documentation

signed long msd_blockRead T_MSD_HANDLE  pa_hMsd,
unsigned long  pa_nBlockAddr,
unsigned long  pa_nBlockCount,
unsigned char *  pa_pcData
 

Parameters:
pa_hMsd handle to the device
pa_nBlockAddr address of the first block to read
pa_nBlockCount number of blocks to read
pa_pcData pointer to a location where the data have to be stored
Returns:
ERR_NONE if the operation was succesful, otherwise - error code
read a specified number of blocks into a specified buffer.

signed long msd_blockWrite T_MSD_HANDLE  pa_hMsd,
unsigned long  pa_nBlockAddr,
unsigned long  pa_nBlockCount,
unsigned char *  pa_pcData
 

Parameters:
pa_hMsd handle to the device
pa_nBlockAddr address of the first block to read
pa_nBlockCount number of blocks to read
pa_pcData pointer to the data location
Returns:
ERR_NONE if the operation was succesful, otherwise - error code
writes a specified number of block from a specified buffer.

void msd_cleanUpManager void   ) 
 

have to be called to clean up resources allocated by the manager

T_ERROR_CODE msd_deregister const char *  pa_acName  ) 
 

Parameters:
pa_acName managed name of the device
deregisters the named device from the device manager.

T_MSD_HANDLE msd_getHandle const char *  pa_acName  ) 
 

Parameters:
pa_acName managed name of the device
Returns:
a handle (T_MSD_HANDLE) to the named device, if the device is unknown then 0

T_ERROR_CODE msd_info T_MSD_HANDLE  pa_hMsd,
T_DEVICE_INFO pa_pstDeviceInfo
 

Parameters:
pa_hMsd 
pa_pstDeviceInfo 
Returns:
ERR_NONE if the operation was succesful, otherwise - error code
reads the device info structure of a given device handle into the T_DEVICE_INFO struct.

void msd_initManager void   ) 
 

have to be called to initialize the manager

T_ERROR_CODE msd_register void *  pa_pDevHandle,
const char *  pa_acName,
unsigned int  pa_nPartition,
T_FN_MSD_BLOCK_READ  pa_fnRead,
T_FN_MSD_BLOCK_WRITE  pa_fnWrite,
T_FN_MSD_INFO  pa_fnInfo
 

Parameters:
pa_pDevHandle handle to the device
pa_acName managed name of the device (can be referenced with this name)
pa_nPartition the partition to be mounted on the device (currently only the first one is considered)
pa_fnRead pointer to the device block-read function, T_FN_MSD_BLOCK_READ
pa_fnWrite pointer to the device block-write function, T_FN_MSD_BLOCK_WRITE
pa_fnInfo pointer to the device info function, T_FN_MSD_INFO
registers the named device to the device manager.


Generated on Thu Mar 2 16:11:32 2006 for VDK Blacksheep by  doxygen 1.4.1