PM5358 S/UNI-4x622 Driver Manual
Data Structures
Proprietary and Confidential to PMC-Sierra, Inc. 26
Document ID: PMC-2010419, Issue 1
3 DATA STRUCTURES
This section describes the elements of the driver that configure or control its behavior, and should
therefore be of interest to the application programmer. Included here are the constants, variables
and structures that the S/UNI-4x622 device driver uses to store initialization, configuration and
counts information. The channel number starts from 0. The structure contains arrays of four
elements, where index 0 corresponds to the first channel and index 3 corresponds to the fourth
channel. For more information on our naming convention, the reader is referred to Appendix A
(page 121).
3.1 Constants
The following Constants are used throughout the driver code:
•
<S/UNI-4x622 ERROR CODES>: error codes used throughout the driver code, returned by
the API functions and used in the global error number field of the MDB and DDB. For a
complete list of error codes, see Appendix B (page 125).
•
SUNI4x622_MAX_DEVS: defines the maximum number of devices that can be supported by
this driver. This constant must not be changed without a thorough analysis of the
consequences to the driver code
•
SUNI4x622_MOD_START, SUNI4x622_MOD_IDLE, SUNI4x622_MOD_READY: the three
possible module states (stored in
stateModule)
•
SUNI4x622_START, SUNI4x622_PRESENT, SUNI4x622_ACTIVE,
SUNI4x622_INACTIVE: the four possible device states (stored in stateDevice)
3.2 Structures Passed by the Application
These structures are defined for use by the application and are passed as argument to functions
within the driver. These structures are the Module Initialization Vector (MIV), the Device
Initialization Vector (DIV) and the ISR mask.
Module Initialization Vector: MIV
Passed via the suni4x622ModuleOpen call, this structure contains all the information needed
by the driver to initialize and connect to the RTOS.
•
maxDevs is used to inform the driver how many devices will be operating concurrently
during this session. The number is used to calculate the amount of memory that will be
allocated to the driver. The maximum value that can be passed is
SUNI4x622_MAX_DEVS
(see section 3.1).