PM5358 S/UNI-4x622 Driver Manual PM5358 S/UNI-4X622 DRIVER MANUAL PROPRIETARY AND CONFIDENTIAL PRELIMINARY ISSUE 1: APRIL, 2001 Proprietary and Confidential to PMC-Sierra, Inc.
PM5358 S/UNI-4x622 Driver Manual ABOUT THIS MANUAL AND S/UNI-4X622 This manual describes the S/UNI-4x622 (PM5358) device driver. It describes the driver’s functions, data structures, and architecture. This manual focuses on the driver’s interfaces and their relationship to your application, real-time operating system, and to the device. It also describes in general terms how to modify and port the driver to your software and hardware platform.
PM5358 S/UNI-4x622 Driver Manual Legal Issues None of the information contained in this document constitutes an express or implied warranty by PMC-Sierra, Inc. as to the sufficiency, fitness or suitability for a particular purpose of any such information or the fitness, or suitability for a particular purpose, merchantability, performance, compatibility with other parts or systems, of any of the products of PMC-Sierra, Inc., or any portion thereof, referred to in this document. PMC-Sierra, Inc.
PM5358 S/UNI-4x622 Driver Manual TABLE OF CONTENTS About this Manual and S/UNI-4x622 ...................................................................................2 Audience....................................................................................................................2 References ................................................................................................................2 Revision History..........................................................................
PM5358 S/UNI-4x622 Driver Manual 3.2 Structures Passed by the Application .........................................................................26 Module Initialization Vector: MIV .............................................................................26 Device Initialization Vector: DIV...............................................................................27 ISR Enable/Disable Mask ........................................................................................28 3.
PM5358 S/UNI-4x622 Driver Manual Writing the K1K2 Byte: suni4x622LOHWriteK1K2 ..................................................65 Reading the K1K2 Byte: suni4x622LOHReadK1K2................................................66 Writing the S1 Byte: suni4x622LOHWriteS1 ...........................................................66 Reading the S1 Byte: suni4x622LOHReadS1.........................................................67 Forcing Line AIS: suni4x622LOHForceAIS .............................................
PM5358 S/UNI-4x622 Driver Manual Clearing RPOH Interrupt Enable Mask: suni4x622ClrMaskRPOH .........................86 Getting PYLD Interrupt Enable Mask: suni4x622GetMaskPYLD ............................87 Setting PYLD Interrupt Enable Mask: suni4x622SetMaskPYLD.............................87 Clearing PYLD Interrupt Enable Mask: suni4x622ClrMaskPYLD ...........................88 Getting FIFO Interrupt Enable Mask: suni4x622GetMaskFIFO ..............................
PM5358 S/UNI-4x622 Driver Manual 5.2 System-Specific Interrupt Servicing ..........................................................................109 Installing the ISR Handler: sysSuni4x622ISRHandlerInstall .................................109 ISR Handler: sysSuni4x622ISRHandler ................................................................ 110 DPR Task: sysSuni4x622DPRTask .......................................................................
PM5358 S/UNI-4x622 Driver Manual Payload Events (PYLD) .........................................................................................128 Line Interface Events (INTF_LINE) .......................................................................128 System Interface Events (SYS_INTF) ...................................................................128 Automatic Protection Switching Events (APS) ......................................................129 List of Terms ................................
PM5358 S/UNI-4x622 Driver Manual LIST OF FIGURES Figure 1: Driver External Interfaces...................................................................................14 Figure 2: Driver Architecture .............................................................................................16 Figure 3: Driver Software States .......................................................................................19 Figure 4: Module Management Flow Diagram ..................................................
PM5358 S/UNI-4x622 Driver Manual LIST OF TABLES Table 1: S/UNI-4x622 Module Initialization Vector: sSUNI4x622_MIV.............................27 Table 2: S/UNI-4x622 Device Initialization Vector: sSUNI4x622_DIV ..............................27 Table 3: S/UNI-4x622 Section Overhead (SOH) ISR Mask: sSUNI4x622_MASK_ISR_SOH ................................................................................29 Table 4: S/UNI-4x622 Line Overhead (LOH) ISR Mask: sSUNI4x622_MASK_ISR_LOH................................
PM5358 S/UNI-4x622 Driver Manual Table 22: S/UNI-4x622 Global Line Interface Configuration: sSUNI4x622_CFG_INTF_LINE_GLOBAL ................................................................44 Table 23: S/UNI-4x622 Signal Failure Configuration: sSUNI4x622_CFG_SF..................44 Table 24: S/UNI-4x622 Signal Defect Configuration: sSUNI4x622_CFG_SD..................44 Table 25: S/UNI-4x622 Channel Status Block: sSUNI4x622_STATUS_CHAN ...............
PM5358 S/UNI-4x622 Driver Manual Introduction 1 INTRODUCTION The following sections of the S/UNI-4x622 Device Driver Design Specification describe the S/UNI-4x622 device driver. The code provided throughout this document is written in ANSI-C. This has been done to promote greater driver portability to other embedded hardware (Section 5) and Real-Time Operating System (RTOS) environments (Section 6).
PM5358 S/UNI-4x622 Driver Manual Software Architecture 2 SOFTWARE ARCHITECTURE This section describes the software architecture of the S/UNI-4x622 device driver. This includes a discussion of the driver’s external interfaces and its main components. 2.1 Driver External Interfaces Figure 1 illustrates the external interfaces defined for the S/UNI-4x622 device driver.
PM5358 S/UNI-4x622 Driver Manual Software Architecture • Initialize the device(s) • Perform diagnostic tests • Validate configuration information • Retrieve status and counts information The driver API functions use the services of the other driver components to provide this systemlevel functionality to the application programmer. The driver API also consists of callback routines that are used to notify the application of significant events that take place within the device(s) and module.
PM5358 S/UNI-4x622 Driver Manual Software Architecture • Alarm, status and counts • Section Overhead • Line Overhead • Path Overhead • Payload Processor • Interface Configuration • APS Configuration Figure 2: Driver Architecture Application Function Calls Application Callbacks APS Configuration Section Overhead Line Overhead Module Data Block Path Overhead Device Data Blocks Interrupt Service Routine .......
PM5358 S/UNI-4x622 Driver Manual Software Architecture • Maximum number of devices • The DDB(s) The Device Data-Block (DDB) is contained in the MDB, and initialized by the driver module for each S/UNI-4x622 device that is registered. There is one DDB per device and there is a limit on the number of DDBs, and that limit is set by the USER when the module is initialized.
PM5358 S/UNI-4x622 Driver Manual Software Architecture Section Overhead The Section Overhead section provides functions to control and monitor the section overhead processing. Read / Write access is given to the section trace message (J0). This message is compared with a configurable reference and mismatches are reported. Section BIP-8 (B1) errors are accumulated in a counter that can be read. Section overhead alarms are detected and reported.
PM5358 S/UNI-4x622 Driver Manual Software Architecture 2.3 Software States Figure 3 shows the software state diagram for the S/UNI-4x622 driver. State transitions occur on the successful execution of the corresponding transition functions shown. State information helps maintain the integrity of the MDB and DDB(s) by controlling the set of operations allowed in each state.
PM5358 S/UNI-4x622 Driver Manual Software Architecture Module States The following is a description of the S/UNI-4x622 module states. See section 4.1 for a detailed description of the API functions that are used to change the module state. Start The driver module has not been initialized. In this state the driver does not hold any RTOS resources (memory, timers, etc); has no running tasks, and performs no actions. Idle The driver module has been initialized successfully.
PM5358 S/UNI-4x622 Driver Manual Software Architecture 2.4 Processing Flows This section describes the main processing flows of the S/UNI-4x622 driver components. The flow diagrams presented here illustrate the sequence of operations that take place for different driver functions. The diagrams also serve as a guide to the application programmer by illustrating the sequence in which the application must invoke the driver API.
PM5358 S/UNI-4x622 Driver Manual Software Architecture Figure 5: Device Management Flow Diagram START suni4x622Add suni4x622Init suni4x622Activate suni4x622Reset Detects the new device in hardware, assigns a DDB to the new device andstores the user's context for the device. Returns a device handle to the user Applies a reset to the device and initializes the device registers and associated RAMs based on the DIV passed by the user.
PM5358 S/UNI-4x622 Driver Manual Software Architecture The driver provides system-independent functions, suni4x622ISR and suni4x622DPR. You must fill in the corresponding system-specific functions, sysSuni4x622ISRHandler and sysSuni4x622DPRTask. The system-specific functions isolate the system-specific communication mechanism (between the ISR and DPR) from the system-independent functions, suni4x622ISR and suni4x622DPR. Figure 6 illustrates the interrupt service model used in the S/UNI-4x622 driver design.
PM5358 S/UNI-4x622 Driver Manual Software Architecture Calling suni4x622DPR The sysSuni4x622DPRTask function is a system specific function that runs as a separate task within the RTOS. You should set the DPR task’s priority higher than the application task(s) interacting with the S/UNI-4x622 driver. In the message-queue implementation model, this task has an associated message queue. The task waits for messages from the ISR on this message queue.
PM5358 S/UNI-4x622 Driver Manual Software Architecture Figure 7: Polling Service Model Indication Callbacks suni4x622Poll suni4x622ISR Interrupt Context Information Application suni4x622DPR In polling mode, the application is responsible for calling suni4x622Poll often enough to service any pending error or alarm conditions. When suni4x622Poll is called, the suni4x622ISR function is called internally.
PM5358 S/UNI-4x622 Driver Manual Data Structures 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.
PM5358 S/UNI-4x622 Driver Manual Data Structures Table 1: S/UNI-4x622 Module Initialization Vector: sSUNI4x622_MIV Field Name Field Type Field Description perrModule INT4 * (pointer to) errModule (see description in the MDB) maxDevs UINT2 Maximum number of devices supported during this session maxInitProfs UINT2 Maximum number of initialization profiles Device Initialization Vector: DIV Passed via the suni4x622Init call, this structure contains all the information needed by the driver to initia
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description cbackPYLD sSUNI4x622_CBACK Address for the callback function for PYLD events cbackFIFO sSUNI4x622_CBACK Address for the callback function for FIFO events cbackIntfLine sSUNI4x622_CBACK Address for the callback function for Line Interface events cbackIntfSys sSUNI4x622_CBACK Address for the callback function for System Interface events cbackAPS sSUNI4x622_CBACK Address for the callback function for APS
PM5358 S/UNI-4x622 Driver Manual Data Structures Table 4: S/UNI-4x622 ISR Mask: sSUNI4x622_MASK_ISR_CHAN Field Name Field Type Field Description maskSOH sSUNI4x622_MASK_ISR_ SOH Interrupt mask for Section Overhead section maskLOH sSUNI4x622_MASK_ISR_ LOH Interrupt mask for Line Overhead section maskRPOH sSUNI4x622_MASK_ISR_ RPOH Interrupt mask for Receive Path Overhead section maskPYLD sSUNI4x622_MASK_ISR_ PYLD Interrupt mask for Payload Processor section maskFIFO sSUNI4x622_MASK_ISR_ FIFO
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description psbf UINT2 APS byte failure coaps UINT2 Change of APS bytes coz1s1 UINT2 Change of synchronization status message lbipe UINT2 Line BIP error lreie UINT2 Line REI error sdber UINT2 Signal Defect sfber UINT2 Signal Failure Table 5: S/UNI-4x622 Receive Path Overhead (RPOH) ISR Mask: sSUNI4x622_MASK__ISR_RPOH Field Name Field Type Field Description tiu UINT2 Path trace unstable tim UINT2 Pat
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description psl UINT2 Path signal label changed aisc UINT2 Pointer AIS event lopc UINT2 Lost of pointer concatenation change newptr UINT2 New pointer received illjreq UINT2 Illegal Pointer Justification discopa UINT2 Discontinuous change of pointer invndf UINT2 Invalid NDF illptr UINT2 Illegal pointer ndf UINT2 NDF event Table 6: S/UNI-4x622 ISR Mask: sSUNI4x622_MASK_ISR_PYLD Field Name Field Type F
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description rxfpfovr UINT2 Rx FP FIFO overrun txfpfudr UINT2 Tx FP FIFO underrun Table 10: S/UNI-4x622 ISR Mask: sSUNI4x622_MASK_ISR_INTF_LINE Field Name Field Type Field Description wansinten UINT2 WANS phase detector averaging period has begun lot UINT2 Loss of transition rool UINT2 Recovered reference out of lock dool UINT2 Recovered data out of lock Table11: S/UNI-4x622 ISR Mask: sSUNI4x622_MASK_ISR_INT
PM5358 S/UNI-4x622 Driver Manual Data Structures 3.3 Field Name Field Type Field Description lof UINT2 Los of frame oof UINT2 Out of frame lot UINT2 Loss of transition dool UINT2 Recovered data out of lock rool UINT2 Recovered reference out of lock ese UINT2 Elastic store FIFO error pj UINT2 Pointer Justification Structures in the Driver’s Allocated Memory These structures are defined and used by the driver and are part of the context memory allocated when the driver is opened.
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description initialized stateModule eSUNI4x622_MOD_STATE Module state; can be one of the following IDLE or READY maxDevs UINT2 Maximum number of devices supported numDevs UINT2 Number of devices currently registered maxInitProfs UINT2 Maximum number of initialization profiles pddb sSUNI4x622_DDB * (array of) Device Data Blocks (DDB) in context memory pinitProfs sSUNI4x622_DIV * (array of) Initialization profile
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description initialized stateDevice eSUNI4x622_DEV_STATE Device State; can be one of the following PRESENT, ACTIVE or INACTIVE baseAddr void * Base address of the device usrCtxt sSUNI4x622_USR_CTXT Stores the user’s context for the device.
PM5358 S/UNI-4x622 Driver Manual Data Structures Device-wide Global Configuration Table 10: S/UNI-4x622 Input/Output Configuration: sSUNI4x622_CFG_GLOBAL Field Name Field Type Field Description sonetsel UINT1 Select SONET/SDH mode cfgIntfSys sSUNI4x622_CFG_INTF_SYS_GLOBAL System Interface configuration block cfgIntfLine sSUNI4x622_CFG_INTF_LINE_GLOBAL Line Interface configuration block Per-Channel Configuration Table 11: S/UNI-4x622 Channel Configuration: sSUNI4x622_CFG_CHAN Field Name Field T
PM5358 S/UNI-4x622 Driver Manual Data Structures Per-Channel Section Overhead (SOH) Configuration Table 12: S/UNI-4x622 Section Overhead Configuration: sSUNI4x622_CFG_SOH Field Name Field Type Field Description algo2 UINT1 Selects framing pattern used to determine and maintain the frame alignment sblkbip UINT1 Controls accumulation of section BIP errors dds UINT1 Rx descrambling ds UINT1 Tx scrambling zeroen UINT1 Selects whether all zero trace identifier messages accepted or ignored Per-
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description allones UINT1 Controls whether incoming AIS will force the downstream Sonet/SDH frame to all ones sdins UINT1 Controls whether SD can cause Line AIS insertion sfins UINT1 Controls whether SF can cause Line AIS insertion lofins UINT1 Controls whether LOF can cause Line AIS insertion losins UINT1 Controls whether LOS can cause Line AIS insertion rtimins UINT1 Controls whether section TIM can cause Lin
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description lcdprdi UINT1 Controls whether loss of cell delineation can cause PRDI insertion alrmprdi UINT1 Controls whether LOS,LOF or LAIS can cause PRDI insertion paisprdi UINT1 Controls whether PAIS can cause PRDI insertion pslmprdi UINT1 Controls whether Path signal label mismatch can cause PRDI insertion lopprdi UINT1 Controls whether loss of pointer indications can cause PRDI insertion lopconprdi UINT1 C
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description ptimeprdi UINT1 Controls whether path trace identifier mismatch can cause EPRDI insertion paisconpais UINT1 Controls whether AIS concatenation events can cause PAIS insertion lopconpais UINT1 Controls whether loss of pointer concatenation events can cause PAIS insertion pslmpais UINT1 Controls whether path signal label mismatch can cause PAIS insertion pslupais UINT1 Controls whether path signal label
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description rxfpminpl UINT1 RX minimum packet length rxfpmaxpl UINT2 RX maximum packet length txdscr UINT1 TX scrambles outgoing payload txcpidlehdr UINT1 TX idle cell header txcpidlepyld UINT1 TX idle cell payload txfpfcssel UINT1 TX FCS select mode UINT1 ATM or POS mode txfpipgap UINT1 The number of Flag Sequence characters inserted between each POS Frame Per-Channel FIFO Configuration Table 17: S/UNI-
PM5358 S/UNI-4x622 Driver Manual Data Structures Per-Channel RALRM Configuration Table 19: S/UNI-4x622 Clock Interface Configuration: sSUNI4x622_CFG_RALRM Field Name Field Type Field Description losen UINT1 Controls whether LOS set RALRM output lofen UINT1 Controls whether LOF set RALRM output oofen UINT1 Controls whether OOF set RALRM output laisen UINT1 Controls whether line AIS set RALRM output lrdien UINT1 Controls whether Line RDIset RALRM output sdberen UINT1 Controls whether SD t
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description cfgRALRM sSUNI4x622_CFG_RALRM RALRM configuration block Device-wide System Interface Configuration Table 21: S/UNI-4x622 Global System Interface Configuration: sSUNI4x622_CFG_INTF_SYS_GLOBAL Field Name Field Type Field Description tul3prtyp UINT1 TUL3 parity tul3l3mode UINT1 TUL3 mode tul3atmsiglbl UINT1 TUL3 ATM signal label tul3possiglbl UINT1 TUL3 POS signal label rul3prtyp UINT1 RUL3 parity
PM5358 S/UNI-4x622 Driver Manual Data Structures Device-Wide Line Interface Configuration Table 22: S/UNI-4x622 Global Line Interface Configuration: sSUNI4x622_CFG_INTF_LINE_GLOBAL Field Name Field Type Field Description rsel UINT1 Selects which channel is used as a clock source for the rx clock output pin tsel UINT1 Selects which channel is used as a clock source for the tx clock output pin Table 23: S/UNI-4x622 Signal Failure Configuration: sSUNI4x622_CFG_SF Field Name Field Type Field Descrip
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description sdsap UINT4 SD Accumulation period sdsth UINT4 SD Saturation Threshold sddth UINT4 SD Declaring Threshold sdcth UINT4 SD Clearing Threshold Table 25: S/UNI-4x622 Channel Status Block: sSUNI4x622_STATUS_CHAN Field Name Field Type Field Description statusSOH sSUNI4x622_STATUS _SOH Alarms, status and counts from the Section Overhead (SOH) section statusLOH sSUNI4x622_STATUS _LOH Alarms, status and c
PM5358 S/UNI-4x622 Driver Manual Data Structures Line Overhead (LOH) Status Table 27: S/UNI-4x622 Line Overhead Status: sSUNI4x622_STATUS_LOH Field Name Field Type Field Description k1 UINT1 Receive K1 k2 UINT1 Receive K2 s1 UINT1 Receive S1 laisdet UINT1 Line alarm signal defect lrdidet UINT1 Line remote defect indication sfber UINT1 Signal Failure sdber UINT1 Signal Degrade psbf UINT1 APS byte failure Receive Path Overhead (RPOH) Status Table 28: S/UNI-4x622 Receive Path Overhe
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description prdi UINT1 Path RDI status tiu UINT1 Path trace identifier unstable tim UINT1 Path trace identifier mismatch uneq UINT1 Equip status of the path signal label pslu UINT1 Path signal label unstable pslm UINT1 Path signal label mismatch ardi UINT1 Aux RDI status aisc UINT1 AIS concatenated lopc UINT1 Loss of pointer concatenated Payload Processor Status Table 30: S/UNI-4x622 Payload Status: s
PM5358 S/UNI-4x622 Driver Manual Data Structures Field Name Field Type Field Description tfclka UINT1 TFCLK active refclka UINT1 REFCLKA active Line Interface Status Table 30: S/UNI-4x622 Line Interface Status: sSUNI4x622_STATUS_INTF_LINE Field Name Field Type Field Description statusClk sSUNI4x622_STATUS_CLK Clock interface status Counters (CNT) Table 31: S/UNI-4x622 Counters: sSUNI4x622_CNTR_CHAN Field Name Field Type Field Description cntrSOH sSUNI4x622_CNTR_SOH Counters for Section
PM5358 S/UNI-4x622 Driver Manual Data Structures Line Overhead (LOH) Counter Table 33: S/UNI-4x622 Line Overhead (LOH) Counters: sSUNI4x622_CNTR_LOH Field Name Field Type Field Description lbe UINT4 Line BIP error counter lfe UINT4 Line REI error counter Receive Path Overhead (RPOH) Counter Table 34: S/UNI-4x622 Receive Path Overhead (RPOH) Counters: sSUNI4x622_CNTR_RPOH Field Name Field Type Field Description pbe UINT2 Path BIP error counter pfe UINT2 Path REI error counter Payload Proce
PM5358 S/UNI-4x622 Driver Manual Data Structures 3.
PM5358 S/UNI-4x622 Driver Manual Data Structures Table 37: S/UNI-4x622 Deferred-Processing Vector: sSUNI4x622_DPV 3.5 Field Name Field Type Field Description event SUNI4x622_DPR_EVENT Event being reported cause UINT2 Reason for the Event Global Variable Although most of the variables within the driver are not meant to be used by the application code, there is one global variable that can be of great use to the application code. suni4x622Mdb: A global pointer to the Module Data Block (MDB).
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface 4 APPLICATION 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.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Inputs None Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_MODULE_STATE Valid States SUNI4x622_MOD_IDLE, SUNI4x622_MOD_READY Side Effects Changes the MODULE state to SUNI4x622_MOD_START Starting the Driver Module: suni4x622ModuleStart This function connects the RTOS resources to the driver.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Side Effects 4.2 Changes the MODULE state to SUNI4x622_MOD_IDLE Profile Management This section describes the functions that add, get and clear an initialization profile. Initialization profiles allow the user to store pre-defined Device Initialization Vectors (DIV) that are validated ahead of time. When the device initialization function is invoked only a profile number needs to be passed.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Valid States SUNI4x622_MOD_IDLE, SUNI4x622_MOD_READY Side Effects None Deleting an Initialization Profile: suni4x622DeleteInitProfile This function deletes an initialization profile given its profile number.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface perrDevice : (pointer to) errDevice (inside the DDB) Returns Success = Device Handle (to be used bas an argument to most of the S/UNI-4x622 APIs) Failure = NULL (pointer) Valid States SUNI4x622_MOD_READY Side Effects Changes the DEVICE state to SUNI4x622_PRESENT Deleting a Device: suni4x622Delete This function removes the specified device from the list of devices being controlled by the S/UNI-4x622 driver.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface SUNI4x622_ERR_INVALID_DIV Valid States SUNI4x622_PRESENT Side Effects Changes the DEVICE state to SUNI4x622_INACTIVE Updating the Configuration of a Device: suni4x622Update This function updates the configuration of the device as well as the Device Data Block (DDB) associated with that device according to the DIV passed by the application.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Side Effects Changes the DEVICE state to SUNI4x622_PRESENT Activating a Device: suni4x622Activate This function restores the state of a device after a de-activate. Interrupts may be re-enabled.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface 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.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Failure = 0 Valid States SUNI4x622_PRESENT, SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the configuration of the device Reading from a block of Device Registers: suni4x622ReadBlock This function reads a register block of a specific S/UNI-4x622 device by providing the starting register number, and the size to read.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Inputs deviceHandle startRegNum size pblock pmask Outputs ERROR code written to the DDB : device handle (from suni4x622Add) : starting register number : size of block to read : (pointer to) block to write : (pointer to) mask SUNI4x622_ERR_INVALID_DEV ERROR code written to the DDB SUNI4x622_ERR_INVALID_ARG SUNI4x622_ERR_INVALID_REG 4.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Reading and Setting the Section Trace Message : suni4x622SOHTraceMsg This function retrieves and sets the section trace message (J0) in the Sonet/SDH Section Trace Buffer. Note: It is the USER’s responsibility to ensure that the message pointer points to an area of memory large enough to hold the returned data.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Forcing B1 Error: suni4x622SOHForceB1 This function inserts the B1 BIP-8 errors byte to be inserted to the section overhead.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Forcing LOS: suni4x622SOHForceLOS When the enable flag is set, this function forces a loss of signal condition in the data stream. When the enable flag is not set, this function resumes normal processing.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Configuring SD Error Monitor: suni4x622LOHSDCfg This function configures the Signal Defect BERM automatic monitoring of line bit error rate threshold events.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Side Effects None Reading the K1K2 Byte: suni4x622LOHReadK1K2 This function reads the K1K2 byte from the line overhead.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Reading the S1 Byte: suni4x622LOHReadS1 This function reads the S1 byte from the line overhead.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Inputs deviceHandle channel enable Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : channel number : flag to start/stop B2 error insertion SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Forcing Line RDI: suni4x622LOHForceRDI This function forces the line RDI into the line ov
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Retrieving and Setting the Path Trace Messages: suni4x622POHTraceMsg This function retrieves and sets the current path trace message in the Sonet/SDH Path Trace Buffer. Note: It is the USER’s responsibility to make sure that the message pointer points to an area of memory large enough to hold the returned data.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Writing the C2 Byte: suni4x622TPOHWriteC2 This function writes the C2 byte into the path overhead.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Writing SS Bits: suni4x622TPOHWriteSS This function writes the passed SS bits (SS[1:0]) in the SS bit positions.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Prototype INT4 suni4x622THPPForceB3(sSUNI4x622_HNDL deviceHandle, UINT1 channel, UINT2 enable) Inputs deviceHandle channel enable Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : channel number : flag to start/stop B3 masking SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Inputs deviceHandle channel enable Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : channel number : flag to start/stop path RDI insertion SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Forcing Path ERDI: suni4x622TPOHForceERDI This function enables the insertion of the Enha
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Forcing Path AIS: suni4x622TPOHForceAIS This function enables the insertion of the Path Alarm Indication Signal (PAIS) in the transmit stream.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface ppyldcfg : (pointer to) payload configuration parameters Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG 4.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Inputs deviceHandle channel pfifocfg Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : channel number : (pointer to) FIFO configuration block SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Configuring the System interface: suni4x622SysIntfCfg This fu
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Resetting the TFCLK DLL: suni4x622IntfSysResetTDLL This function resets the TFCLK DLL.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface 4.10 Automatic Protection Configuration The Automatic Protection Configuration section is responsible for configuring the S/UNI-4x622 to use the APS ports. Configuring APS Working/Protect Mate: suni4x622APSCfg When enable is set, this function enables the S/UNI-4x622 to operate as an APS working/protect mate under a failed condition. When enable is not set, this function resumes normal operation.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Configuring the Source Channel for the Given Channel Transmit Path: suni4x622TPCfg The function is used to control the source channel for the transmit path.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface deviceHandle, UINT1 link) Inputs deviceHandle link Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : APS link number SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_APS_LINK Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Resetting APS Transmit Link: suni4x622APSResetTxLink The function is used to reset the transmit APS link.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Configuring ISR Processing: suni4x622ISRConfig Allows the USER to configure how ISR processing is to be handled: polling (SUNI4x622_POLL_MODE) or interrupt driven (SUNI4x622_ISR_MODE). If polling is selected, the USER is responsible for calling periodically suni4x622Poll to collect exception data from the device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Prototype INT4 suni4x622SetMask(sSUNI4x622_HNDL deviceHandle, sSUNI4x622_MASK_ISR *pmask) Inputs deviceHandle pmask Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : (pointer to) mask structure SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the operation of the ISR / DP
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface pmask : (pointer to) mask structure Outputs pmask : (pointer to) updated mask structure Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Setting SOH Interrupt Enable Mask: suni4x622SetMaskSOH This function sets the contents of the SOH interrupt mask regi
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the operation of the ISR / DPR Getting LOH Interrupt Enable Mask: suni4x622GetMaskLOH This function returns the contents of the LOH interrupt mask registers of the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the operation of the ISR / DPR Clearing LOH Interrupt Enable Mask: suni4x622ClrMaskLOH This function clears LOH individual interrupt bits and registers in the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs pmask Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : (pointer to) updated mask structure SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Setting RPOH Interrupt Enable Mask: suni4x622SetMaskRPOH This function sets the contents of the RPOH interrupt mask registers of the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the operation of the ISR / DPR Getting PYLD Interrupt Enable Mask: suni4x622GetMaskPYLD This function returns the contents of the PYLD interrupt mask registers of the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the operation of the ISR / DPR Clearing PYLD Interrupt Enable Mask: suni4x622ClrMaskPYLD This function clears PYLD individual interrupt bits and registers in the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs pmask Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : (pointer to) updated mask structure SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Setting FIFO Interrupt Enable Mask: suni4x622SetMaskFIFO This function sets the contents of the FIFO interrupt mask registers of the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects May change the operation of the ISR / DPR Getting Line Interface Interrupt Enable Mask: suni4x622GetMaskIntfLine This function returns the contents of the per-channel line interface interrupt mask reg
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Outputs pmask Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : (pointer to) updated mask structure SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Clearing Line Interface Interrupt Enable Mask: suni4x622ClrMaskIntfLine This function clears the contents of the per-channel line interface interrupt mask
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Setting System Interface Interrupt Enable Mask: suni4x622SetMaskSysIntf This function sets the contents of the system interface interrupt mask registers of the S/UNI4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Side Effects May change the operation of the ISR / DPR Getting APS Interrupt Enable Mask: suni4x622GetMaskAPS This function returns the contents of the APS interrupt mask registers of the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Clearing APS Interrupt Enable Mask: suni4x622ClrMaskAPS This function clears the contents of the APS interrupt mask registers of the S/UNI-4x622 device.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Interrupt-Service Routine: suni4x622ISR This function reads the state of the interrupt registers in the S/UNI-4x622 and stores them in an ISV. Performs whatever functions are needed to clear the interrupt, from simply clearing bits to complex functions. This routine is called by the application code, from within sysSuni4x622ISRHandler.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Valid States SUNI4x622_ACTIVE Side Effects None Pseudocode Begin for each ISV element (section) get and fill out a DPV buffer if callback (from suni4x622Init) is not NULL invoke (section) callback release ISV by calling sysSuni4x622ISVBufferRtn End 4.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface pstatusSOH : (pointer to) SOH status block Outputs pstatusSOH : (pointer to) updated SOH status block Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Getting the Device Status: suni4x622GetStatusLOH This function retrieves the LOH status.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Getting the Device Status: suni4x622GetStatusIntfLine This function retrieves the Line Interface status.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface SUNI4x622_ERR_INVALID_CHAN SUNI4x622_ERR_INVALID_ARG Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Getting the Device Counts: suni4x622GetCountsChan This function retrieves all the counts for a specific channel.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Valid States SUNI4x622_ACTIVE, SUNI4x622_INACTIVE Side Effects None Getting the Device Counts: suni4x622GetCountsLOH This function retrieves all the LOH counts.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Side Effects None Getting the Device Counts: suni4x622GetCountsPYLD This function retrieves all the PYLD counts.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Enabling Line Loopbacks: suni4x622DiagLineLoop This function clears / sets a Line Loopback. It is up to the USER to perform any tests on the looped data.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Prototype INT4 suni4x622DiagDataLoop(sSUNI4x622_HNDL deviceHandle, UINT1 channel, UINT2 enable) Inputs deviceHandle channel enable Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE : device handle (from suni4x622Add) : channel number : sets loop if non-zero, else clears loop SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE Side Effects Will inhibit th
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface channel enable : channel number : sets loop if non-zero, else clears loop Outputs None Returns Success = SUNI4x622_SUCCESS Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE SUNI4x622_ERR_INVALID_DEV SUNI4x622_ERR_INVALID_CHAN Valid States SUNI4x622_ACTIVE Side Effects Will inhibit the flow of active data 4.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Valid States SUNI4x622_ACTIVE Side Effects None Notifying the Application of LOH Events: cbackSuni4x622LOH This callback function is provided by the USER and is used by the DPR to report significant LOH section events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Side Effects None Notifying the Application of PYLD Events: cbackSuni4x622PYLD This callback function is provided by the USER and is used by the DPR to report significant PYLD section events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information.
PM5358 S/UNI-4x622 Driver Manual Application Programming Interface Notifying the Application of FIFO Events: cbackSuni4x622FIFO This callback function is provided by the USER and is used by the DPR to report significant FIFO section events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information.
PM5358 S/UNI-4x622 Driver Manual Hardware Interface 5 HARDWARE INTERFACE The S/UNI-4x622 driver interfaces directly with the USER’s hardware. In this section, a listing of each point of interface is shown, along with a declaration and any specific porting instructions. It is the responsibility of the USER to connect these requirements into the hardware, either by defining a macro or by writing a function for each item listed. Care should be taken when matching parameters and return values. 5.
PM5358 S/UNI-4x622 Driver Manual Hardware Interface Polling a Bit: sysSuni4x622PollBit This function simply polls a register masked data until it is zero or times out. Format #define sysSuni4x622PollBit (base, offset, mask) Prototype INT4 sysSuni4x622PollBit (void *base, UINT2 offset, UINT1 mask) Inputs base offset mask 5.2 : base address of device being accessed : offset to the memory location as it appears in the hardware data-sheet.
PM5358 S/UNI-4x622 Driver Manual Hardware Interface Failure = Pseudocode Begin install sysSuni4x622ISRHandler in processor’s interrupt vector table End ISR Handler: sysSuni4x622ISRHandler This routine is invoked when one or more S/UNI-4x622 devices raise the interrupt line to the microprocessor. This routine invokes the driver-provided routine, suni4x622ISR, for each device registered with the driver.
PM5358 S/UNI-4x622 Driver Manual Hardware Interface End Removing the ISR Handler: sysSuni4x622ISRHandlerRemove This function disables Interrupt processing for this device. Removes the USER-supplied Interrupt-Service Routine (ISR), sysSuni4x622ISRHandler, from the processor’s interrupt vector table.
PM5358 S/UNI-4x622 Driver Manual RTOS Interface 6 RTOS INTERFACE The S/UNI-4x622 driver requires the use of some RTOS resources. In this section, a listing of each required resource is shown, along with a declaration and any specific porting instructions. It is the responsibility of the USER to connect these requirements into the RTOS, either by defining a macro or writing a function for each item listed. Care should be taken when matching parameters and return values. 6.
PM5358 S/UNI-4x622 Driver Manual RTOS Interface Prototype void sysSuni4x622MemSet(UINT1 *pdst, UINT1 *psrc, UINT2 sz) Inputs pdst psrc sz Outputs None Returns None : (pointer to) the destination memory : (pointer to) the source memory : size Freeing Memory: sysSuni4x622MemFree This function frees memory allocated using sysSuni4x622MemAlloc. 6.
PM5358 S/UNI-4x622 Driver Manual RTOS Interface Failure = Getting an ISV Buffer: sysSuni4x622ISVBufferGet This function gets a buffer from the RTOS that will be used by the ISR code to create an Interrupt-Service Vector (ISV). The ISV consists of data transferred from the devices interrupt status registers.
PM5358 S/UNI-4x622 Driver Manual RTOS Interface Returning a DPV Buffer: sysSuni4x622DPVBufferRtn This function returns a DPV buffer to the RTOS when the information in the block is no longer needed by the DPR.
PM5358 S/UNI-4x622 Driver Manual RTOS Interface 6.4 Preemption Disabling Preemption: sysSuni4x622PreemptDisable This routine prevents the calling task from being preempted. If the driver is in interrupt mode, this routine locks out all interrupts as well as other tasks in the system. If the driver is in polling mode, this routine locks out other tasks only.
PM5358 S/UNI-4x622 Driver Manual Porting the S/UNI-4x622 Driver 7 PORTING THE S/UNI-4X622 DRIVER This section outlines how to port the S/UNI-4x622 device driver to your hardware and OS platform. However, this manual can offer only guidelines for porting the S/UNI-4x622 driver because each platform and application is unique. 7.1 Driver Source Files The C source files listed in the next table contain the code for the S/UNI-4x622 driver. You may need to modify the code or develop additional code.
PM5358 S/UNI-4x622 Driver Manual Porting the S/UNI-4x622 Driver Procedure 1: Porting Driver OS Extensions The OS extensions encapsulate all OS specific services and data types used by the driver. The suni4x622_rtos.h file contains data types and compiler-specific data-type definitions. It also contains macros for OS specific services used by the OS extensions.
PM5358 S/UNI-4x622 Driver Manual Porting the S/UNI-4x622 Driver Interrupt sysSuni4x622ISRHandlerIntInstall Installs the interrupt handler for the OS sysSuni4x622ISRHandlerRemove Removes the interrupt handler from the OS sysSuni4x622ISRHandler Interrupt handler for the S/UNI-4x622 device sysSuni4x622DPRTask Deferred interrupt-processing routine (DPR) Procedure 2: Porting Drivers to Hardware Platforms This section describes how to modify the driver for your hardware platform.
PM5358 S/UNI-4x622 Driver Manual Porting the S/UNI-4x622 Driver SUNI4x622_DPR_TASK_STACK_SZ DPR task stack size, in bytes 8192 SUNI4x622_POLL_DELAY The constant used in polling task mode defines the interval time in millisecond between each polling action 100 SUNI4x622_TASK_SHUTDOWN_DELAY Delay time in millisecond.
PM5358 S/UNI-4x622 Driver Manual Appendix A: Coding Conventions APPENDIX A: CODING CONVENTIONS This section describes the coding conventions used in the implementation of all PMC-Sierra driver software.
PM5358 S/UNI-4x622 Driver Manual Appendix A: Coding Conventions Type Case Naming convention Examples Functions Notation Porting Functions Hungarian Notation prefix with “sys” and device name sysSuni4x622Read() Other Functions Hungarian Notation utilSuni4x622Valid ateChan() Variables Hungarian Notation maxDevs Pointers to variables Hungarian Notation prefix variable name with “p” pmaxDevs Global variables Hungarian Notation prefix with device name suni4x622Mdb Macros • Macro names m
PM5358 S/UNI-4x622 Driver Manual Appendix A: Coding Conventions Functions API Functions • Naming of the API functions must follow the hungarian notation • The device’s full name in all lowercase shall be used as a prefix • Example: suni4x622Add() is a valid name for an API function Porting Functions Porting functions correspond to all function that are HW and/or RTOS dependent • Naming of the porting functions must follow the hungarian notation • The ‘sys’ prefix shall be used to indicate a portin
PM5358 S/UNI-4x622 Driver Manual Appendix A: Coding Conventions Table 44: File Naming Conventions API (Module and Device Management) suni4x622_api.c Generic driver API block, contains Module & Device Management API such as installing/deinstalling driver instances, read/writes, and initialization profiles. API (ISR) suni4x622_isr.c Interrupt processing is handled by this block. This includes both ISR and DPR management API (Diagnostics) suni4x622_diag.
PM5358 S/UNI-4x622 Driver Manual Appendix B: Error Codes APPENDIX B: ERROR CODES The following describes the error codes used in the S/UNI 4x622 device driver SUNI4x622_SUCCESS Success SUNI4x622_FAILURE Failure SUNI4x622_ERR_MEM_ALLOC Memory allocation failure SUNI4x622_ERR_INVALID_ARG Invalid argument SUNI4x622_ERR_INVALID_CHAN Invalid channel number SUNI4x622_ERR_INVALID_MODULE_STATE Invalid module state SUNI4x622_ERR_INVALID_MIV Invalid Module Initialization Vector SUNI4x622_ERR_PROFILES_F
PM5358 S/UNI-4x622 Driver Manual Appendix C: S/UNI-4x622 Events APPENDIX C: S/UNI-4X622 EVENTS Section Overhead Events (SOH) Error Code Description SUNI4x622_EVENT_SOH_OOF Out Of Frame event SUNI4x622_EVENT_SOH_LOF Loss Of Frame event SUNI4x622_EVENT_SOH_LOS Loss Of Signal event SUNI4x622_EVENT_SOH_SBIPE Section BIP error event SUNI4x622_EVENT_SOH_TIU Section Trace Unstable event SUNI4x622_EVENT_SOH_TIM Section Trace Mismatch event Line Overhead Events (LOH) Error Code Description SUNI4x622
PM5358 S/UNI-4x622 Driver Manual Appendix C: S/UNI-4x622 Events Path Overhead Events (RPOH) Error Code Description SUNI4x622_EVENT_RPOH_TIU Path Trace Unstable event SUNI4x622_EVENT_RPOH_TIM Path Trace Mismatch event SUNI4x622_EVENT_RPOH_PSLMI Path Signal Label Mismatch event SUNI4x622_EVENT_RPOH_PSLUI Path Signal Label Unstable event SUNI4x622_EVENT_RPOH_PRDI Path Remote Defect Indication event SUNI4x622_EVENT_RPOH_PERDI Path Enhanced Remote Defect Indication event SUNI4x622_EVENT_RPOH_PBIPE
PM5358 S/UNI-4x622 Driver Manual Appendix C: S/UNI-4x622 Events Payload Events (PYLD) Error Code Description SUNI4x622_EVENT_PYLD_LCD Loss of Cell Delineation event SUNI4x622_EVENT_PYLD_CHCS Corrected/Uncorrected HCS error event SUNI4x622_EVENT_PYLD_FCS FCS error event SUNI4x622_EVENT_PYLD_RXCPXFER Transfer of Rx CP accumulated counter data event SUNI4x622_EVENT_PYLD_TXCPXFER Transfer of Tx CP accumulated counter event SUNI4x622_EVENT_PYLD_ABRT Aborted packet received event SUNI4x622_EVENT_PY
PM5358 S/UNI-4x622 Driver Manual Appendix C: S/UNI-4x622 Events Error Code Description packet SUNI4x622_EVENT_SYS_INTF_UNPROV event that occurs when a non-existent channel buffer is detected during in-band addressing SUNI4x622_EVENT_SYS_INTF_CAM data field mismatch event SUNI4x622_EVENT_SYS_INTF_TPRTY Tx Parity error event SUNI4x622_EVENT_SYS_INTF_TSOC start of cell re-alignment interrupt SUNI4x622_EVENT_SYS_INTF_FOVR FIFO overrun event SUNI4x622_EVENT_SYS_INTF_FUNR FIFO underrun event Automa
PM5358 S/UNI-4x622 Driver Manual LIST OF TERMS APPLICATION: Refers to protocol software used in a real system as well as validation software written to validate the S/UNI-4x622 driver on a validation platform. API (Application Programming Interface): Describes the connection between this module and the user’s application code. ISR (Interrupt-Service Routine): A common function for intercepting and servicing device events.
PM5358 S/UNI-4x622 Driver Manual ACRONYMS API: Application Programming Interface APS: Automatic Protection Switch ATM: Asynchronous Transfer Mode DDB: Device Data Block DIV: Device Initialization Vector DPR: Deferred-Processing Routine DPV: Deferred-Processing (routine) Vector DSB: Device Status Block FIFO: First In, First Out ISR: Interrupt-Service Routine ISV: Interrupt-Service (routine) Vector LOH: Line Overhead MDB: Module Data Block MIV: Module Initialization Vector POH: Path Overhead PYLD: Payload RP
PM5358 S/UNI-4x622 Driver Manual INDEX A suni4x622GetInitProfile-54 suni4x622GetMask-28, 81 api functions suni4x622GetMaskAPS-93 suni4x622Activate-58 suni4x622GetMaskFIFO-88 suni4x622Add-34, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 121, 123 suni4x622GetMaskIntf-91 suni4x622AddInitProfile-54 suni4x622APSCfg-78 suni4x622APSR
PM5358 S/UNI-4x622 Driver Manual suni4x622RPCfg-78 cbackSuni4x622PYLD-106 suni4x622RPOHSDCfg-65 cbackSuni4x622RPOH-105 suni4x622RPOHSFCfg-64 cbackSuni4x622SOH-104 suni4x622RPOHTraceMsg-69 cbackSuni4x622SysIntf-106 suni4x622SetInitProfile-27 suni4x622SetMask-28, 81, 82 suni4x622SetMaskAPS-93 suni4x622SetMaskFIFO-89 suni4x622SetMaskIntf-92 suni4x622SetMaskIntfLine-90 suni4x622SetMaskLOH-84 suni4x622SetMaskPYLD-87 suni4x622SetMaskRPOH-86 suni4x622SetMaskSOH-83 suni4x622SetMaskSysIntf-92 suni4x622SOHFo
PM5358 S/UNI-4x622 Driver Manual SUNI4x622_EVENT_INTF_SYS_FUNR-129 SUNI4x622_EVENT_PYLD_RXCPFOVR-128 SUNI4x622_EVENT_INTF_SYS_TPRTY-129 SUNI4x622_EVENT_PYLD_RXCPXFER-128 SUNI4x622_EVENT_INTF_SYS_TSOC-129 SUNI4x622_EVENT_PYLD_RXFPFOVR-128 SUNI4x622_EVENT_INTF_SYS_TXOP-128 SUNI4x622_EVENT_PYLD_TXCPXFER-128 SUNI4x622_EVENT_INTF_SYS_UNPROV-129 SUNI4x622_EVENT_PYLD_TXFPFUDR-128 SUNI4x622_EVENT_LOH_COAPS-126 SUNI4x622_EVENT_SOH_LOF-126 SUNI4x622_EVENT_LOH_COZ1S1-126 SUNI4x622_EVENT_SOH_LOS-126 SUNI
PM5358 S/UNI-4x622 Driver Manual suni4x622_strs.h-124 perrDevice-55 suni4x622_typs.h-124 pfifocfg-75, 76 pfirstByte-113 src file suni4x622_api.c-124 pISV-114 suni4x622_aps.c-124 pJ0-62 suni4x622_diag.c-124 pJ1-69 suni4x622_hw.c-118, 124 pK1-66 suni4x622_intf.c-124 pK2-66 suni4x622_isr.c-124 plinecfg-76 suni4x622_loh.c-124 pmask-60, 61, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 suni4x622_poh.c-124 suni4x622_pyld.c-124 suni4x622_rtos.c-118, 124 suni4x622_soh.
PM5358 S/UNI-4x622 Driver Manual sSUNI4x622_CFG_RPOH-36, 38 sSUNI4x622_STATUS_LOH-45, 46, 97 sSUNI4x622_CFG_SD-44, 65 sSUNI4x622_STATUS_PYLD-45, 47 sSUNI4x622_CFG_SF-44, 64 sSUNI4x622_STATUS_RPOH-45, 46, 97 sSUNI4x622_CFG_SOH-36, 37 sSUNI4x622_STATUS_SOH-45, 96 sSUNI4x622_CFG_TPOH-36, 38 sSUNI4x622_USR_CTXT-35, 55, 104, 105, 106, 107, 120 sSUNI4x622_CNTR_CHAN-48, 99 sSUNI4x622_CNTR_LOH-48, 49, 100 system-specific functions sSUNI4x622_CNTR_PYLD-48, 49, 101 sysSuni4x622BufferStart-50, 113 sSUNI