PM5358 S/UNI-4x622 Driver Manual
Application Programming Interface
Proprietary and Confidential to PMC-Sierra, Inc. 59
Document ID: PMC-2010419, Issue 1
4.4 Device Read and Write
Reading from Device Registers: suni4x622Read
This function reads a register of a specific S/UNI-4x622 device by providing the register number.
This function derives the actual address location based on the device handle and register number
inputs. It then reads the contents of this address location using the system specific macro,
sysSuni4x622Read. Note that a failure to read returns a zero and any error indication is written
to the associated DDB.
Prototype
UINT1 suni4x622Read(sSUNI4x622_HNDL deviceHandle,
UINT2 regNum)
Inputs
deviceHandle : device handle (from suni4x622Add)
regNum : register number
Outputs
ERROR code written to the MDB
SUNI4x622_ERR_INVALID_DEV
ERROR code written to the DDB
SUNI4x622_ERR_INVALID_REG
Returns
Success = value read
Failure = 0
Valid States
SUNI4x622_PRESENT, SUNI4x622_ACTIVE,
SUNI4x622_INACTIVE
Side Effects
May affect registers that change after a read operation
Writing to Device Registers: suni4x622Write
This function writes to a register of a specific S/UNI-4x622 device by providing the register
number. This function derives the actual address location based on the device handle and register
number inputs. It then writes the contents of this address location using the system specific
macro,
sysSuni4x622Write. Note that a failure to write returns a zero and any error indication
is written to the DDB.
Prototype
UINT1 suni4x622Write(sSUNI4x622_HNDL deviceHandle,
UINT2 regNum, UINT1 value)
Inputs
deviceHandle : device handle (from suni4x622Add)
regNum : register number
value : value to be written
Outputs
ERROR code written to the MDB
SUNI4x622_ERR_INVALID_DEV
ERROR code written to the DDB
SUNI4x622_ERR_INVALID_REG
Returns
Success = value written