PM5358 S/UNI-4x622 Driver Manual

Application Programming Interface

4APPLICATION PROGRAMMING INTERFACE

This section provides a detailed description of each function that is a member of the S/UNI-4x622 driver Application Programming Interface (API).

The API functions typically execute in the context of an application task.

Note: These functions are not re-entrant. This means that two application tasks can not invoke the same API at the same time. However the driver protects its data structures from concurrent accesses by the application and the DPR task.

4.1Module Management

The module management is a set of API functions that are used by the application to open, start, stop and close the driver module. These functions will take care of initializing the driver, allocating memory and all RTOS resources needed by the driver. They are also used to change the module state. For more information on the module states see the state diagram on page 19. For a typical module management flow diagram see page 21.

Opening the Driver Module: suni4x622ModuleOpen

This function performs module level initialization of the device driver. This involves allocating all of the memory needed by the driver and initializing the internal structures.

Prototype

Inputs

Outputs

Returns

Valid States Side Effects

INT4 suni4x622ModuleOpen(sSUNI4x622_MIV *pmiv)

pmiv

: (pointer to) Module Initialization Vector

Places the address of the MDB into the MIV passed by the application

Success = SUNI4x622_SUCCESS

Failure = SUNI4x622_ERR_INVALID_MODULE_STATE

SUNI4x622_ERR_INVALID_MIV

SUNI4x622_ERR_MEM_ALLOC

SUNI4x622_MOD_START

Changes the MODULE state to SUNI4x622_MOD_IDLE

Closing the Driver Module: suni4x622ModuleClose

This function performs module level shutdown of the driver. This involves deleting all devices being controlled by the driver (by calling suni4x622Delete for each device) and de-allocating all the memory allocated by the driver.

Prototype

INT4 suni4x622ModuleClose(void)

Proprietary and Confidential to PMC-Sierra, Inc.

52

Document ID: PMC-2010419, Issue 1

 

Page 52
Image 52
PMC-Sierra PM5358 S/UNI 4x622 manual Module Management, Opening the Driver Module suni4x622ModuleOpen, Prototype